aboutsummaryrefslogtreecommitdiff
path: root/libgcc/soft-fp/floatbitintdd.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2024-02-10 12:50:52 +0100
committerJakub Jelinek <jakub@redhat.com>2024-02-10 12:50:52 +0100
commitb2684e5512b097fbaa63dd18c35f8af4b351920c (patch)
tree518c686730121bc0969d28916fd46def4d925ab4 /libgcc/soft-fp/floatbitintdd.c
parent39920447f876128ff7942a9cd931021800865894 (diff)
downloadgcc-b2684e5512b097fbaa63dd18c35f8af4b351920c.zip
gcc-b2684e5512b097fbaa63dd18c35f8af4b351920c.tar.gz
gcc-b2684e5512b097fbaa63dd18c35f8af4b351920c.tar.bz2
libgcc: Fix BIL_TYPE_SIZE == 32 support in _BitInt <-> dfp support
I've tried last night to enable _BitInt support for i?86-linux, and a few spots in libgcc emitted -Wshift-count-overflow warnings and clearly didn't do what it was supposed to do. Fixed thusly. 2024-02-10 Jakub Jelinek <jakub@redhat.com> * soft-fp/fixddbitint.c (__bid_fixddbitint): Fix up BIL_TYPE_SIZE == 32 shifts. * soft-fp/fixsdbitint.c (__bid_fixsdbitint): Likewise. * soft-fp/fixtdbitint.c (__bid_fixtdbitint): Likewise. * soft-fp/floatbitintdd.c (__bid_floatbitintdd): Likewise. * soft-fp/floatbitinttd.c (__bid_floatbitinttd): Likewise.
Diffstat (limited to 'libgcc/soft-fp/floatbitintdd.c')
-rw-r--r--libgcc/soft-fp/floatbitintdd.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/libgcc/soft-fp/floatbitintdd.c b/libgcc/soft-fp/floatbitintdd.c
index 0fcc845..77c5fd7 100644
--- a/libgcc/soft-fp/floatbitintdd.c
+++ b/libgcc/soft-fp/floatbitintdd.c
@@ -132,7 +132,7 @@ __bid_floatbitintdd (const UBILtype *i, SItype iprec)
#if BIL_TYPE_SIZE == 64
m = buf[BITINT_END (1, 0)];
#elif BIL_TYPE_SIZE == 32
- m = ((UDItype) buf[1] << 32) | buf[BITINT_END (2, 0)];
+ m = (UDItype) buf[1] << 32 | buf[BITINT_END (2, 0)];
#else
# error Unsupported BIL_TYPE_SIZE
#endif
@@ -212,7 +212,8 @@ __bid_floatbitintdd (const UBILtype *i, SItype iprec)
mantissa = buf[q_limbs + pow10_limbs * 2 + 1];
#else
mantissa
- = ((buf[q_limbs + pow10_limbs * 2 + 1 + BITINT_END (0, 1)] << 32)
+ = ((UDItype)
+ buf[q_limbs + pow10_limbs * 2 + 1 + BITINT_END (0, 1)] << 32
| buf[q_limbs + pow10_limbs * 2 + 1 + BITINT_END (1, 0)]);
#endif
}
@@ -220,8 +221,7 @@ __bid_floatbitintdd (const UBILtype *i, SItype iprec)
#if BIL_TYPE_SIZE == 64
mantissa = buf[BITINT_END (1, 0)];
#else
- mantissa
- = ((buf[1] << 32) | buf[BITINT_END (2, 0)]);
+ mantissa = (UDItype) buf[1] << 32 | buf[BITINT_END (2, 0)];
#endif
}
else
@@ -232,7 +232,7 @@ __bid_floatbitintdd (const UBILtype *i, SItype iprec)
if (in == 1)
mantissa = iprec < 0 ? (UDItype) (BILtype) msb : (UDItype) msb;
else
- mantissa = ((msb << 32) | i[BITINT_END (1, 0)]);
+ mantissa = (UDItype) msb << 32 | i[BITINT_END (1, 0)];
#endif
if (iprec < 0)
mantissa = -mantissa;