Skip to contentSkip to conversation

[5825] target-ppc: convert load/store multiple instructions to TCG

Qemu-devel Aurelien Jarno 1 participant 1 message Nov 30, 2008

lore
Share & tools
lore
#0 lore raw

Revision: 5825

          http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=5825
Author:   aurel32
Date:     2008-11-30 16:23:56 +0000 (Sun, 30 Nov 2008)

Log Message:
-----------
target-ppc: convert load/store multiple instructions to TCG

Modified Paths:
--------------
trunk/target-ppc/helper.h
trunk/target-ppc/op_helper.c
trunk/target-ppc/op_helper.h
trunk/target-ppc/op_helper_mem.h
trunk/target-ppc/op_mem.h
trunk/target-ppc/translate.c

Modified: trunk/target-ppc/helper.h
===================================================================

target-ppc/helper.h +3 -0
@@ -7,6 +7,9 @@
 DEF_HELPER_3(td, void, tl, tl, i32)
 #endif
 
+DEF_HELPER_2(lmw, void, tl, i32)
+DEF_HELPER_2(stmw, void, tl, i32)
+
 DEF_HELPER_2(fcmpo, i32, i64, i64)
 DEF_HELPER_2(fcmpu, i32, i64, i64)
 

Modified: trunk/target-ppc/op_helper.c
===================================================================

target-ppc/op_helper.c +63 -0

69 lines not on this page · raw message

Modified: trunk/target-ppc/op_helper.h
===================================================================

target-ppc/op_helper.h +0 -8
@@ -23,10 +23,6 @@
 /* Memory load/store helpers */
 void glue(do_lsw, MEMSUFFIX) (int dst);
 void glue(do_stsw, MEMSUFFIX) (int src);
-void glue(do_lmw, MEMSUFFIX) (int dst);
-void glue(do_lmw_le, MEMSUFFIX) (int dst);
-void glue(do_stmw, MEMSUFFIX) (int src);
-void glue(do_stmw_le, MEMSUFFIX) (int src);
 void glue(do_icbi, MEMSUFFIX) (void);
 void glue(do_dcbz, MEMSUFFIX) (void);
 void glue(do_POWER_lscbx, MEMSUFFIX) (int dest, int ra, int rb);
@@ -38,10 +34,6 @@
 #if defined(TARGET_PPC64)
 void glue(do_lsw_64, MEMSUFFIX) (int dst);
 void glue(do_stsw_64, MEMSUFFIX) (int src);
-void glue(do_lmw_64, MEMSUFFIX) (int dst);
-void glue(do_lmw_le_64, MEMSUFFIX) (int dst);
-void glue(do_stmw_64, MEMSUFFIX) (int src);
-void glue(do_stmw_le_64, MEMSUFFIX) (int src);
 void glue(do_icbi_64, MEMSUFFIX) (void);
 void glue(do_dcbz_64, MEMSUFFIX) (void);
 #endif

Modified: trunk/target-ppc/op_helper_mem.h
===================================================================

target-ppc/op_helper_mem.h +0 -65

71 lines not on this page · raw message

Modified: trunk/target-ppc/op_mem.h
===================================================================

target-ppc/op_mem.h +0 -57

63 lines not on this page · raw message

Modified: trunk/target-ppc/translate.c
===================================================================

target-ppc/translate.c +12 -12
@@ -3092,30 +3092,30 @@
 GEN_STX(stwbr, st32r, 0x16, 0x14, PPC_INTEGER);
 
 /***                    Integer load and store multiple                    ***/
-#define op_ldstm(name, reg) (*gen_op_##name[ctx->mem_idx])(reg)
-static GenOpFunc1 *gen_op_lmw[NB_MEM_FUNCS] = {
-    GEN_MEM_FUNCS(lmw),
-};
-static GenOpFunc1 *gen_op_stmw[NB_MEM_FUNCS] = {
-    GEN_MEM_FUNCS(stmw),
-};
-
 /* lmw */
 GEN_HANDLER(lmw, 0x2E, 0xFF, 0xFF, 0x00000000, PPC_INTEGER)
 {
+    TCGv t0 = tcg_temp_new();
+    TCGv_i32 t1 = tcg_const_i32(rD(ctx->opcode));
     /* NIP cannot be restored if the memory exception comes from an helper */
     gen_update_nip(ctx, ctx->nip - 4);
-    gen_addr_imm_index(cpu_T[0], ctx, 0);
-    op_ldstm(lmw, rD(ctx->opcode));
+    gen_addr_imm_index(t0, ctx, 0);
+    gen_helper_lmw(t0, t1);
+    tcg_temp_free(t0);
+    tcg_temp_free_i32(t1);
 }
 
 /* stmw */
 GEN_HANDLER(stmw, 0x2F, 0xFF, 0xFF, 0x00000000, PPC_INTEGER)
 {
+    TCGv t0 = tcg_temp_new();
+    TCGv_i32 t1 = tcg_const_i32(rS(ctx->opcode));
     /* NIP cannot be restored if the memory exception comes from an helper */
     gen_update_nip(ctx, ctx->nip - 4);
-    gen_addr_imm_index(cpu_T[0], ctx, 0);
-    op_ldstm(stmw, rS(ctx->opcode));
+    gen_addr_imm_index(t0, ctx, 0);
+    gen_helper_stmw(t0, t1);
+    tcg_temp_free(t0);
+    tcg_temp_free_i32(t1);
 }
 
 /***                    Integer load and store strings                     ***/