From b2684e5512b097fbaa63dd18c35f8af4b351920c Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Sat, 10 Feb 2024 12:50:52 +0100 Subject: 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 * 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. --- libgcc/soft-fp/fixtdbitint.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libgcc/soft-fp/fixtdbitint.c') diff --git a/libgcc/soft-fp/fixtdbitint.c b/libgcc/soft-fp/fixtdbitint.c index 6d33ec2..66aca1c 100644 --- a/libgcc/soft-fp/fixtdbitint.c +++ b/libgcc/soft-fp/fixtdbitint.c @@ -126,9 +126,9 @@ __bid_fixtdbitint (UBILtype *r, SItype rprec, _Decimal128 a) mantissalo = limbs[BITINT_END (5, 4)]; rem = limbs[6] | limbs[7]; #elif BIL_TYPE_SIZE == 32 - mantissahi = limbs[BITINT_END (8, 11)] << 32; + mantissahi = (UDItype) limbs[BITINT_END (8, 11)] << 32; mantissahi |= limbs[BITINT_END (9, 10)]; - mantissalo = limbs[BITINT_END (10, 9)] << 32; + mantissalo = (UDItype) limbs[BITINT_END (10, 9)] << 32; mantissalo |= limbs[BITINT_END (11, 8)]; rem = limbs[12] | limbs[13] | limbs[14] | limbs[15]; #endif -- cgit v1.1