[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 10/17] target/hexagon: Use float32_muladd_scalbn for helper_sffma
From: |
Richard Henderson |
Subject: |
[PATCH 10/17] target/hexagon: Use float32_muladd_scalbn for helper_sffma_sc |
Date: |
Sun, 8 Dec 2024 16:48:37 -0600 |
This instruction has a special case that 0 * x + c returns c
without the normal sign folding that comes with 0 + -0.
Use the new float_muladd_suppress_add_product_zero to
describe this.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
target/hexagon/op_helper.c | 11 +++--------
1 file changed, 3 insertions(+), 8 deletions(-)
diff --git a/target/hexagon/op_helper.c b/target/hexagon/op_helper.c
index aa5ab4a31f..eb010422bf 100644
--- a/target/hexagon/op_helper.c
+++ b/target/hexagon/op_helper.c
@@ -1192,15 +1192,10 @@ static float32 check_nan(float32 dst, float32 x,
float_status *fp_status)
float32 HELPER(sffma_sc)(CPUHexagonState *env, float32 RxV,
float32 RsV, float32 RtV, float32 PuV)
{
- size4s_t tmp;
arch_fpop_start(env);
- RxV = check_nan(RxV, RxV, &env->fp_status);
- RxV = check_nan(RxV, RsV, &env->fp_status);
- RxV = check_nan(RxV, RtV, &env->fp_status);
- tmp = internal_fmafx(RsV, RtV, RxV, fSXTN(8, 64, PuV), &env->fp_status);
- if (!(float32_is_zero(RxV) && is_zero_prod(RsV, RtV))) {
- RxV = tmp;
- }
+ RxV = float32_muladd_scalbn(RsV, RtV, RxV, fSXTN(8, 64, PuV),
+ float_muladd_suppress_add_product_zero,
+ &env->fp_status);
arch_fpop_end(env);
return RxV;
}
--
2.43.0
- [PATCH 04/17] softfloat: Remove float_muladd_halve_result, (continued)
- [PATCH 04/17] softfloat: Remove float_muladd_halve_result, Richard Henderson, 2024/12/08
- [PATCH 07/17] target/hexagon: Use float32_mul in helper_sfmpy, Richard Henderson, 2024/12/08
- [PATCH 05/17] softfloat: Add float_round_nearest_even_max, Richard Henderson, 2024/12/08
- [PATCH 06/17] softfloat: Add float_muladd_suppress_add_product_zero, Richard Henderson, 2024/12/08
- [PATCH 08/17] target/hexagon: Use float32_muladd for helper_sffma, Richard Henderson, 2024/12/08
- [PATCH 09/17] target/hexagon: Use float32_muladd for helper_sffms, Richard Henderson, 2024/12/08
- [PATCH 10/17] target/hexagon: Use float32_muladd_scalbn for helper_sffma_sc,
Richard Henderson <=
- [PATCH 11/17] target/hexagon: Use float32_muladd for helper_sffm[as]_lib, Richard Henderson, 2024/12/08
- [PATCH 12/17] target/hexagon: Remove internal_fmafx, Richard Henderson, 2024/12/08
- [PATCH 13/17] target/hexagon: Expand GEN_XF_ROUND, Richard Henderson, 2024/12/08
- [PATCH 14/17] target/hexagon: Remove Float, Richard Henderson, 2024/12/08
- [PATCH 15/17] target/hexagon: Remove Double, Richard Henderson, 2024/12/08