1414#include " src/__support/CPP/limits.h"
1515#include " src/__support/CPP/optional.h"
1616#include " src/__support/CPP/type_traits.h"
17- #include " src/__support/macros/attributes.h" // LIBC_INLINE
18- #include " src/__support/macros/optimization.h" // LIBC_UNLIKELY
19- #include " src/__support/math_extras.h" // SumCarry, DiffBorrow
17+ #include " src/__support/macros/attributes.h" // LIBC_INLINE
18+ #include " src/__support/macros/optimization.h" // LIBC_UNLIKELY
19+ #include " src/__support/macros/properties/types.h" // LIBC_TYPES_HAS_INT128
20+ #include " src/__support/math_extras.h" // SumCarry, DiffBorrow
2021#include " src/__support/number_pair.h"
2122
2223#include < stddef.h> // For size_t
@@ -30,9 +31,9 @@ template <typename T> struct half_width;
3031template <> struct half_width <uint64_t > : cpp::type_identity<uint32_t > {};
3132template <> struct half_width <uint32_t > : cpp::type_identity<uint16_t > {};
3233template <> struct half_width <uint16_t > : cpp::type_identity<uint8_t > {};
33- #ifdef __SIZEOF_INT128__
34+ #ifdef LIBC_TYPES_HAS_INT128
3435template <> struct half_width <__uint128_t > : cpp::type_identity<uint64_t > {};
35- #endif // __SIZEOF_INT128__
36+ #endif // LIBC_TYPES_HAS_INT128
3637
3738template <typename T> using half_width_t = typename half_width<T>::type;
3839
@@ -69,7 +70,7 @@ LIBC_INLINE constexpr NumberPair<uint32_t> full_mul<uint32_t>(uint32_t a,
6970 return result;
7071}
7172
72- #ifdef __SIZEOF_INT128__
73+ #ifdef LIBC_TYPES_HAS_INT128
7374template <>
7475LIBC_INLINE constexpr NumberPair<uint64_t > full_mul<uint64_t >(uint64_t a,
7576 uint64_t b) {
@@ -79,7 +80,7 @@ LIBC_INLINE constexpr NumberPair<uint64_t> full_mul<uint64_t>(uint64_t a,
7980 result.hi = uint64_t (prod >> 64 );
8081 return result;
8182}
82- #endif // __SIZEOF_INT128__
83+ #endif // LIBC_TYPES_HAS_INT128
8384
8485} // namespace internal
8586
@@ -682,7 +683,7 @@ struct BigInt {
682683 val[1 ] = uint32_t (tmp >> 32 );
683684 return ;
684685 }
685- #ifdef __SIZEOF_INT128__
686+ #ifdef LIBC_TYPES_HAS_INT128
686687 if constexpr ((Bits == 128 ) && (WORD_SIZE == 64 )) {
687688 // Use builtin 128 bits if available;
688689 if (s >= 128 ) {
@@ -696,7 +697,7 @@ struct BigInt {
696697 val[1 ] = uint64_t (tmp >> 64 );
697698 return ;
698699 }
699- #endif // __SIZEOF_INT128__
700+ #endif // LIBC_TYPES_HAS_INT128
700701 if (LIBC_UNLIKELY (s == 0 ))
701702 return ;
702703
@@ -753,7 +754,7 @@ struct BigInt {
753754 val[1 ] = uint32_t (tmp >> 32 );
754755 return ;
755756 }
756- #ifdef __SIZEOF_INT128__
757+ #ifdef LIBC_TYPES_HAS_INT128
757758 if constexpr ((Bits == 128 ) && (WORD_SIZE == 64 )) {
758759 // Use builtin 128 bits if available;
759760 if (s >= 128 ) {
@@ -771,7 +772,7 @@ struct BigInt {
771772 val[1 ] = uint64_t (tmp >> 64 );
772773 return ;
773774 }
774- #endif // __SIZEOF_INT128__
775+ #endif // LIBC_TYPES_HAS_INT128
775776
776777 if (LIBC_UNLIKELY (s == 0 ))
777778 return ;
0 commit comments