[PATCH] longlong.h: loongarch64: replace unsigned __int128__ with __uint128_t
Yao Zi
ziyao at disroot.org
Sat Feb 1 08:25:01 CET 2025
On Fri, Jan 31, 2025 at 10:42:09PM +0100, Marc Glisse wrote:
> Hi,
>
> would it work for you if I replaced __int128__ with __int128, i.e. the name
> that gcc documents at
> https://gcc.gnu.org/onlinedocs/gcc/_005f_005fint128.html ? I think clang
> handles that fine.
Oops, I found out why. GCC 14 complains about usage of __int128 with our
default build configuration while Clang doesn't.
../longlong.h:1165:22: warning: ISO C does not support '__int128' types [-Wpedantic]
1165 | (w1) = (unsigned __int128) __u * __v >> 64; \
| ^~~~~~~~
dive_1.c:117:11: note: in expansion of macro 'umul_ppmm'
117 | umul_ppmm (h, dummy, l, divisor);
| ^~~~~~~~~
> On Sat, 23 Nov 2024, Yao Zi wrote:
>
> > # HG changeset patch
> > # User Yao Zi <ziyao at disroot.org>
> > # Date 1732371310 -28800
> > # Sat Nov 23 22:15:10 2024 +0800
> > # Node ID e2b6d6999ac46ca8e1296343a9a7c7e2293664ff
> > # Parent 6df5dd697f5a547d8ac172efbace161914e23f78
> > longlong.h: loongarch64: replace unsigned __int128__ with __uint128_t
> >
> > Both as compiler extensions, __uint128_t is supported more widely than
> > unsigned __int128__. This change enables gmp to build with Clang 19.
> >
> > diff -r 6df5dd697f5a -r e2b6d6999ac4 longlong.h
> > --- a/longlong.h Fri Oct 18 19:16:58 2024 +0200
> > +++ b/longlong.h Sat Nov 23 22:15:10 2024 +0800
> > @@ -1162,7 +1162,7 @@
> > do { \
> > UDItype __u = (u), __v = (v); \
> > (w0) = __u * __v; \
> > - (w1) = (unsigned __int128__) __u * __v >> 64; \
> > + (w1) = (__uint128_t) __u * __v >> 64; \
> > } while (0)
> > #endif
> >
> >
> >
> > _______________________________________________
> > gmp-devel mailing list
> > gmp-devel at gmplib.org
> > https://gmplib.org/mailman/listinfo/gmp-devel
>
> --
> Marc Glisse
Thanks,
Yao Zi
More information about the gmp-devel
mailing list