aboutsummaryrefslogtreecommitdiff
path: root/target/nios2
diff options
context:
space:
mode:
authorRichard Henderson <richard.henderson@linaro.org>2022-02-26 01:06:07 -1000
committerRichard Henderson <richard.henderson@linaro.org>2022-03-03 09:37:32 -1000
commit0b6e8f5b234181198f4864f201bef13842987525 (patch)
treed0d56013759c2bfbab3b5fba06aa5dd05b4f0e7a /target/nios2
parentd8e609e9bb5a6b70ae2ba45fd14efffada013752 (diff)
downloadqemu-0b6e8f5b234181198f4864f201bef13842987525.zip
qemu-0b6e8f5b234181198f4864f201bef13842987525.tar.gz
qemu-0b6e8f5b234181198f4864f201bef13842987525.tar.bz2
target/nios2: Hoist R_ZERO check in rdctl
This will avoid having to replicate the check to additional cases. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'target/nios2')
-rw-r--r--target/nios2/translate.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/target/nios2/translate.c b/target/nios2/translate.c
index 194c8eb..fa35530 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;
}
}