[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 19/77] target/microblaze: Remove cpu_ear
From: |
Richard Henderson |
Subject: |
[PATCH 19/77] target/microblaze: Remove cpu_ear |
Date: |
Tue, 25 Aug 2020 13:58:52 -0700 |
Since cpu_ear is only used during MSR and MTR instructions,
we can just as easily use an explicit load and store, so
eliminate the variable.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
target/microblaze/translate.c | 23 +++++++++++++++--------
1 file changed, 15 insertions(+), 8 deletions(-)
diff --git a/target/microblaze/translate.c b/target/microblaze/translate.c
index a862ac4055..f5ca25cead 100644
--- a/target/microblaze/translate.c
+++ b/target/microblaze/translate.c
@@ -57,7 +57,6 @@ static TCGv_i32 env_debug;
static TCGv_i32 cpu_R[32];
static TCGv_i32 cpu_pc;
static TCGv_i32 cpu_msr;
-static TCGv_i64 cpu_ear;
static TCGv_i32 cpu_esr;
static TCGv_i32 env_imm;
static TCGv_i32 env_btaken;
@@ -533,7 +532,12 @@ static void dec_msr(DisasContext *dc)
msr_write(dc, cpu_R[dc->ra]);
break;
case SR_EAR:
- tcg_gen_extu_i32_i64(cpu_ear, cpu_R[dc->ra]);
+ {
+ TCGv_i64 t64 = tcg_temp_new_i64();
+ tcg_gen_extu_i32_i64(t64, cpu_R[dc->ra]);
+ tcg_gen_st_i64(t64, cpu_env, offsetof(CPUMBState, ear));
+ tcg_temp_free_i64(t64);
+ }
break;
case SR_ESR:
tcg_gen_mov_i32(cpu_esr, cpu_R[dc->ra]);
@@ -573,10 +577,15 @@ static void dec_msr(DisasContext *dc)
msr_read(dc, cpu_R[dc->rd]);
break;
case SR_EAR:
- if (extended) {
- tcg_gen_extrh_i64_i32(cpu_R[dc->rd], cpu_ear);
- } else {
- tcg_gen_extrl_i64_i32(cpu_R[dc->rd], cpu_ear);
+ {
+ TCGv_i64 t64 = tcg_temp_new_i64();
+ tcg_gen_ld_i64(t64, cpu_env, offsetof(CPUMBState, ear));
+ if (extended) {
+ tcg_gen_extrh_i64_i32(cpu_R[dc->rd], t64);
+ } else {
+ tcg_gen_extrl_i64_i32(cpu_R[dc->rd], t64);
+ }
+ tcg_temp_free_i64(t64);
}
break;
case SR_ESR:
@@ -1865,8 +1874,6 @@ void mb_tcg_init(void)
tcg_global_mem_new_i32(cpu_env, offsetof(CPUMBState, pc), "rpc");
cpu_msr =
tcg_global_mem_new_i32(cpu_env, offsetof(CPUMBState, msr), "rmsr");
- cpu_ear =
- tcg_global_mem_new_i64(cpu_env, offsetof(CPUMBState, ear), "rear");
cpu_esr =
tcg_global_mem_new_i32(cpu_env, offsetof(CPUMBState, esr), "resr");
}
--
2.25.1
- [PATCH 09/77] target/microblaze: Split out FSR from env->sregs, (continued)
- [PATCH 09/77] target/microblaze: Split out FSR from env->sregs, Richard Henderson, 2020/08/25
- [PATCH 10/77] target/microblaze: Split out BTR from env->sregs, Richard Henderson, 2020/08/25
- [PATCH 11/77] target/microblaze: Split out EDR from env->sregs, Richard Henderson, 2020/08/25
- [PATCH 12/77] target/microblaze: Split the cpu_SR array, Richard Henderson, 2020/08/25
- [PATCH 13/77] target/microblaze: Fix width of PC and BTARGET, Richard Henderson, 2020/08/25
- [PATCH 14/77] target/microblaze: Fix width of MSR, Richard Henderson, 2020/08/25
- [PATCH 15/77] target/microblaze: Fix width of ESR, Richard Henderson, 2020/08/25
- [PATCH 16/77] target/microblaze: Fix width of FSR, Richard Henderson, 2020/08/25
- [PATCH 17/77] target/microblaze: Fix width of BTR, Richard Henderson, 2020/08/25
- [PATCH 18/77] target/microblaze: Fix width of EDR, Richard Henderson, 2020/08/25
- [PATCH 19/77] target/microblaze: Remove cpu_ear,
Richard Henderson <=
- [PATCH 20/77] target/microblaze: Tidy raising of exceptions, Richard Henderson, 2020/08/25
- [PATCH 21/77] target/microblaze: Mark raise_exception as noreturn, Richard Henderson, 2020/08/25
- [PATCH 22/77] target/microblaze: Remove helper_debug and env->debug, Richard Henderson, 2020/08/25
- [PATCH 23/77] target/microblaze: Rename env_* tcg variables to cpu_*, Richard Henderson, 2020/08/25
- [PATCH 24/77] target/microblaze: Tidy mb_tcg_init, Richard Henderson, 2020/08/25
- [PATCH 27/77] target/microblaze: Check singlestep_enabled in gen_goto_tb, Richard Henderson, 2020/08/25
- [PATCH 26/77] target/microblaze: Use DISAS_NORETURN, Richard Henderson, 2020/08/25
- [PATCH 30/77] target/microblaze: Remove SIM_COMPAT, Richard Henderson, 2020/08/25
- [PATCH 29/77] target/microblaze: Convert to translator_loop, Richard Henderson, 2020/08/25
- [PATCH 32/77] target/microblaze: Remove empty D macros, Richard Henderson, 2020/08/25