From: H.J. Lu Date: Sat, 29 Nov 2025 03:33:56 +0000 (+0800) Subject: int128: Check BITS_PER_MP_LIMB == 32 instead of __WORDSIZE == 32 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=762bb01d4e8279ca7e48f1f1f526e0506ac4c18b;p=thirdparty%2Fglibc.git int128: Check BITS_PER_MP_LIMB == 32 instead of __WORDSIZE == 32 commit 8cd6efca5b3796193ef3ff60d9dbf6e5572b2b73 Author: Adhemerval Zanella Date: Thu Nov 20 15:30:06 2025 -0300 Add add_ssaaaa and sub_ssaaaa to gmp-arch.h checks __WORDSIZE == 32 to decide if int128 should be used, which breaks x32 which has int128 and __WORDSIZE == 32. Check BITS_PER_MP_LIMB == 32, instead of __WORDSIZE == 32. This fixes BZ #33677. Tested on x32, x86-64 and i686. Signed-off-by: H.J. Lu Reviewed-by: Adhemerval Zanella --- diff --git a/sysdeps/generic/gmp-arch.h b/sysdeps/generic/gmp-arch.h index b3004c90ed..547620da49 100644 --- a/sysdeps/generic/gmp-arch.h +++ b/sysdeps/generic/gmp-arch.h @@ -43,7 +43,7 @@ ll_highpart (mp_limb_t t) static __always_inline void umul_ppmm_generic (mp_limb_t *w1, mp_limb_t *w0, mp_limb_t u, mp_limb_t v) { -#if __WORDSIZE == 32 +#if BITS_PER_MP_LIMB == 32 uint64_t t0 = (uint64_t)u * v; *w1 = t0 >> 32; *w0 = t0; @@ -131,7 +131,7 @@ static __always_inline void add_ssaaaa_generic (mp_limb_t *sh, mp_limb_t *sl, mp_limb_t ah, mp_limb_t al, mp_limb_t bh, mp_limb_t bl) { -#if __WORDSIZE == 32 +#if BITS_PER_MP_LIMB == 32 uint64_t a = (uint64_t)ah << 32 | al; uint64_t b = (uint64_t)bh << 32 | bl; uint64_t r = a + b; @@ -157,7 +157,7 @@ static __always_inline void sub_ddmmss_generic (mp_limb_t *sh, mp_limb_t *sl, mp_limb_t ah, mp_limb_t al, mp_limb_t bh, mp_limb_t bl) { -#if __WORDSIZE == 32 +#if BITS_PER_MP_LIMB == 32 uint64_t a = (uint64_t)ah << 32 | al; uint64_t b = (uint64_t)bh << 32 | bl; uint64_t r = a - b;