aboutsummaryrefslogtreecommitdiff
path: root/target
diff options
context:
space:
mode:
authorRichard Henderson <richard.henderson@linaro.org>2024-04-04 23:42:29 -1000
committerRichard Henderson <richard.henderson@linaro.org>2024-05-15 08:55:19 +0200
commit104cf5524e6694a439891ba4dc071a1427f0ace3 (patch)
tree681ec47c731d5fae92347e3343b740fc68b5d099 /target
parent1f9c4462334f424d844b52c3476fb3b0ec62ab46 (diff)
downloadqemu-104cf5524e6694a439891ba4dc071a1427f0ace3.zip
qemu-104cf5524e6694a439891ba4dc071a1427f0ace3.tar.gz
qemu-104cf5524e6694a439891ba4dc071a1427f0ace3.tar.bz2
target/rx: Use translator_ld*
Reviewed-by: Yoshinori Sato <ysato@users.sourceforge.jp> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'target')
-rw-r--r--target/rx/translate.c27
1 files changed, 14 insertions, 13 deletions
diff --git a/target/rx/translate.c b/target/rx/translate.c
index 92fb2b4..9b81cf2 100644
--- a/target/rx/translate.c
+++ b/target/rx/translate.c
@@ -22,7 +22,6 @@
#include "cpu.h"
#include "exec/exec-all.h"
#include "tcg/tcg-op.h"
-#include "exec/cpu_ldst.h"
#include "exec/helper-proto.h"
#include "exec/helper-gen.h"
#include "exec/translator.h"
@@ -75,10 +74,10 @@ static TCGv_i64 cpu_acc;
/* decoder helper */
static uint32_t decode_load_bytes(DisasContext *ctx, uint32_t insn,
- int i, int n)
+ int i, int n)
{
while (++i <= n) {
- uint8_t b = cpu_ldub_code(ctx->env, ctx->base.pc_next++);
+ uint8_t b = translator_ldub(ctx->env, &ctx->base, ctx->base.pc_next++);
insn |= b << (32 - i * 8);
}
return insn;
@@ -90,22 +89,24 @@ static uint32_t li(DisasContext *ctx, int sz)
CPURXState *env = ctx->env;
addr = ctx->base.pc_next;
- tcg_debug_assert(sz < 4);
switch (sz) {
case 1:
ctx->base.pc_next += 1;
- return cpu_ldsb_code(env, addr);
+ return (int8_t)translator_ldub(env, &ctx->base, addr);
case 2:
ctx->base.pc_next += 2;
- return cpu_ldsw_code(env, addr);
+ return (int16_t)translator_lduw(env, &ctx->base, addr);
case 3:
ctx->base.pc_next += 3;
- tmp = cpu_ldsb_code(env, addr + 2) << 16;
- tmp |= cpu_lduw_code(env, addr) & 0xffff;
+ tmp = (int8_t)translator_ldub(env, &ctx->base, addr + 2);
+ tmp <<= 16;
+ tmp |= translator_lduw(env, &ctx->base, addr);
return tmp;
case 0:
ctx->base.pc_next += 4;
- return cpu_ldl_code(env, addr);
+ return translator_ldl(env, &ctx->base, addr);
+ default:
+ g_assert_not_reached();
}
return 0;
}
@@ -190,22 +191,22 @@ static inline TCGv rx_index_addr(DisasContext *ctx, TCGv mem,
{
uint32_t dsp;
- tcg_debug_assert(ld < 3);
switch (ld) {
case 0:
return cpu_regs[reg];
case 1:
- dsp = cpu_ldub_code(ctx->env, ctx->base.pc_next) << size;
+ dsp = translator_ldub(ctx->env, &ctx->base, ctx->base.pc_next) << size;
tcg_gen_addi_i32(mem, cpu_regs[reg], dsp);
ctx->base.pc_next += 1;
return mem;
case 2:
- dsp = cpu_lduw_code(ctx->env, ctx->base.pc_next) << size;
+ dsp = translator_lduw(ctx->env, &ctx->base, ctx->base.pc_next) << size;
tcg_gen_addi_i32(mem, cpu_regs[reg], dsp);
ctx->base.pc_next += 2;
return mem;
+ default:
+ g_assert_not_reached();
}
- return NULL;
}
static inline MemOp mi_to_mop(unsigned mi)