[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 16/76] target/microblaze: Fix width of FSR
From: |
Richard Henderson |
Subject: |
[PULL 16/76] target/microblaze: Fix width of FSR |
Date: |
Mon, 31 Aug 2020 09:05:01 -0700 |
The exception status register is only 32-bits wide. Do not use a
64-bit type to represent it. Since cpu_fsr 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>
---
target/microblaze/cpu.h | 2 +-
target/microblaze/translate.c | 11 +++++------
2 files changed, 6 insertions(+), 7 deletions(-)
diff --git a/target/microblaze/cpu.h b/target/microblaze/cpu.h
index aaac0c9a6c..34177f9b28 100644
--- a/target/microblaze/cpu.h
+++ b/target/microblaze/cpu.h
@@ -240,7 +240,7 @@ struct CPUMBState {
uint32_t msr;
uint64_t ear;
uint32_t esr;
- uint64_t fsr;
+ uint32_t fsr;
uint64_t btr;
uint64_t edr;
float_status fp_status;
diff --git a/target/microblaze/translate.c b/target/microblaze/translate.c
index f63aae6de9..3fc2feda3d 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_fsr;
static TCGv_i64 cpu_btr;
static TCGv_i64 cpu_edr;
static TCGv_i32 env_imm;
@@ -542,7 +541,8 @@ static void dec_msr(DisasContext *dc)
tcg_gen_mov_i32(cpu_esr, cpu_R[dc->ra]);
break;
case SR_FSR:
- tcg_gen_extu_i32_i64(cpu_fsr, cpu_R[dc->ra]);
+ tcg_gen_st_i32(cpu_R[dc->ra],
+ cpu_env, offsetof(CPUMBState, fsr));
break;
case SR_BTR:
tcg_gen_extu_i32_i64(cpu_btr, cpu_R[dc->ra]);
@@ -583,7 +583,8 @@ static void dec_msr(DisasContext *dc)
tcg_gen_mov_i32(cpu_R[dc->rd], cpu_esr);
break;
case SR_FSR:
- tcg_gen_extrl_i64_i32(cpu_R[dc->rd], cpu_fsr);
+ tcg_gen_ld_i32(cpu_R[dc->rd],
+ cpu_env, offsetof(CPUMBState, fsr));
break;
case SR_BTR:
tcg_gen_extrl_i64_i32(cpu_R[dc->rd], cpu_btr);
@@ -1798,7 +1799,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=%" PRIx64 " "
+ "debug=%x imm=%x iflags=%x fsr=%x "
"rbtr=%" PRIx64 "\n",
env->msr, env->esr, env->ear,
env->debug, env->imm, env->iflags, env->fsr,
@@ -1867,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_fsr =
- tcg_global_mem_new_i64(cpu_env, offsetof(CPUMBState, fsr), "rfsr");
cpu_btr =
tcg_global_mem_new_i64(cpu_env, offsetof(CPUMBState, btr), "rbtr");
cpu_edr =
--
2.25.1
- [PULL 06/76] target/microblaze: Split out MSR from env->sregs, (continued)
- [PULL 06/76] target/microblaze: Split out MSR from env->sregs, Richard Henderson, 2020/08/31
- [PULL 07/76] target/microblaze: Split out EAR from env->sregs, Richard Henderson, 2020/08/31
- [PULL 08/76] target/microblaze: Split out ESR from env->sregs, Richard Henderson, 2020/08/31
- [PULL 09/76] target/microblaze: Split out FSR from env->sregs, Richard Henderson, 2020/08/31
- [PULL 10/76] target/microblaze: Split out BTR from env->sregs, Richard Henderson, 2020/08/31
- [PULL 11/76] target/microblaze: Split out EDR from env->sregs, Richard Henderson, 2020/08/31
- [PULL 12/76] target/microblaze: Split the cpu_SR array, Richard Henderson, 2020/08/31
- [PULL 13/76] target/microblaze: Fix width of PC and BTARGET, Richard Henderson, 2020/08/31
- [PULL 14/76] target/microblaze: Fix width of MSR, Richard Henderson, 2020/08/31
- [PULL 15/76] target/microblaze: Fix width of ESR, Richard Henderson, 2020/08/31
- [PULL 16/76] target/microblaze: Fix width of FSR,
Richard Henderson <=
- [PULL 17/76] target/microblaze: Fix width of BTR, Richard Henderson, 2020/08/31
- [PULL 18/76] target/microblaze: Fix width of EDR, Richard Henderson, 2020/08/31
- [PULL 19/76] target/microblaze: Remove cpu_ear, Richard Henderson, 2020/08/31
- [PULL 21/76] target/microblaze: Mark raise_exception as noreturn, Richard Henderson, 2020/08/31
- [PULL 20/76] target/microblaze: Tidy raising of exceptions, Richard Henderson, 2020/08/31
- [PULL 22/76] target/microblaze: Remove helper_debug and env->debug, Richard Henderson, 2020/08/31
- [PULL 23/76] target/microblaze: Rename env_* tcg variables to cpu_*, Richard Henderson, 2020/08/31
- [PULL 24/76] target/microblaze: Tidy mb_tcg_init, Richard Henderson, 2020/08/31
- [PULL 25/76] target/microblaze: Split out MSR[C] to its own variable, Richard Henderson, 2020/08/31
- [PULL 26/76] target/microblaze: Use DISAS_NORETURN, Richard Henderson, 2020/08/31