Go to the source code of this file.
◆ USE_NATIVE_INT128
#define USE_NATIVE_INT128 0 |
◆ main()
int main |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
Definition at line 74 of file testint128.c.
75{
76 long count;
77
79
80 if (argc >= 2)
81 count = strtol(argv[1], NULL, 0);
82 else
83 count = 1000000000;
84
85 while (count-- > 0)
86 {
92
93
96 t2 = t1;
99
101 {
102 printf(
"%016lX%016lX + unsigned %lX\n",
x,
y, z);
105 return 1;
106 }
107
108
111 t2 = t1;
112 t1.
i128 += (int128) z;
114
116 {
117 printf(
"%016lX%016lX + signed %lX\n",
x,
y, z);
120 return 1;
121 }
122
123
124 t1.
i128 = (int128)
x * (int128)
y;
125
128
130 {
134 return 1;
135 }
136
137
142
145 {
146 printf(
"comparison failure: %d vs %d\n",
151 return 1;
152 }
153
154
156
159 {
160 printf(
"comparison failure: %d vs %d\n",
165 return 1;
166 }
167 }
168
169 return 0;
170}
static void int128_add_uint64(INT128 *i128, uint64 v)
static int int128_compare(INT128 x, INT128 y)
static void int128_add_int64(INT128 *i128, int64 v)
static void int128_add_int64_mul_int64(INT128 *i128, int64 x, int64 y)
uint64 pg_prng_uint64(pg_prng_state *state)
void pg_prng_seed(pg_prng_state *state, uint64 seed)
pg_prng_state pg_global_prng_state
static int my_int128_compare(int128 x, int128 y)
References test128::hi, test128::hl, test128::i128, test128::I128, int128_add_int64(), int128_add_int64_mul_int64(), int128_add_uint64(), int128_compare(), test128::lo, my_int128_compare(), pg_global_prng_state, pg_prng_seed(), pg_prng_uint64(), printf, x, and y.
◆ my_int128_compare()
static int my_int128_compare |
( |
int128 |
x, |
|
|
int128 |
y |
|
) |
| |
|
inlinestatic |
Definition at line 56 of file testint128.c.
57{
59 return -1;
61 return 1;
62 return 0;
63}
References x, and y.
Referenced by main().