TCG global gen_opc_ arrays clean-up
PATCH 1/5 tcg/tcg.h: Duplicate global TCG gen_opc_ arrays into TCGContext.
In reply to Evgeny Voevodin--- tcg/tcg.h | 3 +++ 1 file changed, 3 insertions(+)
tcg/tcg.h +3 -0
@@ -455,6 +455,9 @@ struct TCGContext {uint16_t *gen_opc_ptr;TCGArg *gen_opparam_ptr; +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 ];#if defined(CONFIG_QEMU_LDST_OPTIMIZATION ) && defined(CONFIG_SOFTMMU )/* labels info for qemu_ld/st IRs
Signature · 1 line
1.7.9.5
cover TCG global gen_opc_ arrays clean-up
This set of patches moves global variables to tcg_ctx:gen_opc_instrgen_opparam_icountgen_opc_pc
Build tested for all targets.
Execution tested on Exynos4210 target.
After this patchset was aplied,
I noticed no speed-up or slow-down of code generation.
Here is the test procedure:
1. Boot Linux Kernel 5 times.
2. For each iteration wait while "JIT cycles" is stable for ~10 seconds
3. Write down the "cycles/op"
Here are the results (tested on gcc-4.6):
Before clean-up:
min: 655.5
max: 659.3
avg: 657.2
standard deviation: ~2 ~= 0.4%
Average cycles/op = 657 +- 2
After clean-up:
min: 654.6
max: 657.1
avg: 655.5
standard deviation: ~1 ~= 0.2%
Average cycles/op = 656 +- 1
Evgeny Voevodin (5):
tcg/tcg.h: Duplicate global TCG gen_opc_ arrays into TCGContext.
TCG: Use gen_opc_pc from context instead of global variable.
TCG: Use gen_opc_icount from context instead of global variable.
TCG: Use gen_opc_instr_start from context instead of global variable.
TCG: Remove unused global gen_opc_ arrays.
exec-all.h | 4 ---- target-alpha/translate.c | 12 ++++++------ target-arm/translate.c | 12 ++++++------ target-cris/translate.c | 14 +++++++------- target-i386/translate.c | 19 ++++++++++--------- target-lm32/translate.c | 12 ++++++------ target-m68k/translate.c | 12 ++++++------ target-microblaze/translate.c | 12 ++++++------ target-mips/translate.c | 12 ++++++------ target-openrisc/translate.c | 12 ++++++------ target-ppc/translate.c | 12 ++++++------ target-s390x/translate.c | 12 ++++++------ target-sh4/translate.c | 12 ++++++------ target-sparc/translate.c | 12 ++++++------ target-unicore32/translate.c | 12 ++++++------ target-xtensa/translate.c | 10 +++++----- tcg/tcg.h | 3 +++ translate-all.c | 9 +++------ 18 files changed, 100 insertions(+), 103 deletions(-)
Signature · 1 line
1.7.9.5
PATCH 4/5 TCG: Use gen_opc_instr_start from context instead of global variable.
--- target-alpha/translate.c | 6 +++--- target-arm/translate.c | 6 +++--- target-cris/translate.c | 6 +++--- target-i386/translate.c | 8 ++++---- target-lm32/translate.c | 6 +++--- target-m68k/translate.c | 6 +++--- target-microblaze/translate.c | 6 +++--- target-mips/translate.c | 6 +++--- target-openrisc/translate.c | 6 +++--- target-ppc/translate.c | 6 +++--- target-s390x/translate.c | 6 +++--- target-sh4/translate.c | 6 +++--- target-sparc/translate.c | 6 +++--- target-unicore32/translate.c | 6 +++--- target-xtensa/translate.c | 4 ++-- translate-all.c | 3 ++- 16 files changed, 47 insertions(+), 46 deletions(-)
target-alpha/translate.c +3 -3
@@ -3410,10 +3410,10 @@ static inline void gen_intermediate_code_internal(CPUAlphaState *env,if (lj < j) { lj++;while (lj < j) - gen_opc_instr_start[lj++] =0 ; + tcg_ctx.gen_opc_instr_start[lj++] =0 ; } tcg_ctx.gen_opc_pc[lj] = ctx.pc; - gen_opc_instr_start[lj] =1 ; + tcg_ctx.gen_opc_instr_start[lj] =1 ; tcg_ctx.gen_opc_icount[lj] = num_insns; }if (num_insns +1 == max_insns && (tb->cflags &CF_LAST_IO ))
@@ -3468,7 +3468,7 @@ static inline void gen_intermediate_code_internal(CPUAlphaState *env, j = tcg_ctx.gen_opc_ptr - tcg_ctx.gen_opc_buf; lj++;while (lj <= j) - gen_opc_instr_start[lj++] =0 ; + tcg_ctx.gen_opc_instr_start[lj++] =0 ; }else { tb->size = ctx.pc - pc_start; tb->icount = num_insns;
target-arm/translate.c +3 -3
@@ -9838,11 +9838,11 @@ static inline void gen_intermediate_code_internal(CPUARMState *env,if (lj < j) { lj++;while (lj < j) - gen_opc_instr_start[lj++] =0 ; + tcg_ctx.gen_opc_instr_start[lj++] =0 ; } tcg_ctx.gen_opc_pc[lj] = dc->pc; gen_opc_condexec_bits[lj] = (dc->condexec_cond <<4 ) | (dc->condexec_mask >>1 ); - gen_opc_instr_start[lj] =1 ; + tcg_ctx.gen_opc_instr_start[lj] =1 ; tcg_ctx.gen_opc_icount[lj] = num_insns; }
@@ -9977,7 +9977,7 @@ done_generating: j = tcg_ctx.gen_opc_ptr - tcg_ctx.gen_opc_buf; lj++;while (lj <= j) - gen_opc_instr_start[lj++] =0 ; + tcg_ctx.gen_opc_instr_start[lj++] =0 ; }else { tb->size = dc->pc - pc_start; tb->icount = num_insns;
target-cris/translate.c +3 -3
@@ -3301,7 +3301,7 @@ gen_intermediate_code_internal(CPUCRISState *env, TranslationBlock *tb,if (lj < j) { lj++;while (lj < j) { - gen_opc_instr_start[lj++] =0 ; + tcg_ctx.gen_opc_instr_start[lj++] =0 ; } }if (dc->delayed_branch ==1 ) {
@@ -3309,7 +3309,7 @@ gen_intermediate_code_internal(CPUCRISState *env, TranslationBlock *tb, }else { tcg_ctx.gen_opc_pc[lj] = dc->pc; } - gen_opc_instr_start[lj] =1 ; + tcg_ctx.gen_opc_instr_start[lj] =1 ; tcg_ctx.gen_opc_icount[lj] = num_insns; }
@@ -3439,7 +3439,7 @@ gen_intermediate_code_internal(CPUCRISState *env, TranslationBlock *tb, j = tcg_ctx.gen_opc_ptr - tcg_ctx.gen_opc_buf; lj++;while (lj <= j) { - gen_opc_instr_start[lj++] =0 ; + tcg_ctx.gen_opc_instr_start[lj++] =0 ; } }else { tb->size = dc->pc - pc_start;
target-i386/translate.c +4 -4
@@ -7988,11 +7988,11 @@ static inline void gen_intermediate_code_internal(CPUX86State *env,if (lj < j) { lj++;while (lj < j) - gen_opc_instr_start[lj++] =0 ; + tcg_ctx.gen_opc_instr_start[lj++] =0 ; } tcg_ctx.gen_opc_pc[lj] = pc_ptr; gen_opc_cc_op[lj] = dc->cc_op; - gen_opc_instr_start[lj] =1 ; + tcg_ctx.gen_opc_instr_start[lj] =1 ; tcg_ctx.gen_opc_icount[lj] = num_insns; }if (num_insns +1 == max_insns && (tb->cflags &CF_LAST_IO ))
@@ -8037,7 +8037,7 @@ static inline void gen_intermediate_code_internal(CPUX86State *env, j = tcg_ctx.gen_opc_ptr - tcg_ctx.gen_opc_buf; lj++;while (lj <= j) - gen_opc_instr_start[lj++] =0 ; + tcg_ctx.gen_opc_instr_start[lj++] =0 ; }#ifdef DEBUG_DISAS
@@ -8080,7 +8080,7 @@ void restore_state_to_opc(CPUX86State *env, TranslationBlock *tb, int pc_pos)int i;qemu_log ("RESTORE:\n" );for (i =0 ;i <= pc_pos; i++) { -if (gen_opc_instr_start[i]) { +if (tcg_ctx.gen_opc_instr_start[i]) {qemu_log ("0x%04x: " TARGET_FMT_lx"\n" , i, tcg_ctx.gen_opc_pc[i]); }
target-lm32/translate.c +3 -3
@@ -1051,11 +1051,11 @@ static void gen_intermediate_code_internal(CPULM32State *env,if (lj < j) { lj++;while (lj < j) { - gen_opc_instr_start[lj++] =0 ; + tcg_ctx.gen_opc_instr_start[lj++] =0 ; } } tcg_ctx.gen_opc_pc[lj] = dc->pc; - gen_opc_instr_start[lj] =1 ; + tcg_ctx.gen_opc_instr_start[lj] =1 ; tcg_ctx.gen_opc_icount[lj] = num_insns; }
@@ -1110,7 +1110,7 @@ static void gen_intermediate_code_internal(CPULM32State *env, j = tcg_ctx.gen_opc_ptr - tcg_ctx.gen_opc_buf; lj++;while (lj <= j) { - gen_opc_instr_start[lj++] =0 ; + tcg_ctx.gen_opc_instr_start[lj++] =0 ; } }else { tb->size = dc->pc - pc_start;
target-m68k/translate.c +3 -3
@@ -3019,10 +3019,10 @@ gen_intermediate_code_internal(CPUM68KState *env, TranslationBlock *tb,if (lj < j) { lj++;while (lj < j) - gen_opc_instr_start[lj++] =0 ; + tcg_ctx.gen_opc_instr_start[lj++] =0 ; } tcg_ctx.gen_opc_pc[lj] = dc->pc; - gen_opc_instr_start[lj] =1 ; + tcg_ctx.gen_opc_instr_start[lj] =1 ; tcg_ctx.gen_opc_icount[lj] = num_insns; }if (num_insns +1 == max_insns && (tb->cflags &CF_LAST_IO ))
@@ -3078,7 +3078,7 @@ gen_intermediate_code_internal(CPUM68KState *env, TranslationBlock *tb, j = tcg_ctx.gen_opc_ptr - tcg_ctx.gen_opc_buf; lj++;while (lj <= j) - gen_opc_instr_start[lj++] =0 ; + tcg_ctx.gen_opc_instr_start[lj++] =0 ; }else { tb->size = dc->pc - pc_start; tb->icount = num_insns;
target-microblaze/translate.c +3 -3
@@ -1788,10 +1788,10 @@ gen_intermediate_code_internal(CPUMBState *env, TranslationBlock *tb,if (lj < j) { lj++;while (lj < j) - gen_opc_instr_start[lj++] =0 ; + tcg_ctx.gen_opc_instr_start[lj++] =0 ; } tcg_ctx.gen_opc_pc[lj] = dc->pc; - gen_opc_instr_start[lj] =1 ; + tcg_ctx.gen_opc_instr_start[lj] =1 ; tcg_ctx.gen_opc_icount[lj] = num_insns; }
@@ -1902,7 +1902,7 @@ gen_intermediate_code_internal(CPUMBState *env, TranslationBlock *tb, j = tcg_ctx.gen_opc_ptr - tcg_ctx.gen_opc_buf; lj++;while (lj <= j) - gen_opc_instr_start[lj++] =0 ; + tcg_ctx.gen_opc_instr_start[lj++] =0 ; }else { tb->size = dc->pc - pc_start; tb->icount = num_insns;
target-mips/translate.c +3 -3
@@ -15553,12 +15553,12 @@ gen_intermediate_code_internal (CPUMIPSState *env, TranslationBlock *tb,if (lj < j) { lj++;while (lj < j) - gen_opc_instr_start[lj++] =0 ; + tcg_ctx.gen_opc_instr_start[lj++] =0 ; } tcg_ctx.gen_opc_pc[lj] = ctx.pc; gen_opc_hflags[lj] = ctx.hflags &MIPS_HFLAG_BMASK ; gen_opc_btarget[lj] = ctx.btarget; - gen_opc_instr_start[lj] =1 ; + tcg_ctx.gen_opc_instr_start[lj] =1 ; tcg_ctx.gen_opc_icount[lj] = num_insns; }if (num_insns +1 == max_insns && (tb->cflags &CF_LAST_IO ))
@@ -15636,7 +15636,7 @@ done_generating: j = tcg_ctx.gen_opc_ptr - tcg_ctx.gen_opc_buf; lj++;while (lj <= j) - gen_opc_instr_start[lj++] =0 ; + tcg_ctx.gen_opc_instr_start[lj++] =0 ; }else { tb->size = ctx.pc - pc_start; tb->icount = num_insns;
target-openrisc/translate.c +3 -3
@@ -1707,11 +1707,11 @@ static inline void gen_intermediate_code_internal(OpenRISCCPU *cpu,if (k < j) { k++;while (k < j) { - gen_opc_instr_start[k++] =0 ; + tcg_ctx.gen_opc_instr_start[k++] =0 ; } } tcg_ctx.gen_opc_pc[k] = dc->pc; - gen_opc_instr_start[k] =1 ; + tcg_ctx.gen_opc_instr_start[k] =1 ; tcg_ctx.gen_opc_icount[k] = num_insns; }
@@ -1787,7 +1787,7 @@ static inline void gen_intermediate_code_internal(OpenRISCCPU *cpu, j = tcg_ctx.gen_opc_ptr - tcg_ctx.gen_opc_buf; k++;while (k <= j) { - gen_opc_instr_start[k++] =0 ; + tcg_ctx.gen_opc_instr_start[k++] =0 ; } }else { tb->size = dc->pc - pc_start;
target-ppc/translate.c +3 -3
@@ -9679,10 +9679,10 @@ static inline void gen_intermediate_code_internal(CPUPPCState *env,if (lj < j) { lj++;while (lj < j) - gen_opc_instr_start[lj++] =0 ; + tcg_ctx.gen_opc_instr_start[lj++] =0 ; } tcg_ctx.gen_opc_pc[lj] = ctx.nip; - gen_opc_instr_start[lj] =1 ; + tcg_ctx.gen_opc_instr_start[lj] =1 ; tcg_ctx.gen_opc_icount[lj] = num_insns; }LOG_DISAS ("----------------\n" );
@@ -9780,7 +9780,7 @@ static inline void gen_intermediate_code_internal(CPUPPCState *env, j = tcg_ctx.gen_opc_ptr - tcg_ctx.gen_opc_buf; lj++;while (lj <= j) - gen_opc_instr_start[lj++] =0 ; + tcg_ctx.gen_opc_instr_start[lj++] =0 ; }else { tb->size = ctx.nip - pc_start; tb->icount = num_insns;
target-s390x/translate.c +3 -3
@@ -5160,12 +5160,12 @@ static inline void gen_intermediate_code_internal(CPUS390XState *env,if (lj < j) { lj++;while (lj < j) { - gen_opc_instr_start[lj++] =0 ; + tcg_ctx.gen_opc_instr_start[lj++] =0 ; } } tcg_ctx.gen_opc_pc[lj] = dc.pc; gen_opc_cc_op[lj] = dc.cc_op; - gen_opc_instr_start[lj] =1 ; + tcg_ctx.gen_opc_instr_start[lj] =1 ; tcg_ctx.gen_opc_icount[lj] = num_insns; }if (num_insns +1 == max_insns && (tb->cflags &CF_LAST_IO )) {
@@ -5212,7 +5212,7 @@ static inline void gen_intermediate_code_internal(CPUS390XState *env, j = tcg_ctx.gen_opc_ptr - tcg_ctx.gen_opc_buf; lj++;while (lj <= j) { - gen_opc_instr_start[lj++] =0 ; + tcg_ctx.gen_opc_instr_start[lj++] =0 ; } }else { tb->size = dc.pc - pc_start;
target-sh4/translate.c +3 -3
@@ -2003,11 +2003,11 @@ gen_intermediate_code_internal(CPUSH4State * env, TranslationBlock * tb,if (ii < i) { ii++;while (ii < i) - gen_opc_instr_start[ii++] =0 ; + tcg_ctx.gen_opc_instr_start[ii++] =0 ; } tcg_ctx.gen_opc_pc[ii] = ctx.pc; gen_opc_hflags[ii] = ctx.flags; - gen_opc_instr_start[ii] =1 ; + tcg_ctx.gen_opc_instr_start[ii] =1 ; tcg_ctx.gen_opc_icount[ii] = num_insns; }if (num_insns +1 == max_insns && (tb->cflags &CF_LAST_IO ))
@@ -2061,7 +2061,7 @@ gen_intermediate_code_internal(CPUSH4State * env, TranslationBlock * tb, i = tcg_ctx.gen_opc_ptr - tcg_ctx.gen_opc_buf; ii++;while (ii <= i) - gen_opc_instr_start[ii++] =0 ; + tcg_ctx.gen_opc_instr_start[ii++] =0 ; }else { tb->size = ctx.pc - pc_start; tb->icount = num_insns;
target-sparc/translate.c +3 -3
@@ -5283,10 +5283,10 @@ static inline void gen_intermediate_code_internal(TranslationBlock * tb,if (lj < j) { lj++;while (lj < j) - gen_opc_instr_start[lj++] =0 ; + tcg_ctx.gen_opc_instr_start[lj++] =0 ; tcg_ctx.gen_opc_pc[lj] = dc->pc; gen_opc_npc[lj] = dc->npc; - gen_opc_instr_start[lj] =1 ; + tcg_ctx.gen_opc_instr_start[lj] =1 ; tcg_ctx.gen_opc_icount[lj] = num_insns; } }
@@ -5339,7 +5339,7 @@ static inline void gen_intermediate_code_internal(TranslationBlock * tb, j = tcg_ctx.gen_opc_ptr - tcg_ctx.gen_opc_buf; lj++;while (lj <= j) - gen_opc_instr_start[lj++] =0 ; + tcg_ctx.gen_opc_instr_start[lj++] =0 ;#if 0 log_page_dump ();#endif
target-unicore32/translate.c +3 -3
@@ -2003,11 +2003,11 @@ static inline void gen_intermediate_code_internal(CPUUniCore32State *env,if (lj < j) { lj++;while (lj < j) { - gen_opc_instr_start[lj++] =0 ; + tcg_ctx.gen_opc_instr_start[lj++] =0 ; } } tcg_ctx.gen_opc_pc[lj] = dc->pc; - gen_opc_instr_start[lj] =1 ; + tcg_ctx.gen_opc_instr_start[lj] =1 ; tcg_ctx.gen_opc_icount[lj] = num_insns; }
@@ -2117,7 +2117,7 @@ done_generating: j = tcg_ctx.gen_opc_ptr - tcg_ctx.gen_opc_buf; lj++;while (lj <= j) { - gen_opc_instr_start[lj++] =0 ; + tcg_ctx.gen_opc_instr_start[lj++] =0 ; } }else { tb->size = dc->pc - pc_start;
target-xtensa/translate.c +2 -2
@@ -2897,11 +2897,11 @@ static void gen_intermediate_code_internal(if (lj < j) { lj++;while (lj < j) { - gen_opc_instr_start[lj++] =0 ; + tcg_ctx.gen_opc_instr_start[lj++] =0 ; } } tcg_ctx.gen_opc_pc[lj] = dc.pc; - gen_opc_instr_start[lj] =1 ; + tcg_ctx.gen_opc_instr_start[lj] =1 ; tcg_ctx.gen_opc_icount[lj] = insn_count; }
translate-all.c +2 -1
@@ -146,8 +146,9 @@ int cpu_restore_state(TranslationBlock *tb,if (j <0 )return -1 ;/* now find start of instruction before */ -while (gen_opc_instr_start[j] ==0 ) +while (s->gen_opc_instr_start[j] ==0 ) { j--; + } env->icount_decr.u16.low -= s->gen_opc_icount[j];restore_state_to_opc (env, tb, j);
Signature · 1 line
1.7.9.5
PATCH 5/5 TCG: Remove unused global gen_opc_ arrays.
In reply to Evgeny Voevodin--- exec-all.h | 4 ---- translate-all.c | 4 ---- 2 files changed, 8 deletions(-)
exec-all.h +0 -4
@@ -70,10 +70,6 @@ typedef struct TranslationBlock TranslationBlock;#define OPPARAM_BUF_SIZE (OPC_BUF_SIZE * MAX_OPC_PARAM) -extern target_ulong gen_opc_pc[OPC_BUF_SIZE ]; -extern uint8_t gen_opc_instr_start[OPC_BUF_SIZE ]; -extern uint16_t gen_opc_icount[OPC_BUF_SIZE ]; -#include "qemu-log.h" void gen_intermediate_code (CPUArchState *env,struct TranslationBlock *tb);
translate-all.c +0 -4
@@ -33,10 +33,6 @@/* code generation context */ TCGContext tcg_ctx; -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 ]; -void cpu_gen_init (void ) {tcg_context_init (&tcg_ctx);
Signature · 1 line
1.7.9.5
PATCH 3/5 TCG: Use gen_opc_icount from context instead of global variable.
In reply to Evgeny Voevodin--- target-alpha/translate.c | 2 +- target-arm/translate.c | 2 +- target-cris/translate.c | 2 +- target-i386/translate.c | 2 +- target-lm32/translate.c | 2 +- target-m68k/translate.c | 2 +- target-microblaze/translate.c | 2 +- target-mips/translate.c | 2 +- target-openrisc/translate.c | 2 +- target-ppc/translate.c | 2 +- target-s390x/translate.c | 2 +- target-sh4/translate.c | 2 +- target-sparc/translate.c | 2 +- target-unicore32/translate.c | 2 +- target-xtensa/translate.c | 2 +- translate-all.c | 2 +- 16 files changed, 16 insertions(+), 16 deletions(-)
target-alpha/translate.c +1 -1
@@ -3414,7 +3414,7 @@ static inline void gen_intermediate_code_internal(CPUAlphaState *env, } tcg_ctx.gen_opc_pc[lj] = ctx.pc; gen_opc_instr_start[lj] =1 ; - gen_opc_icount[lj] = num_insns; + tcg_ctx.gen_opc_icount[lj] = num_insns; }if (num_insns +1 == max_insns && (tb->cflags &CF_LAST_IO ))gen_io_start ();
target-arm/translate.c +1 -1
@@ -9843,7 +9843,7 @@ static inline void gen_intermediate_code_internal(CPUARMState *env, tcg_ctx.gen_opc_pc[lj] = dc->pc; gen_opc_condexec_bits[lj] = (dc->condexec_cond <<4 ) | (dc->condexec_mask >>1 ); gen_opc_instr_start[lj] =1 ; - gen_opc_icount[lj] = num_insns; + tcg_ctx.gen_opc_icount[lj] = num_insns; }if (num_insns +1 == max_insns && (tb->cflags &CF_LAST_IO ))
target-cris/translate.c +1 -1
@@ -3310,7 +3310,7 @@ gen_intermediate_code_internal(CPUCRISState *env, TranslationBlock *tb, tcg_ctx.gen_opc_pc[lj] = dc->pc; } gen_opc_instr_start[lj] =1 ; - gen_opc_icount[lj] = num_insns; + tcg_ctx.gen_opc_icount[lj] = num_insns; }/* Pretty disas. */
target-i386/translate.c +1 -1
@@ -7993,7 +7993,7 @@ static inline void gen_intermediate_code_internal(CPUX86State *env, tcg_ctx.gen_opc_pc[lj] = pc_ptr; gen_opc_cc_op[lj] = dc->cc_op; gen_opc_instr_start[lj] =1 ; - gen_opc_icount[lj] = num_insns; + tcg_ctx.gen_opc_icount[lj] = num_insns; }if (num_insns +1 == max_insns && (tb->cflags &CF_LAST_IO ))gen_io_start ();
target-lm32/translate.c +1 -1
@@ -1056,7 +1056,7 @@ static void gen_intermediate_code_internal(CPULM32State *env, } tcg_ctx.gen_opc_pc[lj] = dc->pc; gen_opc_instr_start[lj] =1 ; - gen_opc_icount[lj] = num_insns; + tcg_ctx.gen_opc_icount[lj] = num_insns; }/* Pretty disas. */
target-m68k/translate.c +1 -1
@@ -3023,7 +3023,7 @@ gen_intermediate_code_internal(CPUM68KState *env, TranslationBlock *tb, } tcg_ctx.gen_opc_pc[lj] = dc->pc; gen_opc_instr_start[lj] =1 ; - gen_opc_icount[lj] = num_insns; + tcg_ctx.gen_opc_icount[lj] = num_insns; }if (num_insns +1 == max_insns && (tb->cflags &CF_LAST_IO ))gen_io_start ();
target-microblaze/translate.c +1 -1
@@ -1792,7 +1792,7 @@ gen_intermediate_code_internal(CPUMBState *env, TranslationBlock *tb, } tcg_ctx.gen_opc_pc[lj] = dc->pc; gen_opc_instr_start[lj] =1 ; - gen_opc_icount[lj] = num_insns; + tcg_ctx.gen_opc_icount[lj] = num_insns; }/* Pretty disas. */
target-mips/translate.c +1 -1
@@ -15559,7 +15559,7 @@ gen_intermediate_code_internal (CPUMIPSState *env, TranslationBlock *tb, gen_opc_hflags[lj] = ctx.hflags &MIPS_HFLAG_BMASK ; gen_opc_btarget[lj] = ctx.btarget; gen_opc_instr_start[lj] =1 ; - gen_opc_icount[lj] = num_insns; + tcg_ctx.gen_opc_icount[lj] = num_insns; }if (num_insns +1 == max_insns && (tb->cflags &CF_LAST_IO ))gen_io_start ();
target-openrisc/translate.c +1 -1
@@ -1712,7 +1712,7 @@ static inline void gen_intermediate_code_internal(OpenRISCCPU *cpu, } tcg_ctx.gen_opc_pc[k] = dc->pc; gen_opc_instr_start[k] =1 ; - gen_opc_icount[k] = num_insns; + tcg_ctx.gen_opc_icount[k] = num_insns; }if (unlikely (qemu_loglevel_mask (CPU_LOG_TB_OP |CPU_LOG_TB_OP_OPT ))) {
target-ppc/translate.c +1 -1
@@ -9683,7 +9683,7 @@ static inline void gen_intermediate_code_internal(CPUPPCState *env, } tcg_ctx.gen_opc_pc[lj] = ctx.nip; gen_opc_instr_start[lj] =1 ; - gen_opc_icount[lj] = num_insns; + tcg_ctx.gen_opc_icount[lj] = num_insns; }LOG_DISAS ("----------------\n" ); LOG_DISAS("nip=" TARGET_FMT_lx " super=%d ir=%d\n",
target-s390x/translate.c +1 -1
@@ -5166,7 +5166,7 @@ static inline void gen_intermediate_code_internal(CPUS390XState *env, tcg_ctx.gen_opc_pc[lj] = dc.pc; gen_opc_cc_op[lj] = dc.cc_op; gen_opc_instr_start[lj] =1 ; - gen_opc_icount[lj] = num_insns; + tcg_ctx.gen_opc_icount[lj] = num_insns; }if (num_insns +1 == max_insns && (tb->cflags &CF_LAST_IO )) {gen_io_start ();
target-sh4/translate.c +1 -1
@@ -2008,7 +2008,7 @@ gen_intermediate_code_internal(CPUSH4State * env, TranslationBlock * tb, tcg_ctx.gen_opc_pc[ii] = ctx.pc; gen_opc_hflags[ii] = ctx.flags; gen_opc_instr_start[ii] =1 ; - gen_opc_icount[ii] = num_insns; + tcg_ctx.gen_opc_icount[ii] = num_insns; }if (num_insns +1 == max_insns && (tb->cflags &CF_LAST_IO ))gen_io_start ();
target-sparc/translate.c +1 -1
@@ -5287,7 +5287,7 @@ static inline void gen_intermediate_code_internal(TranslationBlock * tb, tcg_ctx.gen_opc_pc[lj] = dc->pc; gen_opc_npc[lj] = dc->npc; gen_opc_instr_start[lj] =1 ; - gen_opc_icount[lj] = num_insns; + tcg_ctx.gen_opc_icount[lj] = num_insns; } }if (num_insns +1 == max_insns && (tb->cflags &CF_LAST_IO ))
target-unicore32/translate.c +1 -1
@@ -2008,7 +2008,7 @@ static inline void gen_intermediate_code_internal(CPUUniCore32State *env, } tcg_ctx.gen_opc_pc[lj] = dc->pc; gen_opc_instr_start[lj] =1 ; - gen_opc_icount[lj] = num_insns; + tcg_ctx.gen_opc_icount[lj] = num_insns; }if (num_insns +1 == max_insns && (tb->cflags &CF_LAST_IO )) {
target-xtensa/translate.c +1 -1
@@ -2902,7 +2902,7 @@ static void gen_intermediate_code_internal( } tcg_ctx.gen_opc_pc[lj] = dc.pc; gen_opc_instr_start[lj] =1 ; - gen_opc_icount[lj] = insn_count; + tcg_ctx.gen_opc_icount[lj] = insn_count; }if (unlikely (qemu_loglevel_mask (CPU_LOG_TB_OP |CPU_LOG_TB_OP_OPT ))) {
translate-all.c +1 -1
@@ -148,7 +148,7 @@ int cpu_restore_state(TranslationBlock *tb,/* now find start of instruction before */ while (gen_opc_instr_start[j] ==0 ) j--; - env->icount_decr.u16.low -= gen_opc_icount[j]; + env->icount_decr.u16.low -= s->gen_opc_icount[j];restore_state_to_opc (env, tb, j);
Signature · 1 line
1.7.9.5
PATCH 2/5 TCG: Use gen_opc_pc from context instead of global variable.
In reply to Evgeny Voevodin--- target-alpha/translate.c | 4 ++-- target-arm/translate.c | 4 ++-- target-cris/translate.c | 6 +++--- target-i386/translate.c | 9 +++++---- target-lm32/translate.c | 4 ++-- target-m68k/translate.c | 4 ++-- target-microblaze/translate.c | 4 ++-- target-mips/translate.c | 4 ++-- target-openrisc/translate.c | 4 ++-- target-ppc/translate.c | 4 ++-- target-s390x/translate.c | 4 ++-- target-sh4/translate.c | 4 ++-- target-sparc/translate.c | 4 ++-- target-unicore32/translate.c | 4 ++-- target-xtensa/translate.c | 4 ++-- 15 files changed, 34 insertions(+), 33 deletions(-)
target-alpha/translate.c +2 -2
@@ -3412,7 +3412,7 @@ static inline void gen_intermediate_code_internal(CPUAlphaState *env,while (lj < j) gen_opc_instr_start[lj++] =0 ; } - gen_opc_pc[lj] = ctx.pc; + tcg_ctx.gen_opc_pc[lj] = ctx.pc; gen_opc_instr_start[lj] =1 ; gen_opc_icount[lj] = num_insns; }
@@ -3551,5 +3551,5 @@ CPUAlphaState * cpu_alpha_init (const char *cpu_model)void restore_state_to_opc (CPUAlphaState *env,TranslationBlock *tb,int pc_pos) { - env->pc = gen_opc_pc[pc_pos]; + env->pc = tcg_ctx.gen_opc_pc[pc_pos]; }
target-arm/translate.c +2 -2
@@ -9840,7 +9840,7 @@ static inline void gen_intermediate_code_internal(CPUARMState *env,while (lj < j) gen_opc_instr_start[lj++] =0 ; } - gen_opc_pc[lj] = dc->pc; + tcg_ctx.gen_opc_pc[lj] = dc->pc; gen_opc_condexec_bits[lj] = (dc->condexec_cond <<4 ) | (dc->condexec_mask >>1 ); gen_opc_instr_start[lj] =1 ; gen_opc_icount[lj] = num_insns;
@@ -10043,6 +10043,6 @@ void cpu_dump_state(CPUARMState *env, FILE *f, fprintf_function cpu_fprintf,void restore_state_to_opc (CPUARMState *env,TranslationBlock *tb,int pc_pos) { - env->regs[15 ] = gen_opc_pc[pc_pos]; + env->regs[15 ] = tcg_ctx.gen_opc_pc[pc_pos]; env->condexec_bits = gen_opc_condexec_bits[pc_pos]; }
target-cris/translate.c +3 -3
@@ -3305,9 +3305,9 @@ gen_intermediate_code_internal(CPUCRISState *env, TranslationBlock *tb, } }if (dc->delayed_branch ==1 ) { - gen_opc_pc[lj] = dc->ppc |1 ; + tcg_ctx.gen_opc_pc[lj] = dc->ppc |1 ; }else { - gen_opc_pc[lj] = dc->pc; + tcg_ctx.gen_opc_pc[lj] = dc->pc; } gen_opc_instr_start[lj] =1 ; gen_opc_icount[lj] = num_insns;
@@ -3621,5 +3621,5 @@ CRISCPU *cpu_cris_init(const char *cpu_model)void restore_state_to_opc (CPUCRISState *env,TranslationBlock *tb,int pc_pos) { - env->pc = gen_opc_pc[pc_pos]; + env->pc = tcg_ctx.gen_opc_pc[pc_pos]; }
target-i386/translate.c +5 -4
@@ -7990,7 +7990,7 @@ static inline void gen_intermediate_code_internal(CPUX86State *env,while (lj < j) gen_opc_instr_start[lj++] =0 ; } - gen_opc_pc[lj] = pc_ptr; + tcg_ctx.gen_opc_pc[lj] = pc_ptr; gen_opc_cc_op[lj] = dc->cc_op; gen_opc_instr_start[lj] =1 ; gen_opc_icount[lj] = num_insns;
@@ -8081,15 +8081,16 @@ void restore_state_to_opc(CPUX86State *env, TranslationBlock *tb, int pc_pos)qemu_log ("RESTORE:\n" );for (i =0 ;i <= pc_pos; i++) {if (gen_opc_instr_start[i]) { -qemu_log ("0x%04x: " TARGET_FMT_lx"\n" , i, gen_opc_pc[i]); +qemu_log ("0x%04x: " TARGET_FMT_lx"\n" , i, + tcg_ctx.gen_opc_pc[i]); } }qemu_log ("pc_pos=0x%x eip=" TARGET_FMT_lx" cs_base=%x\n" , - pc_pos, gen_opc_pc[pc_pos] - tb->cs_base, + pc_pos, tcg_ctx.gen_opc_pc[pc_pos] - tb->cs_base, (uint32_t)tb->cs_base); }#endif - env->eip = gen_opc_pc[pc_pos] - tb->cs_base; + env->eip = tcg_ctx.gen_opc_pc[pc_pos] - tb->cs_base; cc_op = gen_opc_cc_op[pc_pos];if (cc_op !=CC_OP_DYNAMIC ) env->cc_op = cc_op;
target-lm32/translate.c +2 -2
@@ -1054,7 +1054,7 @@ static void gen_intermediate_code_internal(CPULM32State *env, gen_opc_instr_start[lj++] =0 ; } } - gen_opc_pc[lj] = dc->pc; + tcg_ctx.gen_opc_pc[lj] = dc->pc; gen_opc_instr_start[lj] =1 ; gen_opc_icount[lj] = num_insns; }
@@ -1172,7 +1172,7 @@ void cpu_dump_state(CPULM32State *env, FILE *f, fprintf_function cpu_fprintf,void restore_state_to_opc (CPULM32State *env,TranslationBlock *tb,int pc_pos) { - env->pc = gen_opc_pc[pc_pos]; + env->pc = tcg_ctx.gen_opc_pc[pc_pos]; }void lm32_translate_init (void )
target-m68k/translate.c +2 -2
@@ -3021,7 +3021,7 @@ gen_intermediate_code_internal(CPUM68KState *env, TranslationBlock *tb,while (lj < j) gen_opc_instr_start[lj++] =0 ; } - gen_opc_pc[lj] = dc->pc; + tcg_ctx.gen_opc_pc[lj] = dc->pc; gen_opc_instr_start[lj] =1 ; gen_opc_icount[lj] = num_insns; }
@@ -3121,5 +3121,5 @@ void cpu_dump_state(CPUM68KState *env, FILE *f, fprintf_function cpu_fprintf,void restore_state_to_opc (CPUM68KState *env,TranslationBlock *tb,int pc_pos) { - env->pc = gen_opc_pc[pc_pos]; + env->pc = tcg_ctx.gen_opc_pc[pc_pos]; }
target-microblaze/translate.c +2 -2
@@ -1790,7 +1790,7 @@ gen_intermediate_code_internal(CPUMBState *env, TranslationBlock *tb,while (lj < j) gen_opc_instr_start[lj++] =0 ; } - gen_opc_pc[lj] = dc->pc; + tcg_ctx.gen_opc_pc[lj] = dc->pc; gen_opc_instr_start[lj] =1 ; gen_opc_icount[lj] = num_insns; }
@@ -2014,5 +2014,5 @@ MicroBlazeCPU *cpu_mb_init(const char *cpu_model)void restore_state_to_opc (CPUMBState *env,TranslationBlock *tb,int pc_pos) { - env->sregs[SR_PC ] = gen_opc_pc[pc_pos]; + env->sregs[SR_PC ] = tcg_ctx.gen_opc_pc[pc_pos]; }
target-mips/translate.c +2 -2
@@ -15555,7 +15555,7 @@ gen_intermediate_code_internal (CPUMIPSState *env, TranslationBlock *tb,while (lj < j) gen_opc_instr_start[lj++] =0 ; } - gen_opc_pc[lj] = ctx.pc; + tcg_ctx.gen_opc_pc[lj] = ctx.pc; gen_opc_hflags[lj] = ctx.hflags &MIPS_HFLAG_BMASK ; gen_opc_btarget[lj] = ctx.btarget; gen_opc_instr_start[lj] =1 ;
@@ -15976,7 +15976,7 @@ void cpu_state_reset(CPUMIPSState *env)void restore_state_to_opc (CPUMIPSState *env,TranslationBlock *tb,int pc_pos) { - env->active_tc.PC = gen_opc_pc[pc_pos]; + env->active_tc.PC = tcg_ctx.gen_opc_pc[pc_pos]; env->hflags &= ~MIPS_HFLAG_BMASK ; env->hflags |= gen_opc_hflags[pc_pos];switch (env->hflags &MIPS_HFLAG_BMASK_BASE ) {
target-openrisc/translate.c +2 -2
@@ -1710,7 +1710,7 @@ static inline void gen_intermediate_code_internal(OpenRISCCPU *cpu, gen_opc_instr_start[k++] =0 ; } } - gen_opc_pc[k] = dc->pc; + tcg_ctx.gen_opc_pc[k] = dc->pc; gen_opc_instr_start[k] =1 ; gen_opc_icount[k] = num_insns; }
@@ -1832,5 +1832,5 @@ void cpu_dump_state(CPUOpenRISCState *env, FILE *f,void restore_state_to_opc (CPUOpenRISCState *env,TranslationBlock *tb,int pc_pos) { - env->pc = gen_opc_pc[pc_pos]; + env->pc = tcg_ctx.gen_opc_pc[pc_pos]; }
target-ppc/translate.c +2 -2
@@ -9681,7 +9681,7 @@ static inline void gen_intermediate_code_internal(CPUPPCState *env,while (lj < j) gen_opc_instr_start[lj++] =0 ; } - gen_opc_pc[lj] = ctx.nip; + tcg_ctx.gen_opc_pc[lj] = ctx.nip; gen_opc_instr_start[lj] =1 ; gen_opc_icount[lj] = num_insns; }
@@ -9809,5 +9809,5 @@ void gen_intermediate_code_pc (CPUPPCState *env, struct TranslationBlock *tb)void restore_state_to_opc (CPUPPCState *env,TranslationBlock *tb,int pc_pos) { - env->nip = gen_opc_pc[pc_pos]; + env->nip = tcg_ctx.gen_opc_pc[pc_pos]; }
target-s390x/translate.c +2 -2
@@ -5163,7 +5163,7 @@ static inline void gen_intermediate_code_internal(CPUS390XState *env, gen_opc_instr_start[lj++] =0 ; } } - gen_opc_pc[lj] = dc.pc; + tcg_ctx.gen_opc_pc[lj] = dc.pc; gen_opc_cc_op[lj] = dc.cc_op; gen_opc_instr_start[lj] =1 ; gen_opc_icount[lj] = num_insns;
@@ -5240,7 +5240,7 @@ void gen_intermediate_code_pc (CPUS390XState *env, struct TranslationBlock *tb)void restore_state_to_opc (CPUS390XState *env,TranslationBlock *tb,int pc_pos) {int cc_op; - env->psw.addr = gen_opc_pc[pc_pos]; + env->psw.addr = tcg_ctx.gen_opc_pc[pc_pos]; cc_op = gen_opc_cc_op[pc_pos];if ((cc_op !=CC_OP_DYNAMIC ) && (cc_op !=CC_OP_STATIC )) { env->cc_op = cc_op;
target-sh4/translate.c +2 -2
@@ -2005,7 +2005,7 @@ gen_intermediate_code_internal(CPUSH4State * env, TranslationBlock * tb,while (ii < i) gen_opc_instr_start[ii++] =0 ; } - gen_opc_pc[ii] = ctx.pc; + tcg_ctx.gen_opc_pc[ii] = ctx.pc; gen_opc_hflags[ii] = ctx.flags; gen_opc_instr_start[ii] =1 ; gen_opc_icount[ii] = num_insns;
@@ -2088,6 +2088,6 @@ void gen_intermediate_code_pc(CPUSH4State * env, struct TranslationBlock *tb)void restore_state_to_opc (CPUSH4State *env,TranslationBlock *tb,int pc_pos) { - env->pc = gen_opc_pc[pc_pos]; + env->pc = tcg_ctx.gen_opc_pc[pc_pos]; env->flags = gen_opc_hflags[pc_pos]; }
target-sparc/translate.c +2 -2
@@ -5284,7 +5284,7 @@ static inline void gen_intermediate_code_internal(TranslationBlock * tb, lj++;while (lj < j) gen_opc_instr_start[lj++] =0 ; - gen_opc_pc[lj] = dc->pc; + tcg_ctx.gen_opc_pc[lj] = dc->pc; gen_opc_npc[lj] = dc->npc; gen_opc_instr_start[lj] =1 ; gen_opc_icount[lj] = num_insns;
@@ -5478,7 +5478,7 @@ void gen_intermediate_code_init(CPUSPARCState *env)void restore_state_to_opc (CPUSPARCState *env,TranslationBlock *tb,int pc_pos) {target_ulong npc; - env->pc = gen_opc_pc[pc_pos]; + env->pc = tcg_ctx.gen_opc_pc[pc_pos]; npc = gen_opc_npc[pc_pos];if (npc ==1 ) {/* dynamic NPC: already stored */
target-unicore32/translate.c +2 -2
@@ -2006,7 +2006,7 @@ static inline void gen_intermediate_code_internal(CPUUniCore32State *env, gen_opc_instr_start[lj++] =0 ; } } - gen_opc_pc[lj] = dc->pc; + tcg_ctx.gen_opc_pc[lj] = dc->pc; gen_opc_instr_start[lj] =1 ; gen_opc_icount[lj] = num_insns; }
@@ -2203,5 +2203,5 @@ void cpu_dump_state(CPUUniCore32State *env, FILE *f,void restore_state_to_opc (CPUUniCore32State *env,TranslationBlock *tb,int pc_pos) { - env->regs[31 ] = gen_opc_pc[pc_pos]; + env->regs[31 ] = tcg_ctx.gen_opc_pc[pc_pos]; }
target-xtensa/translate.c +2 -2
@@ -2900,7 +2900,7 @@ static void gen_intermediate_code_internal( gen_opc_instr_start[lj++] =0 ; } } - gen_opc_pc[lj] = dc.pc; + tcg_ctx.gen_opc_pc[lj] = dc.pc; gen_opc_instr_start[lj] =1 ; gen_opc_icount[lj] = insn_count; }
@@ -3028,5 +3028,5 @@ void cpu_dump_state(CPUXtensaState *env, FILE *f, fprintf_function cpu_fprintf,void restore_state_to_opc (CPUXtensaState *env,TranslationBlock *tb,int pc_pos) { - env->pc = gen_opc_pc[pc_pos]; + env->pc = tcg_ctx.gen_opc_pc[pc_pos]; }
Signature · 1 line
1.7.9.5
Quoted 54 lines · Evgeny Voevodin
This set of patches moves global variables to
tcg_ctx:gen_opc_instrgen_opparam_icountgen_opc_pcBuild tested for all targets.
Execution tested on Exynos4210 target.After this patchset was aplied,
I noticed no speed-up or slow-down of code generation.Here is the test procedure:
1. Boot Linux Kernel 5 times.
2. For each iteration wait while "JIT cycles" is stable for ~10 seconds
3. Write down the "cycles/op"Here are the results (tested on gcc-4.6):
Before clean-up:
min: 655.5
max: 659.3
avg: 657.2
standard deviation: ~2 ~= 0.4%Average cycles/op = 657 +- 2
After clean-up:
min: 654.6
max: 657.1
avg: 655.5
standard deviation: ~1 ~= 0.2%Average cycles/op = 656 +- 1
Evgeny Voevodin (5):
tcg/tcg.h: Duplicate global TCGgen_opc_arrays into TCGContext.
TCG: Usegen_opc_pcfrom context instead of global variable.
TCG: Usegen_opc_icountfrom context instead of global variable.
TCG: Usegen_opc_instr_startfrom context instead of global variable.
TCG: Remove unused globalgen_opc_arrays.exec-all.h | 4 ---- target-alpha/translate.c | 12 ++++++------ target-arm/translate.c | 12 ++++++------ target-cris/translate.c | 14 +++++++------- target-i386/translate.c | 19 ++++++++++--------- target-lm32/translate.c | 12 ++++++------ target-m68k/translate.c | 12 ++++++------ target-microblaze/translate.c | 12 ++++++------ target-mips/translate.c | 12 ++++++------ target-openrisc/translate.c | 12 ++++++------ target-ppc/translate.c | 12 ++++++------
Quoted 9 lines
target-s390x/translate.c | 12 ++++++------ target-sh4/translate.c | 12 ++++++------ target-sparc/translate.c | 12 ++++++------ target-unicore32/translate.c | 12 ++++++------ target-xtensa/translate.c | 10 +++++----- tcg/tcg.h | 3 +++ translate-all.c | 9 +++------ 18 files changed, 100 insertions(+), 103 deletions(-)
Ping?
+CC: Alexander Graf <[email protected]>; Paul Brook <[email protected]>
Signature · 6 lines
Kind regards, Evgeny Voevodin, Technical Leader, Mobile Group, Samsung Moscow Research Centre, e-mail: [email protected]
Quoted 65 lines · Evgeny Voevodin
Quoted 54 lines · Evgeny Voevodin
This set of patches moves global variables to
tcg_ctx:gen_opc_instrgen_opparam_icountgen_opc_pcBuild tested for all targets.
Execution tested on Exynos4210 target.After this patchset was aplied,
I noticed no speed-up or slow-down of code generation.Here is the test procedure:
1. Boot Linux Kernel 5 times.
2. For each iteration wait while "JIT cycles" is stable for ~10 seconds
3. Write down the "cycles/op"Here are the results (tested on gcc-4.6):
Before clean-up:
min: 655.5
max: 659.3
avg: 657.2
standard deviation: ~2 ~= 0.4%Average cycles/op = 657 +- 2
After clean-up:
min: 654.6
max: 657.1
avg: 655.5
standard deviation: ~1 ~= 0.2%Average cycles/op = 656 +- 1
Evgeny Voevodin (5):
tcg/tcg.h: Duplicate global TCGgen_opc_arrays into TCGContext.
TCG: Usegen_opc_pcfrom context instead of global variable.
TCG: Usegen_opc_icountfrom context instead of global variable.
TCG: Usegen_opc_instr_startfrom context instead of global variable.
TCG: Remove unused globalgen_opc_arrays.exec-all.h | 4 ---- target-alpha/translate.c | 12 ++++++------ target-arm/translate.c | 12 ++++++------ target-cris/translate.c | 14 +++++++------- target-i386/translate.c | 19 ++++++++++--------- target-lm32/translate.c | 12 ++++++------ target-m68k/translate.c | 12 ++++++------ target-microblaze/translate.c | 12 ++++++------ target-mips/translate.c | 12 ++++++------ target-openrisc/translate.c | 12 ++++++------ target-ppc/translate.c | 12 ++++++------Quoted 9 lines
target-s390x/translate.c | 12 ++++++------ target-sh4/translate.c | 12 ++++++------ target-sparc/translate.c | 12 ++++++------ target-unicore32/translate.c | 12 ++++++------ target-xtensa/translate.c | 10 +++++----- tcg/tcg.h | 3 +++ translate-all.c | 9 +++------ 18 files changed, 100 insertions(+), 103 deletions(-)
Quoted 4 lines
Ping?
+CC: Alexander Graf <[email protected]>; Paul Brook <[email protected]>
Ping??
Signature · 6 lines
Kind regards, Evgeny Voevodin, Technical Leader, Mobile Group, Samsung Moscow Research Centre, e-mail: [email protected]
Blue Swirl
AppliedThanks, applied all.
Quoted 83 lines · Evgeny Voevodin
Quoted 67 lines · Evgeny Voevodin
Quoted 55 lines · Evgeny Voevodin
This set of patches moves global variables to
tcg_ctx:gen_opc_instrgen_opparam_icountgen_opc_pcBuild tested for all targets.
Execution tested on Exynos4210 target.After this patchset was aplied,
I noticed no speed-up or slow-down of code generation.Here is the test procedure:
1. Boot Linux Kernel 5 times.
2. For each iteration wait while "JIT cycles" is stable for ~10 seconds
3. Write down the "cycles/op"Here are the results (tested on gcc-4.6):
Before clean-up:
min: 655.5
max: 659.3
avg: 657.2
standard deviation: ~2 ~= 0.4%Average cycles/op = 657 +- 2
After clean-up:
min: 654.6
max: 657.1
avg: 655.5
standard deviation: ~1 ~= 0.2%Average cycles/op = 656 +- 1
Evgeny Voevodin (5):
tcg/tcg.h: Duplicate global TCGgen_opc_arrays into TCGContext.
TCG: Usegen_opc_pcfrom context instead of global variable.
TCG: Usegen_opc_icountfrom context instead of global variable.
TCG: Usegen_opc_instr_startfrom context instead of global variable.
TCG: Remove unused globalgen_opc_arrays.exec-all.h | 4 ---- target-alpha/translate.c | 12 ++++++------ target-arm/translate.c | 12 ++++++------ target-cris/translate.c | 14 +++++++------- target-i386/translate.c | 19 ++++++++++--------- target-lm32/translate.c | 12 ++++++------ target-m68k/translate.c | 12 ++++++------ target-microblaze/translate.c | 12 ++++++------ target-mips/translate.c | 12 ++++++------ target-openrisc/translate.c | 12 ++++++------ target-ppc/translate.c | 12 ++++++------Quoted 9 lines
target-s390x/translate.c | 12 ++++++------ target-sh4/translate.c | 12 ++++++------ target-sparc/translate.c | 12 ++++++------ target-unicore32/translate.c | 12 ++++++------ target-xtensa/translate.c | 10 +++++----- tcg/tcg.h | 3 +++ translate-all.c | 9 +++------ 18 files changed, 100 insertions(+), 103 deletions(-)Quoted 4 lines
Ping?
+CC: Alexander Graf <[email protected]>; Paul Brook <[email protected]>
Ping??
--
Kind regards,
Evgeny Voevodin,
Technical Leader,
Mobile Group,
Samsung Moscow Research Centre,
e-mail: [email protected]