[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 20/22] target/arm: Use float*_maybe_ah_chs in sve_ftmad_*
From: |
Richard Henderson |
Subject: |
[PATCH 20/22] target/arm: Use float*_maybe_ah_chs in sve_ftmad_* |
Date: |
Mon, 27 Jan 2025 15:26:02 -0800 |
Since we know the operand is negative, absolute value
can be had by negating rather than abs per se.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
target/arm/tcg/sve_helper.c | 12 +++---------
1 file changed, 3 insertions(+), 9 deletions(-)
diff --git a/target/arm/tcg/sve_helper.c b/target/arm/tcg/sve_helper.c
index a2ff3b7f11..970947e1ca 100644
--- a/target/arm/tcg/sve_helper.c
+++ b/target/arm/tcg/sve_helper.c
@@ -5150,9 +5150,7 @@ void HELPER(sve_ftmad_h)(void *vd, void *vn, void *vm,
float16 mm = m[i];
intptr_t xx = x;
if (float16_is_neg(mm)) {
- if (!(fpcr_ah && float16_is_any_nan(mm))) {
- mm = float16_abs(mm);
- }
+ mm = float16_maybe_ah_chs(mm, fpcr_ah);
xx += 8;
}
d[i] = float16_muladd(n[i], mm, coeff[xx], 0, s);
@@ -5176,9 +5174,7 @@ void HELPER(sve_ftmad_s)(void *vd, void *vn, void *vm,
float32 mm = m[i];
intptr_t xx = x;
if (float32_is_neg(mm)) {
- if (!(fpcr_ah && float32_is_any_nan(mm))) {
- mm = float32_abs(mm);
- }
+ mm = float32_maybe_ah_chs(mm, fpcr_ah);
xx += 8;
}
d[i] = float32_muladd(n[i], mm, coeff[xx], 0, s);
@@ -5206,9 +5202,7 @@ void HELPER(sve_ftmad_d)(void *vd, void *vn, void *vm,
float64 mm = m[i];
intptr_t xx = x;
if (float64_is_neg(mm)) {
- if (!(fpcr_ah && float64_is_any_nan(mm))) {
- mm = float64_abs(mm);
- }
+ mm = float64_maybe_ah_chs(mm, fpcr_ah);
xx += 8;
}
d[i] = float64_muladd(n[i], mm, coeff[xx], 0, s);
--
2.43.0
- [PATCH 13/22] target/arm: Remove fp_status_a64, (continued)
- [PATCH 13/22] target/arm: Remove fp_status_a64, Richard Henderson, 2025/01/27
- [PATCH 15/22] target/arm: Simplify fp_status indexing in mve_helper.c, Richard Henderson, 2025/01/27
- [PATCH 12/22] target/arm: Remove fp_status_f16_a32, Richard Henderson, 2025/01/27
- [PATCH 14/22] target/arm: Remove fp_status_a32, Richard Henderson, 2025/01/27
- [PATCH 10/22] target/arm: Remove ah_fp_status, Richard Henderson, 2025/01/27
- [PATCH 11/22] target/arm: Remove fp_status_f16_a64, Richard Henderson, 2025/01/27
- [PATCH 19/22] target/arm: Use float*_maybe_ah_chs in sve_ftssel_*, Richard Henderson, 2025/01/27
- [PATCH 22/22] target/arm: Use flags for AH negation in do_fmla_zpzzz_*, Richard Henderson, 2025/01/27
- [PATCH 17/22] target/arm: Move float*_ah_chs to vec_internal.h, Richard Henderson, 2025/01/27
- [PATCH 21/22] target/arm: Use float*_maybe_ah_chs in sve_ftmad_*, Richard Henderson, 2025/01/27
- [PATCH 20/22] target/arm: Use float*_maybe_ah_chs in sve_ftmad_*,
Richard Henderson <=