[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 38/46] softfloat: Use mulu64 for mul64To128
From: |
Richard Henderson |
Subject: |
[PULL 38/46] softfloat: Use mulu64 for mul64To128 |
Date: |
Sun, 16 May 2021 07:34:23 -0500 |
Via host-utils.h, we use a host widening multiply for
64-bit hosts, and a common subroutine for 32-bit hosts.
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: David Hildenbrand <david@redhat.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
include/fpu/softfloat-macros.h | 23 +++--------------------
1 file changed, 3 insertions(+), 20 deletions(-)
diff --git a/include/fpu/softfloat-macros.h b/include/fpu/softfloat-macros.h
index 2e3760a9c1..f6dfbe108d 100644
--- a/include/fpu/softfloat-macros.h
+++ b/include/fpu/softfloat-macros.h
@@ -470,27 +470,10 @@ static inline void sub192(uint64_t a0, uint64_t a1,
uint64_t a2,
| `z0Ptr' and `z1Ptr'.
*----------------------------------------------------------------------------*/
-static inline void mul64To128( uint64_t a, uint64_t b, uint64_t *z0Ptr,
uint64_t *z1Ptr )
+static inline void
+mul64To128(uint64_t a, uint64_t b, uint64_t *z0Ptr, uint64_t *z1Ptr)
{
- uint32_t aHigh, aLow, bHigh, bLow;
- uint64_t z0, zMiddleA, zMiddleB, z1;
-
- aLow = a;
- aHigh = a>>32;
- bLow = b;
- bHigh = b>>32;
- z1 = ( (uint64_t) aLow ) * bLow;
- zMiddleA = ( (uint64_t) aLow ) * bHigh;
- zMiddleB = ( (uint64_t) aHigh ) * bLow;
- z0 = ( (uint64_t) aHigh ) * bHigh;
- zMiddleA += zMiddleB;
- z0 += ( ( (uint64_t) ( zMiddleA < zMiddleB ) )<<32 ) + ( zMiddleA>>32 );
- zMiddleA <<= 32;
- z1 += zMiddleA;
- z0 += ( z1 < zMiddleA );
- *z1Ptr = z1;
- *z0Ptr = z0;
-
+ mulu64(z1Ptr, z0Ptr, a, b);
}
/*----------------------------------------------------------------------------
--
2.25.1
- [PULL 07/46] softfloat: Inline float_raise, (continued)
- [PULL 07/46] softfloat: Inline float_raise, Richard Henderson, 2021/05/16
- [PULL 31/46] softfloat: Move sf_canonicalize to softfloat-parts.c.inc, Richard Henderson, 2021/05/16
- [PULL 22/46] softfloat: Use pointers with ftype_unpack_canonical, Richard Henderson, 2021/05/16
- [PULL 26/46] softfloat: Convert float128_silence_nan to parts, Richard Henderson, 2021/05/16
- [PULL 25/46] softfloat: Rearrange FloatParts64, Richard Henderson, 2021/05/16
- [PULL 24/46] softfloat: Use pointers with parts_silence_nan, Richard Henderson, 2021/05/16
- [PULL 28/46] softfloat: Move return_nan to softfloat-parts.c.inc, Richard Henderson, 2021/05/16
- [PULL 21/46] softfloat: Use pointers with ftype_pack_raw, Richard Henderson, 2021/05/16
- [PULL 30/46] softfloat: Move pick_nan_muladd to softfloat-parts.c.inc, Richard Henderson, 2021/05/16
- [PULL 34/46] softfloat: Move addsub_floats to softfloat-parts.c.inc, Richard Henderson, 2021/05/16
- [PULL 38/46] softfloat: Use mulu64 for mul64To128,
Richard Henderson <=
- [PULL 27/46] softfloat: Convert float128_default_nan to parts, Richard Henderson, 2021/05/16
- [PULL 35/46] softfloat: Implement float128_add/sub via parts, Richard Henderson, 2021/05/16
- [PULL 37/46] softfloat: Move muladd_floats to softfloat-parts.c.inc, Richard Henderson, 2021/05/16
- [PULL 32/46] softfloat: Move round_canonical to softfloat-parts.c.inc, Richard Henderson, 2021/05/16
- [PULL 39/46] softfloat: Use add192 in mul128To256, Richard Henderson, 2021/05/16
- [PULL 36/46] softfloat: Move mul_floats to softfloat-parts.c.inc, Richard Henderson, 2021/05/16
- [PULL 41/46] softfloat: Introduce sh[lr]_double primitives, Richard Henderson, 2021/05/16
- [PULL 40/46] softfloat: Tidy mul128By64To192, Richard Henderson, 2021/05/16
- [PULL 42/46] softfloat: Move div_floats to softfloat-parts.c.inc, Richard Henderson, 2021/05/16