[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 70/72] target/hexagon: Use mulu64 for int128_mul_6464
From: |
Richard Henderson |
Subject: |
[PULL 70/72] target/hexagon: Use mulu64 for int128_mul_6464 |
Date: |
Tue, 24 Dec 2024 12:05:19 -0800 |
No need to open-code 64x64->128-bit multiplication.
Reviewed-by: Brian Cain <brian.cain@oss.qualcomm.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
target/hexagon/fma_emu.c | 32 +++-----------------------------
1 file changed, 3 insertions(+), 29 deletions(-)
diff --git a/target/hexagon/fma_emu.c b/target/hexagon/fma_emu.c
index ddc793fe14..07d2880776 100644
--- a/target/hexagon/fma_emu.c
+++ b/target/hexagon/fma_emu.c
@@ -82,38 +82,12 @@ int32_t float32_getexp(float32 f32)
return -1;
}
-static uint32_t int128_getw0(Int128 x)
-{
- return int128_getlo(x);
-}
-
-static uint32_t int128_getw1(Int128 x)
-{
- return int128_getlo(x) >> 32;
-}
-
static Int128 int128_mul_6464(uint64_t ai, uint64_t bi)
{
- Int128 a, b;
- uint64_t pp0, pp1a, pp1b, pp1s, pp2;
+ uint64_t l, h;
- a = int128_make64(ai);
- b = int128_make64(bi);
- pp0 = (uint64_t)int128_getw0(a) * (uint64_t)int128_getw0(b);
- pp1a = (uint64_t)int128_getw1(a) * (uint64_t)int128_getw0(b);
- pp1b = (uint64_t)int128_getw1(b) * (uint64_t)int128_getw0(a);
- pp2 = (uint64_t)int128_getw1(a) * (uint64_t)int128_getw1(b);
-
- pp1s = pp1a + pp1b;
- if ((pp1s < pp1a) || (pp1s < pp1b)) {
- pp2 += (1ULL << 32);
- }
- uint64_t ret_low = pp0 + (pp1s << 32);
- if ((ret_low < pp0) || (ret_low < (pp1s << 32))) {
- pp2 += 1;
- }
-
- return int128_make128(ret_low, pp2 + (pp1s >> 32));
+ mulu64(&l, &h, ai, bi);
+ return int128_make128(l, h);
}
static Int128 int128_sub_borrow(Int128 a, Int128 b, int borrow)
--
2.43.0
- [PULL 53/72] tcg/optimize: Move fold_bitsel_vec into alphabetic sort, (continued)
- [PULL 53/72] tcg/optimize: Move fold_bitsel_vec into alphabetic sort, Richard Henderson, 2024/12/24
- [PULL 58/72] softfloat: Remove float_muladd_halve_result, Richard Henderson, 2024/12/24
- [PULL 60/72] softfloat: Add float_muladd_suppress_add_product_zero, Richard Henderson, 2024/12/24
- [PULL 61/72] target/hexagon: Use float32_mul in helper_sfmpy, Richard Henderson, 2024/12/24
- [PULL 64/72] target/hexagon: Use float32_muladd_scalbn for helper_sffma_sc, Richard Henderson, 2024/12/24
- [PULL 68/72] target/hexagon: Remove Float, Richard Henderson, 2024/12/24
- [PULL 44/72] tcg/optimize: Simplify sign bit test in fold_shift, Richard Henderson, 2024/12/24
- [PULL 56/72] target/arm: Use float*_muladd_scalbn, Richard Henderson, 2024/12/24
- [PULL 52/72] tcg/optimize: Re-enable sign-mask optimizations, Richard Henderson, 2024/12/24
- [PULL 69/72] target/hexagon: Remove Double, Richard Henderson, 2024/12/24
- [PULL 70/72] target/hexagon: Use mulu64 for int128_mul_6464,
Richard Henderson <=
- [PULL 51/72] tcg/optimize: Remove z_mask, s_mask from OptContext, Richard Henderson, 2024/12/24
- [PULL 67/72] target/hexagon: Expand GEN_XF_ROUND, Richard Henderson, 2024/12/24
- [PULL 72/72] accel/tcg: Move gen_intermediate_code to TCGCPUOps.translate_core, Richard Henderson, 2024/12/24
- [PULL 62/72] target/hexagon: Use float32_muladd for helper_sffma, Richard Henderson, 2024/12/24
- [PULL 63/72] target/hexagon: Use float32_muladd for helper_sffms, Richard Henderson, 2024/12/24
- [PULL 66/72] target/hexagon: Remove internal_fmafx, Richard Henderson, 2024/12/24
- [PULL 71/72] target/hexagon: Simplify internal_mpyhh setup, Richard Henderson, 2024/12/24
- [PULL 65/72] target/hexagon: Use float32_muladd for helper_sffm[as]_lib, Richard Henderson, 2024/12/24
- Re: [PULL 00/72] tcg patch queue, Stefan Hajnoczi, 2024/12/25