target/arm: Use FPST_A64_F16 for halfprec-to-other conversions
authorPeter Maydell <peter.maydell@linaro.org>
Fri, 24 Jan 2025 16:27:46 +0000 (16:27 +0000)
committerPeter Maydell <peter.maydell@linaro.org>
Tue, 28 Jan 2025 18:40:19 +0000 (18:40 +0000)
commite07b48995aaae22fb8aa582b0a53633734bbea92
tree99423993cd0809f4f0bd4426f36e1a0d0feb4381
parentd168a081479c8f90fa99949111c93bcb3a342348
target/arm: Use FPST_A64_F16 for halfprec-to-other conversions

We should be using the F16-specific float_status for conversions from
half-precision, because halfprec inputs never set Input Denormal.

Without FEAT_AHP, using the wrong fpst here had no effect, because
the only difference between the A64_F16 and A64 fpst is its handling
of flush-to-zero on input and output, and the helper functions
vfp_fcvt_f16_to_* and vfp_fcvt_*_to_f16 all explicitly squash the
relevant flushing flags, and flush_inputs_to_zero was the only way
that IDC could be set.

With FEAT_AHP, the FPCR.AH=1 behaviour sets IDC for
input_denormal_used, which we will only ignore in
vfp_get_fpsr_from_host() for the A64_F16 fpst; so it matters that we
use that one for f16 inputs (and the normal one for single/double to
f16 conversions).

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20250124162836.2332150-27-peter.maydell@linaro.org
target/arm/tcg/translate-a64.c
target/arm/tcg/translate-sve.c