On 5/19/26 09:23, Peter Maydell wrote:
Because we use either FPST_A64 or FPST_A64_F16 here, this doesn't handle the FPCR.AH = 1 case right. The pseudocode FPAbsMax squashes AH to 0, so it always has the behaviour of the "normal Arm" operations for things like what the default NaN value is and which NaN to propagate when both arguments are NaNs. FPST_A64 and FPST_A64_F16 for QEMU both change behaviour when FPCR.AH is set.I can't see an existing fp_status word that we have that has the desired "ignore AH even when AH is set" handling; a simple fix is: diff --git a/target/arm/tcg/vec_helper64.c b/target/arm/tcg/vec_helper64.c index 2f481ac489..fc2566bddd 100644 --- a/target/arm/tcg/vec_helper64.c +++ b/target/arm/tcg/vec_helper64.c @@ -8,6 +8,7 @@ #include "qemu/osdep.h" #include "cpu.h" +#include "internals.h" #include "helper.h" #include "helper-a64.h" #include "helper-sme.h" @@ -152,6 +153,7 @@ TYPE TYPE##_##NAME(TYPE a, TYPE b, float_status *s) \ float_status local = *s; \ set_flush_to_zero(0, &local); \ set_flush_inputs_to_zero(0, &local); \ + arm_set_default_fp_behaviours(&local); \ TYPE r = TYPE##_minmax(a, b, &local, MIN | float_minmax_ismag); \ if (!TYPE##_is_any_nan(r)) { \ r = TYPE##_abs(r); \
Thanks. I believe that leaves nothing of value in the local = *s copy, since minmax does no rounding. It would be clearer to have local = {} and drop the set_flush_* lines.
r~
