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>
This commit is contained in:
Richard Henderson 2022-02-26 01:06:07 -10:00
parent d8e609e9bb
commit 0b6e8f5b23

View File

@ -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;
}
}