]> git.ipfire.org Git - thirdparty/qemu.git/commit
fpu: Implement float_flag_input_denormal_used
authorPeter Maydell <peter.maydell@linaro.org>
Sat, 1 Feb 2025 16:39:07 +0000 (16:39 +0000)
committerPeter Maydell <peter.maydell@linaro.org>
Tue, 11 Feb 2025 16:22:07 +0000 (16:22 +0000)
commit029a2083a293f55b7b3d56e16b1546c882d9299c
tree317c5935030480643acf555a16261ff8a02d252c
parent7ad6a567570ed8cd829c4f05a006e2ba2c86fa4a
fpu: Implement float_flag_input_denormal_used

For the x86 and the Arm FEAT_AFP semantics, we need to be able to
tell the target code that the FPU operation has used an input
denormal.  Implement this; when it happens we set the new
float_flag_denormal_input_used.

Note that we only set this when an input denormal is actually used by
the operation: if the operation results in Invalid Operation or
Divide By Zero or the result is a NaN because some other input was a
NaN then we never needed to look at the input denormal and do not set
denormal_input_used.

We mostly do not need to adjust the hardfloat codepaths to deal with
this flag, because almost all hardfloat operations are already gated
on the input not being a denormal, and will fall back to softfloat
for a denormal input.  The only exception is the comparison
operations, where we need to add the check for input denormals, which
must now fall back to softfloat where they did not before.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
fpu/softfloat-parts.c.inc
fpu/softfloat.c
include/fpu/softfloat-types.h