]> git.ipfire.org Git - thirdparty/qemu.git/commit
target/sparc: Move cpu_put_fsr(env, 0) call to reset
authorPeter Maydell <peter.maydell@linaro.org>
Tue, 5 Nov 2024 10:09:55 +0000 (10:09 +0000)
committerPeter Maydell <peter.maydell@linaro.org>
Tue, 5 Nov 2024 10:09:55 +0000 (10:09 +0000)
commit65c1c039cdbcf66e9bc5b0366c8f7cc22284359a
tree8e15f35f06de303a9359a72405acd2c8afa3eb5c
parentad58ba13d04b85c141bca2d927fb9de6490bf0c1
target/sparc: Move cpu_put_fsr(env, 0) call to reset

Currently we call cpu_put_fsr(0) in sparc_cpu_realizefn(), which
initializes various fields in the CPU struct:
 * fsr_cexc_ftt
 * fcc[]
 * fsr_qne
 * fsr
It also sets the rounding mode in env->fp_status.

This is largely pointless, because when we later reset the CPU
this will zero out all the fields up until the "end_reset_fields"
label, which includes all of these (but not fp_status!)

Move the cpu_put_fsr(env, 0) call to reset, because that expresses
the logical requirement: we want to reset FSR to 0 on every reset.
This isn't a behaviour change because the fields are all zero anyway.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20241025141254.2141506-12-peter.maydell@linaro.org
target/sparc/cpu.c