tcg: get rid of copy_size in TCGOpDef
authorAurelien Jarno <aurelien@aurel32.net>
Thu, 3 Jun 2010 17:29:31 +0000 (19:29 +0200)
committerAurelien Jarno <aurelien@aurel32.net>
Wed, 9 Jun 2010 14:10:50 +0000 (16:10 +0200)
copy_size is a left-over from the dyngen era, remove it.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
exec-all.h
exec.c
tcg/tcg-opc.h
tcg/tcg.c
tcg/tcg.h
translate-all.c

index 4565dd060501e8b44973d74f1d38aafde08673e4..a775582be71c7bae9f793a350f8ffdc742aac912 100644 (file)
@@ -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 bb3dcadcded839ce3bf7a4507ab5b3fe8a32202c..aedfda4e04a89f91a11ef211ff3520fd2600f22d 100644 (file)
--- 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));
 }
index 674c73a5270181f4158debc313fa0d1747e15969..5531da7456a50251bff1ceecd669657530f061b0 100644 (file)
@@ -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 */
index 3368d93a95231e423d827acbf3f6adf2e58cb771..b1fe470f43e73d5eb6b168e39618e69bb52bcef7 100644 (file)
--- a/tcg/tcg.c
+++ b/tcg/tcg.c
@@ -69,7 +69,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
index 9134700cf0cbbd96735f502ece7d254218089657..7fe7ab045d133130a7a10274e8e1de8188deeaa8 100644 (file)
--- 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,
@@ -422,7 +422,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)
index 91cbbc4929397c73e864e844ce25d1d4748c2806..efcfb9adcdc82fa6d1ef7969e11584c1956d3271 100644 (file)
@@ -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);