From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KbJDa-0001oV-JM for qemu-devel@nongnu.org; Thu, 04 Sep 2008 14:06:06 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KbJDZ-0001oB-Fu for qemu-devel@nongnu.org; Thu, 04 Sep 2008 14:06:05 -0400 Received: from [199.232.76.173] (port=46896 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KbJDZ-0001o8-Ca for qemu-devel@nongnu.org; Thu, 04 Sep 2008 14:06:05 -0400 Received: from savannah.gnu.org ([199.232.41.3]:52363 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KbJDZ-0003KB-0n for qemu-devel@nongnu.org; Thu, 04 Sep 2008 14:06:05 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1KbJDY-0003NA-Gb for qemu-devel@nongnu.org; Thu, 04 Sep 2008 18:06:04 +0000 Received: from aurel32 by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1KbJDY-0003N6-5S for qemu-devel@nongnu.org; Thu, 04 Sep 2008 18:06:04 +0000 MIME-Version: 1.0 Errors-To: aurel32 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Aurelien Jarno Message-Id: Date: Thu, 04 Sep 2008 18:06:04 +0000 Subject: [Qemu-devel] [5160] ppc: Convert nip moves to TCG Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Revision: 5160 http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=5160 Author: aurel32 Date: 2008-09-04 18:06:03 +0000 (Thu, 04 Sep 2008) Log Message: ----------- ppc: Convert nip moves to TCG Signed-off-by: Aurelien Jarno Modified Paths: -------------- trunk/target-ppc/op.c trunk/target-ppc/translate.c Modified: trunk/target-ppc/op.c =================================================================== --- trunk/target-ppc/op.c 2008-09-04 17:16:41 UTC (rev 5159) +++ trunk/target-ppc/op.c 2008-09-04 18:06:03 UTC (rev 5160) @@ -46,20 +46,6 @@ do_raise_exception_err(PARAM1, PARAM2); } -void OPPROTO op_update_nip (void) -{ - env->nip = (uint32_t)PARAM1; - RETURN(); -} - -#if defined(TARGET_PPC64) -void OPPROTO op_update_nip_64 (void) -{ - env->nip = ((uint64_t)PARAM1 << 32) | (uint64_t)PARAM2; - RETURN(); -} -#endif - void OPPROTO op_debug (void) { do_raise_exception(EXCP_DEBUG); @@ -465,8 +451,6 @@ } /* Branch */ -#define EIP env->nip - void OPPROTO op_setlr (void) { env->lr = (uint32_t)PARAM1; @@ -481,20 +465,6 @@ } #endif -void OPPROTO op_b_T1 (void) -{ - env->nip = (uint32_t)(T1 & ~3); - RETURN(); -} - -#if defined (TARGET_PPC64) -void OPPROTO op_b_T1_64 (void) -{ - env->nip = (uint64_t)(T1 & ~3); - RETURN(); -} -#endif - void OPPROTO op_jz_T0 (void) { if (!T0) Modified: trunk/target-ppc/translate.c =================================================================== --- trunk/target-ppc/translate.c 2008-09-04 17:16:41 UTC (rev 5159) +++ trunk/target-ppc/translate.c 2008-09-04 18:06:03 UTC (rev 5160) @@ -60,6 +60,7 @@ static TCGv cpu_fpr[32]; static TCGv cpu_avrh[32], cpu_avrl[32]; static TCGv cpu_crf[8]; +static TCGv cpu_nip; /* dyngen register indexes */ static TCGv cpu_T[3]; @@ -164,6 +165,9 @@ p += (i < 10) ? 6 : 7; } + cpu_nip = tcg_global_mem_new(TCG_TYPE_TL, TCG_AREG0, + offsetof(CPUState, nip), "nip"); + /* register helpers */ #undef DEF_HELPER #define DEF_HELPER(ret, name, params) tcg_register_helper(name, #name); @@ -268,10 +272,10 @@ { #if defined(TARGET_PPC64) if (ctx->sf_mode) - gen_op_update_nip_64(nip >> 32, nip); + tcg_gen_movi_tl(cpu_nip, nip); else #endif - gen_op_update_nip(nip); + tcg_gen_movi_tl(cpu_nip, (uint32_t)nip); } #define GEN_EXCP(ctx, excp, error) \ @@ -2836,19 +2840,19 @@ tcg_gen_movi_tl(cpu_T[1], dest); #if defined(TARGET_PPC64) if (ctx->sf_mode) - gen_op_b_T1_64(); + tcg_gen_andi_tl(cpu_nip, cpu_T[1], ~3); else #endif - gen_op_b_T1(); + tcg_gen_andi_tl(cpu_nip, cpu_T[1], (uint32_t)~3); tcg_gen_exit_tb((long)tb + n); } else { tcg_gen_movi_tl(cpu_T[1], dest); #if defined(TARGET_PPC64) if (ctx->sf_mode) - gen_op_b_T1_64(); + tcg_gen_andi_tl(cpu_nip, cpu_T[1], ~3); else #endif - gen_op_b_T1(); + tcg_gen_andi_tl(cpu_nip, cpu_T[1], (uint32_t)~3); if (unlikely(ctx->singlestep_enabled)) { if ((ctx->singlestep_enabled & (CPU_BRANCH_STEP | CPU_SINGLE_STEP)) && @@ -2969,10 +2973,10 @@ } else { #if defined(TARGET_PPC64) if (ctx->sf_mode) - gen_op_b_T1_64(); + tcg_gen_andi_tl(cpu_nip, cpu_T[1], ~3); else #endif - gen_op_b_T1(); + tcg_gen_andi_tl(cpu_nip, cpu_T[1], (uint32_t)~3); goto no_test; } break;