summaryrefslogtreecommitdiffstats
path: root/target/microblaze
diff options
context:
space:
mode:
authorRichard Henderson2020-08-20 07:44:49 +0200
committerRichard Henderson2020-09-01 16:41:38 +0200
commitccf628b7939c542cf9e46e9aaa2b0acf0888ec52 (patch)
tree9135f99a9d9a74d7af7bd5872e3f155cdd641074 /target/microblaze
parenttarget/microblaze: Fix width of FSR (diff)
downloadqemu-ccf628b7939c542cf9e46e9aaa2b0acf0888ec52.tar.gz
qemu-ccf628b7939c542cf9e46e9aaa2b0acf0888ec52.tar.xz
qemu-ccf628b7939c542cf9e46e9aaa2b0acf0888ec52.zip
target/microblaze: Fix width of BTR
The branch target register is only 32-bits wide. Do not use a 64-bit type to represent it. Since cpu_btr is only used during MSR and MTR instructions, we can just as easily use an explicit load and store, so eliminate the variable. Tested-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com> Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'target/microblaze')
-rw-r--r--target/microblaze/cpu.h2
-rw-r--r--target/microblaze/translate.c12
2 files changed, 6 insertions, 8 deletions
diff --git a/target/microblaze/cpu.h b/target/microblaze/cpu.h
index 34177f9b28..72f068a5fd 100644
--- a/target/microblaze/cpu.h
+++ b/target/microblaze/cpu.h
@@ -241,7 +241,7 @@ struct CPUMBState {
uint64_t ear;
uint32_t esr;
uint32_t fsr;
- uint64_t btr;
+ uint32_t btr;
uint64_t edr;
float_status fp_status;
/* Stack protectors. Yes, it's a hw feature. */
diff --git a/target/microblaze/translate.c b/target/microblaze/translate.c
index 3fc2feda3d..a2bba0fe61 100644
--- a/target/microblaze/translate.c
+++ b/target/microblaze/translate.c
@@ -59,7 +59,6 @@ static TCGv_i32 cpu_pc;
static TCGv_i32 cpu_msr;
static TCGv_i64 cpu_ear;
static TCGv_i32 cpu_esr;
-static TCGv_i64 cpu_btr;
static TCGv_i64 cpu_edr;
static TCGv_i32 env_imm;
static TCGv_i32 env_btaken;
@@ -545,7 +544,8 @@ static void dec_msr(DisasContext *dc)
cpu_env, offsetof(CPUMBState, fsr));
break;
case SR_BTR:
- tcg_gen_extu_i32_i64(cpu_btr, cpu_R[dc->ra]);
+ tcg_gen_st_i32(cpu_R[dc->ra],
+ cpu_env, offsetof(CPUMBState, btr));
break;
case SR_EDR:
tcg_gen_extu_i32_i64(cpu_edr, cpu_R[dc->ra]);
@@ -587,7 +587,8 @@ static void dec_msr(DisasContext *dc)
cpu_env, offsetof(CPUMBState, fsr));
break;
case SR_BTR:
- tcg_gen_extrl_i64_i32(cpu_R[dc->rd], cpu_btr);
+ tcg_gen_ld_i32(cpu_R[dc->rd],
+ cpu_env, offsetof(CPUMBState, btr));
break;
case SR_EDR:
tcg_gen_extrl_i64_i32(cpu_R[dc->rd], cpu_edr);
@@ -1799,8 +1800,7 @@ void mb_cpu_dump_state(CPUState *cs, FILE *f, int flags)
qemu_fprintf(f, "IN: PC=%x %s\n",
env->pc, lookup_symbol(env->pc));
qemu_fprintf(f, "rmsr=%x resr=%x rear=%" PRIx64 " "
- "debug=%x imm=%x iflags=%x fsr=%x "
- "rbtr=%" PRIx64 "\n",
+ "debug=%x imm=%x iflags=%x fsr=%x rbtr=%x\n",
env->msr, env->esr, env->ear,
env->debug, env->imm, env->iflags, env->fsr,
env->btr);
@@ -1868,8 +1868,6 @@ void mb_tcg_init(void)
tcg_global_mem_new_i64(cpu_env, offsetof(CPUMBState, ear), "rear");
cpu_esr =
tcg_global_mem_new_i32(cpu_env, offsetof(CPUMBState, esr), "resr");
- cpu_btr =
- tcg_global_mem_new_i64(cpu_env, offsetof(CPUMBState, btr), "rbtr");
cpu_edr =
tcg_global_mem_new_i64(cpu_env, offsetof(CPUMBState, edr), "redr");
}