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:
parent
d8e609e9bb
commit
0b6e8f5b23
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user