target/sparc: Initialize local scratch float_status from env->fp_status
authorPeter Maydell <peter.maydell@linaro.org>
Wed, 11 Dec 2024 15:31:03 +0000 (15:31 +0000)
committerPeter Maydell <peter.maydell@linaro.org>
Wed, 11 Dec 2024 15:31:03 +0000 (15:31 +0000)
commit5edd92d6c340553e1788e86fef844a389f052b72
tree4be934a5000fbea254b233521b00e358748f395f
parentca81533e94c81838fa05bb8ba7a8a6708e4dca99
target/sparc: Initialize local scratch float_status from env->fp_status

In the helper functions flcmps and flcmpd we use a scratch float_status
so that we don't change the CPU state if the comparison raises any
floating point exception flags. Instead of zero-initializing this
scratch float_status, initialize it as a copy of env->fp_status. This
avoids the need to explicitly initialize settings like the NaN
propagation rule or others we might add to softfloat in future.

To do this we need to pass the CPU env pointer in to the helper.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20241202131347.498124-33-peter.maydell@linaro.org
target/sparc/fop_helper.c
target/sparc/helper.h
target/sparc/translate.c