diff options
author | Richard Henderson <richard.henderson@linaro.org> | 2022-02-26 01:06:07 -1000 |
---|---|---|
committer | Richard Henderson <richard.henderson@linaro.org> | 2022-03-03 09:37:32 -1000 |
commit | 0b6e8f5b234181198f4864f201bef13842987525 (patch) | |
tree | d0d56013759c2bfbab3b5fba06aa5dd05b4f0e7a /target/nios2 | |
parent | d8e609e9bb5a6b70ae2ba45fd14efffada013752 (diff) | |
download | qemu-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.c | 8 |
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; } } |