target/arm: Adjust FP behaviour for FPCR.AH = 1
authorPeter Maydell <peter.maydell@linaro.org>
Sat, 1 Feb 2025 16:39:11 +0000 (16:39 +0000)
committerPeter Maydell <peter.maydell@linaro.org>
Tue, 11 Feb 2025 16:22:07 +0000 (16:22 +0000)
commitb3d00d0a448b6ea5750da1a163aeead0287f6c05
treeb45c060c4e8b5586ba53de6ab2ab586487eb8018
parentc2e60204779616daf35ade1bc5ef31f1388e9892
target/arm: Adjust FP behaviour for FPCR.AH = 1

When FPCR.AH is set, various behaviours of AArch64 floating point
operations which are controlled by softfloat config settings change:
 * tininess and ftz detection before/after rounding
 * NaN propagation order
 * result of 0 * Inf + NaN
 * default NaN value

When the guest changes the value of the AH bit, switch these config
settings on the fp_status_a64 and fp_status_f16_a64 float_status
fields.

This requires us to make the arm_set_default_fp_behaviours() function
global, since we now need to call it from cpu.c and vfp_helper.c; we
move it to vfp_helper.c so it can be next to the new
arm_set_ah_fp_behaviours().

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
target/arm/cpu.c
target/arm/internals.h
target/arm/vfp_helper.c