Lines Matching +full:0 +full:x40700000
73 uint32 exp = (hl >> 52) & 0x7ff; in set_mpfr_d()
76 if (exp == 0x7ff) { in set_mpfr_d()
77 if (mantissa == 0) in set_mpfr_d()
81 } else if (exp == 0 && mantissa == 0) { in set_mpfr_d()
82 mpfr_set_ui(x, 0, GMP_RNDN); in set_mpfr_d()
83 mpfr_setsign(x, x, sign < 0, GMP_RNDN); in set_mpfr_d()
85 if (exp != 0) in set_mpfr_d()
89 mpfr_set_sj_2exp(x, mantissa * sign, (int)exp - 0x3ff - 52, GMP_RNDN); in set_mpfr_d()
94 uint32 exp = (f >> 23) & 0xff; in set_mpfr_f()
97 if (exp == 0xff) { in set_mpfr_f()
98 if (mantissa == 0) in set_mpfr_f()
102 } else if (exp == 0 && mantissa == 0) { in set_mpfr_f()
103 mpfr_set_ui(x, 0, GMP_RNDN); in set_mpfr_f()
104 mpfr_setsign(x, x, sign < 0, GMP_RNDN); in set_mpfr_f()
106 if (exp != 0) in set_mpfr_f()
110 mpfr_set_sj_2exp(x, mantissa * sign, (int)exp - 0x7f - 23, GMP_RNDN); in set_mpfr_f()
142 *h = 0x7ff80000; in get_mpfr_d()
143 *l = 0; in get_mpfr_d()
144 *extra = 0; in get_mpfr_d()
148 sign = mpfr_signbit(x) ? 0x80000000U : 0; in get_mpfr_d()
151 *h = 0x7ff00000 | sign; in get_mpfr_d()
152 *l = 0; in get_mpfr_d()
153 *extra = 0; in get_mpfr_d()
158 *h = 0x00000000 | sign; in get_mpfr_d()
159 *l = 0; in get_mpfr_d()
160 *extra = 0; in get_mpfr_d()
167 mpfr_set_exp(significand, 0); in get_mpfr_d()
170 * So the IEEE exponent corresponding to exp==0 is 0x3fe. */ in get_mpfr_d()
171 if (exp > 0x400) { in get_mpfr_d()
173 *h = 0x7ff00000 | sign; in get_mpfr_d()
174 *l = 0; in get_mpfr_d()
175 *extra = 0; in get_mpfr_d()
180 if (exp <= -0x3fe || mpfr_zero_p(x)) in get_mpfr_d()
181 exp = -0x3fd; /* denormalise */ in get_mpfr_d()
182 expfield = exp + 0x3fd; /* offset to cancel leading mantissa bit */ in get_mpfr_d()
206 *f = 0x7fc00000; in get_mpfr_f()
207 *extra = 0; in get_mpfr_f()
211 sign = mpfr_signbit(x) ? 0x80000000U : 0; in get_mpfr_f()
214 *f = 0x7f800000 | sign; in get_mpfr_f()
215 *extra = 0; in get_mpfr_f()
220 *f = 0x00000000 | sign; in get_mpfr_f()
221 *extra = 0; in get_mpfr_f()
228 mpfr_set_exp(significand, 0); in get_mpfr_f()
231 * So the IEEE exponent corresponding to exp==0 is 0x7e. */ in get_mpfr_f()
232 if (exp > 0x80) { in get_mpfr_f()
234 *f = 0x7f800000 | sign; in get_mpfr_f()
235 *extra = 0; in get_mpfr_f()
240 if (exp <= -0x7e || mpfr_zero_p(x)) in get_mpfr_f()
241 exp = -0x7d; /* denormalise */ in get_mpfr_f()
242 expfield = exp + 0x7d; /* offset to cancel leading mantissa bit */ in get_mpfr_f()
303 * 0x3c2, i.e. of the order of 2^-61. So we need 1024 bits of pi in test_rred()
334 * NaN in cases where gamma(x) < 0, so it's no use to us. in test_lgamma()
382 (((in)[0] & 0x7F800000) == 0x7F800000 || \
383 (((in)[0] & 0x7F800000) == 0 && ((in)[0]&0x7FFFFFFF) != 0)))
386 (((in)[0] & 0x7FF00000) == 0x7FF00000 || \
387 (((in)[0] & 0x7FF00000) == 0 && (((in)[0] & 0xFFFFF) | (in)[1]) != 0)))
395 if ((0x7FF00000 & ~in[0]) == 0) in is_dinteger()
396 return 0; /* not finite, hence not integer */ in is_dinteger()
398 return in[0] == out[0] && in[1] == out[1]; in is_dinteger()
403 if ((0x7F800000 & ~in[0]) == 0) in is_sinteger()
404 return 0; /* not finite, hence not integer */ in is_sinteger()
406 return in[0] == out[0]; in is_sinteger()
414 if ((in[0] & 0x7FF00000) != 0x7FF00000) in is_dsnan()
415 return 0; /* not the inf/nan exponent */ in is_dsnan()
416 if ((in[0] << 12) == 0 && in[1] == 0) in is_dsnan()
417 return 0; /* inf */ in is_dsnan()
418 if (in[0] & 0x00080000) in is_dsnan()
419 return 0; /* qnan */ in is_dsnan()
424 if ((in[0] & 0x7F800000) != 0x7F800000) in is_ssnan()
425 return 0; /* not the inf/nan exponent */ in is_ssnan()
426 if ((in[0] << 9) == 0) in is_ssnan()
427 return 0; /* inf */ in is_ssnan()
428 if (in[0] & 0x00400000) in is_ssnan()
429 return 0; /* qnan */ in is_ssnan()
447 for (op = 0; op < wrapper_get_nops(ctx); op++) { in universal_wrapper()
467 cases_uniform, 0x3e400000, 0x40300000},
469 cases_uniform_float, 0x39800000, 0x41800000},
471 cases_uniform, 0x3e400000, 0x40300000},
473 cases_uniform_float, 0x39800000, 0x41800000},
475 cases_uniform, 0x3e400000, 0x40300000},
477 cases_uniform_float, 0x39800000, 0x41800000},
479 cases_uniform_float, 0x39800000, 0x41800000},
481 cases_uniform_float, 0x39800000, 0x41800000},
487 cases_uniform, 0x3e400000, 0x3fefffff},
489 cases_uniform_float, 0x39800000, 0x3f7fffff},
491 cases_uniform, 0x3c900000, 0x3fefffff},
493 cases_uniform_float, 0x33800000, 0x3f7fffff},
500 cases_uniform, 0x3e400000, 0x43400000},
502 cases_uniform_float, 0x39800000, 0x4b800000},
508 atan2_cases, 0},
510 atan2_cases_float, 0},
516 cases_uniform, 0x3c900000, 0x40878000},
518 cases_uniform_float, 0x33800000, 0x42dc0000},
520 cases_uniform, 0x3c900000, 0x40878000},
522 cases_uniform_float, 0x33800000, 0x42dc0000},
524 cases_uniform, 0x3e400000, 0x40878000},
526 cases_uniform_float, 0x39800000, 0x42dc0000},
531 cases_uniform, 0x3e400000, 0x40340000},
533 cases_uniform, 0x39800000, 0x41100000},
539 {"log", (funcptr)mpfr_log, args1, {NULL}, log_cases, 0},
540 {"logf", (funcptr)mpfr_log, args1f, {NULL}, log_cases_float, 0},
541 {"log10", (funcptr)mpfr_log10, args1, {NULL}, log_cases, 0},
542 {"log10f", (funcptr)mpfr_log10, args1f, {NULL}, log_cases_float, 0},
546 {"pow", (funcptr)mpfr_pow, args2, {NULL}, pow_cases, 0},
547 {"powf", (funcptr)mpfr_pow, args2f, {NULL}, pow_cases_float, 0},
553 {"rred", (funcptr)test_rred, rred, {NULL}, rred_cases, 0},
554 {"rredf", (funcptr)test_rred, rredf, {NULL}, rred_cases_float, 0},
558 {"sqrt", (funcptr)mpfr_sqrt, args1, {NULL}, log_cases, 0},
559 {"sqrtf", (funcptr)mpfr_sqrt, args1f, {NULL}, log_cases_float, 0},
560 {"cbrt", (funcptr)mpfr_cbrt, args1, {NULL}, log_cases, 0},
561 {"cbrtf", (funcptr)mpfr_cbrt, args1f, {NULL}, log_cases_float, 0},
562 {"hypot", (funcptr)mpfr_hypot, args2, {NULL}, atan2_cases, 0},
563 {"hypotf", (funcptr)mpfr_hypot, args2f, {NULL}, atan2_cases_float, 0},
585 {"isfinite", (funcptr)test_isfinite, classify, {NULL}, cases_uniform, 0, 0x7fffffff},
586 {"isfinitef", (funcptr)test_isfinitef, classifyf, {NULL}, cases_uniform_float, 0, 0x7fffffff},
587 {"isinf", (funcptr)test_isinf, classify, {NULL}, cases_uniform, 0, 0x7fffffff},
588 {"isinff", (funcptr)test_isinff, classifyf, {NULL}, cases_uniform_float, 0, 0x7fffffff},
589 {"isnan", (funcptr)test_isnan, classify, {NULL}, cases_uniform, 0, 0x7fffffff},
590 {"isnanf", (funcptr)test_isnanf, classifyf, {NULL}, cases_uniform_float, 0, 0x7fffffff},
591 {"isnormal", (funcptr)test_isnormal, classify, {NULL}, cases_uniform, 0, 0x7fffffff},
592 {"isnormalf", (funcptr)test_isnormalf, classifyf, {NULL}, cases_uniform_float, 0, 0x7fffffff},
593 {"signbit", (funcptr)test_signbit, classify, {NULL}, cases_uniform, 0, 0x7fffffff},
594 {"signbitf", (funcptr)test_signbitf, classifyf, {NULL}, cases_uniform_float, 0, 0x7fffffff},
595 {"fpclassify", (funcptr)test_fpclassify, classify, {NULL}, cases_uniform, 0, 0x7fffffff},
596 … {"fpclassifyf", (funcptr)test_fpclassifyf, classifyf, {NULL}, cases_uniform_float, 0, 0x7fffffff},
600 {"isgreater", (funcptr)test_isgreater, compare, {NULL}, cases_uniform, 0, 0x7fffffff},
601 {"isgreaterequal", (funcptr)test_isgreaterequal, compare, {NULL}, cases_uniform, 0, 0x7fffffff},
602 {"isless", (funcptr)test_isless, compare, {NULL}, cases_uniform, 0, 0x7fffffff},
603 {"islessequal", (funcptr)test_islessequal, compare, {NULL}, cases_uniform, 0, 0x7fffffff},
604 {"islessgreater", (funcptr)test_islessgreater, compare, {NULL}, cases_uniform, 0, 0x7fffffff},
605 {"isunordered", (funcptr)test_isunordered, compare, {NULL}, cases_uniform, 0, 0x7fffffff},
607 {"isgreaterf", (funcptr)test_isgreaterf, comparef, {NULL}, cases_uniform_float, 0, 0x7fffffff},
608 …{"isgreaterequalf", (funcptr)test_isgreaterequalf, comparef, {NULL}, cases_uniform_float, 0, 0x7ff…
609 {"islessf", (funcptr)test_islessf, comparef, {NULL}, cases_uniform_float, 0, 0x7fffffff},
610 …{"islessequalf", (funcptr)test_islessequalf, comparef, {NULL}, cases_uniform_float, 0, 0x7fffffff},
611 …{"islessgreaterf", (funcptr)test_islessgreaterf, comparef, {NULL}, cases_uniform_float, 0, 0x7ffff…
612 …{"isunorderedf", (funcptr)test_isunorderedf, comparef, {NULL}, cases_uniform_float, 0, 0x7fffffff},
617 {"atanh", (funcptr)mpfr_atanh, args1, {NULL}, cases_uniform, 0x3e400000, 0x3fefffff},
618 {"asinh", (funcptr)mpfr_asinh, args1, {NULL}, cases_uniform, 0x3e400000, 0x3fefffff},
619 {"acosh", (funcptr)mpfr_acosh, args1, {NULL}, cases_uniform_positive, 0x3ff00000, 0x7fefffff},
621 {"atanhf", (funcptr)mpfr_atanh, args1f, {NULL}, cases_uniform_float, 0x32000000, 0x3f7fffff},
622 {"asinhf", (funcptr)mpfr_asinh, args1f, {NULL}, cases_uniform_float, 0x32000000, 0x3f7fffff},
623 …{"acoshf", (funcptr)mpfr_acosh, args1f, {NULL}, cases_uniform_float_positive, 0x3f800000, 0x7f8000…
630 {"csin", (funcptr)mpc_sin, args1c, {NULL}, complex_cases_uniform, 0x3f000000, 0x40300000},
631 … {"csinf", (funcptr)mpc_sin, args1fc, {NULL}, complex_cases_uniform_float, 0x38000000, 0x41800000},
632 {"ccos", (funcptr)mpc_cos, args1c, {NULL}, complex_cases_uniform, 0x3f000000, 0x40300000},
633 … {"ccosf", (funcptr)mpc_cos, args1fc, {NULL}, complex_cases_uniform_float, 0x38000000, 0x41800000},
634 {"ctan", (funcptr)mpc_tan, args1c, {NULL}, complex_cases_uniform, 0x3f000000, 0x40300000},
635 … {"ctanf", (funcptr)mpc_tan, args1fc, {NULL}, complex_cases_uniform_float, 0x38000000, 0x41800000},
637 {"casin", (funcptr)mpc_asin, args1c, {NULL}, complex_cases_uniform, 0x3f000000, 0x40300000},
638 …{"casinf", (funcptr)mpc_asin, args1fc, {NULL}, complex_cases_uniform_float, 0x38000000, 0x41800000…
639 {"cacos", (funcptr)mpc_acos, args1c, {NULL}, complex_cases_uniform, 0x3f000000, 0x40300000},
640 …{"cacosf", (funcptr)mpc_acos, args1fc, {NULL}, complex_cases_uniform_float, 0x38000000, 0x41800000…
641 {"catan", (funcptr)mpc_atan, args1c, {NULL}, complex_cases_uniform, 0x3f000000, 0x40300000},
642 …{"catanf", (funcptr)mpc_atan, args1fc, {NULL}, complex_cases_uniform_float, 0x38000000, 0x41800000…
644 {"csinh", (funcptr)mpc_sinh, args1c, {NULL}, complex_cases_uniform, 0x3f000000, 0x40300000},
645 …{"csinhf", (funcptr)mpc_sinh, args1fc, {NULL}, complex_cases_uniform_float, 0x38000000, 0x41800000…
646 {"ccosh", (funcptr)mpc_cosh, args1c, {NULL}, complex_cases_uniform, 0x3f000000, 0x40300000},
647 …{"ccoshf", (funcptr)mpc_cosh, args1fc, {NULL}, complex_cases_uniform_float, 0x38000000, 0x41800000…
648 {"ctanh", (funcptr)mpc_tanh, args1c, {NULL}, complex_cases_uniform, 0x3f000000, 0x40300000},
649 …{"ctanhf", (funcptr)mpc_tanh, args1fc, {NULL}, complex_cases_uniform_float, 0x38000000, 0x41800000…
651 {"casinh", (funcptr)mpc_asinh, args1c, {NULL}, complex_cases_uniform, 0x3f000000, 0x40300000},
652 …{"casinhf", (funcptr)mpc_asinh, args1fc, {NULL}, complex_cases_uniform_float, 0x38000000, 0x418000…
653 {"cacosh", (funcptr)mpc_acosh, args1c, {NULL}, complex_cases_uniform, 0x3f000000, 0x40300000},
654 …{"cacoshf", (funcptr)mpc_acosh, args1fc, {NULL}, complex_cases_uniform_float, 0x38000000, 0x418000…
655 {"catanh", (funcptr)mpc_atanh, args1c, {NULL}, complex_cases_uniform, 0x3f000000, 0x40300000},
656 …{"catanhf", (funcptr)mpc_atanh, args1fc, {NULL}, complex_cases_uniform_float, 0x38000000, 0x418000…
658 {"cexp", (funcptr)mpc_exp, args1c, {NULL}, complex_cases_uniform, 0x3c900000, 0x40862000},
659 {"cpow", (funcptr)test_cpow, args2c, {NULL}, complex_pow_cases, 0x3fc00000, 0x40000000},
660 {"clog", (funcptr)mpc_log, args1c, {NULL}, complex_log_cases, 0, 0},
661 {"csqrt", (funcptr)mpc_sqrt, args1c, {NULL}, complex_log_cases, 0, 0},
663 … {"cexpf", (funcptr)mpc_exp, args1fc, {NULL}, complex_cases_uniform_float, 0x24800000, 0x42b00000},
664 {"cpowf", (funcptr)test_cpow, args2fc, {NULL}, complex_pow_cases_float, 0x3e000000, 0x41000000},
665 {"clogf", (funcptr)mpc_log, args1fc, {NULL}, complex_log_cases_float, 0, 0},
666 {"csqrtf", (funcptr)mpc_sqrt, args1fc, {NULL}, complex_log_cases_float, 0, 0},
668 {"cdiv", (funcptr)mpc_div, args2c, {NULL}, complex_arithmetic_cases, 0, 0},
669 {"cmul", (funcptr)mpc_mul, args2c, {NULL}, complex_arithmetic_cases, 0, 0},
670 {"cadd", (funcptr)mpc_add, args2c, {NULL}, complex_arithmetic_cases, 0, 0},
671 {"csub", (funcptr)mpc_sub, args2c, {NULL}, complex_arithmetic_cases, 0, 0},
673 {"cdivf", (funcptr)mpc_div, args2fc, {NULL}, complex_arithmetic_cases_float, 0, 0},
674 {"cmulf", (funcptr)mpc_mul, args2fc, {NULL}, complex_arithmetic_cases_float, 0, 0},
675 {"caddf", (funcptr)mpc_add, args2fc, {NULL}, complex_arithmetic_cases_float, 0, 0},
676 {"csubf", (funcptr)mpc_sub, args2fc, {NULL}, complex_arithmetic_cases_float, 0, 0},
678 {"cabsf", (funcptr)mpc_abs, args1fcr, {NULL}, complex_arithmetic_cases_float, 0, 0},
679 {"cabs", (funcptr)mpc_abs, args1cr, {NULL}, complex_arithmetic_cases, 0, 0},
680 {"cargf", (funcptr)mpc_arg, args1fcr, {NULL}, complex_arithmetic_cases_float, 0, 0},
681 {"carg", (funcptr)mpc_arg, args1cr, {NULL}, complex_arithmetic_cases, 0, 0},
682 {"cimagf", (funcptr)mpc_imag, args1fcr, {NULL}, complex_arithmetic_cases_float, 0, 0},
683 {"cimag", (funcptr)mpc_imag, args1cr, {NULL}, complex_arithmetic_cases, 0, 0},
684 {"conjf", (funcptr)mpc_conj, args1fc, {NULL}, complex_arithmetic_cases_float, 0, 0},
685 {"conj", (funcptr)mpc_conj, args1c, {NULL}, complex_arithmetic_cases, 0, 0},
686 {"cprojf", (funcptr)mpc_proj, args1fc, {NULL}, complex_arithmetic_cases_float, 0, 0},
687 {"cproj", (funcptr)mpc_proj, args1c, {NULL}, complex_arithmetic_cases, 0, 0},
688 {"crealf", (funcptr)mpc_real, args1fcr, {NULL}, complex_arithmetic_cases_float, 0, 0},
689 {"creal", (funcptr)mpc_real, args1cr, {NULL}, complex_arithmetic_cases, 0, 0},
690 {"erfcf", (funcptr)mpfr_erfc, args1f, {NULL}, cases_biased_float, 0x1e800000, 0x41000000},
691 {"erfc", (funcptr)mpfr_erfc, args1, {NULL}, cases_biased, 0x3bd00000, 0x403c0000},
692 {"erff", (funcptr)mpfr_erf, args1f, {NULL}, cases_biased_float, 0x03800000, 0x40700000},
693 {"erf", (funcptr)mpfr_erf, args1, {NULL}, cases_biased, 0x00800000, 0x40200000},
694 {"exp2f", (funcptr)mpfr_exp2, args1f, {NULL}, cases_uniform_float, 0x33800000, 0x43c00000},
695 {"exp2", (funcptr)mpfr_exp2, args1, {NULL}, cases_uniform, 0x3ca00000, 0x40a00000},
696 {"expm1f", (funcptr)mpfr_expm1, args1f, {NULL}, cases_uniform_float, 0x33000000, 0x43800000},
697 {"expm1", (funcptr)mpfr_expm1, args1, {NULL}, cases_uniform, 0x3c900000, 0x409c0000},
698 {"fmaxf", (funcptr)mpfr_max, args2f, {NULL}, minmax_cases_float, 0, 0x7f7fffff},
699 {"fmax", (funcptr)mpfr_max, args2, {NULL}, minmax_cases, 0, 0x7fefffff},
700 {"fminf", (funcptr)mpfr_min, args2f, {NULL}, minmax_cases_float, 0, 0x7f7fffff},
701 {"fmin", (funcptr)mpfr_min, args2, {NULL}, minmax_cases, 0, 0x7fefffff},
702 {"lgammaf", (funcptr)test_lgamma, args1f, {NULL}, cases_uniform_float, 0x01800000, 0x7f800000},
703 {"lgamma", (funcptr)test_lgamma, args1, {NULL}, cases_uniform, 0x00100000, 0x7ff00000},
704 {"log1pf", (funcptr)mpfr_log1p, args1f, {NULL}, log1p_cases_float, 0, 0},
705 {"log1p", (funcptr)mpfr_log1p, args1, {NULL}, log1p_cases, 0, 0},
706 {"log2f", (funcptr)mpfr_log2, args1f, {NULL}, log_cases_float, 0, 0},
707 {"log2", (funcptr)mpfr_log2, args1, {NULL}, log_cases, 0, 0},
708 {"tgammaf", (funcptr)mpfr_gamma, args1f, {NULL}, cases_uniform_float, 0x2f800000, 0x43000000},
709 {"tgamma", (funcptr)mpfr_gamma, args1, {NULL}, cases_uniform, 0x3c000000, 0x40800000},
714 #define random_sign ( random_upto(1) ? 0x80000000 : 0 )
717 return !((x[0] & 0x7FFFFFFF) || x[1]); in iszero()
723 cases_uniform(out,0x00100000,0x7fefffff); in complex_log_cases()
724 cases_uniform(out+2,0x00100000,0x7fefffff); in complex_log_cases()
730 cases_uniform_float(out,0x00800000,0x7f7fffff); in complex_log_cases_float()
731 cases_uniform_float(out+2,0x00800000,0x7f7fffff); in complex_log_cases_float()
777 cases_uniform(out,0x3fe00000, 0x40000000); in complex_pow_cases()
778 cases_uniform(out+2,0x3fe00000, 0x40000000); in complex_pow_cases()
779 cases_uniform(out+4,0x3f800000, 0x40600000); in complex_pow_cases()
780 cases_uniform(out+6,0x3f800000, 0x40600000); in complex_pow_cases()
789 cases_uniform_float(out,0x3f000000, 0x40000000); in complex_pow_cases_float()
790 cases_uniform_float(out+2,0x3f000000, 0x40000000); in complex_pow_cases_float()
791 cases_uniform_float(out+4,0x3d600000, 0x41900000); in complex_pow_cases_float()
792 cases_uniform_float(out+6,0x3d600000, 0x41900000); in complex_pow_cases_float()
797 cases_uniform(out,0,0x7fefffff); in complex_arithmetic_cases()
798 cases_uniform(out+2,0,0x7fefffff); in complex_arithmetic_cases()
799 cases_uniform(out+4,0,0x7fefffff); in complex_arithmetic_cases()
800 cases_uniform(out+6,0,0x7fefffff); in complex_arithmetic_cases()
805 cases_uniform_float(out,0,0x7f7fffff); in complex_arithmetic_cases_float()
806 cases_uniform_float(out+2,0,0x7f7fffff); in complex_arithmetic_cases_float()
807 cases_uniform_float(out+4,0,0x7f7fffff); in complex_arithmetic_cases_float()
808 cases_uniform_float(out+6,0,0x7f7fffff); in complex_arithmetic_cases_float()
826 premax = preptr = 0; in float32_case()
832 -127, -126, -125, -24, -4, -3, -2, -1, 0, 1, 2, 3, 4, in float32_case()
852 preptr = 0; in float32_case()
853 for (sign = 0; sign <= 1; sign++) { in float32_case()
854 for (eptr = 0; eptr < sizeof(exps)/sizeof(*exps); eptr++) { in float32_case()
855 se = (sign ? 0x80000000 : 0) | ((exps[eptr]+127) << 23); in float32_case()
859 specifics[preptr++] = se | 0; in float32_case()
863 specifics[preptr++] = se | 0x7FFFFF; in float32_case()
867 for (j = 1; j && j <= 0x400000; j <<= 1) in float32_case()
872 for (j = 1; j && j <= 0x400000; j <<= 1) in float32_case()
873 specifics[preptr++] = se | (0x7FFFFF ^ j); in float32_case()
877 for (j = 2; j && j <= 0x100000; j <<= 1) in float32_case()
882 for (j = 4; j && j <= 0x200000; j <<= 1) in float32_case()
883 specifics[preptr++] = se | (0x7FFFFF ^ (j-1)); in float32_case()
916 * - with prob 1/5, all 0s down to some point and then random in float32_case()
917 * - with prob 1/5, all 0s up to some point and then random in float32_case()
923 case 0: in float32_case()
938 f &= 0x7FFFFF; in float32_case()
939 f |= (random32() & 0xFF800000);/* FIXME - do better */ in float32_case()
953 premax = preptr = 0; in float64_case()
960 -1, 0, 1, 2, 3, 4, 29, 30, 31, 32, 53, 61, 62, 63, 64, 127, in float64_case()
980 preptr = 0; in float64_case()
981 for (sign = 0; sign <= 1; sign++) { in float64_case()
982 for (eptr = 0; eptr < sizeof(exps)/sizeof(*exps); eptr++) { in float64_case()
983 se = (sign ? 0x80000000 : 0) | ((exps[eptr]+1023) << 20); in float64_case()
987 specifics[preptr][0] = 0; in float64_case()
988 specifics[preptr][1] = 0; in float64_case()
989 specifics[preptr++][0] |= se; in float64_case()
993 specifics[preptr][0] = 0xFFFFF; in float64_case()
994 specifics[preptr][1] = ~0; in float64_case()
995 specifics[preptr++][0] |= se; in float64_case()
999 for (j = 1; j && j <= 0x80000000; j <<= 1) { in float64_case()
1000 specifics[preptr][0] = 0; in float64_case()
1002 specifics[preptr++][0] |= se; in float64_case()
1003 if (j & 0xFFFFF) { in float64_case()
1004 specifics[preptr][0] = j; in float64_case()
1005 specifics[preptr][1] = 0; in float64_case()
1006 specifics[preptr++][0] |= se; in float64_case()
1012 for (j = 1; j && j <= 0x80000000; j <<= 1) { in float64_case()
1013 specifics[preptr][0] = 0xFFFFF; in float64_case()
1015 specifics[preptr++][0] |= se; in float64_case()
1016 if (j & 0xFFFFF) { in float64_case()
1017 specifics[preptr][0] = 0xFFFFF ^ j; in float64_case()
1018 specifics[preptr][1] = ~0; in float64_case()
1019 specifics[preptr++][0] |= se; in float64_case()
1025 for (j = 2; j && j <= 0x80000000; j <<= 1) { in float64_case()
1026 specifics[preptr][0] = 0; in float64_case()
1028 specifics[preptr++][0] |= se; in float64_case()
1030 for (j = 1; j && j <= 0x20000; j <<= 1) { in float64_case()
1031 specifics[preptr][0] = 2*j-1; in float64_case()
1032 specifics[preptr][1] = ~0; in float64_case()
1033 specifics[preptr++][0] |= se; in float64_case()
1038 for (j = 4; j && j <= 0x80000000; j <<= 1) { in float64_case()
1039 specifics[preptr][0] = 0xFFFFF; in float64_case()
1041 specifics[preptr++][0] |= se; in float64_case()
1043 for (j = 1; j && j <= 0x40000; j <<= 1) { in float64_case()
1044 specifics[preptr][0] = 0xFFFFF ^ (j-1); in float64_case()
1045 specifics[preptr][1] = 0; in float64_case()
1046 specifics[preptr++][0] |= se; in float64_case()
1066 t = specifics[n][0]; in float64_case()
1067 specifics[n][0] = specifics[preptr-1][0]; in float64_case()
1068 specifics[preptr-1][0] = t; /* (not really needed) */ in float64_case()
1069 ret[0] = t; in float64_case()
1084 * - with prob 1/5, all 0s down to some point and then random in float64_case()
1085 * - with prob 1/5, all 0s up to some point and then random in float64_case()
1092 case 0: in float64_case()
1100 f = ~0; in float64_case()
1109 f = 0; in float64_case()
1118 g = 0; in float64_case()
1127 g = ~0; in float64_case()
1131 g &= 0xFFFFF; in float64_case()
1132 g |= (random32() & 0xFFF00000);/* FIXME - do better */ in float64_case()
1133 ret[0] = g; in float64_case()
1141 out[0] = highbound - random_upto_biased(highbound-lowbound, 8); in cases_biased()
1142 out[1] = random_upto(0xFFFFFFFF); in cases_biased()
1143 out[0] |= random_sign; in cases_biased()
1150 out[0] = highbound - random_upto_biased(highbound-lowbound, 8); in cases_biased_positive()
1151 out[1] = random_upto(0xFFFFFFFF); in cases_biased_positive()
1158 out[0] = highbound - random_upto_biased(highbound-lowbound, 8); in cases_biased_float()
1159 out[1] = 0; in cases_biased_float()
1160 out[0] |= random_sign; in cases_biased_float()
1201 out[0] = highbound - random_upto(highbound-lowbound); in cases_uniform()
1202 out[1] = random_upto(0xFFFFFFFF); in cases_uniform()
1203 out[0] |= random_sign; in cases_uniform()
1209 out[0] = highbound - random_upto(highbound-lowbound); in cases_uniform_float()
1210 out[1] = 0; in cases_uniform_float()
1211 out[0] |= random_sign; in cases_uniform_float()
1218 out[0] = highbound - random_upto(highbound-lowbound); in cases_uniform_positive()
1219 out[1] = random_upto(0xFFFFFFFF); in cases_uniform_positive()
1225 out[0] = highbound - random_upto(highbound-lowbound); in cases_uniform_float_positive()
1226 out[1] = 0; in cases_uniform_float_positive()
1234 out[0] = random_upto(0x7FEFFFFF); in log_cases()
1235 out[1] = random_upto(0xFFFFFFFF); in log_cases()
1242 out[0] = random_upto(0x7F7FFFFF); in log_cases_float()
1243 out[1] = 0; in log_cases_float()
1250 if (sign == 0) { in log1p_cases()
1251 cases_uniform_positive(out, 0x3c700000, 0x43400000); in log1p_cases()
1253 cases_uniform_positive(out, 0x3c000000, 0x3ff00000); in log1p_cases()
1255 out[0] |= sign; in log1p_cases()
1261 if (sign == 0) { in log1p_cases_float()
1262 cases_uniform_float_positive(out, 0x32000000, 0x4c000000); in log1p_cases_float()
1264 cases_uniform_float_positive(out, 0x30000000, 0x3f800000); in log1p_cases_float()
1266 out[0] |= sign; in log1p_cases_float()
1272 out[0] = random_upto(0x7FEFFFFF); in minmax_cases()
1273 out[1] = random_upto(0xFFFFFFFF); in minmax_cases()
1274 out[0] |= random_sign; in minmax_cases()
1275 out[2] = random_upto(0x7FEFFFFF); in minmax_cases()
1276 out[3] = random_upto(0xFFFFFFFF); in minmax_cases()
1284 out[0] = random_upto(0x7F7FFFFF); in minmax_cases_float()
1285 out[1] = 0; in minmax_cases_float()
1286 out[0] |= random_sign; in minmax_cases_float()
1287 out[2] = random_upto(0x7F7FFFFF); in minmax_cases_float()
1288 out[3] = 0; in minmax_cases_float()
1296 out[0] = ((0x3fc00000 + random_upto(0x036fffff)) | in rred_cases()
1298 out[1] = random_upto(0xFFFFFFFF); in rred_cases()
1305 out[0] = ((0x3e000000 + random_upto(0x0cffffff)) | in rred_cases_float()
1307 out[1] = 0; /* for iszero */ in rred_cases_float()
1316 if (expdiff < 0) { in atan2_cases()
1320 swap = 0; in atan2_cases()
1321 out[swap ^ 0] = random_upto(0x7FEFFFFF-((expdiff+1)<<20)); in atan2_cases()
1322 out[swap ^ 2] = random_upto(((expdiff+1)<<20)-1) + out[swap ^ 0]; in atan2_cases()
1323 out[1] = random_upto(0xFFFFFFFF); in atan2_cases()
1324 out[3] = random_upto(0xFFFFFFFF); in atan2_cases()
1325 out[0] |= random_sign; in atan2_cases()
1335 if (expdiff < 0) { in atan2_cases_float()
1339 swap = 0; in atan2_cases_float()
1340 out[swap ^ 0] = random_upto(0x7F7FFFFF-((expdiff+1)<<23)); in atan2_cases_float()
1341 out[swap ^ 2] = random_upto(((expdiff+1)<<23)-1) + out[swap ^ 0]; in atan2_cases_float()
1342 out[0] |= random_sign; in atan2_cases_float()
1344 out[1] = out[3] = 0; /* for iszero */ in atan2_cases_float()
1351 * Pick an exponent e (-0x33 to +0x7FE) for x, and here's the in pow_cases()
1354 * For e < 0x3FE, the range is [-0x400/(0x3FE-e),+0x432/(0x3FE-e)] in pow_cases()
1355 * For e > 0x3FF, the range is [-0x432/(e-0x3FF),+0x400/(e-0x3FF)] in pow_cases()
1357 * For e == 0x3FE or e == 0x3FF, the range gets infinite at one in pow_cases()
1360 * 0x3ff00000.00000001 whereas 52 is anything at least as big in pow_cases()
1361 * as 0x3ff80000.00000000; for e == 0x3fe, 1 necessarily means in pow_cases()
1362 * 0x3fefffff.ffffffff and 52 is anything at most as big as in pow_cases()
1363 * 0x3fe80000.00000000). Then, as it happens, a sensible in pow_cases()
1364 * maximum power is 2^(63-n) for e == 0x3fe, and 2^(62-n) for in pow_cases()
1365 * e == 0x3ff. in pow_cases()
1376 const uint32 pmin = 0x3e100000; in pow_cases()
1382 0x3FE - random_upto_biased(0x431,2) : /* small */ in pow_cases()
1383 0x3FF + random_upto_biased(0x3FF,2)); /* big */ in pow_cases()
1388 if (e < 0x3FE || e > 0x3FF) { in pow_cases()
1390 if (e < 0x3FE) in pow_cases()
1391 imin = 0x40000 / (0x3FE - e), imax = 0x43200 / (0x3FE - e); in pow_cases()
1393 imin = 0x43200 / (e - 0x3FF), imax = 0x40000 / (e - 0x3FF); in pow_cases()
1398 n = (e > 0 ? 53 : 52+e); in pow_cases()
1402 if (e == 0x3FE) in pow_cases()
1406 dmax = (dmax << 20) + 0x3FF00000; in pow_cases()
1411 out[0] = 0; in pow_cases()
1414 out[0] = 1; in pow_cases()
1415 out[1] = random_upto(0xFFFFFFFF); in pow_cases()
1417 out[0] = random_upto((1 << (n-33)) - 1) + (1 << (n-33)); in pow_cases()
1418 out[1] = random_upto(0xFFFFFFFF); in pow_cases()
1420 /* Negate the mantissa if e == 0x3FE. */ in pow_cases()
1421 if (e == 0x3FE) { in pow_cases()
1423 out[0] = -out[0]; in pow_cases()
1424 if (out[1]) out[0]--; in pow_cases()
1427 out[0] &= 0xFFFFF; in pow_cases()
1428 out[0] |= ((e > 0 ? e : 0) << 20); in pow_cases()
1435 out[2] = (dmin - random_upto_biased(dmin-pmin, 10)) | 0x80000000; in pow_cases()
1437 out[3] = random_upto(0xFFFFFFFF); in pow_cases()
1442 * Pick an exponent e (-0x16 to +0xFE) for x, and here's the in pow_cases_float()
1445 * For e < 0x7E, the range is [-0x80/(0x7E-e),+0x95/(0x7E-e)] in pow_cases_float()
1446 * For e > 0x7F, the range is [-0x95/(e-0x7F),+0x80/(e-0x7F)] in pow_cases_float()
1448 * For e == 0x7E or e == 0x7F, the range gets infinite at one in pow_cases_float()
1451 * 0x3f800001 whereas 23 is anything at least as big as in pow_cases_float()
1452 * 0x3fc00000; for e == 0x7e, 1 necessarily means 0x3f7fffff in pow_cases_float()
1453 * and 23 is anything at most as big as 0x3f400000). Then, as in pow_cases_float()
1455 * 0x7e, and 2^(30-n) for e == 0x7f. in pow_cases_float()
1466 const uint32 pmin = 0x38000000; in pow_cases_float()
1472 0x7E - random_upto_biased(0x94,2) : /* small */ in pow_cases_float()
1473 0x7F + random_upto_biased(0x7f,2)); /* big */ in pow_cases_float()
1478 if (e < 0x7E || e > 0x7F) { in pow_cases_float()
1480 if (e < 0x7E) in pow_cases_float()
1481 imin = 0x8000 / (0x7e - e), imax = 0x9500 / (0x7e - e); in pow_cases_float()
1483 imin = 0x9500 / (e - 0x7f), imax = 0x8000 / (e - 0x7f); in pow_cases_float()
1488 n = (e > 0 ? 24 : 23+e); in pow_cases_float()
1492 if (e == 0x7E) in pow_cases_float()
1496 dmax = (dmax << 23) + 0x3F800000; in pow_cases_float()
1500 out[0] = random_upto((1 << (n-1)) - 1) + (1 << (n-1)); in pow_cases_float()
1501 out[1] = 0; in pow_cases_float()
1502 /* Negate the mantissa if e == 0x7E. */ in pow_cases_float()
1503 if (e == 0x7E) { in pow_cases_float()
1504 out[0] = -out[0]; in pow_cases_float()
1507 out[0] &= 0x7FFFFF; in pow_cases_float()
1508 out[0] |= ((e > 0 ? e : 0) << 23); in pow_cases_float()
1515 out[2] = (dmin - random_upto_biased(dmin-pmin, 10)) | 0x80000000; in pow_cases_float()
1517 out[3] = 0; in pow_cases_float()
1521 int declined = 0; in vet_for_decline()
1531 declined |= lib_fo && is_dhard(args+0); in vet_for_decline()
1539 declined |= lib_fo && is_shard(args+0); in vet_for_decline()
1546 declined |= lib_fo && is_dhard(args+0); in vet_for_decline()
1555 declined |= lib_fo && is_shard(args+0); in vet_for_decline()
1559 declined |= lib_fo && is_dhard(args+0); in vet_for_decline()
1565 declined |= lib_fo && is_shard(args+0); in vet_for_decline()
1593 declined |= lib_fo && is_dhard(result+0); in vet_for_decline()
1600 declined |= lib_fo && is_shard(result+0); in vet_for_decline()
1604 declined |= lib_fo && is_dhard(result+0); in vet_for_decline()
1609 declined |= lib_fo && is_shard(result+0); in vet_for_decline()
1646 rejected = 0; /* FIXME */ in docase()
1655 printf(" op1=%08x.%08x", args[0], args[1]); in docase()
1663 printf(" op1=%08x", args[0]); in docase()
1668 printf(" op1=%08x.%08x", args[0], args[1]); in docase()
1675 printf(" op1=%08x", args[0]); in docase()
1679 printf(" op1=%08x.%08x", args[0], args[1]); in docase()
1684 printf(" op1r=%08x.%08x", args[0], args[1]); in docase()
1688 printf(" op1r=%08x.%08x", args[0], args[1]); in docase()
1695 printf(" op1r=%08x", args[0]); in docase()
1699 printf(" op1r=%08x", args[0]); in docase()
1716 if (rejected == 0) { in docase()
1719 set_mpfr_d(a, args[0], args[1]); in docase()
1722 get_mpfr_d(r, &result[0], &result[1], &result[2]); in docase()
1725 get_mpfr_d(r, &result[0], &result[1], &result[2]); in docase()
1728 set_mpc_d(ac, args[0], args[1], args[2], args[3]); in docase()
1731 get_mpfr_d(r, &result[0], &result[1], &result[2]); in docase()
1734 get_mpfr_d(r, &result[0], &result[1], &result[2]); in docase()
1737 set_mpfr_f(a, args[0]); in docase()
1740 get_mpfr_f(r, &result[0], &result[1]); in docase()
1743 get_mpfr_f(r, &result[0], &result[1]); in docase()
1746 set_mpc_f(ac, args[0], args[2]); in docase()
1749 get_mpfr_f(r, &result[0], &result[1]); in docase()
1752 get_mpfr_f(r, &result[0], &result[1]); in docase()
1755 set_mpfr_d(a, args[0], args[1]); in docase()
1760 get_mpfr_d(r, &result[0], &result[1], &result[2]); in docase()
1763 get_mpfr_d(r, &result[0], &result[1], &result[2]); in docase()
1766 set_mpfr_f(a, args[0]); in docase()
1771 get_mpfr_f(r, &result[0], &result[1]); in docase()
1774 get_mpfr_f(r, &result[0], &result[1]); in docase()
1777 set_mpfr_d(a, args[0], args[1]); in docase()
1780 get_mpfr_d(r, &result[0], &result[1], &result[2]); in docase()
1785 get_mpfr_d(r, &result[0], &result[1], &result[2]); in docase()
1788 set_mpfr_f(a, args[0]); in docase()
1791 get_mpfr_f(r, &result[0], &result[1]); in docase()
1796 get_mpfr_f(r, &result[0], &result[1]); in docase()
1827 errstr = ((testclassify)(fn->func))(args, &result[0]); in docase()
1830 errstr = ((testclassifyf)(fn->func))(args, &result[0]); in docase()
1833 set_mpc_d(ac, args[0], args[1], args[2], args[3]); in docase()
1836 get_mpc_d(rc, &result[0], &result[1], &result[2], &result[4], &result[5], &result[6]); in docase()
1839 … get_mpc_d(rc, &result[0], &result[1], &result[2], &result[4], &result[5], &result[6]); in docase()
1842 set_mpc_d(ac, args[0], args[1], args[2], args[3]); in docase()
1847 get_mpc_d(rc, &result[0], &result[1], &result[2], &result[4], &result[5], &result[6]); in docase()
1850 … get_mpc_d(rc, &result[0], &result[1], &result[2], &result[4], &result[5], &result[6]); in docase()
1853 set_mpc_f(ac, args[0], args[2]); in docase()
1856 get_mpc_f(rc, &result[0], &result[1], &result[4], &result[5]); in docase()
1859 get_mpc_f(rc, &result[0], &result[1], &result[4], &result[5]); in docase()
1862 set_mpc_f(ac, args[0], args[2]); in docase()
1867 get_mpc_f(rc, &result[0], &result[1], &result[4], &result[5]); in docase()
1870 get_mpc_f(rc, &result[0], &result[1], &result[4], &result[5]); in docase()
1884 if (rejected == 0) { in docase()
1887 if ((result[0] & 0x7FFFFFFF) == 0 && result[1] == 0) { in docase()
1889 * If the output is +0 or -0 apart from the extra in docase()
1920 if (result[2] < 0x40000000) { in docase()
1926 printextra = 0; in docase()
1933 } else if (!(result[0] & 0x7ff00000)) { in docase()
1951 } else if ((result[0] & 0x7FFFFFFF) > 0x7FEFFFFF) { in docase()
1958 (args[0] & 0x80000000) != 0 && /* negative */ in docase()
1964 printextra = 0; in docase()
1967 /* lgamma(0) is also a pole. */ in docase()
1970 printextra = 0; in docase()
1975 if (!printextra || (rejected && !(rejected==1 && result[2]!=0))) { in docase()
1977 result[0], result[1]); in docase()
1980 result[0], result[1], (result[2] >> 20) & 0xFFF); in docase()
1991 if (rejected == 0) { in docase()
1994 if ((result[0] & 0x7FFFFFFF) == 0) { in docase()
2001 if (result[1] < 0x40000000) { in docase()
2003 printextra = 0; in docase()
2007 } else if (!(result[0] & 0x7f800000)) { in docase()
2022 } else if ((result[0] & 0x7FFFFFFF) > 0x7F7FFFFF) { in docase()
2029 (args[0] & 0x80000000) != 0 && /* negative */ in docase()
2035 printextra = 0; in docase()
2038 /* lgamma(0) is also a pole. */ in docase()
2041 printextra = 0; in docase()
2046 if (!printextra || (rejected && !(rejected==1 && result[1]!=0))) { in docase()
2048 result[0]); in docase()
2051 result[0], (result[1] >> 20) & 0xFFF); in docase()
2060 printf(" result=%08x.%08x", result[0], result[1]); in docase()
2065 printf(" result=%08x", result[0]); in docase()
2068 printf(" result=%08x.%08x res2=%08x", result[0], result[1], in docase()
2073 result[0], result[1], result[2], result[3]); in docase()
2078 printf(" result=%08x res2=%08x", result[0], result[2]); in docase()
2084 printf(" result=%x", result[0]); in docase()
2088 if (0/* errstr */) { in docase()
2089 printf(" resultr=%08x.%08x", result[0], result[1]); in docase()
2093 result[0], result[1], (result[2] >> 20) & 0xFFF); in docase()
2095 result[4], result[5], (result[6] >> 20) & 0xFFF); in docase()
2102 if (0/* errstr */) { in docase()
2103 printf(" resultr=%08x", result[0]); in docase()
2107 result[0], (result[1] >> 20) & 0xFFF); in docase()
2109 result[4], (result[5] >> 20) & 0xFFF); in docase()
2116 if (errstr && *(errstr+1) == '\0') { in docase()
2117 printf(" errno=0 status=%c",*errstr); in docase()
2120 } else if (errstr && errstr[0] == 'E') { in docase()
2123 printf(" error=%s", errstr && *errstr ? errstr : "0"); in docase()
2128 vet_for_decline(fn, args, result, 0); in docase()
2147 for (i = 0; i < number; i++) { in gencases()
2156 int e = 0x412 + scale; in doubletop()
2157 while (!(x & 0x100000)) in doubletop()
2163 int e = 0x95 + scale; in floatval()
2164 while (!(x & 0x800000)) in floatval()