]> git.ipfire.org Git - thirdparty/qemu.git/commit
target/arm: Handle FPCR.AH in negation step in SVE FMLS (vector)
authorPeter Maydell <peter.maydell@linaro.org>
Sat, 1 Feb 2025 16:39:46 +0000 (16:39 +0000)
committerPeter Maydell <peter.maydell@linaro.org>
Tue, 11 Feb 2025 16:22:07 +0000 (16:22 +0000)
commit51330e58480b05cd39a9b913be9f83a0530471cb
treeb5aea08d01ed7284940a68222453546ceaa877dd
parent1fae4f5e9f48f1620c20f33eb1c673276a301548
target/arm: Handle FPCR.AH in negation step in SVE FMLS (vector)

Handle the FPCR.AH "don't negate the sign of a NaN" semantics fro the
SVE FMLS (vector) insns, by providing new helpers for the AH=1 case
which end up passing fpcr_ah = true to the do_fmla_zpzzz_* functions
that do the work.

The float*_muladd functions have a flags argument that can
perform optional negation of various operand.  We don't use
that for "normal" arm fmla, because the muladd flags are not
applied when an input is a NaN.  But since FEAT_AFP does not
negate NaNs, this behaviour is exactly what we need.

The non-AH helpers pass in a zero flags argument and control the
negation via the neg1 and neg3 arguments; the AH helpers always pass
in neg1 and neg3 as zero and control the negation via the flags
argument.  This allows us to avoid conditional branches within the
inner loop.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
target/arm/tcg/helper-sve.h
target/arm/tcg/sve_helper.c
target/arm/tcg/translate-sve.c