On 2/1/25 08:39, Peter Maydell wrote:
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.mayd...@linaro.org>
---
v2: drop the now-unnecessary float*_input_flush2() calls in
the float*_hs_compare() functions
---
include/fpu/softfloat-types.h | 7 ++++
fpu/softfloat.c | 38 +++++++++++++++++---
fpu/softfloat-parts.c.inc | 68 ++++++++++++++++++++++++++++++++++-
3 files changed, 107 insertions(+), 6 deletions(-)
Reviewed-by: Richard Henderson <richard.hender...@linaro.org>
r~