On 2/1/25 08:39, Peter Maydell wrote:
The negation steps in FCADD must honour FPCR.AH's "don't change the
sign of a NaN" semantics.  Implement this in the same way we did for
the base ASIMD FCADD, by encoding FPCR.AH into the SIMD data field
passed to the helper and using that to decide whether to negate the
values.

The construction of neg_imag and neg_real were done to make it easy
to apply both in parallel with two simple logical operations.  This
changed with FPCR.AH, which is more complex than that. Switch to
an approach that follows the pseudocode more closely, by extracting
the 'rot=1' parameter from the SIMD data field and changing the
sign of the appropriate input value.

Note that there was a naming issue with neg_imag and neg_real.
They were named backward, with neg_imag being non-zero for rot=1,
and vice versa.  This was combined with reversed usage within the
loop, so that the negation in the end turned out correct.

Signed-off-by: Peter Maydell<peter.mayd...@linaro.org>
---
v2: Squashed in changes from RTH's patchset
---
  target/arm/tcg/vec_internal.h  | 17 ++++++++++++++
  target/arm/tcg/sve_helper.c    | 42 ++++++++++++++++++++++++----------
  target/arm/tcg/translate-sve.c |  2 +-
  3 files changed, 48 insertions(+), 13 deletions(-)

Reviewed-by: Richard Henderson <richard.hender...@linaro.org>

r~

Reply via email to