2 #include "i64operations.h"
4 int64_t tval_a = 1234567890003LL;
5 int64_t tval_b = 2345678901235LL;
6 int64_t tval_c = 1234567890001LL;
7 int64_t tval_d = 10001LL;
8 int64_t tval_e = 10000LL;
9 uint64_t tval_f = 0xffffff0750135eb9;
11 /* ~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~- */
14 i64_eq(int64_t a, int64_t b)
20 i64_neq(int64_t a, int64_t b)
26 i64_gt(int64_t a, int64_t b)
32 i64_le(int64_t a, int64_t b)
38 i64_ge(int64_t a, int64_t b) {
43 i64_lt(int64_t a, int64_t b) {
48 i64_uge(uint64_t a, uint64_t b)
54 i64_ult(uint64_t a, uint64_t b)
60 i64_ugt(uint64_t a, uint64_t b)
66 i64_ule(uint64_t a, uint64_t b)
72 i64_eq_select(int64_t a, int64_t b, int64_t c, int64_t d)
74 return ((a == b) ? c : d);
78 i64_neq_select(int64_t a, int64_t b, int64_t c, int64_t d)
80 return ((a != b) ? c : d);
84 i64_gt_select(int64_t a, int64_t b, int64_t c, int64_t d) {
85 return ((a > b) ? c : d);
89 i64_le_select(int64_t a, int64_t b, int64_t c, int64_t d) {
90 return ((a <= b) ? c : d);
94 i64_ge_select(int64_t a, int64_t b, int64_t c, int64_t d) {
95 return ((a >= b) ? c : d);
99 i64_lt_select(int64_t a, int64_t b, int64_t c, int64_t d) {
100 return ((a < b) ? c : d);
104 i64_ugt_select(uint64_t a, uint64_t b, uint64_t c, uint64_t d)
106 return ((a > b) ? c : d);
110 i64_ule_select(uint64_t a, uint64_t b, uint64_t c, uint64_t d)
112 return ((a <= b) ? c : d);
116 i64_uge_select(uint64_t a, uint64_t b, uint64_t c, uint64_t d) {
117 return ((a >= b) ? c : d);
121 i64_ult_select(uint64_t a, uint64_t b, uint64_t c, uint64_t d) {
122 return ((a < b) ? c : d);
125 /* ~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~- */
127 struct harness_int64_pred int64_tests_eq[] = {
128 {"a %s a", &tval_a, &tval_a, &tval_c, &tval_d, TRUE_VAL, &tval_c},
129 {"a %s b", &tval_a, &tval_b, &tval_c, &tval_d, FALSE_VAL, &tval_d},
130 {"a %s c", &tval_a, &tval_c, &tval_c, &tval_d, FALSE_VAL, &tval_d},
131 {"d %s e", &tval_d, &tval_e, &tval_c, &tval_d, FALSE_VAL, &tval_d},
132 {"e %s e", &tval_e, &tval_e, &tval_c, &tval_d, TRUE_VAL, &tval_c}
135 struct harness_int64_pred int64_tests_neq[] = {
136 {"a %s a", &tval_a, &tval_a, &tval_c, &tval_d, FALSE_VAL, &tval_d},
137 {"a %s b", &tval_a, &tval_b, &tval_c, &tval_d, TRUE_VAL, &tval_c},
138 {"a %s c", &tval_a, &tval_c, &tval_c, &tval_d, TRUE_VAL, &tval_c},
139 {"d %s e", &tval_d, &tval_e, &tval_c, &tval_d, TRUE_VAL, &tval_c},
140 {"e %s e", &tval_e, &tval_e, &tval_c, &tval_d, FALSE_VAL, &tval_d}
143 struct harness_int64_pred int64_tests_sgt[] = {
144 {"a %s a", &tval_a, &tval_a, &tval_c, &tval_d, FALSE_VAL, &tval_d},
145 {"a %s b", &tval_a, &tval_b, &tval_c, &tval_d, FALSE_VAL, &tval_d},
146 {"a %s c", &tval_a, &tval_c, &tval_c, &tval_d, TRUE_VAL, &tval_c},
147 {"d %s e", &tval_d, &tval_e, &tval_c, &tval_d, TRUE_VAL, &tval_c},
148 {"e %s e", &tval_e, &tval_e, &tval_c, &tval_d, FALSE_VAL, &tval_d}
151 struct harness_int64_pred int64_tests_sle[] = {
152 {"a %s a", &tval_a, &tval_a, &tval_c, &tval_d, TRUE_VAL, &tval_c},
153 {"a %s b", &tval_a, &tval_b, &tval_c, &tval_d, TRUE_VAL, &tval_c},
154 {"a %s c", &tval_a, &tval_c, &tval_c, &tval_d, FALSE_VAL, &tval_d},
155 {"d %s e", &tval_d, &tval_e, &tval_c, &tval_d, FALSE_VAL, &tval_d},
156 {"e %s e", &tval_e, &tval_e, &tval_c, &tval_d, TRUE_VAL, &tval_c}
159 struct harness_int64_pred int64_tests_sge[] = {
160 {"a %s a", &tval_a, &tval_a, &tval_c, &tval_d, TRUE_VAL, &tval_c},
161 {"a %s b", &tval_a, &tval_b, &tval_c, &tval_d, FALSE_VAL, &tval_d},
162 {"a %s c", &tval_a, &tval_c, &tval_c, &tval_d, TRUE_VAL, &tval_c},
163 {"d %s e", &tval_d, &tval_e, &tval_c, &tval_d, TRUE_VAL, &tval_c},
164 {"e %s e", &tval_e, &tval_e, &tval_c, &tval_d, TRUE_VAL, &tval_c}
167 struct harness_int64_pred int64_tests_slt[] = {
168 {"a %s a", &tval_a, &tval_a, &tval_c, &tval_d, FALSE_VAL, &tval_d},
169 {"a %s b", &tval_a, &tval_b, &tval_c, &tval_d, TRUE_VAL, &tval_c},
170 {"a %s c", &tval_a, &tval_c, &tval_c, &tval_d, FALSE_VAL, &tval_d},
171 {"d %s e", &tval_d, &tval_e, &tval_c, &tval_d, FALSE_VAL, &tval_d},
172 {"e %s e", &tval_e, &tval_e, &tval_c, &tval_d, FALSE_VAL, &tval_d}
175 struct int64_pred_s int64_preds[] = {
176 {"eq", i64_eq, i64_eq_select,
177 int64_tests_eq, ARR_SIZE(int64_tests_eq)},
178 {"neq", i64_neq, i64_neq_select,
179 int64_tests_neq, ARR_SIZE(int64_tests_neq)},
180 {"gt", i64_gt, i64_gt_select,
181 int64_tests_sgt, ARR_SIZE(int64_tests_sgt)},
182 {"le", i64_le, i64_le_select,
183 int64_tests_sle, ARR_SIZE(int64_tests_sle)},
184 {"ge", i64_ge, i64_ge_select,
185 int64_tests_sge, ARR_SIZE(int64_tests_sge)},
186 {"lt", i64_lt, i64_lt_select,
187 int64_tests_slt, ARR_SIZE(int64_tests_slt)}
190 /* ~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~- */
192 struct harness_uint64_pred uint64_tests_ugt[] = {
193 {"a %s a", (uint64_t *) &tval_a, (uint64_t *) &tval_a, (uint64_t *) &tval_c,
194 (uint64_t *) &tval_d, FALSE_VAL, (uint64_t *) &tval_d},
195 {"a %s b", (uint64_t *) &tval_a, (uint64_t *) &tval_b, (uint64_t *) &tval_c,
196 (uint64_t *) &tval_d, FALSE_VAL, (uint64_t *) &tval_d },
197 {"a %s c", (uint64_t *) &tval_a, (uint64_t *) &tval_c, (uint64_t *) &tval_c,
198 (uint64_t *) &tval_d, TRUE_VAL, (uint64_t *) &tval_c },
199 {"d %s e", (uint64_t *) &tval_d, (uint64_t *) &tval_e, (uint64_t *) &tval_c,
200 (uint64_t *) &tval_d, TRUE_VAL, (uint64_t *) &tval_c },
201 {"e %s e", (uint64_t *) &tval_e, (uint64_t *) &tval_e, (uint64_t *) &tval_c,
202 (uint64_t *) &tval_d, FALSE_VAL, (uint64_t *) &tval_d }
205 struct harness_uint64_pred uint64_tests_ule[] = {
206 {"a %s a", (uint64_t *) &tval_a, (uint64_t *) &tval_a, (uint64_t *) &tval_c,
207 (uint64_t *) &tval_d, TRUE_VAL, (uint64_t *) &tval_c},
208 {"a %s b", (uint64_t *) &tval_a, (uint64_t *) &tval_b, (uint64_t *) &tval_c,
209 (uint64_t *) &tval_d, TRUE_VAL, (uint64_t *) &tval_c},
210 {"a %s c", (uint64_t *) &tval_a, (uint64_t *) &tval_c, (uint64_t *) &tval_c,
211 (uint64_t *) &tval_d, FALSE_VAL, (uint64_t *) &tval_d},
212 {"d %s e", (uint64_t *) &tval_d, (uint64_t *) &tval_e, (uint64_t *) &tval_c,
213 (uint64_t *) &tval_d, FALSE_VAL, (uint64_t *) &tval_d},
214 {"e %s e", (uint64_t *) &tval_e, (uint64_t *) &tval_e, (uint64_t *) &tval_c,
215 (uint64_t *) &tval_d, TRUE_VAL, (uint64_t *) &tval_c}
218 struct harness_uint64_pred uint64_tests_uge[] = {
219 {"a %s a", (uint64_t *) &tval_a, (uint64_t *) &tval_a, (uint64_t *) &tval_c,
220 (uint64_t *) &tval_d, TRUE_VAL, (uint64_t *) &tval_c},
221 {"a %s b", (uint64_t *) &tval_a, (uint64_t *) &tval_b, (uint64_t *) &tval_c,
222 (uint64_t *) &tval_d, FALSE_VAL, (uint64_t *) &tval_d},
223 {"a %s c", (uint64_t *) &tval_a, (uint64_t *) &tval_c, (uint64_t *) &tval_c,
224 (uint64_t *) &tval_d, TRUE_VAL, (uint64_t *) &tval_c},
225 {"d %s e", (uint64_t *) &tval_d, (uint64_t *) &tval_e, (uint64_t *) &tval_c,
226 (uint64_t *) &tval_d, TRUE_VAL, (uint64_t *) &tval_c},
227 {"e %s e", (uint64_t *) &tval_e, (uint64_t *) &tval_e, (uint64_t *) &tval_c,
228 (uint64_t *) &tval_d, TRUE_VAL, (uint64_t *) &tval_c}
231 struct harness_uint64_pred uint64_tests_ult[] = {
232 {"a %s a", (uint64_t *) &tval_a, (uint64_t *) &tval_a, (uint64_t *) &tval_c,
233 (uint64_t *) &tval_d, FALSE_VAL, (uint64_t *) &tval_d},
234 {"a %s b", (uint64_t *) &tval_a, (uint64_t *) &tval_b, (uint64_t *) &tval_c,
235 (uint64_t *) &tval_d, TRUE_VAL, (uint64_t *) &tval_c},
236 {"a %s c", (uint64_t *) &tval_a, (uint64_t *) &tval_c, (uint64_t *) &tval_c,
237 (uint64_t *) &tval_d, FALSE_VAL, (uint64_t *) &tval_d},
238 {"d %s e", (uint64_t *) &tval_d, (uint64_t *) &tval_e, (uint64_t *) &tval_c,
239 (uint64_t *) &tval_d, FALSE_VAL, (uint64_t *) &tval_d},
240 {"e %s e", (uint64_t *) &tval_e, (uint64_t *) &tval_e, (uint64_t *) &tval_c,
241 (uint64_t *) &tval_d, FALSE_VAL, (uint64_t *) &tval_d}
244 struct uint64_pred_s uint64_preds[] = {
245 {"ugt", i64_ugt, i64_ugt_select,
246 uint64_tests_ugt, ARR_SIZE(uint64_tests_ugt)},
247 {"ule", i64_ule, i64_ule_select,
248 uint64_tests_ule, ARR_SIZE(uint64_tests_ule)},
249 {"uge", i64_uge, i64_uge_select,
250 uint64_tests_uge, ARR_SIZE(uint64_tests_uge)},
251 {"ult", i64_ult, i64_ult_select,
252 uint64_tests_ult, ARR_SIZE(uint64_tests_ult)}
256 compare_expect_int64(const struct int64_pred_s * pred)
260 for (j = 0; j < pred->n_tests; ++j) {
263 pred_result = (*pred->predfunc) (*pred->tests[j].lhs, *pred->tests[j].rhs);
265 if (pred_result != pred->tests[j].expected) {
268 sprintf(str, pred->tests[j].fmt_string, pred->name);
269 printf("%s: returned value is %d, expecting %d\n", str,
270 pred_result, pred->tests[j].expected);
271 printf(" lhs = %19lld (0x%016llx)\n", *pred->tests[j].lhs,
272 *pred->tests[j].lhs);
273 printf(" rhs = %19lld (0x%016llx)\n", *pred->tests[j].rhs,
274 *pred->tests[j].rhs);
279 selresult = (pred->selfunc) (*pred->tests[j].lhs, *pred->tests[j].rhs,
280 *pred->tests[j].select_a,
281 *pred->tests[j].select_b);
283 if (selresult != *pred->tests[j].select_expected) {
286 sprintf(str, pred->tests[j].fmt_string, pred->name);
287 printf("%s select: returned value is %d, expecting %d\n", str,
288 pred_result, pred->tests[j].expected);
289 printf(" lhs = %19lld (0x%016llx)\n", *pred->tests[j].lhs,
290 *pred->tests[j].lhs);
291 printf(" rhs = %19lld (0x%016llx)\n", *pred->tests[j].rhs,
292 *pred->tests[j].rhs);
293 printf(" true = %19lld (0x%016llx)\n", *pred->tests[j].select_a,
294 *pred->tests[j].select_a);
295 printf(" false = %19lld (0x%016llx)\n", *pred->tests[j].select_b,
296 *pred->tests[j].select_b);
302 printf(" %d tests performed, should be %d.\n", j, pred->n_tests);
308 compare_expect_uint64(const struct uint64_pred_s * pred)
312 for (j = 0; j < pred->n_tests; ++j) {
315 pred_result = (*pred->predfunc) (*pred->tests[j].lhs, *pred->tests[j].rhs);
316 if (pred_result != pred->tests[j].expected) {
319 sprintf(str, pred->tests[j].fmt_string, pred->name);
320 printf("%s: returned value is %d, expecting %d\n", str,
321 pred_result, pred->tests[j].expected);
322 printf(" lhs = %19llu (0x%016llx)\n", *pred->tests[j].lhs,
323 *pred->tests[j].lhs);
324 printf(" rhs = %19llu (0x%016llx)\n", *pred->tests[j].rhs,
325 *pred->tests[j].rhs);
330 selresult = (pred->selfunc) (*pred->tests[j].lhs, *pred->tests[j].rhs,
331 *pred->tests[j].select_a,
332 *pred->tests[j].select_b);
333 if (selresult != *pred->tests[j].select_expected) {
336 sprintf(str, pred->tests[j].fmt_string, pred->name);
337 printf("%s select: returned value is %d, expecting %d\n", str,
338 pred_result, pred->tests[j].expected);
339 printf(" lhs = %19llu (0x%016llx)\n", *pred->tests[j].lhs,
340 *pred->tests[j].lhs);
341 printf(" rhs = %19llu (0x%016llx)\n", *pred->tests[j].rhs,
342 *pred->tests[j].rhs);
343 printf(" true = %19llu (0x%016llx)\n", *pred->tests[j].select_a,
344 *pred->tests[j].select_a);
345 printf(" false = %19llu (0x%016llx)\n", *pred->tests[j].select_b,
346 *pred->tests[j].select_b);
352 printf(" %d tests performed, should be %d.\n", j, pred->n_tests);
357 /* ~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~- */
360 test_i64_sext_i32(int in, int64_t expected) {
361 int64_t result = (int64_t) in;
363 if (result != expected) {
365 sprintf(str, "i64_sext_i32(%d) returns %lld\n", in, result);
373 test_i64_sext_i16(short in, int64_t expected) {
374 int64_t result = (int64_t) in;
376 if (result != expected) {
378 sprintf(str, "i64_sext_i16(%hd) returns %lld\n", in, result);
386 test_i64_sext_i8(signed char in, int64_t expected) {
387 int64_t result = (int64_t) in;
389 if (result != expected) {
391 sprintf(str, "i64_sext_i8(%d) returns %lld\n", in, result);
399 test_i64_zext_i32(unsigned int in, uint64_t expected) {
400 uint64_t result = (uint64_t) in;
402 if (result != expected) {
404 sprintf(str, "i64_zext_i32(%u) returns %llu\n", in, result);
412 test_i64_zext_i16(unsigned short in, uint64_t expected) {
413 uint64_t result = (uint64_t) in;
415 if (result != expected) {
417 sprintf(str, "i64_zext_i16(%hu) returns %llu\n", in, result);
425 test_i64_zext_i8(unsigned char in, uint64_t expected) {
426 uint64_t result = (uint64_t) in;
428 if (result != expected) {
430 sprintf(str, "i64_zext_i8(%u) returns %llu\n", in, result);
437 /* ~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~- */
440 i64_shl_const(int64_t a) {
445 i64_shl(int64_t a, int amt) {
450 u64_shl_const(uint64_t a) {
455 u64_shl(uint64_t a, int amt) {
460 i64_srl_const(int64_t a) {
465 i64_srl(int64_t a, int amt) {
470 u64_srl_const(uint64_t a) {
475 u64_srl(uint64_t a, int amt) {
480 i64_sra_const(int64_t a) {
485 i64_sra(int64_t a, int amt) {
490 u64_sra_const(uint64_t a) {
495 u64_sra(uint64_t a, int amt) {
500 test_u64_constant_shift(const char *func_name, uint64_t (*func)(uint64_t), uint64_t a, uint64_t expected) {
501 uint64_t result = (*func)(a);
503 if (result != expected) {
504 printf("%s(0x%016llx) returns 0x%016llx, expected 0x%016llx\n", func_name, a, result, expected);
512 test_i64_constant_shift(const char *func_name, int64_t (*func)(int64_t), int64_t a, int64_t expected) {
513 int64_t result = (*func)(a);
515 if (result != expected) {
516 printf("%s(0x%016llx) returns 0x%016llx, expected 0x%016llx\n", func_name, a, result, expected);
524 test_u64_variable_shift(const char *func_name, uint64_t (*func)(uint64_t, int), uint64_t a, unsigned int b, uint64_t expected) {
525 uint64_t result = (*func)(a, b);
527 if (result != expected) {
528 printf("%s(0x%016llx, %d) returns 0x%016llx, expected 0x%016llx\n", func_name, a, b, result, expected);
536 test_i64_variable_shift(const char *func_name, int64_t (*func)(int64_t, int), int64_t a, unsigned int b, int64_t expected) {
537 int64_t result = (*func)(a, b);
539 if (result != expected) {
540 printf("%s(0x%016llx, %d) returns 0x%016llx, expected 0x%016llx\n", func_name, a, b, result, expected);
547 /* ~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~- */
552 int i, j, failed = 0;
553 const char *something_failed = " %d tests failed.\n";
554 const char *all_tests_passed = " All tests passed.\n";
556 printf("tval_a = %20lld (0x%020llx)\n", tval_a, tval_a);
557 printf("tval_b = %20lld (0x%020llx)\n", tval_b, tval_b);
558 printf("tval_c = %20lld (0x%020llx)\n", tval_c, tval_c);
559 printf("tval_d = %20lld (0x%020llx)\n", tval_d, tval_d);
560 printf("tval_e = %20lld (0x%020llx)\n", tval_e, tval_e);
561 printf("tval_f = %20llu (0x%020llx)\n", tval_f, tval_f);
562 printf("----------------------------------------\n");
564 for (i = 0; i < ARR_SIZE(int64_preds); ++i) {
565 printf("%s series:\n", int64_preds[i].name);
566 if ((failed = compare_expect_int64(int64_preds + i)) > 0) {
567 printf(something_failed, failed);
569 printf(all_tests_passed);
572 printf("----------------------------------------\n");
575 for (i = 0; i < ARR_SIZE(uint64_preds); ++i) {
576 printf("%s series:\n", uint64_preds[i].name);
577 if ((failed = compare_expect_uint64(uint64_preds + i)) > 0) {
578 printf(something_failed, failed);
580 printf(all_tests_passed);
583 printf("----------------------------------------\n");
586 /*----------------------------------------------------------------------*/
588 puts("signed/zero-extend tests:");
591 failed += test_i64_sext_i32(-1, -1LL);
592 failed += test_i64_sext_i32(10, 10LL);
593 failed += test_i64_sext_i32(0x7fffffff, 0x7fffffffLL);
594 failed += test_i64_sext_i16(-1, -1LL);
595 failed += test_i64_sext_i16(10, 10LL);
596 failed += test_i64_sext_i16(0x7fff, 0x7fffLL);
597 failed += test_i64_sext_i8(-1, -1LL);
598 failed += test_i64_sext_i8(10, 10LL);
599 failed += test_i64_sext_i8(0x7f, 0x7fLL);
601 failed += test_i64_zext_i32(0xffffffff, 0x00000000ffffffffLLU);
602 failed += test_i64_zext_i32(0x01234567, 0x0000000001234567LLU);
603 failed += test_i64_zext_i16(0xffff, 0x000000000000ffffLLU);
604 failed += test_i64_zext_i16(0x569a, 0x000000000000569aLLU);
605 failed += test_i64_zext_i8(0xff, 0x00000000000000ffLLU);
606 failed += test_i64_zext_i8(0xa0, 0x00000000000000a0LLU);
609 printf(" %d tests failed.\n", failed);
611 printf(" All tests passed.\n");
614 printf("----------------------------------------\n");
617 puts("signed left/right shift tests:");
618 failed += test_i64_constant_shift("i64_shl_const", i64_shl_const, tval_a, 0x00047dc7ec114c00LL);
619 failed += test_i64_variable_shift("i64_shl", i64_shl, tval_a, 10, 0x00047dc7ec114c00LL);
620 failed += test_i64_constant_shift("i64_srl_const", i64_srl_const, tval_a, 0x0000000047dc7ec1LL);
621 failed += test_i64_variable_shift("i64_srl", i64_srl, tval_a, 10, 0x0000000047dc7ec1LL);
622 failed += test_i64_constant_shift("i64_sra_const", i64_sra_const, tval_a, 0x0000000047dc7ec1LL);
623 failed += test_i64_variable_shift("i64_sra", i64_sra, tval_a, 10, 0x0000000047dc7ec1LL);
626 printf(" %d tests ailed.\n", failed);
628 printf(" All tests passed.\n");
631 printf("----------------------------------------\n");
634 puts("unsigned left/right shift tests:");
635 failed += test_u64_constant_shift("u64_shl_const", u64_shl_const, tval_f, 0xfffc1d404d7ae400LL);
636 failed += test_u64_variable_shift("u64_shl", u64_shl, tval_f, 10, 0xfffc1d404d7ae400LL);
637 failed += test_u64_constant_shift("u64_srl_const", u64_srl_const, tval_f, 0x003fffffc1d404d7LL);
638 failed += test_u64_variable_shift("u64_srl", u64_srl, tval_f, 10, 0x003fffffc1d404d7LL);
639 failed += test_i64_constant_shift("i64_sra_const", i64_sra_const, tval_f, 0xffffffffc1d404d7LL);
640 failed += test_i64_variable_shift("i64_sra", i64_sra, tval_f, 10, 0xffffffffc1d404d7LL);
641 failed += test_u64_constant_shift("u64_sra_const", u64_sra_const, tval_f, 0x003fffffc1d404d7LL);
642 failed += test_u64_variable_shift("u64_sra", u64_sra, tval_f, 10, 0x003fffffc1d404d7LL);
645 printf(" %d tests ailed.\n", failed);
647 printf(" All tests passed.\n");
650 printf("----------------------------------------\n");