[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 4/7] target/nios2: Hoist R_ZERO check in rdctl
From: |
Richard Henderson |
Subject: |
[PATCH 4/7] target/nios2: Hoist R_ZERO check in rdctl |
Date: |
Sun, 27 Feb 2022 08:21:22 -1000 |
This will avoid having to replicate the check to additional cases.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
target/nios2/translate.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/target/nios2/translate.c b/target/nios2/translate.c
index 194c8ebafd..fa355308a9 100644
--- a/target/nios2/translate.c
+++ b/target/nios2/translate.c
@@ -447,11 +447,13 @@ static void rdctl(DisasContext *dc, uint32_t code,
uint32_t flags)
gen_check_supervisor(dc);
+ if (unlikely(instr.c == R_ZERO)) {
+ return;
+ }
+
switch (instr.imm5 + CR_BASE) {
default:
- if (likely(instr.c != R_ZERO)) {
- tcg_gen_mov_tl(cpu_R[instr.c], cpu_R[instr.imm5 + CR_BASE]);
- }
+ tcg_gen_mov_tl(cpu_R[instr.c], cpu_R[instr.imm5 + CR_BASE]);
break;
}
}
--
2.25.1
- [PATCH 0/7] target/nios2: Rewrite interrupt handling, Richard Henderson, 2022/02/27
- [PATCH 1/7] target/nios2: Remove mmu_read_debug, Richard Henderson, 2022/02/27
- [PATCH 3/7] target/nios2: Only build mmu.c for system mode, Richard Henderson, 2022/02/27
- [PATCH 2/7] target/nios2: Replace MMU_LOG with tracepoints, Richard Henderson, 2022/02/27
- [PATCH 4/7] target/nios2: Hoist R_ZERO check in rdctl,
Richard Henderson <=
- [PATCH 6/7] target/nios2: Special case ipending in rdctl and wrctl, Richard Henderson, 2022/02/27
- [PATCH 5/7] target/nios2: Split mmu_write, Richard Henderson, 2022/02/27
- [PATCH 7/7] target/nios2: Rewrite interrupt handling, Richard Henderson, 2022/02/27