Mark __int128 as extension

This commit is contained in:
Andrew Johnson 2024-06-23 15:21:57 +03:00
parent 5a6dea3195
commit 6d628d60e3
2 changed files with 7 additions and 6 deletions

View file

@ -5365,19 +5365,20 @@ int bf_acos(bf_t *r, const bf_t *a, limb_t prec, bf_flags_t flags)
#if LIMB_BITS == 64 #if LIMB_BITS == 64
/* Note: we assume __int128 is available */ /* Note: we assume __int128 is available */
/* uint128_t defined in libbf.h */
#define muldq(r1, r0, a, b) \ #define muldq(r1, r0, a, b) \
do { \ do { \
unsigned __int128 __t; \ uint128_t __t; \
__t = (unsigned __int128)(a) * (unsigned __int128)(b); \ __t = (uint128_t)(a) * (uint128_t)(b); \
r0 = __t; \ r0 = __t; \
r1 = __t >> 64; \ r1 = __t >> 64; \
} while (0) } while (0)
#define divdq(q, r, a1, a0, b) \ #define divdq(q, r, a1, a0, b) \
do { \ do { \
unsigned __int128 __t; \ uint128_t __t; \
limb_t __b = (b); \ limb_t __b = (b); \
__t = ((unsigned __int128)(a1) << 64) | (a0); \ __t = ((uint128_t)(a1) << 64) | (a0); \
q = __t / __b; \ q = __t / __b; \
r = __t % __b; \ r = __t % __b; \
} while (0) } while (0)

View file

@ -36,8 +36,8 @@
#define LIMB_BITS (1 << LIMB_LOG2_BITS) #define LIMB_BITS (1 << LIMB_LOG2_BITS)
#if LIMB_BITS == 64 #if LIMB_BITS == 64
typedef __int128 int128_t; __extension__ typedef __int128 int128_t;
typedef unsigned __int128 uint128_t; __extension__ typedef unsigned __int128 uint128_t;
typedef int64_t slimb_t; typedef int64_t slimb_t;
typedef uint64_t limb_t; typedef uint64_t limb_t;
typedef uint128_t dlimb_t; typedef uint128_t dlimb_t;