#include #include #include #include typedef union uwide128 uwide128; union uwide128 { uint64_t v64[2]; uint32_t v32[4]; }; #define word64(X) (__BYTE_ORDER == __LITTLE_ENDIAN ? (X) : (2-(X))) #define lo64 word64(0) #define hi64 word64(1) #define word32(X) (__BYTE_ORDER == __LITTLE_ENDIAN ? (X) : (4-(X))) #define wo32_0 word32(0) #define wo32_1 word32(1) #define wo32_2 word32(2) #define wo32_3 word32(3) #define comp2(LO, HI) { { [lo64] = (LO), [hi64] = (HI), }, } #if __STDC_VERSION__ >= 202311L constexpr uwide128 __uwide128_max = { -1, -1, }; #define UWIDE128_MAX __uwide128_max #else #define UWIDE128_MAX ((void)0, (uwide128)comp2(-1, -1)) #endif static __inline uwide128 __uwide128_i64(int64_t a) __unsequenced; static __inline uwide128 __uwide128_u64(uint64_t a) __unsequenced; static __inline uwide128 __uwide128_i64(int64_t a) { return (uwide128)comp2(a, (a < 0) ? UINT64_MAX : 0); } static __inline uwide128 __uwide128_u64(uint64_t a) { return (uwide128)comp2(a, 0); } _Bool __uwide128_le(uwide128, uwide128) __unsequenced; // intscan _Bool __uwide128_iszero(uwide128) __unsequenced; // vfprintf uwide128 __uwide128_neg(uwide128) __unsequenced; // intscan uwide128 __uwide128_add(uwide128, uint8_t) __unsequenced; // intscan uwide128 __uwide128_sub(uwide128, uint8_t) __unsequenced; // intscan uwide128 __uwide128_mul(uwide128, uint8_t) __unsequenced; // intscan uint8_t __uwide128_div10(uwide128*); // vfprintf uint8_t __uwide128_div2(uwide128*); // vfprintf uint8_t __uwide128_div8(uwide128*); // vfprintf uint8_t __uwide128_div16(uwide128*); // vfprintf uwide128 __uwide128_pop(va_list *ap); // vfprintf uwide128 __uwide128_i64(int64_t); // vfprintf uwide128 __uwide128_u64(uint64_t); // vfprintf