1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
| | #include <features.h>
#include <stdint.h>
#include <stdbool.h>
#include <stdarg.h>
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
|