diff options
author | aurel32 <aurel32@c046a42c-6fe2-441c-8c8c-71466251a162> | 2008-11-30 16:24:47 +0000 |
---|---|---|
committer | aurel32 <aurel32@c046a42c-6fe2-441c-8c8c-71466251a162> | 2008-11-30 16:24:47 +0000 |
commit | fa407c030c2bb592b4f9a7152517815a047007e6 (patch) | |
tree | 58da919de53f009b9facd87a533e998dec99ffb0 /target-ppc/translate.c | |
parent | cf360a32af84ee473b4bcba1dcaa4646f10ef937 (diff) |
target-ppc: convert external load/store instructions to TCG
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5831 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'target-ppc/translate.c')
-rw-r--r-- | target-ppc/translate.c | 61 |
1 files changed, 13 insertions, 48 deletions
diff --git a/target-ppc/translate.c b/target-ppc/translate.c index 1c3986e88c..3f39431a10 100644 --- a/target-ppc/translate.c +++ b/target-ppc/translate.c @@ -2490,37 +2490,6 @@ static always_inline void gen_check_align (DisasContext *ctx, TCGv EA, int mask) tcg_temp_free(t0); } -#if defined(TARGET_PPC64) -#define _GEN_MEM_FUNCS(name, mode) \ - &gen_op_##name##_##mode, \ - &gen_op_##name##_le_##mode, \ - &gen_op_##name##_64_##mode, \ - &gen_op_##name##_le_64_##mode -#else -#define _GEN_MEM_FUNCS(name, mode) \ - &gen_op_##name##_##mode, \ - &gen_op_##name##_le_##mode -#endif -#if defined(CONFIG_USER_ONLY) -#if defined(TARGET_PPC64) -#define NB_MEM_FUNCS 4 -#else -#define NB_MEM_FUNCS 2 -#endif -#define GEN_MEM_FUNCS(name) \ - _GEN_MEM_FUNCS(name, raw) -#else -#if defined(TARGET_PPC64) -#define NB_MEM_FUNCS 12 -#else -#define NB_MEM_FUNCS 6 -#endif -#define GEN_MEM_FUNCS(name) \ - _GEN_MEM_FUNCS(name, user), \ - _GEN_MEM_FUNCS(name, kernel), \ - _GEN_MEM_FUNCS(name, hypv) -#endif - /*** Integer load ***/ #if defined(TARGET_PPC64) #define GEN_QEMU_LD_PPC64(width) \ @@ -4427,32 +4396,28 @@ GEN_HANDLER(slbie, 0x1F, 0x12, 0x0D, 0x03FF0001, PPC_SLBI) /*** External control ***/ /* Optional: */ -#define op_eciwx() (*gen_op_eciwx[ctx->mem_idx])() -#define op_ecowx() (*gen_op_ecowx[ctx->mem_idx])() -static GenOpFunc *gen_op_eciwx[NB_MEM_FUNCS] = { - GEN_MEM_FUNCS(eciwx), -}; -static GenOpFunc *gen_op_ecowx[NB_MEM_FUNCS] = { - GEN_MEM_FUNCS(ecowx), -}; - /* eciwx */ GEN_HANDLER(eciwx, 0x1F, 0x16, 0x0D, 0x00000001, PPC_EXTERN) { - /* Should check EAR[E] & alignment ! */ + /* Should check EAR[E] ! */ + TCGv t0 = tcg_temp_new(); gen_set_access_type(ACCESS_RES); - gen_addr_reg_index(cpu_T[0], ctx); - op_eciwx(); - tcg_gen_mov_tl(cpu_gpr[rD(ctx->opcode)], cpu_T[0]); + gen_addr_reg_index(t0, ctx); + gen_check_align(ctx, t0, 0x03); + gen_qemu_ld32u(cpu_gpr[rD(ctx->opcode)], t0, ctx->mem_idx); + tcg_temp_free(t0); } /* ecowx */ GEN_HANDLER(ecowx, 0x1F, 0x16, 0x09, 0x00000001, PPC_EXTERN) { - /* Should check EAR[E] & alignment ! */ - gen_addr_reg_index(cpu_T[0], ctx); - tcg_gen_mov_tl(cpu_T[1], cpu_gpr[rS(ctx->opcode)]); - op_ecowx(); + /* Should check EAR[E] ! */ + TCGv t0 = tcg_temp_new(); + gen_set_access_type(ACCESS_RES); + gen_addr_reg_index(t0, ctx); + gen_check_align(ctx, t0, 0x03); + gen_qemu_st32(cpu_gpr[rD(ctx->opcode)], t0, ctx->mem_idx); + tcg_temp_free(t0); } /* PowerPC 601 specific instructions */ |