Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Kb7Lt-0003Cu-Eh for qemu-devel@nongnu.org; Thu, 04 Sep 2008 01:25:53 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Kb7Lr-0003Bn-23 for qemu-devel@nongnu.org; Thu, 04 Sep 2008 01:25:52 -0400 Received: from [199.232.76.173] (port=51318 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Kb7Lq-0003Bf-SR for qemu-devel@nongnu.org; Thu, 04 Sep 2008 01:25:50 -0400 Received: from savannah.gnu.org ([199.232.41.3]:42996 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 1Kb7Lp-0003Au-OX for qemu-devel@nongnu.org; Thu, 04 Sep 2008 01:25:50 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1Kb7Lp-0005pN-49 for qemu-devel@nongnu.org; Thu, 04 Sep 2008 05:25:49 +0000 Received: from aurel32 by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1Kb7Lo-0005p8-Gh for qemu-devel@nongnu.org; Thu, 04 Sep 2008 05:25:49 +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 05:25:48 +0000 Subject: [Qemu-devel] [5153] ppc: Convert GPR 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: 5153 http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=5153 Author: aurel32 Date: 2008-09-04 05:25:47 +0000 (Thu, 04 Sep 2008) Log Message: ----------- ppc: Convert GPR moves to TCG Replace op_load_gpr_{T0,T1,T2} and op_store_{T0,T1,T2} with tcg_gen_mov_tl. Introduce TCG variables cpu_gpr[0..31]. For the SPE extension, assure that ppc_gpr_t is only uint64_t for ppc64. Introduce TCG variables cpu_gprh[0..31] for upper 32 bits on ppc and helpers gen_{load,store}_gpr64. Based on suggestions by Aurelien, Thiemo and Blue. Signed-off-by: Andreas Faerber Signed-off-by: Aurelien Jarno Modified Paths: -------------- trunk/target-ppc/cpu.h trunk/target-ppc/op_template.h trunk/target-ppc/translate.c Modified: trunk/target-ppc/cpu.h =================================================================== --- trunk/target-ppc/cpu.h 2008-09-04 04:36:20 UTC (rev 5152) +++ trunk/target-ppc/cpu.h 2008-09-04 05:25:47 UTC (rev 5153) @@ -33,17 +33,7 @@ #else /* defined (TARGET_PPC64) */ /* PowerPC 32 definitions */ -#if (HOST_LONG_BITS >= 64) -/* When using 64 bits temporary registers, - * we can use 64 bits GPR with no extra cost - * It's even an optimization as this will prevent - * the compiler to do unuseful masking in the micro-ops. - */ -typedef uint64_t ppc_gpr_t; -#else /* (HOST_LONG_BITS >= 64) */ typedef uint32_t ppc_gpr_t; -#endif /* (HOST_LONG_BITS >= 64) */ - #define TARGET_LONG_BITS 32 #if defined(TARGET_PPCEMB) @@ -541,7 +531,7 @@ /* First are the most commonly used resources * during translated code execution */ -#if (HOST_LONG_BITS == 32) +#if (TARGET_LONG_BITS > HOST_LONG_BITS) || !defined(TARGET_PPC64) /* temporary fixed-point registers * used to emulate 64 bits registers on 32 bits hosts */ Modified: trunk/target-ppc/op_template.h =================================================================== --- trunk/target-ppc/op_template.h 2008-09-04 04:36:20 UTC (rev 5152) +++ trunk/target-ppc/op_template.h 2008-09-04 05:25:47 UTC (rev 5153) @@ -18,91 +18,6 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/* General purpose registers moves */ -void OPPROTO glue(op_load_gpr_T0_gpr, REG) (void) -{ - T0 = env->gpr[REG]; - RETURN(); -} - -void OPPROTO glue(op_load_gpr_T1_gpr, REG) (void) -{ - T1 = env->gpr[REG]; - RETURN(); -} - -void OPPROTO glue(op_load_gpr_T2_gpr, REG) (void) -{ - T2 = env->gpr[REG]; - RETURN(); -} - -void OPPROTO glue(op_store_T0_gpr_gpr, REG) (void) -{ - env->gpr[REG] = T0; - RETURN(); -} - -void OPPROTO glue(op_store_T1_gpr_gpr, REG) (void) -{ - env->gpr[REG] = T1; - RETURN(); -} - -#if 0 // unused -void OPPROTO glue(op_store_T2_gpr_gpr, REG) (void) -{ - env->gpr[REG] = T2; - RETURN(); -} -#endif - -/* General purpose registers containing vector operands moves */ -#if !defined(TARGET_PPC64) -void OPPROTO glue(op_load_gpr64_T0_gpr, REG) (void) -{ - T0_64 = (uint64_t)env->gpr[REG] | ((uint64_t)env->gprh[REG] << 32); - RETURN(); -} - -void OPPROTO glue(op_load_gpr64_T1_gpr, REG) (void) -{ - T1_64 = (uint64_t)env->gpr[REG] | ((uint64_t)env->gprh[REG] << 32); - RETURN(); -} - -#if 0 // unused -void OPPROTO glue(op_load_gpr64_T2_gpr, REG) (void) -{ - T2_64 = (uint64_t)env->gpr[REG] | ((uint64_t)env->gprh[REG] << 32); - RETURN(); -} -#endif - -void OPPROTO glue(op_store_T0_gpr64_gpr, REG) (void) -{ - env->gpr[REG] = T0_64; - env->gprh[REG] = T0_64 >> 32; - RETURN(); -} - -void OPPROTO glue(op_store_T1_gpr64_gpr, REG) (void) -{ - env->gpr[REG] = T1_64; - env->gprh[REG] = T1_64 >> 32; - RETURN(); -} - -#if 0 // unused -void OPPROTO glue(op_store_T2_gpr64_gpr, REG) (void) -{ - env->gpr[REG] = T2_64; - env->gprh[REG] = T2_64 >> 32; - RETURN(); -} -#endif -#endif /* !defined(TARGET_PPC64) */ - /* Altivec registers moves */ void OPPROTO glue(op_load_avr_A0_avr, REG) (void) { Modified: trunk/target-ppc/translate.c =================================================================== --- trunk/target-ppc/translate.c 2008-09-04 04:36:20 UTC (rev 5152) +++ trunk/target-ppc/translate.c 2008-09-04 05:25:47 UTC (rev 5153) @@ -44,15 +44,37 @@ /*****************************************************************************/ /* Code translation helpers */ -static TCGv cpu_env, cpu_T[3]; +/* global register indexes */ +static TCGv cpu_env; +static char cpu_reg_names[10*3 + 22*4 +#if !defined(TARGET_PPC64) + + 10*4 + 22*5 +#endif +]; +static TCGv cpu_gpr[32]; +#if !defined(TARGET_PPC64) +static TCGv cpu_gprh[32]; +#endif +/* dyngen register indexes */ +static TCGv cpu_T[3]; +#if defined(TARGET_PPC64) +#define cpu_T64 cpu_T +#else +static TCGv cpu_T64[3]; +#endif + #include "gen-icount.h" void ppc_translate_init(void) { + int i; + char* p; static int done_init = 0; + if (done_init) return; + cpu_env = tcg_global_reg_new(TCG_TYPE_PTR, TCG_AREG0, "env"); #if TARGET_LONG_BITS > HOST_LONG_BITS cpu_T[0] = tcg_global_mem_new(TCG_TYPE_TL, @@ -66,6 +88,31 @@ cpu_T[1] = tcg_global_reg_new(TCG_TYPE_TL, TCG_AREG2, "T1"); cpu_T[2] = tcg_global_reg_new(TCG_TYPE_TL, TCG_AREG3, "T2"); #endif +#if !defined(TARGET_PPC64) + cpu_T64[0] = tcg_global_mem_new(TCG_TYPE_I64, + TCG_AREG0, offsetof(CPUState, t0), + "T0_64"); + cpu_T64[1] = tcg_global_mem_new(TCG_TYPE_I64, + TCG_AREG0, offsetof(CPUState, t1), + "T1_64"); + cpu_T64[2] = tcg_global_mem_new(TCG_TYPE_I64, + TCG_AREG0, offsetof(CPUState, t2), + "T2_64"); +#endif + + p = cpu_reg_names; + for (i = 0; i < 32; i++) { + sprintf(p, "r%d", i); + cpu_gpr[i] = tcg_global_mem_new(TCG_TYPE_TL, TCG_AREG0, + offsetof(CPUState, gpr[i]), p); + p += (i < 10) ? 3 : 4; +#if !defined(TARGET_PPC64) + sprintf(p, "r%dH", i); + cpu_gprh[i] = tcg_global_mem_new(TCG_TYPE_I32, TCG_AREG0, + offsetof(CPUState, gprh[i]), p); + p += (i < 10) ? 4 : 5; +#endif + } /* register helpers */ #undef DEF_HELPER @@ -126,17 +173,6 @@ GEN8(gen_op_store_T1_crf, gen_op_store_T1_crf_crf); #endif -/* General purpose registers moves */ -GEN32(gen_op_load_gpr_T0, gen_op_load_gpr_T0_gpr); -GEN32(gen_op_load_gpr_T1, gen_op_load_gpr_T1_gpr); -GEN32(gen_op_load_gpr_T2, gen_op_load_gpr_T2_gpr); - -GEN32(gen_op_store_T0_gpr, gen_op_store_T0_gpr_gpr); -GEN32(gen_op_store_T1_gpr, gen_op_store_T1_gpr_gpr); -#if 0 // unused -GEN32(gen_op_store_T2_gpr, gen_op_store_T2_gpr_gpr); -#endif - /* floating point registers moves */ GEN32(gen_op_load_fpr_FT0, gen_op_load_fpr_FT0_fpr); GEN32(gen_op_load_fpr_FT1, gen_op_load_fpr_FT1_fpr); @@ -667,10 +703,10 @@ #define __GEN_INT_ARITH2(name, opc1, opc2, opc3, inval, type) \ GEN_HANDLER(name, opc1, opc2, opc3, inval, type) \ { \ - gen_op_load_gpr_T0(rA(ctx->opcode)); \ - gen_op_load_gpr_T1(rB(ctx->opcode)); \ + tcg_gen_mov_tl(cpu_T[0], cpu_gpr[rA(ctx->opcode)]); \ + tcg_gen_mov_tl(cpu_T[1], cpu_gpr[rB(ctx->opcode)]); \ gen_op_##name(); \ - gen_op_store_T0_gpr(rD(ctx->opcode)); \ + tcg_gen_mov_tl(cpu_gpr[rD(ctx->opcode)], cpu_T[0]); \ if (unlikely(Rc(ctx->opcode) != 0)) \ gen_set_Rc0(ctx); \ } @@ -678,10 +714,10 @@ #define __GEN_INT_ARITH2_O(name, opc1, opc2, opc3, inval, type) \ GEN_HANDLER(name, opc1, opc2, opc3, inval, type) \ { \ - gen_op_load_gpr_T0(rA(ctx->opcode)); \ - gen_op_load_gpr_T1(rB(ctx->opcode)); \ + tcg_gen_mov_tl(cpu_T[0], cpu_gpr[rA(ctx->opcode)]); \ + tcg_gen_mov_tl(cpu_T[1], cpu_gpr[rB(ctx->opcode)]); \ gen_op_##name(); \ - gen_op_store_T0_gpr(rD(ctx->opcode)); \ + tcg_gen_mov_tl(cpu_gpr[rD(ctx->opcode)], cpu_T[0]); \ if (unlikely(Rc(ctx->opcode) != 0)) \ gen_set_Rc0(ctx); \ } @@ -689,18 +725,18 @@ #define __GEN_INT_ARITH1(name, opc1, opc2, opc3, type) \ GEN_HANDLER(name, opc1, opc2, opc3, 0x0000F800, type) \ { \ - gen_op_load_gpr_T0(rA(ctx->opcode)); \ + tcg_gen_mov_tl(cpu_T[0], cpu_gpr[rA(ctx->opcode)]); \ gen_op_##name(); \ - gen_op_store_T0_gpr(rD(ctx->opcode)); \ + tcg_gen_mov_tl(cpu_gpr[rD(ctx->opcode)], cpu_T[0]); \ if (unlikely(Rc(ctx->opcode) != 0)) \ gen_set_Rc0(ctx); \ } #define __GEN_INT_ARITH1_O(name, opc1, opc2, opc3, type) \ GEN_HANDLER(name, opc1, opc2, opc3, 0x0000F800, type) \ { \ - gen_op_load_gpr_T0(rA(ctx->opcode)); \ + tcg_gen_mov_tl(cpu_T[0], cpu_gpr[rA(ctx->opcode)]); \ gen_op_##name(); \ - gen_op_store_T0_gpr(rD(ctx->opcode)); \ + tcg_gen_mov_tl(cpu_gpr[rD(ctx->opcode)], cpu_T[0]); \ if (unlikely(Rc(ctx->opcode) != 0)) \ gen_set_Rc0(ctx); \ } @@ -723,13 +759,13 @@ #define __GEN_INT_ARITH2_64(name, opc1, opc2, opc3, inval, type) \ GEN_HANDLER(name, opc1, opc2, opc3, inval, type) \ { \ - gen_op_load_gpr_T0(rA(ctx->opcode)); \ - gen_op_load_gpr_T1(rB(ctx->opcode)); \ + tcg_gen_mov_tl(cpu_T[0], cpu_gpr[rA(ctx->opcode)]); \ + tcg_gen_mov_tl(cpu_T[1], cpu_gpr[rB(ctx->opcode)]); \ if (ctx->sf_mode) \ gen_op_##name##_64(); \ else \ gen_op_##name(); \ - gen_op_store_T0_gpr(rD(ctx->opcode)); \ + tcg_gen_mov_tl(cpu_gpr[rD(ctx->opcode)], cpu_T[0]); \ if (unlikely(Rc(ctx->opcode) != 0)) \ gen_set_Rc0(ctx); \ } @@ -737,13 +773,13 @@ #define __GEN_INT_ARITH2_O_64(name, opc1, opc2, opc3, inval, type) \ GEN_HANDLER(name, opc1, opc2, opc3, inval, type) \ { \ - gen_op_load_gpr_T0(rA(ctx->opcode)); \ - gen_op_load_gpr_T1(rB(ctx->opcode)); \ + tcg_gen_mov_tl(cpu_T[0], cpu_gpr[rA(ctx->opcode)]); \ + tcg_gen_mov_tl(cpu_T[1], cpu_gpr[rB(ctx->opcode)]); \ if (ctx->sf_mode) \ gen_op_##name##_64(); \ else \ gen_op_##name(); \ - gen_op_store_T0_gpr(rD(ctx->opcode)); \ + tcg_gen_mov_tl(cpu_gpr[rD(ctx->opcode)], cpu_T[0]); \ if (unlikely(Rc(ctx->opcode) != 0)) \ gen_set_Rc0(ctx); \ } @@ -751,24 +787,24 @@ #define __GEN_INT_ARITH1_64(name, opc1, opc2, opc3, type) \ GEN_HANDLER(name, opc1, opc2, opc3, 0x0000F800, type) \ { \ - gen_op_load_gpr_T0(rA(ctx->opcode)); \ + tcg_gen_mov_tl(cpu_T[0], cpu_gpr[rA(ctx->opcode)]); \ if (ctx->sf_mode) \ gen_op_##name##_64(); \ else \ gen_op_##name(); \ - gen_op_store_T0_gpr(rD(ctx->opcode)); \ + tcg_gen_mov_tl(cpu_gpr[rD(ctx->opcode)], cpu_T[0]); \ if (unlikely(Rc(ctx->opcode) != 0)) \ gen_set_Rc0(ctx); \ } #define __GEN_INT_ARITH1_O_64(name, opc1, opc2, opc3, type) \ GEN_HANDLER(name, opc1, opc2, opc3, 0x0000F800, type) \ { \ - gen_op_load_gpr_T0(rA(ctx->opcode)); \ + tcg_gen_mov_tl(cpu_T[0], cpu_gpr[rA(ctx->opcode)]); \ if (ctx->sf_mode) \ gen_op_##name##_64(); \ else \ gen_op_##name(); \ - gen_op_store_T0_gpr(rD(ctx->opcode)); \ + tcg_gen_mov_tl(cpu_gpr[rD(ctx->opcode)], cpu_T[0]); \ if (unlikely(Rc(ctx->opcode) != 0)) \ gen_set_Rc0(ctx); \ } @@ -986,18 +1022,18 @@ /* li case */ tcg_gen_movi_tl(cpu_T[0], simm); } else { - gen_op_load_gpr_T0(rA(ctx->opcode)); + tcg_gen_mov_tl(cpu_T[0], cpu_gpr[rA(ctx->opcode)]); if (likely(simm != 0)) gen_op_addi(simm); } - gen_op_store_T0_gpr(rD(ctx->opcode)); + tcg_gen_mov_tl(cpu_gpr[rD(ctx->opcode)], cpu_T[0]); } /* addic */ GEN_HANDLER(addic, 0x0C, 0xFF, 0xFF, 0x00000000, PPC_INTEGER) { target_long simm = SIMM(ctx->opcode); - gen_op_load_gpr_T0(rA(ctx->opcode)); + tcg_gen_mov_tl(cpu_T[0], cpu_gpr[rA(ctx->opcode)]); if (likely(simm != 0)) { tcg_gen_mov_tl(cpu_T[2], cpu_T[0]); gen_op_addi(simm); @@ -1010,14 +1046,14 @@ } else { gen_op_clear_xer_ca(); } - gen_op_store_T0_gpr(rD(ctx->opcode)); + tcg_gen_mov_tl(cpu_gpr[rD(ctx->opcode)], cpu_T[0]); } /* addic. */ GEN_HANDLER2(addic_, "addic.", 0x0D, 0xFF, 0xFF, 0x00000000, PPC_INTEGER) { target_long simm = SIMM(ctx->opcode); - gen_op_load_gpr_T0(rA(ctx->opcode)); + tcg_gen_mov_tl(cpu_T[0], cpu_gpr[rA(ctx->opcode)]); if (likely(simm != 0)) { tcg_gen_mov_tl(cpu_T[2], cpu_T[0]); gen_op_addi(simm); @@ -1030,7 +1066,7 @@ } else { gen_op_clear_xer_ca(); } - gen_op_store_T0_gpr(rD(ctx->opcode)); + tcg_gen_mov_tl(cpu_gpr[rD(ctx->opcode)], cpu_T[0]); gen_set_Rc0(ctx); } /* addis */ @@ -1042,30 +1078,30 @@ /* lis case */ tcg_gen_movi_tl(cpu_T[0], simm << 16); } else { - gen_op_load_gpr_T0(rA(ctx->opcode)); + tcg_gen_mov_tl(cpu_T[0], cpu_gpr[rA(ctx->opcode)]); if (likely(simm != 0)) gen_op_addi(simm << 16); } - gen_op_store_T0_gpr(rD(ctx->opcode)); + tcg_gen_mov_tl(cpu_gpr[rD(ctx->opcode)], cpu_T[0]); } /* mulli */ GEN_HANDLER(mulli, 0x07, 0xFF, 0xFF, 0x00000000, PPC_INTEGER) { - gen_op_load_gpr_T0(rA(ctx->opcode)); + tcg_gen_mov_tl(cpu_T[0], cpu_gpr[rA(ctx->opcode)]); gen_op_mulli(SIMM(ctx->opcode)); - gen_op_store_T0_gpr(rD(ctx->opcode)); + tcg_gen_mov_tl(cpu_gpr[rD(ctx->opcode)], cpu_T[0]); } /* subfic */ GEN_HANDLER(subfic, 0x08, 0xFF, 0xFF, 0x00000000, PPC_INTEGER) { - gen_op_load_gpr_T0(rA(ctx->opcode)); + tcg_gen_mov_tl(cpu_T[0], cpu_gpr[rA(ctx->opcode)]); #if defined(TARGET_PPC64) if (ctx->sf_mode) gen_op_subfic_64(SIMM(ctx->opcode)); else #endif gen_op_subfic(SIMM(ctx->opcode)); - gen_op_store_T0_gpr(rD(ctx->opcode)); + tcg_gen_mov_tl(cpu_gpr[rD(ctx->opcode)], cpu_T[0]); } #if defined(TARGET_PPC64) @@ -1086,8 +1122,8 @@ #define GEN_CMP(name, opc, type) \ GEN_HANDLER(name, 0x1F, 0x00, opc, 0x00400000, type) \ { \ - gen_op_load_gpr_T0(rA(ctx->opcode)); \ - gen_op_load_gpr_T1(rB(ctx->opcode)); \ + tcg_gen_mov_tl(cpu_T[0], cpu_gpr[rA(ctx->opcode)]); \ + tcg_gen_mov_tl(cpu_T[1], cpu_gpr[rB(ctx->opcode)]); \ if (ctx->sf_mode && (ctx->opcode & 0x00200000)) \ gen_op_##name##_64(); \ else \ @@ -1098,8 +1134,8 @@ #define GEN_CMP(name, opc, type) \ GEN_HANDLER(name, 0x1F, 0x00, opc, 0x00400000, type) \ { \ - gen_op_load_gpr_T0(rA(ctx->opcode)); \ - gen_op_load_gpr_T1(rB(ctx->opcode)); \ + tcg_gen_mov_tl(cpu_T[0], cpu_gpr[rA(ctx->opcode)]); \ + tcg_gen_mov_tl(cpu_T[1], cpu_gpr[rB(ctx->opcode)]); \ gen_op_##name(); \ gen_op_store_T0_crf(crfD(ctx->opcode)); \ } @@ -1110,7 +1146,7 @@ /* cmpi */ GEN_HANDLER(cmpi, 0x0B, 0xFF, 0xFF, 0x00400000, PPC_INTEGER) { - gen_op_load_gpr_T0(rA(ctx->opcode)); + tcg_gen_mov_tl(cpu_T[0], cpu_gpr[rA(ctx->opcode)]); #if defined(TARGET_PPC64) if (ctx->sf_mode && (ctx->opcode & 0x00200000)) gen_op_cmpi_64(SIMM(ctx->opcode)); @@ -1124,7 +1160,7 @@ /* cmpli */ GEN_HANDLER(cmpli, 0x0A, 0xFF, 0xFF, 0x00400000, PPC_INTEGER) { - gen_op_load_gpr_T0(rA(ctx->opcode)); + tcg_gen_mov_tl(cpu_T[0], cpu_gpr[rA(ctx->opcode)]); #if defined(TARGET_PPC64) if (ctx->sf_mode && (ctx->opcode & 0x00200000)) gen_op_cmpli_64(UIMM(ctx->opcode)); @@ -1143,24 +1179,24 @@ if (rA(ctx->opcode) == 0) { tcg_gen_movi_tl(cpu_T[0], 0); } else { - gen_op_load_gpr_T1(rA(ctx->opcode)); + tcg_gen_mov_tl(cpu_T[1], cpu_gpr[rA(ctx->opcode)]); } - gen_op_load_gpr_T2(rB(ctx->opcode)); + tcg_gen_mov_tl(cpu_T[2], cpu_gpr[rB(ctx->opcode)]); mask = 1 << (3 - (bi & 0x03)); gen_op_load_crf_T0(bi >> 2); gen_op_test_true(mask); gen_op_isel(); - gen_op_store_T0_gpr(rD(ctx->opcode)); + tcg_gen_mov_tl(cpu_gpr[rD(ctx->opcode)], cpu_T[0]); } /*** Integer logical ***/ #define __GEN_LOGICAL2(name, opc2, opc3, type) \ GEN_HANDLER(name, 0x1F, opc2, opc3, 0x00000000, type) \ { \ - gen_op_load_gpr_T0(rS(ctx->opcode)); \ - gen_op_load_gpr_T1(rB(ctx->opcode)); \ + tcg_gen_mov_tl(cpu_T[0], cpu_gpr[rS(ctx->opcode)]); \ + tcg_gen_mov_tl(cpu_T[1], cpu_gpr[rB(ctx->opcode)]); \ gen_op_##name(); \ - gen_op_store_T0_gpr(rA(ctx->opcode)); \ + tcg_gen_mov_tl(cpu_gpr[rA(ctx->opcode)], cpu_T[0]); \ if (unlikely(Rc(ctx->opcode) != 0)) \ gen_set_Rc0(ctx); \ } @@ -1170,9 +1206,9 @@ #define GEN_LOGICAL1(name, opc, type) \ GEN_HANDLER(name, 0x1F, 0x1A, opc, 0x00000000, type) \ { \ - gen_op_load_gpr_T0(rS(ctx->opcode)); \ + tcg_gen_mov_tl(cpu_T[0], cpu_gpr[rS(ctx->opcode)]); \ gen_op_##name(); \ - gen_op_store_T0_gpr(rA(ctx->opcode)); \ + tcg_gen_mov_tl(cpu_gpr[rA(ctx->opcode)], cpu_T[0]); \ if (unlikely(Rc(ctx->opcode) != 0)) \ gen_set_Rc0(ctx); \ } @@ -1184,17 +1220,17 @@ /* andi. */ GEN_HANDLER2(andi_, "andi.", 0x1C, 0xFF, 0xFF, 0x00000000, PPC_INTEGER) { - gen_op_load_gpr_T0(rS(ctx->opcode)); + tcg_gen_mov_tl(cpu_T[0], cpu_gpr[rS(ctx->opcode)]); gen_op_andi_T0(UIMM(ctx->opcode)); - gen_op_store_T0_gpr(rA(ctx->opcode)); + tcg_gen_mov_tl(cpu_gpr[rA(ctx->opcode)], cpu_T[0]); gen_set_Rc0(ctx); } /* andis. */ GEN_HANDLER2(andis_, "andis.", 0x1D, 0xFF, 0xFF, 0x00000000, PPC_INTEGER) { - gen_op_load_gpr_T0(rS(ctx->opcode)); + tcg_gen_mov_tl(cpu_T[0], cpu_gpr[rS(ctx->opcode)]); gen_op_andi_T0(UIMM(ctx->opcode) << 16); - gen_op_store_T0_gpr(rA(ctx->opcode)); + tcg_gen_mov_tl(cpu_gpr[rA(ctx->opcode)], cpu_T[0]); gen_set_Rc0(ctx); } @@ -1221,16 +1257,16 @@ rb = rB(ctx->opcode); /* Optimisation for mr. ri case */ if (rs != ra || rs != rb) { - gen_op_load_gpr_T0(rs); + tcg_gen_mov_tl(cpu_T[0], cpu_gpr[rs]); if (rs != rb) { - gen_op_load_gpr_T1(rb); + tcg_gen_mov_tl(cpu_T[1], cpu_gpr[rb]); gen_op_or(); } - gen_op_store_T0_gpr(ra); + tcg_gen_mov_tl(cpu_gpr[ra], cpu_T[0]); if (unlikely(Rc(ctx->opcode) != 0)) gen_set_Rc0(ctx); } else if (unlikely(Rc(ctx->opcode) != 0)) { - gen_op_load_gpr_T0(rs); + tcg_gen_mov_tl(cpu_T[0], cpu_gpr[rs]); gen_set_Rc0(ctx); #if defined(TARGET_PPC64) } else { @@ -1286,15 +1322,15 @@ /* xor & xor. */ GEN_HANDLER(xor, 0x1F, 0x1C, 0x09, 0x00000000, PPC_INTEGER) { - gen_op_load_gpr_T0(rS(ctx->opcode)); + tcg_gen_mov_tl(cpu_T[0], cpu_gpr[rS(ctx->opcode)]); /* Optimisation for "set to zero" case */ if (rS(ctx->opcode) != rB(ctx->opcode)) { - gen_op_load_gpr_T1(rB(ctx->opcode)); + tcg_gen_mov_tl(cpu_T[1], cpu_gpr[rB(ctx->opcode)]); gen_op_xor(); } else { tcg_gen_movi_tl(cpu_T[0], 0); } - gen_op_store_T0_gpr(rA(ctx->opcode)); + tcg_gen_mov_tl(cpu_gpr[rA(ctx->opcode)], cpu_T[0]); if (unlikely(Rc(ctx->opcode) != 0)) gen_set_Rc0(ctx); } @@ -1308,10 +1344,10 @@ /* XXX: should handle special NOPs for POWER series */ return; } - gen_op_load_gpr_T0(rS(ctx->opcode)); + tcg_gen_mov_tl(cpu_T[0], cpu_gpr[rS(ctx->opcode)]); if (likely(uimm != 0)) gen_op_ori(uimm); - gen_op_store_T0_gpr(rA(ctx->opcode)); + tcg_gen_mov_tl(cpu_gpr[rA(ctx->opcode)], cpu_T[0]); } /* oris */ GEN_HANDLER(oris, 0x19, 0xFF, 0xFF, 0x00000000, PPC_INTEGER) @@ -1322,10 +1358,10 @@ /* NOP */ return; } - gen_op_load_gpr_T0(rS(ctx->opcode)); + tcg_gen_mov_tl(cpu_T[0], cpu_gpr[rS(ctx->opcode)]); if (likely(uimm != 0)) gen_op_ori(uimm << 16); - gen_op_store_T0_gpr(rA(ctx->opcode)); + tcg_gen_mov_tl(cpu_gpr[rA(ctx->opcode)], cpu_T[0]); } /* xori */ GEN_HANDLER(xori, 0x1A, 0xFF, 0xFF, 0x00000000, PPC_INTEGER) @@ -1336,10 +1372,10 @@ /* NOP */ return; } - gen_op_load_gpr_T0(rS(ctx->opcode)); + tcg_gen_mov_tl(cpu_T[0], cpu_gpr[rS(ctx->opcode)]); if (likely(uimm != 0)) gen_op_xori(uimm); - gen_op_store_T0_gpr(rA(ctx->opcode)); + tcg_gen_mov_tl(cpu_gpr[rA(ctx->opcode)], cpu_T[0]); } /* xoris */ @@ -1351,23 +1387,23 @@ /* NOP */ return; } - gen_op_load_gpr_T0(rS(ctx->opcode)); + tcg_gen_mov_tl(cpu_T[0], cpu_gpr[rS(ctx->opcode)]); if (likely(uimm != 0)) gen_op_xori(uimm << 16); - gen_op_store_T0_gpr(rA(ctx->opcode)); + tcg_gen_mov_tl(cpu_gpr[rA(ctx->opcode)], cpu_T[0]); } /* popcntb : PowerPC 2.03 specification */ GEN_HANDLER(popcntb, 0x1F, 0x03, 0x03, 0x0000F801, PPC_POPCNTB) { - gen_op_load_gpr_T0(rS(ctx->opcode)); + tcg_gen_mov_tl(cpu_T[0], cpu_gpr[rS(ctx->opcode)]); #if defined(TARGET_PPC64) if (ctx->sf_mode) gen_op_popcntb_64(); else #endif gen_op_popcntb(); - gen_op_store_T0_gpr(rA(ctx->opcode)); + tcg_gen_mov_tl(cpu_gpr[rA(ctx->opcode)], cpu_T[0]); } #if defined(TARGET_PPC64) @@ -1389,18 +1425,18 @@ sh = SH(ctx->opcode); if (likely(sh == 0)) { if (likely(mb == 0 && me == 31)) { - gen_op_load_gpr_T0(rS(ctx->opcode)); + tcg_gen_mov_tl(cpu_T[0], cpu_gpr[rS(ctx->opcode)]); goto do_store; } else if (likely(mb == 31 && me == 0)) { - gen_op_load_gpr_T0(rA(ctx->opcode)); + tcg_gen_mov_tl(cpu_T[0], cpu_gpr[rA(ctx->opcode)]); goto do_store; } - gen_op_load_gpr_T0(rS(ctx->opcode)); - gen_op_load_gpr_T1(rA(ctx->opcode)); + tcg_gen_mov_tl(cpu_T[0], cpu_gpr[rS(ctx->opcode)]); + tcg_gen_mov_tl(cpu_T[1], cpu_gpr[rA(ctx->opcode)]); goto do_mask; } - gen_op_load_gpr_T0(rS(ctx->opcode)); - gen_op_load_gpr_T1(rA(ctx->opcode)); + tcg_gen_mov_tl(cpu_T[0], cpu_gpr[rS(ctx->opcode)]); + tcg_gen_mov_tl(cpu_T[1], cpu_gpr[rA(ctx->opcode)]); gen_op_rotli32_T0(SH(ctx->opcode)); do_mask: #if defined(TARGET_PPC64) @@ -1412,7 +1448,7 @@ gen_op_andi_T1(~mask); gen_op_or(); do_store: - gen_op_store_T0_gpr(rA(ctx->opcode)); + tcg_gen_mov_tl(cpu_gpr[rA(ctx->opcode)], cpu_T[0]); if (unlikely(Rc(ctx->opcode) != 0)) gen_set_Rc0(ctx); } @@ -1424,7 +1460,7 @@ sh = SH(ctx->opcode); mb = MB(ctx->opcode); me = ME(ctx->opcode); - gen_op_load_gpr_T0(rS(ctx->opcode)); + tcg_gen_mov_tl(cpu_T[0], cpu_gpr[rS(ctx->opcode)]); if (likely(sh == 0)) { goto do_mask; } @@ -1450,7 +1486,7 @@ #endif gen_op_andi_T0(MASK(mb, me)); do_store: - gen_op_store_T0_gpr(rA(ctx->opcode)); + tcg_gen_mov_tl(cpu_gpr[rA(ctx->opcode)], cpu_T[0]); if (unlikely(Rc(ctx->opcode) != 0)) gen_set_Rc0(ctx); } @@ -1461,8 +1497,8 @@ mb = MB(ctx->opcode); me = ME(ctx->opcode); - gen_op_load_gpr_T0(rS(ctx->opcode)); - gen_op_load_gpr_T1(rB(ctx->opcode)); + tcg_gen_mov_tl(cpu_T[0], cpu_gpr[rS(ctx->opcode)]); + tcg_gen_mov_tl(cpu_T[1], cpu_gpr[rB(ctx->opcode)]); gen_op_rotl32_T0_T1(); if (unlikely(mb != 0 || me != 31)) { #if defined(TARGET_PPC64) @@ -1471,7 +1507,7 @@ #endif gen_op_andi_T0(MASK(mb, me)); } - gen_op_store_T0_gpr(rA(ctx->opcode)); + tcg_gen_mov_tl(cpu_gpr[rA(ctx->opcode)], cpu_T[0]); if (unlikely(Rc(ctx->opcode) != 0)) gen_set_Rc0(ctx); } @@ -1527,7 +1563,7 @@ static always_inline void gen_rldinm (DisasContext *ctx, uint32_t mb, uint32_t me, uint32_t sh) { - gen_op_load_gpr_T0(rS(ctx->opcode)); + tcg_gen_mov_tl(cpu_T[0], cpu_gpr[rS(ctx->opcode)]); if (likely(sh == 0)) { goto do_mask; } @@ -1549,7 +1585,7 @@ do_mask: gen_andi_T0_64(ctx, MASK(mb, me)); do_store: - gen_op_store_T0_gpr(rA(ctx->opcode)); + tcg_gen_mov_tl(cpu_gpr[rA(ctx->opcode)], cpu_T[0]); if (unlikely(Rc(ctx->opcode) != 0)) gen_set_Rc0(ctx); } @@ -1587,13 +1623,13 @@ static always_inline void gen_rldnm (DisasContext *ctx, uint32_t mb, uint32_t me) { - gen_op_load_gpr_T0(rS(ctx->opcode)); - gen_op_load_gpr_T1(rB(ctx->opcode)); + tcg_gen_mov_tl(cpu_T[0], cpu_gpr[rS(ctx->opcode)]); + tcg_gen_mov_tl(cpu_T[1], cpu_gpr[rB(ctx->opcode)]); gen_op_rotl64_T0_T1(); if (unlikely(mb != 0 || me != 63)) { gen_andi_T0_64(ctx, MASK(mb, me)); } - gen_op_store_T0_gpr(rA(ctx->opcode)); + tcg_gen_mov_tl(cpu_gpr[rA(ctx->opcode)], cpu_T[0]); if (unlikely(Rc(ctx->opcode) != 0)) gen_set_Rc0(ctx); } @@ -1627,15 +1663,15 @@ me = 63 - sh; if (likely(sh == 0)) { if (likely(mb == 0)) { - gen_op_load_gpr_T0(rS(ctx->opcode)); + tcg_gen_mov_tl(cpu_T[0], cpu_gpr[rS(ctx->opcode)]); goto do_store; } - gen_op_load_gpr_T0(rS(ctx->opcode)); - gen_op_load_gpr_T1(rA(ctx->opcode)); + tcg_gen_mov_tl(cpu_T[0], cpu_gpr[rS(ctx->opcode)]); + tcg_gen_mov_tl(cpu_T[1], cpu_gpr[rA(ctx->opcode)]); goto do_mask; } - gen_op_load_gpr_T0(rS(ctx->opcode)); - gen_op_load_gpr_T1(rA(ctx->opcode)); + tcg_gen_mov_tl(cpu_T[0], cpu_gpr[rS(ctx->opcode)]); + tcg_gen_mov_tl(cpu_T[1], cpu_gpr[rA(ctx->opcode)]); gen_op_rotli64_T0(sh); do_mask: mask = MASK(mb, me); @@ -1643,7 +1679,7 @@ gen_andi_T1_64(ctx, ~mask); gen_op_or(); do_store: - gen_op_store_T0_gpr(rA(ctx->opcode)); + tcg_gen_mov_tl(cpu_gpr[rA(ctx->opcode)], cpu_T[0]); if (unlikely(Rc(ctx->opcode) != 0)) gen_set_Rc0(ctx); } @@ -1659,7 +1695,7 @@ GEN_HANDLER(srawi, 0x1F, 0x18, 0x19, 0x00000000, PPC_INTEGER) { int mb, me; - gen_op_load_gpr_T0(rS(ctx->opcode)); + tcg_gen_mov_tl(cpu_T[0], cpu_gpr[rS(ctx->opcode)]); if (SH(ctx->opcode) != 0) { tcg_gen_mov_tl(cpu_T[1], cpu_T[0]); mb = 32 - SH(ctx->opcode); @@ -1670,7 +1706,7 @@ #endif gen_op_srawi(SH(ctx->opcode), MASK(mb, me)); } - gen_op_store_T0_gpr(rA(ctx->opcode)); + tcg_gen_mov_tl(cpu_gpr[rA(ctx->opcode)], cpu_T[0]); if (unlikely(Rc(ctx->opcode) != 0)) gen_set_Rc0(ctx); } @@ -1688,7 +1724,7 @@ uint64_t mask; int sh, mb, me; - gen_op_load_gpr_T0(rS(ctx->opcode)); + tcg_gen_mov_tl(cpu_T[0], cpu_gpr[rS(ctx->opcode)]); sh = SH(ctx->opcode) + (n << 5); if (sh != 0) { tcg_gen_mov_tl(cpu_T[1], cpu_T[0]); @@ -1697,7 +1733,7 @@ mask = MASK(mb, me); gen_op_sradi(sh, mask >> 32, mask); } - gen_op_store_T0_gpr(rA(ctx->opcode)); + tcg_gen_mov_tl(cpu_gpr[rA(ctx->opcode)], cpu_T[0]); if (unlikely(Rc(ctx->opcode) != 0)) gen_set_Rc0(ctx); } @@ -2082,7 +2118,7 @@ if (rA(ctx->opcode) == 0) { tcg_gen_movi_tl(cpu_T[0], simm); } else { - gen_op_load_gpr_T0(rA(ctx->opcode)); + tcg_gen_mov_tl(cpu_T[0], cpu_gpr[rA(ctx->opcode)]); if (likely(simm != 0)) gen_op_addi(simm); } @@ -2094,10 +2130,10 @@ static always_inline void gen_addr_reg_index (DisasContext *ctx) { if (rA(ctx->opcode) == 0) { - gen_op_load_gpr_T0(rB(ctx->opcode)); + tcg_gen_mov_tl(cpu_T[0], cpu_gpr[rB(ctx->opcode)]); } else { - gen_op_load_gpr_T0(rA(ctx->opcode)); - gen_op_load_gpr_T1(rB(ctx->opcode)); + tcg_gen_mov_tl(cpu_T[0], cpu_gpr[rA(ctx->opcode)]); + tcg_gen_mov_tl(cpu_T[1], cpu_gpr[rB(ctx->opcode)]); gen_op_add(); } #ifdef DEBUG_MEMORY_ACCESSES @@ -2110,7 +2146,7 @@ if (rA(ctx->opcode) == 0) { tcg_gen_movi_tl(cpu_T[0], 0); } else { - gen_op_load_gpr_T0(rA(ctx->opcode)); + tcg_gen_mov_tl(cpu_T[0], cpu_gpr[rA(ctx->opcode)]); } #ifdef DEBUG_MEMORY_ACCESSES gen_op_print_mem_EA(); @@ -2181,7 +2217,7 @@ { \ gen_addr_imm_index(ctx, 0); \ op_ldst(l##width); \ - gen_op_store_T1_gpr(rD(ctx->opcode)); \ + tcg_gen_mov_tl(cpu_gpr[rD(ctx->opcode)], cpu_T[1]); \ } #define GEN_LDU(width, opc, type) \ @@ -2197,8 +2233,8 @@ else \ gen_addr_imm_index(ctx, 0); \ op_ldst(l##width); \ - gen_op_store_T1_gpr(rD(ctx->opcode)); \ - gen_op_store_T0_gpr(rA(ctx->opcode)); \ + tcg_gen_mov_tl(cpu_gpr[rD(ctx->opcode)], cpu_T[1]); \ + tcg_gen_mov_tl(cpu_gpr[rA(ctx->opcode)], cpu_T[0]); \ } #define GEN_LDUX(width, opc2, opc3, type) \ @@ -2211,8 +2247,8 @@ } \ gen_addr_reg_index(ctx); \ op_ldst(l##width); \ - gen_op_store_T1_gpr(rD(ctx->opcode)); \ - gen_op_store_T0_gpr(rA(ctx->opcode)); \ + tcg_gen_mov_tl(cpu_gpr[rD(ctx->opcode)], cpu_T[1]); \ + tcg_gen_mov_tl(cpu_gpr[rA(ctx->opcode)], cpu_T[0]); \ } #define GEN_LDX(width, opc2, opc3, type) \ @@ -2220,7 +2256,7 @@ { \ gen_addr_reg_index(ctx); \ op_ldst(l##width); \ - gen_op_store_T1_gpr(rD(ctx->opcode)); \ + tcg_gen_mov_tl(cpu_gpr[rD(ctx->opcode)], cpu_T[1]); \ } #define GEN_LDS(width, op, type) \ @@ -2266,9 +2302,9 @@ /* ld - ldu */ op_ldst(ld); } - gen_op_store_T1_gpr(rD(ctx->opcode)); + tcg_gen_mov_tl(cpu_gpr[rD(ctx->opcode)], cpu_T[1]); if (Rc(ctx->opcode)) - gen_op_store_T0_gpr(rA(ctx->opcode)); + tcg_gen_mov_tl(cpu_gpr[rA(ctx->opcode)], cpu_T[0]); } /* lq */ GEN_HANDLER(lq, 0x38, 0xFF, 0xFF, 0x00000000, PPC_64BX) @@ -2296,10 +2332,10 @@ } gen_addr_imm_index(ctx, 0x0F); op_ldst(ld); - gen_op_store_T1_gpr(rd); + tcg_gen_mov_tl(cpu_gpr[rd], cpu_T[1]); gen_op_addi(8); op_ldst(ld); - gen_op_store_T1_gpr(rd + 1); + tcg_gen_mov_tl(cpu_gpr[rd + 1], cpu_T[1]); #endif } #endif @@ -2309,7 +2345,7 @@ GEN_HANDLER(st##width, opc, 0xFF, 0xFF, 0x00000000, type) \ { \ gen_addr_imm_index(ctx, 0); \ - gen_op_load_gpr_T1(rS(ctx->opcode)); \ + tcg_gen_mov_tl(cpu_T[1], cpu_gpr[rS(ctx->opcode)]); \ op_ldst(st##width); \ } @@ -2324,9 +2360,9 @@ gen_addr_imm_index(ctx, 0x03); \ else \ gen_addr_imm_index(ctx, 0); \ - gen_op_load_gpr_T1(rS(ctx->opcode)); \ + tcg_gen_mov_tl(cpu_T[1], cpu_gpr[rS(ctx->opcode)]); \ op_ldst(st##width); \ - gen_op_store_T0_gpr(rA(ctx->opcode)); \ + tcg_gen_mov_tl(cpu_gpr[rA(ctx->opcode)], cpu_T[0]); \ } #define GEN_STUX(width, opc2, opc3, type) \ @@ -2337,16 +2373,16 @@ return; \ } \ gen_addr_reg_index(ctx); \ - gen_op_load_gpr_T1(rS(ctx->opcode)); \ + tcg_gen_mov_tl(cpu_T[1], cpu_gpr[rS(ctx->opcode)]); \ op_ldst(st##width); \ - gen_op_store_T0_gpr(rA(ctx->opcode)); \ + tcg_gen_mov_tl(cpu_gpr[rA(ctx->opcode)], cpu_T[0]); \ } #define GEN_STX(width, opc2, opc3, type) \ GEN_HANDLER(st##width##x, 0x1F, opc2, opc3, 0x00000001, type) \ { \ gen_addr_reg_index(ctx); \ - gen_op_load_gpr_T1(rS(ctx->opcode)); \ + tcg_gen_mov_tl(cpu_T[1], cpu_gpr[rS(ctx->opcode)]); \ op_ldst(st##width); \ } @@ -2391,10 +2427,10 @@ return; } gen_addr_imm_index(ctx, 0x03); - gen_op_load_gpr_T1(rs); + tcg_gen_mov_tl(cpu_T[1], cpu_gpr[rs]); op_ldst(std); gen_op_addi(8); - gen_op_load_gpr_T1(rs + 1); + tcg_gen_mov_tl(cpu_T[1], cpu_gpr[rs + 1]); op_ldst(std); #endif } else { @@ -2406,10 +2442,10 @@ } } gen_addr_imm_index(ctx, 0x03); - gen_op_load_gpr_T1(rs); + tcg_gen_mov_tl(cpu_T[1], cpu_gpr[rs]); op_ldst(std); if (Rc(ctx->opcode)) - gen_op_store_T0_gpr(rA(ctx->opcode)); + tcg_gen_mov_tl(cpu_gpr[rA(ctx->opcode)], cpu_T[0]); } } #endif @@ -2590,7 +2626,7 @@ gen_update_nip(ctx, ctx->nip - 4); gen_addr_reg_index(ctx); op_lwarx(); - gen_op_store_T1_gpr(rD(ctx->opcode)); + tcg_gen_mov_tl(cpu_gpr[rD(ctx->opcode)], cpu_T[1]); } /* stwcx. */ @@ -2599,7 +2635,7 @@ /* NIP cannot be restored if the memory exception comes from an helper */ gen_update_nip(ctx, ctx->nip - 4); gen_addr_reg_index(ctx); - gen_op_load_gpr_T1(rS(ctx->opcode)); + tcg_gen_mov_tl(cpu_T[1], cpu_gpr[rS(ctx->opcode)]); op_stwcx(); } @@ -2620,7 +2656,7 @@ gen_update_nip(ctx, ctx->nip - 4); gen_addr_reg_index(ctx); op_ldarx(); - gen_op_store_T1_gpr(rD(ctx->opcode)); + tcg_gen_mov_tl(cpu_gpr[rD(ctx->opcode)], cpu_T[1]); } /* stdcx. */ @@ -2629,7 +2665,7 @@ /* NIP cannot be restored if the memory exception comes from an helper */ gen_update_nip(ctx, ctx->nip - 4); gen_addr_reg_index(ctx); - gen_op_load_gpr_T1(rS(ctx->opcode)); + tcg_gen_mov_tl(cpu_T[1], cpu_gpr[rS(ctx->opcode)]); op_stdcx(); } #endif /* defined(TARGET_PPC64) */ @@ -2674,7 +2710,7 @@ gen_addr_imm_index(ctx, 0); \ op_ldst(l##width); \ gen_op_store_FT0_fpr(rD(ctx->opcode)); \ - gen_op_store_T0_gpr(rA(ctx->opcode)); \ + tcg_gen_mov_tl(cpu_gpr[rA(ctx->opcode)], cpu_T[0]); \ } #define GEN_LDUXF(width, opc, type) \ @@ -2691,7 +2727,7 @@ gen_addr_reg_index(ctx); \ op_ldst(l##width); \ gen_op_store_FT0_fpr(rD(ctx->opcode)); \ - gen_op_store_T0_gpr(rA(ctx->opcode)); \ + tcg_gen_mov_tl(cpu_gpr[rA(ctx->opcode)], cpu_T[0]); \ } #define GEN_LDXF(width, opc2, opc3, type) \ @@ -2745,7 +2781,7 @@ gen_addr_imm_index(ctx, 0); \ gen_op_load_fpr_FT0(rS(ctx->opcode)); \ op_ldst(st##width); \ - gen_op_store_T0_gpr(rA(ctx->opcode)); \ + tcg_gen_mov_tl(cpu_gpr[rA(ctx->opcode)], cpu_T[0]); \ } #define GEN_STUXF(width, opc, type) \ @@ -2762,7 +2798,7 @@ gen_addr_reg_index(ctx); \ gen_op_load_fpr_FT0(rS(ctx->opcode)); \ op_ldst(st##width); \ - gen_op_store_T0_gpr(rA(ctx->opcode)); \ + tcg_gen_mov_tl(cpu_gpr[rA(ctx->opcode)], cpu_T[0]); \ } #define GEN_STXF(width, opc2, opc3, type) \ @@ -3154,8 +3190,8 @@ /* tw */ GEN_HANDLER(tw, 0x1F, 0x04, 0x00, 0x00000001, PPC_FLOW) { - gen_op_load_gpr_T0(rA(ctx->opcode)); - gen_op_load_gpr_T1(rB(ctx->opcode)); + tcg_gen_mov_tl(cpu_T[0], cpu_gpr[rA(ctx->opcode)]); + tcg_gen_mov_tl(cpu_T[1], cpu_gpr[rB(ctx->opcode)]); /* Update the nip since this might generate a trap exception */ gen_update_nip(ctx, ctx->nip); gen_op_tw(TO(ctx->opcode)); @@ -3164,7 +3200,7 @@ /* twi */ GEN_HANDLER(twi, 0x03, 0xFF, 0xFF, 0x00000000, PPC_FLOW) { - gen_op_load_gpr_T0(rA(ctx->opcode)); + tcg_gen_mov_tl(cpu_T[0], cpu_gpr[rA(ctx->opcode)]); tcg_gen_movi_tl(cpu_T[1], SIMM(ctx->opcode)); /* Update the nip since this might generate a trap exception */ gen_update_nip(ctx, ctx->nip); @@ -3175,8 +3211,8 @@ /* td */ GEN_HANDLER(td, 0x1F, 0x04, 0x02, 0x00000001, PPC_64B) { - gen_op_load_gpr_T0(rA(ctx->opcode)); - gen_op_load_gpr_T1(rB(ctx->opcode)); + tcg_gen_mov_tl(cpu_T[0], cpu_gpr[rA(ctx->opcode)]); + tcg_gen_mov_tl(cpu_T[1], cpu_gpr[rB(ctx->opcode)]); /* Update the nip since this might generate a trap exception */ gen_update_nip(ctx, ctx->nip); gen_op_td(TO(ctx->opcode)); @@ -3185,7 +3221,7 @@ /* tdi */ GEN_HANDLER(tdi, 0x02, 0xFF, 0xFF, 0x00000000, PPC_64B) { - gen_op_load_gpr_T0(rA(ctx->opcode)); + tcg_gen_mov_tl(cpu_T[0], cpu_gpr[rA(ctx->opcode)]); tcg_gen_movi_tl(cpu_T[1], SIMM(ctx->opcode)); /* Update the nip since this might generate a trap exception */ gen_update_nip(ctx, ctx->nip); @@ -3217,7 +3253,7 @@ } else { gen_op_load_cr(); } - gen_op_store_T0_gpr(rD(ctx->opcode)); + tcg_gen_mov_tl(cpu_gpr[rD(ctx->opcode)], cpu_T[0]); } /* mfmsr */ @@ -3231,7 +3267,7 @@ return; } gen_op_load_msr(); - gen_op_store_T0_gpr(rD(ctx->opcode)); + tcg_gen_mov_tl(cpu_gpr[rD(ctx->opcode)], cpu_T[0]); #endif } @@ -3263,7 +3299,7 @@ if (likely(read_cb != NULL)) { if (likely(read_cb != SPR_NOACCESS)) { (*read_cb)(ctx, sprn); - gen_op_store_T0_gpr(rD(ctx->opcode)); + tcg_gen_mov_tl(cpu_gpr[rD(ctx->opcode)], cpu_T[0]); } else { /* Privilege exception */ /* This is a hack to avoid warnings when running Linux: @@ -3309,7 +3345,7 @@ { uint32_t crm, crn; - gen_op_load_gpr_T0(rS(ctx->opcode)); + tcg_gen_mov_tl(cpu_T[0], cpu_gpr[rS(ctx->opcode)]); crm = CRM(ctx->opcode); if (likely((ctx->opcode & 0x00100000) || (crm ^ (crm - 1)) == 0)) { crn = ffs(crm); @@ -3332,7 +3368,7 @@ GEN_EXCP_PRIVREG(ctx); return; } - gen_op_load_gpr_T0(rS(ctx->opcode)); + tcg_gen_mov_tl(cpu_T[0], cpu_gpr[rS(ctx->opcode)]); if (ctx->opcode & 0x00010000) { /* Special form that does not need any synchronisation */ gen_op_update_riee(); @@ -3360,7 +3396,7 @@ GEN_EXCP_PRIVREG(ctx); return; } - gen_op_load_gpr_T0(rS(ctx->opcode)); + tcg_gen_mov_tl(cpu_T[0], cpu_gpr[rS(ctx->opcode)]); if (ctx->opcode & 0x00010000) { /* Special form that does not need any synchronisation */ gen_op_update_riee(); @@ -3399,7 +3435,7 @@ write_cb = ctx->spr_cb[sprn].uea_write; if (likely(write_cb != NULL)) { if (likely(write_cb != SPR_NOACCESS)) { - gen_op_load_gpr_T0(rS(ctx->opcode)); + tcg_gen_mov_tl(cpu_T[0], cpu_gpr[rS(ctx->opcode)]); (*write_cb)(ctx, sprn); } else { /* Privilege exception */ @@ -3614,7 +3650,7 @@ } tcg_gen_movi_tl(cpu_T[1], SR(ctx->opcode)); gen_op_load_sr(); - gen_op_store_T0_gpr(rD(ctx->opcode)); + tcg_gen_mov_tl(cpu_gpr[rD(ctx->opcode)], cpu_T[0]); #endif } @@ -3628,10 +3664,10 @@ GEN_EXCP_PRIVREG(ctx); return; } - gen_op_load_gpr_T1(rB(ctx->opcode)); + tcg_gen_mov_tl(cpu_T[1], cpu_gpr[rB(ctx->opcode)]); gen_op_srli_T1(28); gen_op_load_sr(); - gen_op_store_T0_gpr(rD(ctx->opcode)); + tcg_gen_mov_tl(cpu_gpr[rD(ctx->opcode)], cpu_T[0]); #endif } @@ -3645,7 +3681,7 @@ GEN_EXCP_PRIVREG(ctx); return; } - gen_op_load_gpr_T0(rS(ctx->opcode)); + tcg_gen_mov_tl(cpu_T[0], cpu_gpr[rS(ctx->opcode)]); tcg_gen_movi_tl(cpu_T[1], SR(ctx->opcode)); gen_op_store_sr(); #endif @@ -3661,8 +3697,8 @@ GEN_EXCP_PRIVREG(ctx); return; } - gen_op_load_gpr_T0(rS(ctx->opcode)); - gen_op_load_gpr_T1(rB(ctx->opcode)); + tcg_gen_mov_tl(cpu_T[0], cpu_gpr[rS(ctx->opcode)]); + tcg_gen_mov_tl(cpu_T[1], cpu_gpr[rB(ctx->opcode)]); gen_op_srli_T1(28); gen_op_store_sr(); #endif @@ -3682,7 +3718,7 @@ } tcg_gen_movi_tl(cpu_T[1], SR(ctx->opcode)); gen_op_load_slb(); - gen_op_store_T0_gpr(rD(ctx->opcode)); + tcg_gen_mov_tl(cpu_gpr[rD(ctx->opcode)], cpu_T[0]); #endif } @@ -3697,10 +3733,10 @@ GEN_EXCP_PRIVREG(ctx); return; } - gen_op_load_gpr_T1(rB(ctx->opcode)); + tcg_gen_mov_tl(cpu_T[1], cpu_gpr[rB(ctx->opcode)]); gen_op_srli_T1(28); gen_op_load_slb(); - gen_op_store_T0_gpr(rD(ctx->opcode)); + tcg_gen_mov_tl(cpu_gpr[rD(ctx->opcode)], cpu_T[0]); #endif } @@ -3714,7 +3750,7 @@ GEN_EXCP_PRIVREG(ctx); return; } - gen_op_load_gpr_T0(rS(ctx->opcode)); + tcg_gen_mov_tl(cpu_T[0], cpu_gpr[rS(ctx->opcode)]); tcg_gen_movi_tl(cpu_T[1], SR(ctx->opcode)); gen_op_store_slb(); #endif @@ -3731,8 +3767,8 @@ GEN_EXCP_PRIVREG(ctx); return; } - gen_op_load_gpr_T0(rS(ctx->opcode)); - gen_op_load_gpr_T1(rB(ctx->opcode)); + tcg_gen_mov_tl(cpu_T[0], cpu_gpr[rS(ctx->opcode)]); + tcg_gen_mov_tl(cpu_T[1], cpu_gpr[rB(ctx->opcode)]); gen_op_srli_T1(28); gen_op_store_slb(); #endif @@ -3765,7 +3801,7 @@ GEN_EXCP_PRIVOPC(ctx); return; } - gen_op_load_gpr_T0(rB(ctx->opcode)); + tcg_gen_mov_tl(cpu_T[0], cpu_gpr[rB(ctx->opcode)]); #if defined(TARGET_PPC64) if (ctx->sf_mode) gen_op_tlbie_64(); @@ -3817,7 +3853,7 @@ GEN_EXCP_PRIVOPC(ctx); return; } - gen_op_load_gpr_T0(rB(ctx->opcode)); + tcg_gen_mov_tl(cpu_T[0], cpu_gpr[rB(ctx->opcode)]); gen_op_slbie(); #endif } @@ -3840,7 +3876,7 @@ /* Should check EAR[E] & alignment ! */ gen_addr_reg_index(ctx); op_eciwx(); - gen_op_store_T0_gpr(rD(ctx->opcode)); + tcg_gen_mov_tl(cpu_gpr[rD(ctx->opcode)], cpu_T[0]); } /* ecowx */ @@ -3848,7 +3884,7 @@ { /* Should check EAR[E] & alignment ! */ gen_addr_reg_index(ctx); - gen_op_load_gpr_T1(rS(ctx->opcode)); + tcg_gen_mov_tl(cpu_T[1], cpu_gpr[rS(ctx->opcode)]); op_ecowx(); } @@ -3856,9 +3892,9 @@ /* abs - abs. */ GEN_HANDLER(abs, 0x1F, 0x08, 0x0B, 0x0000F800, PPC_POWER_BR) { - gen_op_load_gpr_T0(rA(ctx->opcode)); + tcg_gen_mov_tl(cpu_T[0], cpu_gpr[rA(ctx->opcode)]); gen_op_POWER_abs(); - gen_op_store_T0_gpr(rD(ctx->opcode)); + tcg_gen_mov_tl(cpu_gpr[rD(ctx->opcode)], cpu_T[0]); if (unlikely(Rc(ctx->opcode) != 0)) gen_set_Rc0(ctx); } @@ -3866,9 +3902,9 @@ /* abso - abso. */ GEN_HANDLER(abso, 0x1F, 0x08, 0x1B, 0x0000F800, PPC_POWER_BR) { - gen_op_load_gpr_T0(rA(ctx->opcode)); + tcg_gen_mov_tl(cpu_T[0], cpu_gpr[rA(ctx->opcode)]); gen_op_POWER_abso(); - gen_op_store_T0_gpr(rD(ctx->opcode)); + tcg_gen_mov_tl(cpu_gpr[rD(ctx->opcode)], cpu_T[0]); if (unlikely(Rc(ctx->opcode) != 0)) gen_set_Rc0(ctx); } @@ -3876,19 +3912,19 @@ /* clcs */ GEN_HANDLER(clcs, 0x1F, 0x10, 0x13, 0x0000F800, PPC_POWER_BR) { - gen_op_load_gpr_T0(rA(ctx->opcode)); + tcg_gen_mov_tl(cpu_T[0], cpu_gpr[rA(ctx->opcode)]); gen_op_POWER_clcs(); /* Rc=1 sets CR0 to an undefined state */ - gen_op_store_T0_gpr(rD(ctx->opcode)); + tcg_gen_mov_tl(cpu_gpr[rD(ctx->opcode)], cpu_T[0]); } /* div - div. */ GEN_HANDLER(div, 0x1F, 0x0B, 0x0A, 0x00000000, PPC_POWER_BR) { - gen_op_load_gpr_T0(rA(ctx->opcode)); - gen_op_load_gpr_T1(rB(ctx->opcode)); + tcg_gen_mov_tl(cpu_T[0], cpu_gpr[rA(ctx->opcode)]); + tcg_gen_mov_tl(cpu_T[1], cpu_gpr[rB(ctx->opcode)]); gen_op_POWER_div(); - gen_op_store_T0_gpr(rD(ctx->opcode)); + tcg_gen_mov_tl(cpu_gpr[rD(ctx->opcode)], cpu_T[0]); if (unlikely(Rc(ctx->opcode) != 0)) gen_set_Rc0(ctx); } @@ -3896,10 +3932,10 @@ /* divo - divo. */ GEN_HANDLER(divo, 0x1F, 0x0B, 0x1A, 0x00000000, PPC_POWER_BR) { - gen_op_load_gpr_T0(rA(ctx->opcode)); - gen_op_load_gpr_T1(rB(ctx->opcode)); + tcg_gen_mov_tl(cpu_T[0], cpu_gpr[rA(ctx->opcode)]); + tcg_gen_mov_tl(cpu_T[1], cpu_gpr[rB(ctx->opcode)]); gen_op_POWER_divo(); - gen_op_store_T0_gpr(rD(ctx->opcode)); + tcg_gen_mov_tl(cpu_gpr[rD(ctx->opcode)], cpu_T[0]); if (unlikely(Rc(ctx->opcode) != 0)) gen_set_Rc0(ctx); } @@ -3907,10 +3943,10 @@ /* divs - divs. */ GEN_HANDLER(divs, 0x1F, 0x0B, 0x0B, 0x00000000, PPC_POWER_BR) { - gen_op_load_gpr_T0(rA(ctx->opcode)); - gen_op_load_gpr_T1(rB(ctx->opcode)); + tcg_gen_mov_tl(cpu_T[0], cpu_gpr[rA(ctx->opcode)]); + tcg_gen_mov_tl(cpu_T[1], cpu_gpr[rB(ctx->opcode)]); gen_op_POWER_divs(); - gen_op_store_T0_gpr(rD(ctx->opcode)); + tcg_gen_mov_tl(cpu_gpr[rD(ctx->opcode)], cpu_T[0]); if (unlikely(Rc(ctx->opcode) != 0)) gen_set_Rc0(ctx); } @@ -3918,10 +3954,10 @@ /* divso - divso. */ GEN_HANDLER(divso, 0x1F, 0x0B, 0x1B, 0x00000000, PPC_POWER_BR) { - gen_op_load_gpr_T0(rA(ctx->opcode)); - gen_op_load_gpr_T1(rB(ctx->opcode)); + tcg_gen_mov_tl(cpu_T[0], cpu_gpr[rA(ctx->opcode)]); + tcg_gen_mov_tl(cpu_T[1], cpu_gpr[rB(ctx->opcode)]); gen_op_POWER_divso(); - gen_op_store_T0_gpr(rD(ctx->opcode)); + tcg_gen_mov_tl(cpu_gpr[rD(ctx->opcode)], cpu_T[0]); if (unlikely(Rc(ctx->opcode) != 0)) gen_set_Rc0(ctx); } @@ -3929,10 +3965,10 @@ /* doz - doz. */ GEN_HANDLER(doz, 0x1F, 0x08, 0x08, 0x00000000, PPC_POWER_BR) { - gen_op_load_gpr_T0(rA(ctx->opcode)); - gen_op_load_gpr_T1(rB(ctx->opcode)); + tcg_gen_mov_tl(cpu_T[0], cpu_gpr[rA(ctx->opcode)]); + tcg_gen_mov_tl(cpu_T[1], cpu_gpr[rB(ctx->opcode)]); gen_op_POWER_doz(); - gen_op_store_T0_gpr(rD(ctx->opcode)); + tcg_gen_mov_tl(cpu_gpr[rD(ctx->opcode)], cpu_T[0]); if (unlikely(Rc(ctx->opcode) != 0)) gen_set_Rc0(ctx); } @@ -3940,10 +3976,10 @@ /* dozo - dozo. */ GEN_HANDLER(dozo, 0x1F, 0x08, 0x18, 0x00000000, PPC_POWER_BR) { - gen_op_load_gpr_T0(rA(ctx->opcode)); - gen_op_load_gpr_T1(rB(ctx->opcode)); + tcg_gen_mov_tl(cpu_T[0], cpu_gpr[rA(ctx->opcode)]); + tcg_gen_mov_tl(cpu_T[1], cpu_gpr[rB(ctx->opcode)]); gen_op_POWER_dozo(); - gen_op_store_T0_gpr(rD(ctx->opcode)); + tcg_gen_mov_tl(cpu_gpr[rD(ctx->opcode)], cpu_T[0]); if (unlikely(Rc(ctx->opcode) != 0)) gen_set_Rc0(ctx); } @@ -3951,10 +3987,10 @@ /* dozi */ GEN_HANDLER(dozi, 0x09, 0xFF, 0xFF, 0x00000000, PPC_POWER_BR) { - gen_op_load_gpr_T0(rA(ctx->opcode)); + tcg_gen_mov_tl(cpu_T[0], cpu_gpr[rA(ctx->opcode)]); tcg_gen_movi_tl(cpu_T[1], SIMM(ctx->opcode)); gen_op_POWER_doz(); - gen_op_store_T0_gpr(rD(ctx->opcode)); + tcg_gen_mov_tl(cpu_gpr[rD(ctx->opcode)], cpu_T[0]); } /* As lscbx load from memory byte after byte, it's always endian safe. @@ -4001,10 +4037,10 @@ /* maskg - maskg. */ GEN_HANDLER(maskg, 0x1F, 0x1D, 0x00, 0x00000000, PPC_POWER_BR) { - gen_op_load_gpr_T0(rS(ctx->opcode)); - gen_op_load_gpr_T1(rB(ctx->opcode)); + tcg_gen_mov_tl(cpu_T[0], cpu_gpr[rS(ctx->opcode)]); + tcg_gen_mov_tl(cpu_T[1], cpu_gpr[rB(ctx->opcode)]); gen_op_POWER_maskg(); - gen_op_store_T0_gpr(rA(ctx->opcode)); + tcg_gen_mov_tl(cpu_gpr[rA(ctx->opcode)], cpu_T[0]); if (unlikely(Rc(ctx->opcode) != 0)) gen_set_Rc0(ctx); } @@ -4012,11 +4048,11 @@ /* maskir - maskir. */ GEN_HANDLER(maskir, 0x1F, 0x1D, 0x10, 0x00000000, PPC_POWER_BR) { - gen_op_load_gpr_T0(rA(ctx->opcode)); - gen_op_load_gpr_T1(rS(ctx->opcode)); - gen_op_load_gpr_T2(rB(ctx->opcode)); + tcg_gen_mov_tl(cpu_T[0], cpu_gpr[rA(ctx->opcode)]); + tcg_gen_mov_tl(cpu_T[1], cpu_gpr[rS(ctx->opcode)]); + tcg_gen_mov_tl(cpu_T[2], cpu_gpr[rB(ctx->opcode)]); gen_op_POWER_maskir(); - gen_op_store_T0_gpr(rA(ctx->opcode)); + tcg_gen_mov_tl(cpu_gpr[rA(ctx->opcode)], cpu_T[0]); if (unlikely(Rc(ctx->opcode) != 0)) gen_set_Rc0(ctx); } @@ -4024,10 +4060,10 @@ /* mul - mul. */ GEN_HANDLER(mul, 0x1F, 0x0B, 0x03, 0x00000000, PPC_POWER_BR) { - gen_op_load_gpr_T0(rA(ctx->opcode)); - gen_op_load_gpr_T1(rB(ctx->opcode)); + tcg_gen_mov_tl(cpu_T[0], cpu_gpr[rA(ctx->opcode)]); + tcg_gen_mov_tl(cpu_T[1], cpu_gpr[rB(ctx->opcode)]); gen_op_POWER_mul(); - gen_op_store_T0_gpr(rD(ctx->opcode)); + tcg_gen_mov_tl(cpu_gpr[rD(ctx->opcode)], cpu_T[0]); if (unlikely(Rc(ctx->opcode) != 0)) gen_set_Rc0(ctx); } @@ -4035,10 +4071,10 @@ /* mulo - mulo. */ GEN_HANDLER(mulo, 0x1F, 0x0B, 0x13, 0x00000000, PPC_POWER_BR) { - gen_op_load_gpr_T0(rA(ctx->opcode)); - gen_op_load_gpr_T1(rB(ctx->opcode)); + tcg_gen_mov_tl(cpu_T[0], cpu_gpr[rA(ctx->opcode)]); + tcg_gen_mov_tl(cpu_T[1], cpu_gpr[rB(ctx->opcode)]); gen_op_POWER_mulo(); - gen_op_store_T0_gpr(rD(ctx->opcode)); + tcg_gen_mov_tl(cpu_gpr[rD(ctx->opcode)], cpu_T[0]); if (unlikely(Rc(ctx->opcode) != 0)) gen_set_Rc0(ctx); } @@ -4046,9 +4082,9 @@ /* nabs - nabs. */ GEN_HANDLER(nabs, 0x1F, 0x08, 0x0F, 0x00000000, PPC_POWER_BR) { - gen_op_load_gpr_T0(rA(ctx->opcode)); + tcg_gen_mov_tl(cpu_T[0], cpu_gpr[rA(ctx->opcode)]); gen_op_POWER_nabs(); - gen_op_store_T0_gpr(rD(ctx->opcode)); + tcg_gen_mov_tl(cpu_gpr[rD(ctx->opcode)], cpu_T[0]); if (unlikely(Rc(ctx->opcode) != 0)) gen_set_Rc0(ctx); } @@ -4056,9 +4092,9 @@ /* nabso - nabso. */ GEN_HANDLER(nabso, 0x1F, 0x08, 0x1F, 0x00000000, PPC_POWER_BR) { - gen_op_load_gpr_T0(rA(ctx->opcode)); + tcg_gen_mov_tl(cpu_T[0], cpu_gpr[rA(ctx->opcode)]); gen_op_POWER_nabso(); - gen_op_store_T0_gpr(rD(ctx->opcode)); + tcg_gen_mov_tl(cpu_gpr[rD(ctx->opcode)], cpu_T[0]); if (unlikely(Rc(ctx->opcode) != 0)) gen_set_Rc0(ctx); } @@ -4070,11 +4106,11 @@ mb = MB(ctx->opcode); me = ME(ctx->opcode); - gen_op_load_gpr_T0(rS(ctx->opcode)); - gen_op_load_gpr_T1(rA(ctx->opcode)); - gen_op_load_gpr_T2(rB(ctx->opcode)); + tcg_gen_mov_tl(cpu_T[0], cpu_gpr[rS(ctx->opcode)]); + tcg_gen_mov_tl(cpu_T[1], cpu_gpr[rA(ctx->opcode)]); + tcg_gen_mov_tl(cpu_T[2], cpu_gpr[rB(ctx->opcode)]); gen_op_POWER_rlmi(MASK(mb, me), ~MASK(mb, me)); - gen_op_store_T0_gpr(rA(ctx->opcode)); + tcg_gen_mov_tl(cpu_gpr[rA(ctx->opcode)], cpu_T[0]); if (unlikely(Rc(ctx->opcode) != 0)) gen_set_Rc0(ctx); } @@ -4082,11 +4118,11 @@ /* rrib - rrib. */ GEN_HANDLER(rrib, 0x1F, 0x19, 0x10, 0x00000000, PPC_POWER_BR) { - gen_op_load_gpr_T0(rS(ctx->opcode)); - gen_op_load_gpr_T1(rA(ctx->opcode)); - gen_op_load_gpr_T2(rB(ctx->opcode)); + tcg_gen_mov_tl(cpu_T[0], cpu_gpr[rS(ctx->opcode)]); + tcg_gen_mov_tl(cpu_T[1], cpu_gpr[rA(ctx->opcode)]); + tcg_gen_mov_tl(cpu_T[2], cpu_gpr[rB(ctx->opcode)]); gen_op_POWER_rrib(); - gen_op_store_T0_gpr(rA(ctx->opcode)); + tcg_gen_mov_tl(cpu_gpr[rA(ctx->opcode)], cpu_T[0]); if (unlikely(Rc(ctx->opcode) != 0)) gen_set_Rc0(ctx); } @@ -4094,10 +4130,10 @@ /* sle - sle. */ GEN_HANDLER(sle, 0x1F, 0x19, 0x04, 0x00000000, PPC_POWER_BR) { - gen_op_load_gpr_T0(rS(ctx->opcode)); - gen_op_load_gpr_T1(rB(ctx->opcode)); + tcg_gen_mov_tl(cpu_T[0], cpu_gpr[rS(ctx->opcode)]); + tcg_gen_mov_tl(cpu_T[1], cpu_gpr[rB(ctx->opcode)]); gen_op_POWER_sle(); - gen_op_store_T0_gpr(rA(ctx->opcode)); + tcg_gen_mov_tl(cpu_gpr[rA(ctx->opcode)], cpu_T[0]); if (unlikely(Rc(ctx->opcode) != 0)) gen_set_Rc0(ctx); } @@ -4105,10 +4141,10 @@ /* sleq - sleq. */ GEN_HANDLER(sleq, 0x1F, 0x19, 0x06, 0x00000000, PPC_POWER_BR) { - gen_op_load_gpr_T0(rS(ctx->opcode)); - gen_op_load_gpr_T1(rB(ctx->opcode)); + tcg_gen_mov_tl(cpu_T[0], cpu_gpr[rS(ctx->opcode)]); + tcg_gen_mov_tl(cpu_T[1], cpu_gpr[rB(ctx->opcode)]); gen_op_POWER_sleq(); - gen_op_store_T0_gpr(rA(ctx->opcode)); + tcg_gen_mov_tl(cpu_gpr[rA(ctx->opcode)], cpu_T[0]); if (unlikely(Rc(ctx->opcode) != 0)) gen_set_Rc0(ctx); } @@ -4116,10 +4152,10 @@ /* sliq - sliq. */ GEN_HANDLER(sliq, 0x1F, 0x18, 0x05, 0x00000000, PPC_POWER_BR) { - gen_op_load_gpr_T0(rS(ctx->opcode)); + tcg_gen_mov_tl(cpu_T[0], cpu_gpr[rS(ctx->opcode)]); tcg_gen_movi_tl(cpu_T[1], SH(ctx->opcode)); gen_op_POWER_sle(); - gen_op_store_T0_gpr(rA(ctx->opcode)); + tcg_gen_mov_tl(cpu_gpr[rA(ctx->opcode)], cpu_T[0]); if (unlikely(Rc(ctx->opcode) != 0)) gen_set_Rc0(ctx); } @@ -4127,10 +4163,10 @@ /* slliq - slliq. */ GEN_HANDLER(slliq, 0x1F, 0x18, 0x07, 0x00000000, PPC_POWER_BR) { - gen_op_load_gpr_T0(rS(ctx->opcode)); + tcg_gen_mov_tl(cpu_T[0], cpu_gpr[rS(ctx->opcode)]); tcg_gen_movi_tl(cpu_T[1], SH(ctx->opcode)); gen_op_POWER_sleq(); - gen_op_store_T0_gpr(rA(ctx->opcode)); + tcg_gen_mov_tl(cpu_gpr[rA(ctx->opcode)], cpu_T[0]); if (unlikely(Rc(ctx->opcode) != 0)) gen_set_Rc0(ctx); } @@ -4138,10 +4174,10 @@ /* sllq - sllq. */ GEN_HANDLER(sllq, 0x1F, 0x18, 0x06, 0x00000000, PPC_POWER_BR) { - gen_op_load_gpr_T0(rS(ctx->opcode)); - gen_op_load_gpr_T1(rB(ctx->opcode)); + tcg_gen_mov_tl(cpu_T[0], cpu_gpr[rS(ctx->opcode)]); + tcg_gen_mov_tl(cpu_T[1], cpu_gpr[rB(ctx->opcode)]); gen_op_POWER_sllq(); - gen_op_store_T0_gpr(rA(ctx->opcode)); + tcg_gen_mov_tl(cpu_gpr[rA(ctx->opcode)], cpu_T[0]); if (unlikely(Rc(ctx->opcode) != 0)) gen_set_Rc0(ctx); } @@ -4149,10 +4185,10 @@ /* slq - slq. */ GEN_HANDLER(slq, 0x1F, 0x18, 0x04, 0x00000000, PPC_POWER_BR) { - gen_op_load_gpr_T0(rS(ctx->opcode)); - gen_op_load_gpr_T1(rB(ctx->opcode)); + tcg_gen_mov_tl(cpu_T[0], cpu_gpr[rS(ctx->opcode)]); + tcg_gen_mov_tl(cpu_T[1], cpu_gpr[rB(ctx->opcode)]); gen_op_POWER_slq(); - gen_op_store_T0_gpr(rA(ctx->opcode)); + tcg_gen_mov_tl(cpu_gpr[rA(ctx->opcode)], cpu_T[0]); if (unlikely(Rc(ctx->opcode) != 0)) gen_set_Rc0(ctx); } @@ -4160,10 +4196,10 @@ /* sraiq - sraiq. */ GEN_HANDLER(sraiq, 0x1F, 0x18, 0x1D, 0x00000000, PPC_POWER_BR) { - gen_op_load_gpr_T0(rS(ctx->opcode)); + tcg_gen_mov_tl(cpu_T[0], cpu_gpr[rS(ctx->opcode)]); tcg_gen_movi_tl(cpu_T[1], SH(ctx->opcode)); gen_op_POWER_sraq(); - gen_op_store_T0_gpr(rA(ctx->opcode)); + tcg_gen_mov_tl(cpu_gpr[rA(ctx->opcode)], cpu_T[0]); if (unlikely(Rc(ctx->opcode) != 0)) gen_set_Rc0(ctx); } @@ -4171,10 +4207,10 @@ /* sraq - sraq. */ GEN_HANDLER(sraq, 0x1F, 0x18, 0x1C, 0x00000000, PPC_POWER_BR) { - gen_op_load_gpr_T0(rS(ctx->opcode)); - gen_op_load_gpr_T1(rB(ctx->opcode)); + tcg_gen_mov_tl(cpu_T[0], cpu_gpr[rS(ctx->opcode)]); + tcg_gen_mov_tl(cpu_T[1], cpu_gpr[rB(ctx->opcode)]); gen_op_POWER_sraq(); - gen_op_store_T0_gpr(rA(ctx->opcode)); + tcg_gen_mov_tl(cpu_gpr[rA(ctx->opcode)], cpu_T[0]); if (unlikely(Rc(ctx->opcode) != 0)) gen_set_Rc0(ctx); } @@ -4182,10 +4218,10 @@ /* sre - sre. */ GEN_HANDLER(sre, 0x1F, 0x19, 0x14, 0x00000000, PPC_POWER_BR) { - gen_op_load_gpr_T0(rS(ctx->opcode)); - gen_op_load_gpr_T1(rB(ctx->opcode)); + tcg_gen_mov_tl(cpu_T[0], cpu_gpr[rS(ctx->opcode)]); + tcg_gen_mov_tl(cpu_T[1], cpu_gpr[rB(ctx->opcode)]); gen_op_POWER_sre(); - gen_op_store_T0_gpr(rA(ctx->opcode)); + tcg_gen_mov_tl(cpu_gpr[rA(ctx->opcode)], cpu_T[0]); if (unlikely(Rc(ctx->opcode) != 0)) gen_set_Rc0(ctx); } @@ -4193,10 +4229,10 @@ /* srea - srea. */ GEN_HANDLER(srea, 0x1F, 0x19, 0x1C, 0x00000000, PPC_POWER_BR) { - gen_op_load_gpr_T0(rS(ctx->opcode)); - gen_op_load_gpr_T1(rB(ctx->opcode)); + tcg_gen_mov_tl(cpu_T[0], cpu_gpr[rS(ctx->opcode)]); + tcg_gen_mov_tl(cpu_T[1], cpu_gpr[rB(ctx->opcode)]); gen_op_POWER_srea(); - gen_op_store_T0_gpr(rA(ctx->opcode)); + tcg_gen_mov_tl(cpu_gpr[rA(ctx->opcode)], cpu_T[0]); if (unlikely(Rc(ctx->opcode) != 0)) gen_set_Rc0(ctx); } @@ -4204,10 +4240,10 @@ /* sreq */ GEN_HANDLER(sreq, 0x1F, 0x19, 0x16, 0x00000000, PPC_POWER_BR) { - gen_op_load_gpr_T0(rS(ctx->opcode)); - gen_op_load_gpr_T1(rB(ctx->opcode)); + tcg_gen_mov_tl(cpu_T[0], cpu_gpr[rS(ctx->opcode)]); + tcg_gen_mov_tl(cpu_T[1], cpu_gpr[rB(ctx->opcode)]); gen_op_POWER_sreq(); - gen_op_store_T0_gpr(rA(ctx->opcode)); + tcg_gen_mov_tl(cpu_gpr[rA(ctx->opcode)], cpu_T[0]); if (unlikely(Rc(ctx->opcode) != 0)) gen_set_Rc0(ctx); } @@ -4215,10 +4251,10 @@ /* sriq */ GEN_HANDLER(sriq, 0x1F, 0x18, 0x15, 0x00000000, PPC_POWER_BR) { - gen_op_load_gpr_T0(rS(ctx->opcode)); + tcg_gen_mov_tl(cpu_T[0], cpu_gpr[rS(ctx->opcode)]); tcg_gen_movi_tl(cpu_T[1], SH(ctx->opcode)); gen_op_POWER_srq(); - gen_op_store_T0_gpr(rA(ctx->opcode)); + tcg_gen_mov_tl(cpu_gpr[rA(ctx->opcode)], cpu_T[0]); if (unlikely(Rc(ctx->opcode) != 0)) gen_set_Rc0(ctx); } @@ -4226,11 +4262,11 @@ /* srliq */ GEN_HANDLER(srliq, 0x1F, 0x18, 0x17, 0x00000000, PPC_POWER_BR) { - gen_op_load_gpr_T0(rS(ctx->opcode)); - gen_op_load_gpr_T1(rB(ctx->opcode)); + tcg_gen_mov_tl(cpu_T[0], cpu_gpr[rS(ctx->opcode)]); + tcg_gen_mov_tl(cpu_T[1], cpu_gpr[rB(ctx->opcode)]); tcg_gen_movi_tl(cpu_T[1], SH(ctx->opcode)); gen_op_POWER_srlq(); - gen_op_store_T0_gpr(rA(ctx->opcode)); + tcg_gen_mov_tl(cpu_gpr[rA(ctx->opcode)], cpu_T[0]); if (unlikely(Rc(ctx->opcode) != 0)) gen_set_Rc0(ctx); } @@ -4238,10 +4274,10 @@ /* srlq */ GEN_HANDLER(srlq, 0x1F, 0x18, 0x16, 0x00000000, PPC_POWER_BR) { - gen_op_load_gpr_T0(rS(ctx->opcode)); - gen_op_load_gpr_T1(rB(ctx->opcode)); + tcg_gen_mov_tl(cpu_T[0], cpu_gpr[rS(ctx->opcode)]); + tcg_gen_mov_tl(cpu_T[1], cpu_gpr[rB(ctx->opcode)]); gen_op_POWER_srlq(); - gen_op_store_T0_gpr(rA(ctx->opcode)); + tcg_gen_mov_tl(cpu_gpr[rA(ctx->opcode)], cpu_T[0]); if (unlikely(Rc(ctx->opcode) != 0)) gen_set_Rc0(ctx); } @@ -4249,10 +4285,10 @@ /* srq */ GEN_HANDLER(srq, 0x1F, 0x18, 0x14, 0x00000000, PPC_POWER_BR) { - gen_op_load_gpr_T0(rS(ctx->opcode)); - gen_op_load_gpr_T1(rB(ctx->opcode)); + tcg_gen_mov_tl(cpu_T[0], cpu_gpr[rS(ctx->opcode)]); + tcg_gen_mov_tl(cpu_T[1], cpu_gpr[rB(ctx->opcode)]); gen_op_POWER_srq(); - gen_op_store_T0_gpr(rA(ctx->opcode)); + tcg_gen_mov_tl(cpu_gpr[rA(ctx->opcode)], cpu_T[0]); if (unlikely(Rc(ctx->opcode) != 0)) gen_set_Rc0(ctx); } @@ -4282,9 +4318,9 @@ GEN_EXCP_PRIVOPC(ctx); return; } - gen_op_load_gpr_T0(rA(ctx->opcode)); + tcg_gen_mov_tl(cpu_T[0], cpu_gpr[rA(ctx->opcode)]); gen_op_602_mfrom(); - gen_op_store_T0_gpr(rD(ctx->opcode)); + tcg_gen_mov_tl(cpu_gpr[rD(ctx->opcode)], cpu_T[0]); #endif } @@ -4299,7 +4335,7 @@ GEN_EXCP_PRIVOPC(ctx); return; } - gen_op_load_gpr_T0(rB(ctx->opcode)); + tcg_gen_mov_tl(cpu_T[0], cpu_gpr[rB(ctx->opcode)]); gen_op_6xx_tlbld(); #endif } @@ -4314,7 +4350,7 @@ GEN_EXCP_PRIVOPC(ctx); return; } - gen_op_load_gpr_T0(rB(ctx->opcode)); + tcg_gen_mov_tl(cpu_T[0], cpu_gpr[rB(ctx->opcode)]); gen_op_6xx_tlbli(); #endif } @@ -4330,7 +4366,7 @@ GEN_EXCP_PRIVOPC(ctx); return; } - gen_op_load_gpr_T0(rB(ctx->opcode)); + tcg_gen_mov_tl(cpu_T[0], cpu_gpr[rB(ctx->opcode)]); gen_op_74xx_tlbld(); #endif } @@ -4345,7 +4381,7 @@ GEN_EXCP_PRIVOPC(ctx); return; } - gen_op_load_gpr_T0(rB(ctx->opcode)); + tcg_gen_mov_tl(cpu_T[0], cpu_gpr[rB(ctx->opcode)]); gen_op_74xx_tlbli(); #endif } @@ -4391,9 +4427,9 @@ gen_addr_reg_index(ctx); gen_op_POWER_mfsri(); - gen_op_store_T0_gpr(rd); + tcg_gen_mov_tl(cpu_gpr[rd], cpu_T[0]); if (ra != 0 && ra != rd) - gen_op_store_T1_gpr(ra); + tcg_gen_mov_tl(cpu_gpr[ra], cpu_T[1]); #endif } @@ -4408,7 +4444,7 @@ } gen_addr_reg_index(ctx); gen_op_POWER_rac(); - gen_op_store_T0_gpr(rD(ctx->opcode)); + tcg_gen_mov_tl(cpu_gpr[rD(ctx->opcode)], cpu_T[0]); #endif } @@ -4479,7 +4515,7 @@ gen_op_store_FT0_fpr(rD(ctx->opcode)); gen_op_store_FT1_fpr(rD(ctx->opcode) + 1); if (ra != 0) - gen_op_store_T0_gpr(ra); + tcg_gen_mov_tl(cpu_gpr[ra], cpu_T[0]); } /* lfqux */ @@ -4494,7 +4530,7 @@ gen_op_store_FT0_fpr(rD(ctx->opcode)); gen_op_store_FT1_fpr(rD(ctx->opcode) + 1); if (ra != 0) - gen_op_store_T0_gpr(ra); + tcg_gen_mov_tl(cpu_gpr[ra], cpu_T[0]); } /* lfqx */ @@ -4531,7 +4567,7 @@ gen_op_load_fpr_FT1(rS(ctx->opcode) + 1); op_POWER2_stfq(); if (ra != 0) - gen_op_store_T0_gpr(ra); + tcg_gen_mov_tl(cpu_gpr[ra], cpu_T[0]); } /* stfqux */ @@ -4546,7 +4582,7 @@ gen_op_load_fpr_FT1(rS(ctx->opcode) + 1); op_POWER2_stfq(); if (ra != 0) - gen_op_store_T0_gpr(ra); + tcg_gen_mov_tl(cpu_gpr[ra], cpu_T[0]); } /* stfqx */ @@ -4594,8 +4630,8 @@ int opc2, int opc3, int ra, int rb, int rt, int Rc) { - gen_op_load_gpr_T0(ra); - gen_op_load_gpr_T1(rb); + tcg_gen_mov_tl(cpu_T[0], cpu_gpr[ra]); + tcg_gen_mov_tl(cpu_T[1], cpu_gpr[rb]); switch (opc3 & 0x0D) { case 0x05: /* macchw - macchw. - macchwo - macchwo. */ @@ -4646,7 +4682,7 @@ } if (opc2 & 0x04) { /* (n)multiply-and-accumulate (0x0C - 0x0E) */ - gen_op_load_gpr_T2(rt); + tcg_gen_mov_tl(cpu_T[2], cpu_gpr[rt]); tcg_gen_mov_tl(cpu_T[1], cpu_T[0]); gen_op_405_add_T0_T2(); } @@ -4664,7 +4700,7 @@ else gen_op_405_check_satu(); } - gen_op_store_T0_gpr(rt); + tcg_gen_mov_tl(cpu_gpr[rt], cpu_T[0]); if (unlikely(Rc) != 0) { /* Update Rc0 */ gen_set_Rc0(ctx); @@ -4778,7 +4814,7 @@ } tcg_gen_movi_tl(cpu_T[0], dcrn); gen_op_load_dcr(); - gen_op_store_T0_gpr(rD(ctx->opcode)); + tcg_gen_mov_tl(cpu_gpr[rD(ctx->opcode)], cpu_T[0]); #endif } @@ -4795,7 +4831,7 @@ return; } tcg_gen_movi_tl(cpu_T[0], dcrn); - gen_op_load_gpr_T1(rS(ctx->opcode)); + tcg_gen_mov_tl(cpu_T[1], cpu_gpr[rS(ctx->opcode)]); gen_op_store_dcr(); #endif } @@ -4811,9 +4847,9 @@ GEN_EXCP_PRIVREG(ctx); return; } - gen_op_load_gpr_T0(rA(ctx->opcode)); + tcg_gen_mov_tl(cpu_T[0], cpu_gpr[rA(ctx->opcode)]); gen_op_load_dcr(); - gen_op_store_T0_gpr(rD(ctx->opcode)); + tcg_gen_mov_tl(cpu_gpr[rD(ctx->opcode)], cpu_T[0]); /* Note: Rc update flag set leads to undefined state of Rc0 */ #endif } @@ -4829,8 +4865,8 @@ GEN_EXCP_PRIVREG(ctx); return; } - gen_op_load_gpr_T0(rA(ctx->opcode)); - gen_op_load_gpr_T1(rS(ctx->opcode)); + tcg_gen_mov_tl(cpu_T[0], cpu_gpr[rA(ctx->opcode)]); + tcg_gen_mov_tl(cpu_T[1], cpu_gpr[rS(ctx->opcode)]); gen_op_store_dcr(); /* Note: Rc update flag set leads to undefined state of Rc0 */ #endif @@ -4839,17 +4875,17 @@ /* mfdcrux (PPC 460) : user-mode access to DCR */ GEN_HANDLER(mfdcrux, 0x1F, 0x03, 0x09, 0x00000000, PPC_DCRUX) { - gen_op_load_gpr_T0(rA(ctx->opcode)); + tcg_gen_mov_tl(cpu_T[0], cpu_gpr[rA(ctx->opcode)]); gen_op_load_dcr(); - gen_op_store_T0_gpr(rD(ctx->opcode)); + tcg_gen_mov_tl(cpu_gpr[rD(ctx->opcode)], cpu_T[0]); /* Note: Rc update flag set leads to undefined state of Rc0 */ } /* mtdcrux (PPC 460) : user-mode access to DCR */ GEN_HANDLER(mtdcrux, 0x1F, 0x03, 0x0D, 0x00000000, PPC_DCRUX) { - gen_op_load_gpr_T0(rA(ctx->opcode)); - gen_op_load_gpr_T1(rS(ctx->opcode)); + tcg_gen_mov_tl(cpu_T[0], cpu_gpr[rA(ctx->opcode)]); + tcg_gen_mov_tl(cpu_T[1], cpu_gpr[rS(ctx->opcode)]); gen_op_store_dcr(); /* Note: Rc update flag set leads to undefined state of Rc0 */ } @@ -4880,7 +4916,7 @@ } gen_addr_reg_index(ctx); op_ldst(lwz); - gen_op_store_T0_gpr(rD(ctx->opcode)); + tcg_gen_mov_tl(cpu_gpr[rD(ctx->opcode)], cpu_T[0]); #endif } @@ -4998,14 +5034,14 @@ } switch (rB(ctx->opcode)) { case 0: - gen_op_load_gpr_T0(rA(ctx->opcode)); + tcg_gen_mov_tl(cpu_T[0], cpu_gpr[rA(ctx->opcode)]); gen_op_4xx_tlbre_hi(); - gen_op_store_T0_gpr(rD(ctx->opcode)); + tcg_gen_mov_tl(cpu_gpr[rD(ctx->opcode)], cpu_T[0]); break; case 1: - gen_op_load_gpr_T0(rA(ctx->opcode)); + tcg_gen_mov_tl(cpu_T[0], cpu_gpr[rA(ctx->opcode)]); gen_op_4xx_tlbre_lo(); - gen_op_store_T0_gpr(rD(ctx->opcode)); + tcg_gen_mov_tl(cpu_gpr[rD(ctx->opcode)], cpu_T[0]); break; default: GEN_EXCP_INVAL(ctx); @@ -5028,7 +5064,7 @@ gen_op_4xx_tlbsx(); if (Rc(ctx->opcode)) gen_op_4xx_tlbsx_check(); - gen_op_store_T0_gpr(rD(ctx->opcode)); + tcg_gen_mov_tl(cpu_gpr[rD(ctx->opcode)], cpu_T[0]); #endif } @@ -5044,13 +5080,13 @@ } switch (rB(ctx->opcode)) { case 0: - gen_op_load_gpr_T0(rA(ctx->opcode)); - gen_op_load_gpr_T1(rS(ctx->opcode)); + tcg_gen_mov_tl(cpu_T[0], cpu_gpr[rA(ctx->opcode)]); + tcg_gen_mov_tl(cpu_T[1], cpu_gpr[rS(ctx->opcode)]); gen_op_4xx_tlbwe_hi(); break; case 1: - gen_op_load_gpr_T0(rA(ctx->opcode)); - gen_op_load_gpr_T1(rS(ctx->opcode)); + tcg_gen_mov_tl(cpu_T[0], cpu_gpr[rA(ctx->opcode)]); + tcg_gen_mov_tl(cpu_T[1], cpu_gpr[rS(ctx->opcode)]); gen_op_4xx_tlbwe_lo(); break; default: @@ -5075,9 +5111,9 @@ case 0: case 1: case 2: - gen_op_load_gpr_T0(rA(ctx->opcode)); + tcg_gen_mov_tl(cpu_T[0], cpu_gpr[rA(ctx->opcode)]); gen_op_440_tlbre(rB(ctx->opcode)); - gen_op_store_T0_gpr(rD(ctx->opcode)); + tcg_gen_mov_tl(cpu_gpr[rD(ctx->opcode)], cpu_T[0]); break; default: GEN_EXCP_INVAL(ctx); @@ -5100,7 +5136,7 @@ gen_op_440_tlbsx(); if (Rc(ctx->opcode)) gen_op_4xx_tlbsx_check(); - gen_op_store_T0_gpr(rD(ctx->opcode)); + tcg_gen_mov_tl(cpu_gpr[rD(ctx->opcode)], cpu_T[0]); #endif } @@ -5118,8 +5154,8 @@ case 0: case 1: case 2: - gen_op_load_gpr_T0(rA(ctx->opcode)); - gen_op_load_gpr_T1(rS(ctx->opcode)); + tcg_gen_mov_tl(cpu_T[0], cpu_gpr[rA(ctx->opcode)]); + tcg_gen_mov_tl(cpu_T[1], cpu_gpr[rS(ctx->opcode)]); gen_op_440_tlbwe(rB(ctx->opcode)); break; default: @@ -5139,7 +5175,7 @@ GEN_EXCP_PRIVOPC(ctx); return; } - gen_op_load_gpr_T0(rD(ctx->opcode)); + tcg_gen_mov_tl(cpu_T[0], cpu_gpr[rD(ctx->opcode)]); gen_op_wrte(); /* Stop translation to have a chance to raise an exception * if we just set msr_ee to 1 @@ -5171,10 +5207,10 @@ /* dlmzb */ GEN_HANDLER(dlmzb, 0x1F, 0x0E, 0x02, 0x00000000, PPC_440_SPEC) { - gen_op_load_gpr_T0(rS(ctx->opcode)); - gen_op_load_gpr_T1(rB(ctx->opcode)); + tcg_gen_mov_tl(cpu_T[0], cpu_gpr[rS(ctx->opcode)]); + tcg_gen_mov_tl(cpu_T[1], cpu_gpr[rB(ctx->opcode)]); gen_op_440_dlmzb(); - gen_op_store_T0_gpr(rA(ctx->opcode)); + tcg_gen_mov_tl(cpu_gpr[rA(ctx->opcode)], cpu_T[0]); gen_op_store_xer_bc(); if (Rc(ctx->opcode)) { gen_op_440_dlmzb_update_Rc(); @@ -5263,37 +5299,32 @@ /*** SPE extension ***/ /* Register moves */ -#if !defined(TARGET_PPC64) -GEN32(gen_op_load_gpr64_T0, gen_op_load_gpr64_T0_gpr); -GEN32(gen_op_load_gpr64_T1, gen_op_load_gpr64_T1_gpr); -#if 0 // unused -GEN32(gen_op_load_gpr64_T2, gen_op_load_gpr64_T2_gpr); +static always_inline void gen_load_gpr64(TCGv t, int reg) { +#if defined(TARGET_PPC64) + tcg_gen_mov_i64(t, cpu_gpr[reg]); +#else + tcg_gen_extu_i32_i64(t, cpu_gprh[reg]); + tcg_gen_shli_i64(t, t, 32); + TCGv tmp = tcg_temp_local_new(TCG_TYPE_I64); + tcg_gen_extu_i32_i64(tmp, cpu_gpr[reg]); + tcg_gen_or_i64(t, t, tmp); + tcg_temp_free(tmp); #endif +} -GEN32(gen_op_store_T0_gpr64, gen_op_store_T0_gpr64_gpr); -GEN32(gen_op_store_T1_gpr64, gen_op_store_T1_gpr64_gpr); -#if 0 // unused -GEN32(gen_op_store_T2_gpr64, gen_op_store_T2_gpr64_gpr); +static always_inline void gen_store_gpr64(int reg, TCGv t) { +#if defined(TARGET_PPC64) + tcg_gen_mov_i64(cpu_gpr[reg], t); +#else + tcg_gen_trunc_i64_i32(cpu_gpr[reg], t); + TCGv tmp = tcg_temp_local_new(TCG_TYPE_I64); + tcg_gen_shri_i64(tmp, t, 32); + tcg_gen_trunc_i64_i32(cpu_gprh[reg], tmp); + tcg_temp_free(tmp); #endif +} -#else /* !defined(TARGET_PPC64) */ - -/* No specific load/store functions: GPRs are already 64 bits */ -#define gen_op_load_gpr64_T0 gen_op_load_gpr_T0 -#define gen_op_load_gpr64_T1 gen_op_load_gpr_T1 -#if 0 // unused -#define gen_op_load_gpr64_T2 gen_op_load_gpr_T2 -#endif - -#define gen_op_store_T0_gpr64 gen_op_store_T0_gpr -#define gen_op_store_T1_gpr64 gen_op_store_T1_gpr -#if 0 // unused -#define gen_op_store_T2_gpr64 gen_op_store_T2_gpr -#endif - -#endif /* !defined(TARGET_PPC64) */ - #define GEN_SPE(name0, name1, opc2, opc3, inval, type) \ GEN_HANDLER(name0##_##name1, 0x04, opc2, opc3, inval, type) \ { \ @@ -5317,7 +5348,7 @@ if (rA(ctx->opcode) == 0) { tcg_gen_movi_tl(cpu_T[0], simm << sh); } else { - gen_op_load_gpr_T0(rA(ctx->opcode)); + tcg_gen_mov_tl(cpu_T[0], cpu_gpr[rA(ctx->opcode)]); if (likely(simm != 0)) gen_op_addi(simm << sh); } @@ -5342,7 +5373,7 @@ } \ gen_addr_spe_imm_index(ctx, sh); \ op_spe_ldst(spe_l##name); \ - gen_op_store_T1_gpr64(rD(ctx->opcode)); \ + gen_store_gpr64(rD(ctx->opcode), cpu_T64[1]); \ } #define GEN_SPE_LDX(name) \ @@ -5354,7 +5385,7 @@ } \ gen_addr_reg_index(ctx); \ op_spe_ldst(spe_l##name); \ - gen_op_store_T1_gpr64(rD(ctx->opcode)); \ + gen_store_gpr64(rD(ctx->opcode), cpu_T64[1]); \ } #define GEN_SPEOP_LD(name, sh) \ @@ -5370,7 +5401,7 @@ return; \ } \ gen_addr_spe_imm_index(ctx, sh); \ - gen_op_load_gpr64_T1(rS(ctx->opcode)); \ + gen_load_gpr64(cpu_T64[1], rS(ctx->opcode)); \ op_spe_ldst(spe_st##name); \ } @@ -5382,7 +5413,7 @@ return; \ } \ gen_addr_reg_index(ctx); \ - gen_op_load_gpr64_T1(rS(ctx->opcode)); \ + gen_load_gpr64(cpu_T64[1], rS(ctx->opcode)); \ op_spe_ldst(spe_st##name); \ } @@ -5403,10 +5434,10 @@ GEN_EXCP_NO_AP(ctx); \ return; \ } \ - gen_op_load_gpr64_T0(rA(ctx->opcode)); \ - gen_op_load_gpr64_T1(rB(ctx->opcode)); \ + gen_load_gpr64(cpu_T64[0], rA(ctx->opcode)); \ + gen_load_gpr64(cpu_T64[1], rB(ctx->opcode)); \ gen_op_##name(); \ - gen_op_store_T0_gpr64(rD(ctx->opcode)); \ + gen_store_gpr64(rD(ctx->opcode), cpu_T64[0]); \ } #define GEN_SPEOP_ARITH1(name) \ @@ -5416,9 +5447,9 @@ GEN_EXCP_NO_AP(ctx); \ return; \ } \ - gen_op_load_gpr64_T0(rA(ctx->opcode)); \ + gen_load_gpr64(cpu_T64[0], rA(ctx->opcode)); \ gen_op_##name(); \ - gen_op_store_T0_gpr64(rD(ctx->opcode)); \ + gen_store_gpr64(rD(ctx->opcode), cpu_T64[0]); \ } #define GEN_SPEOP_COMP(name) \ @@ -5428,8 +5459,8 @@ GEN_EXCP_NO_AP(ctx); \ return; \ } \ - gen_op_load_gpr64_T0(rA(ctx->opcode)); \ - gen_op_load_gpr64_T1(rB(ctx->opcode)); \ + gen_load_gpr64(cpu_T64[0], rA(ctx->opcode)); \ + gen_load_gpr64(cpu_T64[1], rB(ctx->opcode)); \ gen_op_##name(); \ gen_op_store_T0_crf(crfD(ctx->opcode)); \ } @@ -5465,10 +5496,10 @@ static always_inline void gen_brinc (DisasContext *ctx) { /* Note: brinc is usable even if SPE is disabled */ - gen_op_load_gpr_T0(rA(ctx->opcode)); - gen_op_load_gpr_T1(rB(ctx->opcode)); + tcg_gen_mov_tl(cpu_T[0], cpu_gpr[rA(ctx->opcode)]); + tcg_gen_mov_tl(cpu_T[1], cpu_gpr[rB(ctx->opcode)]); gen_op_brinc(); - gen_op_store_T0_gpr(rD(ctx->opcode)); + tcg_gen_mov_tl(cpu_gpr[rD(ctx->opcode)], cpu_T[0]); } #define GEN_SPEOP_ARITH_IMM2(name) \ @@ -5478,10 +5509,10 @@ GEN_EXCP_NO_AP(ctx); \ return; \ } \ - gen_op_load_gpr64_T0(rB(ctx->opcode)); \ + gen_load_gpr64(cpu_T64[0], rB(ctx->opcode)); \ gen_op_splatwi_T1_64(rA(ctx->opcode)); \ gen_op_##name(); \ - gen_op_store_T0_gpr64(rD(ctx->opcode)); \ + gen_store_gpr64(rD(ctx->opcode), cpu_T64[0]); \ } #define GEN_SPEOP_LOGIC_IMM2(name) \ @@ -5491,10 +5522,10 @@ GEN_EXCP_NO_AP(ctx); \ return; \ } \ - gen_op_load_gpr64_T0(rA(ctx->opcode)); \ + gen_load_gpr64(cpu_T64[0], rA(ctx->opcode)); \ gen_op_splatwi_T1_64(rB(ctx->opcode)); \ gen_op_##name(); \ - gen_op_store_T0_gpr64(rD(ctx->opcode)); \ + gen_store_gpr64(rD(ctx->opcode), cpu_T64[0]); \ } GEN_SPEOP_ARITH_IMM2(evaddw); @@ -5513,7 +5544,7 @@ int32_t imm = (int32_t)(rA(ctx->opcode) << 27) >> 27; gen_op_splatwi_T0_64(imm); - gen_op_store_T0_gpr64(rD(ctx->opcode)); + gen_store_gpr64(rD(ctx->opcode), cpu_T64[0]); } static always_inline void gen_evsplatfi (DisasContext *ctx) @@ -5521,7 +5552,7 @@ uint32_t imm = rA(ctx->opcode) << 27; gen_op_splatwi_T0_64(imm); - gen_op_store_T0_gpr64(rD(ctx->opcode)); + gen_store_gpr64(rD(ctx->opcode), cpu_T64[0]); } /* Comparison */ @@ -5564,10 +5595,10 @@ return; } gen_op_load_crf_T0(ctx->opcode & 0x7); - gen_op_load_gpr64_T0(rA(ctx->opcode)); - gen_op_load_gpr64_T1(rB(ctx->opcode)); + gen_load_gpr64(cpu_T64[0], rA(ctx->opcode)); + gen_load_gpr64(cpu_T64[1], rB(ctx->opcode)); gen_op_evsel(); - gen_op_store_T0_gpr64(rD(ctx->opcode)); + gen_store_gpr64(rD(ctx->opcode), cpu_T64[0]); } GEN_HANDLER2(evsel0, "evsel", 0x04, 0x1c, 0x09, 0x00000000, PPC_SPE) @@ -5906,9 +5937,9 @@ #define GEN_SPEFPUOP_CONV(name) \ static always_inline void gen_##name (DisasContext *ctx) \ { \ - gen_op_load_gpr64_T0(rB(ctx->opcode)); \ + gen_load_gpr64(cpu_T64[0], rB(ctx->opcode)); \ gen_op_##name(); \ - gen_op_store_T0_gpr64(rD(ctx->opcode)); \ + gen_store_gpr64(rD(ctx->opcode), cpu_T64[0]); \ } /* Single precision floating-point vectors operations */