1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21 #if defined(NEED_128)
22
23 # define cast_128(x) construct_128 ((uint64_t) (x).h, (x).l)
24 # define cast_s128(x) construct_s128 ((int64_t) (x).h, (x).l)
25
26 int test_math128(void);
27 bool iszero_128 (uint128 w);
28 bool isnonzero_128 (uint128 w);
29 bool iseq_128 (uint128 a, uint128 b);
30 bool isgt_128 (uint128 a, uint128 b);
31 bool islt_128 (uint128 a, uint128 b);
32 bool isge_128 (uint128 a, uint128 b);
33 bool islt_s128 (int128 a, int128 b);
34 bool isgt_s128 (int128 a, int128 b);
35 uint128 and_128 (uint128 a, uint128 b);
36 int128 and_s128 (int128 a, uint128 b);
37 uint128 or_128 (uint128 a, uint128 b);
38 uint128 xor_128 (uint128 a, uint128 b);
39 uint128 add_128 (uint128 a, uint128 b);
40 uint128 subtract_128 (uint128 a, uint128 b);
41 uint128 multiply_128 (uint128 a, uint128 b);
42 int128 multiply_s128 (int128 a, int128 b);
43 uint128 divide_128_16 (uint128 a, uint16_t b, uint16_t * rem);
44 uint128 divide_128_32 (uint128 a, uint32_t b, uint32_t * rem);
45 uint128 divide_128 (uint128 a, uint128 b, uint128 * rem);
46 uint128 complement_128 (uint128 a);
47 uint128 negate_128 (uint128 a);
48 int128 negate_s128 (int128 a);
49 uint128 lshift_128 (uint128 a, unsigned int n);
50 int128 lshift_s128 (int128 a, unsigned int n);
51 uint128 rshift_128 (uint128 a, unsigned int n);
52 int128 rshift_s128 (int128 a, unsigned int n);
53 #else
54
55 # if (__SIZEOF_LONG__ < 8) && ( !defined(__MINGW64__) || !defined(__MINGW32__) )
56
57 typedef int TItype __attribute__ ((mode (TI)));
58 typedef unsigned int UTItype __attribute__ ((mode (TI)));
59
60 typedef TItype __int128_t;
61 typedef UTItype __uint128_t;
62
63 # endif
64 #endif