From patchwork Wed Nov 21 07:43:06 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Evgeny Voevodin X-Patchwork-Id: 200594 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 52BDB2C008E for ; Wed, 21 Nov 2012 18:43:46 +1100 (EST) Received: from localhost ([::1]:47185 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tb4yG-0007JH-Ev for incoming@patchwork.ozlabs.org; Wed, 21 Nov 2012 02:43:44 -0500 Received: from eggs.gnu.org ([208.118.235.92]:51287) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tb4xv-000780-QB for qemu-devel@nongnu.org; Wed, 21 Nov 2012 02:43:25 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Tb4xs-0000CU-NP for qemu-devel@nongnu.org; Wed, 21 Nov 2012 02:43:23 -0500 Received: from mailout2.w1.samsung.com ([210.118.77.12]:43583) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tb4xs-000096-Ez for qemu-devel@nongnu.org; Wed, 21 Nov 2012 02:43:20 -0500 Received: from eusync4.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by mailout2.w1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MDT0031FUSNHF60@mailout2.w1.samsung.com> for qemu-devel@nongnu.org; Wed, 21 Nov 2012 07:43:35 +0000 (GMT) Received: from evvoevodinPC.rnd.samsung.ru ([106.109.8.15]) by eusync4.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MDT00BGQURZGE50@eusync4.samsung.com> for qemu-devel@nongnu.org; Wed, 21 Nov 2012 07:43:19 +0000 (GMT) From: Evgeny Voevodin To: qemu-devel@nongnu.org Date: Wed, 21 Nov 2012 11:43:06 +0400 Message-id: <1353483787-22308-5-git-send-email-e.voevodin@samsung.com> X-Mailer: git-send-email 1.7.9.5 In-reply-to: <1353483787-22308-1-git-send-email-e.voevodin@samsung.com> References: <1353483787-22308-1-git-send-email-e.voevodin@samsung.com> X-TM-AS-MML: No X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 210.118.77.12 Cc: Evgeny Voevodin , blauwirbel@gmail.com, kyungmin.park@samsung.com, edgar.iglesias@gmail.com, aurelien@aurel32.net, rth@twiddle.net Subject: [Qemu-devel] [PATCH 4/5] TCG: Use gen_opc_instr_start from context instead of global variable. X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Signed-off-by: Evgeny Voevodin --- 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(-) diff --git a/target-alpha/translate.c b/target-alpha/translate.c index 8b73fbb..71fe1a1 100644 --- a/target-alpha/translate.c +++ b/target-alpha/translate.c @@ -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; diff --git a/target-arm/translate.c b/target-arm/translate.c index 4695d8b..3cf3604 100644 --- a/target-arm/translate.c +++ b/target-arm/translate.c @@ -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; diff --git a/target-cris/translate.c b/target-cris/translate.c index 6ec8c3c..60bdc24 100644 --- a/target-cris/translate.c +++ b/target-cris/translate.c @@ -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; diff --git a/target-i386/translate.c b/target-i386/translate.c index 80fb695..f394ea6 100644 --- a/target-i386/translate.c +++ b/target-i386/translate.c @@ -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]); } diff --git a/target-lm32/translate.c b/target-lm32/translate.c index 4e029e0..e131ad1 100644 --- a/target-lm32/translate.c +++ b/target-lm32/translate.c @@ -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; diff --git a/target-m68k/translate.c b/target-m68k/translate.c index 0762085..11defc6 100644 --- a/target-m68k/translate.c +++ b/target-m68k/translate.c @@ -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; diff --git a/target-microblaze/translate.c b/target-microblaze/translate.c index d975756..6ceff02 100644 --- a/target-microblaze/translate.c +++ b/target-microblaze/translate.c @@ -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; diff --git a/target-mips/translate.c b/target-mips/translate.c index 81807cf..1a5e3d6 100644 --- a/target-mips/translate.c +++ b/target-mips/translate.c @@ -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; diff --git a/target-openrisc/translate.c b/target-openrisc/translate.c index 5b08314..9ac999a 100644 --- a/target-openrisc/translate.c +++ b/target-openrisc/translate.c @@ -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; diff --git a/target-ppc/translate.c b/target-ppc/translate.c index bbe2390..ed0aa83 100644 --- a/target-ppc/translate.c +++ b/target-ppc/translate.c @@ -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; diff --git a/target-s390x/translate.c b/target-s390x/translate.c index b2774ee..787e3c6 100644 --- a/target-s390x/translate.c +++ b/target-s390x/translate.c @@ -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; diff --git a/target-sh4/translate.c b/target-sh4/translate.c index ca76be5..86493e1 100644 --- a/target-sh4/translate.c +++ b/target-sh4/translate.c @@ -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; diff --git a/target-sparc/translate.c b/target-sparc/translate.c index cbb8997..5859f2e 100644 --- a/target-sparc/translate.c +++ b/target-sparc/translate.c @@ -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 diff --git a/target-unicore32/translate.c b/target-unicore32/translate.c index 0562615..3951758 100644 --- a/target-unicore32/translate.c +++ b/target-unicore32/translate.c @@ -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; diff --git a/target-xtensa/translate.c b/target-xtensa/translate.c index e93c2e6..828b9ca 100644 --- a/target-xtensa/translate.c +++ b/target-xtensa/translate.c @@ -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; } diff --git a/translate-all.c b/translate-all.c index 177e95a..2f616bf 100644 --- a/translate-all.c +++ b/translate-all.c @@ -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);