From patchwork Thu Jun 3 20:31:48 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: y@volta.aurel32.net X-Patchwork-Id: 54520 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 03573B7D2E for ; Fri, 4 Jun 2010 06:33:08 +1000 (EST) Received: from localhost ([127.0.0.1]:56158 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OKH68-0006Ag-QJ for incoming@patchwork.ozlabs.org; Thu, 03 Jun 2010 16:33:04 -0400 Received: from [140.186.70.92] (port=53001 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OKH59-0006AP-Ev for qemu-devel@nongnu.org; Thu, 03 Jun 2010 16:32:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OKH58-0007Mo-7U for qemu-devel@nongnu.org; Thu, 03 Jun 2010 16:32:03 -0400 Received: from hall.aurel32.net ([88.191.82.174]:42668) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OKH57-0007Lw-Vy for qemu-devel@nongnu.org; Thu, 03 Jun 2010 16:32:02 -0400 Received: from [2a01:e35:2e80:2fb0:21e:8cff:feb0:693b] (helo=volta.aurel32.net) by hall.aurel32.net with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.69) (envelope-from ) id 1OKH4y-0006Mz-Nh; Thu, 03 Jun 2010 22:31:52 +0200 Received: from aurel32 by volta.aurel32.net with local (Exim 4.71) (envelope-from ) id 1OKH4x-0000hg-D3; Thu, 03 Jun 2010 22:31:51 +0200 From: y@volta.aurel32.net To: qemu-devel@nongnu.org Date: Thu, 3 Jun 2010 22:31:48 +0200 Message-Id: <1275597109-2674-1-git-send-email-y> X-Mailer: git-send-email 1.7.1 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) Cc: Aurelien Jarno Subject: [Qemu-devel] [PATCH 1/2] tcg: get rid of copy_size in TCGOpDef X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Aurelien Jarno copy_size is a left-over from the dyngen era, remove it. Signed-off-by: Aurelien Jarno --- exec-all.h | 1 - exec.c | 2 +- tcg/tcg-opc.h | 2 +- tcg/tcg.c | 2 +- tcg/tcg.h | 3 +-- translate-all.c | 16 ---------------- 6 files changed, 4 insertions(+), 22 deletions(-) diff --git a/exec-all.h b/exec-all.h index 4565dd0..a775582 100644 --- a/exec-all.h +++ b/exec-all.h @@ -80,7 +80,6 @@ void gen_intermediate_code_pc(CPUState *env, struct TranslationBlock *tb); void gen_pc_load(CPUState *env, struct TranslationBlock *tb, unsigned long searched_pc, int pc_pos, void *puc); -unsigned long code_gen_max_block_size(void); void cpu_gen_init(void); int cpu_gen_code(CPUState *env, struct TranslationBlock *tb, int *gen_code_size_ptr); diff --git a/exec.c b/exec.c index bb3dcad..aedfda4 100644 --- a/exec.c +++ b/exec.c @@ -557,7 +557,7 @@ static void code_gen_alloc(unsigned long tb_size) #endif /* !USE_STATIC_CODE_GEN_BUFFER */ map_exec(code_gen_prologue, sizeof(code_gen_prologue)); code_gen_buffer_max_size = code_gen_buffer_size - - code_gen_max_block_size(); + (TCG_MAX_OP_SIZE * OPC_MAX_SIZE); code_gen_max_blocks = code_gen_buffer_size / CODE_GEN_AVG_BLOCK_SIZE; tbs = qemu_malloc(code_gen_max_blocks * sizeof(TranslationBlock)); } diff --git a/tcg/tcg-opc.h b/tcg/tcg-opc.h index 674c73a..5531da7 100644 --- a/tcg/tcg-opc.h +++ b/tcg/tcg-opc.h @@ -22,7 +22,7 @@ * THE SOFTWARE. */ #ifndef DEF2 -#define DEF2(name, oargs, iargs, cargs, flags) DEF(name, oargs + iargs + cargs, 0) +#define DEF2(name, oargs, iargs, cargs, flags) DEF(name, oargs + iargs + cargs) #endif /* predefined ops */ diff --git a/tcg/tcg.c b/tcg/tcg.c index 880e7ce..b0b0363 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@ -67,7 +67,7 @@ static void patch_reloc(uint8_t *code_ptr, int type, tcg_target_long value, tcg_target_long addend); static TCGOpDef tcg_op_defs[] = { -#define DEF(s, n, copy_size) { #s, 0, 0, n, n, 0, copy_size }, +#define DEF(s, n) { #s, 0, 0, n, n, 0 }, #define DEF2(s, oargs, iargs, cargs, flags) { #s, oargs, iargs, cargs, iargs + oargs + cargs, flags, 0 }, #include "tcg-opc.h" #undef DEF diff --git a/tcg/tcg.h b/tcg/tcg.h index 5853823..74d2e0b 100644 --- a/tcg/tcg.h +++ b/tcg/tcg.h @@ -48,7 +48,7 @@ typedef uint64_t TCGRegSet; #endif typedef enum TCGOpcode { -#define DEF(s, n, copy_size) INDEX_op_ ## s, +#define DEF(s, n) INDEX_op_ ## s, #include "tcg-opc.h" #undef DEF NB_OPS, @@ -415,7 +415,6 @@ typedef struct TCGOpDef { const char *name; uint8_t nb_oargs, nb_iargs, nb_cargs, nb_args; uint8_t flags; - uint16_t copy_size; TCGArgConstraint *args_ct; int *sorted_args; #if defined(CONFIG_DEBUG_TCG) diff --git a/translate-all.c b/translate-all.c index 91cbbc4..efcfb9a 100644 --- a/translate-all.c +++ b/translate-all.c @@ -41,22 +41,6 @@ target_ulong gen_opc_pc[OPC_BUF_SIZE]; uint16_t gen_opc_icount[OPC_BUF_SIZE]; uint8_t gen_opc_instr_start[OPC_BUF_SIZE]; -/* XXX: suppress that */ -unsigned long code_gen_max_block_size(void) -{ - static unsigned long max; - - if (max == 0) { - max = TCG_MAX_OP_SIZE; -#define DEF(s, n, copy_size) max = copy_size > max? copy_size : max; -#include "tcg-opc.h" -#undef DEF - max *= OPC_MAX_SIZE; - } - - return max; -} - void cpu_gen_init(void) { tcg_context_init(&tcg_ctx);