Lines Matching +full:0 +full:x40300000
21 #if MPFR_VERSION < MPFR_VERSION_NUM(4, 2, 0)
102 uint32 exp = (hl >> 52) & 0x7ff; in set_mpfr_d()
105 if (exp == 0x7ff) { in set_mpfr_d()
106 if (mantissa == 0) in set_mpfr_d()
110 } else if (exp == 0 && mantissa == 0) { in set_mpfr_d()
111 mpfr_set_ui(x, 0, GMP_RNDN); in set_mpfr_d()
112 mpfr_setsign(x, x, sign < 0, GMP_RNDN); in set_mpfr_d()
114 if (exp != 0) in set_mpfr_d()
118 mpfr_set_sj_2exp(x, mantissa * sign, (int)exp - 0x3ff - 52, GMP_RNDN); in set_mpfr_d()
123 uint32 exp = (f >> 23) & 0xff; in set_mpfr_f()
126 if (exp == 0xff) { in set_mpfr_f()
127 if (mantissa == 0) in set_mpfr_f()
131 } else if (exp == 0 && mantissa == 0) { in set_mpfr_f()
132 mpfr_set_ui(x, 0, GMP_RNDN); in set_mpfr_f()
133 mpfr_setsign(x, x, sign < 0, GMP_RNDN); in set_mpfr_f()
135 if (exp != 0) in set_mpfr_f()
139 mpfr_set_sj_2exp(x, mantissa * sign, (int)exp - 0x7f - 23, GMP_RNDN); in set_mpfr_f()
171 *h = 0x7ff80000; in get_mpfr_d()
172 *l = 0; in get_mpfr_d()
173 *extra = 0; in get_mpfr_d()
177 sign = mpfr_signbit(x) ? 0x80000000U : 0; in get_mpfr_d()
180 *h = 0x7ff00000 | sign; in get_mpfr_d()
181 *l = 0; in get_mpfr_d()
182 *extra = 0; in get_mpfr_d()
187 *h = 0x00000000 | sign; in get_mpfr_d()
188 *l = 0; in get_mpfr_d()
189 *extra = 0; in get_mpfr_d()
196 mpfr_set_exp(significand, 0); in get_mpfr_d()
199 * So the IEEE exponent corresponding to exp==0 is 0x3fe. */ in get_mpfr_d()
200 if (exp > 0x400) { in get_mpfr_d()
202 *h = 0x7ff00000 | sign; in get_mpfr_d()
203 *l = 0; in get_mpfr_d()
204 *extra = 0; in get_mpfr_d()
209 if (exp <= -0x3fe || mpfr_zero_p(x)) in get_mpfr_d()
210 exp = -0x3fd; /* denormalise */ in get_mpfr_d()
211 expfield = exp + 0x3fd; /* offset to cancel leading mantissa bit */ in get_mpfr_d()
235 *f = 0x7fc00000; in get_mpfr_f()
236 *extra = 0; in get_mpfr_f()
240 sign = mpfr_signbit(x) ? 0x80000000U : 0; in get_mpfr_f()
243 *f = 0x7f800000 | sign; in get_mpfr_f()
244 *extra = 0; in get_mpfr_f()
249 *f = 0x00000000 | sign; in get_mpfr_f()
250 *extra = 0; in get_mpfr_f()
257 mpfr_set_exp(significand, 0); in get_mpfr_f()
260 * So the IEEE exponent corresponding to exp==0 is 0x7e. */ in get_mpfr_f()
261 if (exp > 0x80) { in get_mpfr_f()
263 *f = 0x7f800000 | sign; in get_mpfr_f()
264 *extra = 0; in get_mpfr_f()
269 if (exp <= -0x7e || mpfr_zero_p(x)) in get_mpfr_f()
270 exp = -0x7d; /* denormalise */ in get_mpfr_f()
271 expfield = exp + 0x7d; /* offset to cancel leading mantissa bit */ in get_mpfr_f()
332 * 0x3c2, i.e. of the order of 2^-61. So we need 1024 bits of pi in test_rred()
363 * NaN in cases where gamma(x) < 0, so it's no use to us. in test_lgamma()
411 (((in)[0] & 0x7F800000) == 0x7F800000 || \
412 (((in)[0] & 0x7F800000) == 0 && ((in)[0]&0x7FFFFFFF) != 0)))
415 (((in)[0] & 0x7FF00000) == 0x7FF00000 || \
416 (((in)[0] & 0x7FF00000) == 0 && (((in)[0] & 0xFFFFF) | (in)[1]) != 0)))
424 if ((0x7FF00000 & ~in[0]) == 0) in is_dinteger()
425 return 0; /* not finite, hence not integer */ in is_dinteger()
427 return in[0] == out[0] && in[1] == out[1]; in is_dinteger()
432 if ((0x7F800000 & ~in[0]) == 0) in is_sinteger()
433 return 0; /* not finite, hence not integer */ in is_sinteger()
435 return in[0] == out[0]; in is_sinteger()
443 if ((in[0] & 0x7FF00000) != 0x7FF00000) in is_dsnan()
444 return 0; /* not the inf/nan exponent */ in is_dsnan()
445 if ((in[0] << 12) == 0 && in[1] == 0) in is_dsnan()
446 return 0; /* inf */ in is_dsnan()
447 if (in[0] & 0x00080000) in is_dsnan()
448 return 0; /* qnan */ in is_dsnan()
453 if ((in[0] & 0x7F800000) != 0x7F800000) in is_ssnan()
454 return 0; /* not the inf/nan exponent */ in is_ssnan()
455 if ((in[0] << 9) == 0) in is_ssnan()
456 return 0; /* inf */ in is_ssnan()
457 if (in[0] & 0x00400000) in is_ssnan()
458 return 0; /* qnan */ in is_ssnan()
476 for (op = 0; op < wrapper_get_nops(ctx); op++) { in universal_wrapper()
497 cases_uniform, 0x3e400000, 0x40300000},
499 cases_uniform_float, 0x39800000, 0x41800000},
501 cases_uniform, 0x3e400000, 0x40300000},
503 cases_uniform_float, 0x39800000, 0x41800000},
505 cases_uniform, 0x3e400000, 0x40300000},
507 cases_uniform_float, 0x39800000, 0x41800000},
509 cases_uniform_float, 0x39800000, 0x41800000},
511 cases_uniform_float, 0x39800000, 0x41800000},
513 cases_uniform, 0x3e400000, 0x40300000},
515 cases_uniform_float, 0x39800000, 0x41800000},
517 cases_uniform, 0x3e400000, 0x40300000},
519 cases_uniform_float, 0x39800000, 0x41800000},
521 cases_uniform, 0x3e400000, 0x40300000},
523 cases_uniform_float, 0x39800000, 0x41800000},
529 cases_uniform, 0x3e400000, 0x3fefffff},
531 cases_uniform_float, 0x39800000, 0x3f7fffff},
533 cases_uniform, 0x3c900000, 0x3fefffff},
535 cases_uniform_float, 0x33800000, 0x3f7fffff},
542 cases_uniform, 0x3e400000, 0x43400000},
544 cases_uniform_float, 0x39800000, 0x4b800000},
550 atan2_cases, 0},
552 atan2_cases_float, 0},
558 cases_uniform, 0x3c900000, 0x40878000},
560 cases_uniform_float, 0x33800000, 0x42dc0000},
562 cases_uniform, 0x3c900000, 0x40878000},
564 cases_uniform_float, 0x33800000, 0x42dc0000},
566 cases_uniform, 0x3e400000, 0x40878000},
568 cases_uniform_float, 0x39800000, 0x42dc0000},
573 cases_uniform, 0x3e400000, 0x40340000},
575 cases_uniform, 0x39800000, 0x41100000},
581 {"log", (funcptr)mpfr_log, args1, {NULL}, log_cases, 0},
582 {"logf", (funcptr)mpfr_log, args1f, {NULL}, log_cases_float, 0},
583 {"log10", (funcptr)mpfr_log10, args1, {NULL}, log_cases, 0},
584 {"log10f", (funcptr)mpfr_log10, args1f, {NULL}, log_cases_float, 0},
588 {"pow", (funcptr)mpfr_pow, args2, {NULL}, pow_cases, 0},
589 {"powf", (funcptr)mpfr_pow, args2f, {NULL}, pow_cases_float, 0},
595 {"rred", (funcptr)test_rred, rred, {NULL}, rred_cases, 0},
596 {"rredf", (funcptr)test_rred, rredf, {NULL}, rred_cases_float, 0},
600 {"sqrt", (funcptr)mpfr_sqrt, args1, {NULL}, log_cases, 0},
601 {"sqrtf", (funcptr)mpfr_sqrt, args1f, {NULL}, log_cases_float, 0},
602 {"cbrt", (funcptr)mpfr_cbrt, args1, {NULL}, log_cases, 0},
603 {"cbrtf", (funcptr)mpfr_cbrt, args1f, {NULL}, log_cases_float, 0},
604 {"hypot", (funcptr)mpfr_hypot, args2, {NULL}, atan2_cases, 0},
605 {"hypotf", (funcptr)mpfr_hypot, args2f, {NULL}, atan2_cases_float, 0},
627 {"isfinite", (funcptr)test_isfinite, classify, {NULL}, cases_uniform, 0, 0x7fffffff},
628 {"isfinitef", (funcptr)test_isfinitef, classifyf, {NULL}, cases_uniform_float, 0, 0x7fffffff},
629 {"isinf", (funcptr)test_isinf, classify, {NULL}, cases_uniform, 0, 0x7fffffff},
630 {"isinff", (funcptr)test_isinff, classifyf, {NULL}, cases_uniform_float, 0, 0x7fffffff},
631 {"isnan", (funcptr)test_isnan, classify, {NULL}, cases_uniform, 0, 0x7fffffff},
632 {"isnanf", (funcptr)test_isnanf, classifyf, {NULL}, cases_uniform_float, 0, 0x7fffffff},
633 {"isnormal", (funcptr)test_isnormal, classify, {NULL}, cases_uniform, 0, 0x7fffffff},
634 {"isnormalf", (funcptr)test_isnormalf, classifyf, {NULL}, cases_uniform_float, 0, 0x7fffffff},
635 {"signbit", (funcptr)test_signbit, classify, {NULL}, cases_uniform, 0, 0x7fffffff},
636 {"signbitf", (funcptr)test_signbitf, classifyf, {NULL}, cases_uniform_float, 0, 0x7fffffff},
637 {"fpclassify", (funcptr)test_fpclassify, classify, {NULL}, cases_uniform, 0, 0x7fffffff},
638 … {"fpclassifyf", (funcptr)test_fpclassifyf, classifyf, {NULL}, cases_uniform_float, 0, 0x7fffffff},
642 {"isgreater", (funcptr)test_isgreater, compare, {NULL}, cases_uniform, 0, 0x7fffffff},
643 {"isgreaterequal", (funcptr)test_isgreaterequal, compare, {NULL}, cases_uniform, 0, 0x7fffffff},
644 {"isless", (funcptr)test_isless, compare, {NULL}, cases_uniform, 0, 0x7fffffff},
645 {"islessequal", (funcptr)test_islessequal, compare, {NULL}, cases_uniform, 0, 0x7fffffff},
646 {"islessgreater", (funcptr)test_islessgreater, compare, {NULL}, cases_uniform, 0, 0x7fffffff},
647 {"isunordered", (funcptr)test_isunordered, compare, {NULL}, cases_uniform, 0, 0x7fffffff},
649 {"isgreaterf", (funcptr)test_isgreaterf, comparef, {NULL}, cases_uniform_float, 0, 0x7fffffff},
650 …{"isgreaterequalf", (funcptr)test_isgreaterequalf, comparef, {NULL}, cases_uniform_float, 0, 0x7ff…
651 {"islessf", (funcptr)test_islessf, comparef, {NULL}, cases_uniform_float, 0, 0x7fffffff},
652 …{"islessequalf", (funcptr)test_islessequalf, comparef, {NULL}, cases_uniform_float, 0, 0x7fffffff},
653 …{"islessgreaterf", (funcptr)test_islessgreaterf, comparef, {NULL}, cases_uniform_float, 0, 0x7ffff…
654 …{"isunorderedf", (funcptr)test_isunorderedf, comparef, {NULL}, cases_uniform_float, 0, 0x7fffffff},
659 {"atanh", (funcptr)mpfr_atanh, args1, {NULL}, cases_uniform, 0x3e400000, 0x3fefffff},
660 {"asinh", (funcptr)mpfr_asinh, args1, {NULL}, cases_uniform, 0x3e400000, 0x3fefffff},
661 {"acosh", (funcptr)mpfr_acosh, args1, {NULL}, cases_uniform_positive, 0x3ff00000, 0x7fefffff},
663 {"atanhf", (funcptr)mpfr_atanh, args1f, {NULL}, cases_uniform_float, 0x32000000, 0x3f7fffff},
664 {"asinhf", (funcptr)mpfr_asinh, args1f, {NULL}, cases_uniform_float, 0x32000000, 0x3f7fffff},
665 …{"acoshf", (funcptr)mpfr_acosh, args1f, {NULL}, cases_uniform_float_positive, 0x3f800000, 0x7f8000…
672 {"csin", (funcptr)mpc_sin, args1c, {NULL}, complex_cases_uniform, 0x3f000000, 0x40300000},
673 … {"csinf", (funcptr)mpc_sin, args1fc, {NULL}, complex_cases_uniform_float, 0x38000000, 0x41800000},
674 {"ccos", (funcptr)mpc_cos, args1c, {NULL}, complex_cases_uniform, 0x3f000000, 0x40300000},
675 … {"ccosf", (funcptr)mpc_cos, args1fc, {NULL}, complex_cases_uniform_float, 0x38000000, 0x41800000},
676 {"ctan", (funcptr)mpc_tan, args1c, {NULL}, complex_cases_uniform, 0x3f000000, 0x40300000},
677 … {"ctanf", (funcptr)mpc_tan, args1fc, {NULL}, complex_cases_uniform_float, 0x38000000, 0x41800000},
679 {"casin", (funcptr)mpc_asin, args1c, {NULL}, complex_cases_uniform, 0x3f000000, 0x40300000},
680 …{"casinf", (funcptr)mpc_asin, args1fc, {NULL}, complex_cases_uniform_float, 0x38000000, 0x41800000…
681 {"cacos", (funcptr)mpc_acos, args1c, {NULL}, complex_cases_uniform, 0x3f000000, 0x40300000},
682 …{"cacosf", (funcptr)mpc_acos, args1fc, {NULL}, complex_cases_uniform_float, 0x38000000, 0x41800000…
683 {"catan", (funcptr)mpc_atan, args1c, {NULL}, complex_cases_uniform, 0x3f000000, 0x40300000},
684 …{"catanf", (funcptr)mpc_atan, args1fc, {NULL}, complex_cases_uniform_float, 0x38000000, 0x41800000…
686 {"csinh", (funcptr)mpc_sinh, args1c, {NULL}, complex_cases_uniform, 0x3f000000, 0x40300000},
687 …{"csinhf", (funcptr)mpc_sinh, args1fc, {NULL}, complex_cases_uniform_float, 0x38000000, 0x41800000…
688 {"ccosh", (funcptr)mpc_cosh, args1c, {NULL}, complex_cases_uniform, 0x3f000000, 0x40300000},
689 …{"ccoshf", (funcptr)mpc_cosh, args1fc, {NULL}, complex_cases_uniform_float, 0x38000000, 0x41800000…
690 {"ctanh", (funcptr)mpc_tanh, args1c, {NULL}, complex_cases_uniform, 0x3f000000, 0x40300000},
691 …{"ctanhf", (funcptr)mpc_tanh, args1fc, {NULL}, complex_cases_uniform_float, 0x38000000, 0x41800000…
693 {"casinh", (funcptr)mpc_asinh, args1c, {NULL}, complex_cases_uniform, 0x3f000000, 0x40300000},
694 …{"casinhf", (funcptr)mpc_asinh, args1fc, {NULL}, complex_cases_uniform_float, 0x38000000, 0x418000…
695 {"cacosh", (funcptr)mpc_acosh, args1c, {NULL}, complex_cases_uniform, 0x3f000000, 0x40300000},
696 …{"cacoshf", (funcptr)mpc_acosh, args1fc, {NULL}, complex_cases_uniform_float, 0x38000000, 0x418000…
697 {"catanh", (funcptr)mpc_atanh, args1c, {NULL}, complex_cases_uniform, 0x3f000000, 0x40300000},
698 …{"catanhf", (funcptr)mpc_atanh, args1fc, {NULL}, complex_cases_uniform_float, 0x38000000, 0x418000…
700 {"cexp", (funcptr)mpc_exp, args1c, {NULL}, complex_cases_uniform, 0x3c900000, 0x40862000},
701 {"cpow", (funcptr)test_cpow, args2c, {NULL}, complex_pow_cases, 0x3fc00000, 0x40000000},
702 {"clog", (funcptr)mpc_log, args1c, {NULL}, complex_log_cases, 0, 0},
703 {"csqrt", (funcptr)mpc_sqrt, args1c, {NULL}, complex_log_cases, 0, 0},
705 … {"cexpf", (funcptr)mpc_exp, args1fc, {NULL}, complex_cases_uniform_float, 0x24800000, 0x42b00000},
706 {"cpowf", (funcptr)test_cpow, args2fc, {NULL}, complex_pow_cases_float, 0x3e000000, 0x41000000},
707 {"clogf", (funcptr)mpc_log, args1fc, {NULL}, complex_log_cases_float, 0, 0},
708 {"csqrtf", (funcptr)mpc_sqrt, args1fc, {NULL}, complex_log_cases_float, 0, 0},
710 {"cdiv", (funcptr)mpc_div, args2c, {NULL}, complex_arithmetic_cases, 0, 0},
711 {"cmul", (funcptr)mpc_mul, args2c, {NULL}, complex_arithmetic_cases, 0, 0},
712 {"cadd", (funcptr)mpc_add, args2c, {NULL}, complex_arithmetic_cases, 0, 0},
713 {"csub", (funcptr)mpc_sub, args2c, {NULL}, complex_arithmetic_cases, 0, 0},
715 {"cdivf", (funcptr)mpc_div, args2fc, {NULL}, complex_arithmetic_cases_float, 0, 0},
716 {"cmulf", (funcptr)mpc_mul, args2fc, {NULL}, complex_arithmetic_cases_float, 0, 0},
717 {"caddf", (funcptr)mpc_add, args2fc, {NULL}, complex_arithmetic_cases_float, 0, 0},
718 {"csubf", (funcptr)mpc_sub, args2fc, {NULL}, complex_arithmetic_cases_float, 0, 0},
720 {"cabsf", (funcptr)mpc_abs, args1fcr, {NULL}, complex_arithmetic_cases_float, 0, 0},
721 {"cabs", (funcptr)mpc_abs, args1cr, {NULL}, complex_arithmetic_cases, 0, 0},
722 {"cargf", (funcptr)mpc_arg, args1fcr, {NULL}, complex_arithmetic_cases_float, 0, 0},
723 {"carg", (funcptr)mpc_arg, args1cr, {NULL}, complex_arithmetic_cases, 0, 0},
724 {"cimagf", (funcptr)mpc_imag, args1fcr, {NULL}, complex_arithmetic_cases_float, 0, 0},
725 {"cimag", (funcptr)mpc_imag, args1cr, {NULL}, complex_arithmetic_cases, 0, 0},
726 {"conjf", (funcptr)mpc_conj, args1fc, {NULL}, complex_arithmetic_cases_float, 0, 0},
727 {"conj", (funcptr)mpc_conj, args1c, {NULL}, complex_arithmetic_cases, 0, 0},
728 {"cprojf", (funcptr)mpc_proj, args1fc, {NULL}, complex_arithmetic_cases_float, 0, 0},
729 {"cproj", (funcptr)mpc_proj, args1c, {NULL}, complex_arithmetic_cases, 0, 0},
730 {"crealf", (funcptr)mpc_real, args1fcr, {NULL}, complex_arithmetic_cases_float, 0, 0},
731 {"creal", (funcptr)mpc_real, args1cr, {NULL}, complex_arithmetic_cases, 0, 0},
732 {"erfcf", (funcptr)mpfr_erfc, args1f, {NULL}, cases_biased_float, 0x1e800000, 0x41000000},
733 {"erfc", (funcptr)mpfr_erfc, args1, {NULL}, cases_biased, 0x3bd00000, 0x403c0000},
734 {"erff", (funcptr)mpfr_erf, args1f, {NULL}, cases_biased_float, 0x03800000, 0x40700000},
735 {"erf", (funcptr)mpfr_erf, args1, {NULL}, cases_biased, 0x00800000, 0x40200000},
736 {"exp2f", (funcptr)mpfr_exp2, args1f, {NULL}, cases_uniform_float, 0x33800000, 0x43c00000},
737 {"exp2", (funcptr)mpfr_exp2, args1, {NULL}, cases_uniform, 0x3ca00000, 0x40a00000},
738 {"expm1f", (funcptr)mpfr_expm1, args1f, {NULL}, cases_uniform_float, 0x33000000, 0x43800000},
739 {"expm1", (funcptr)mpfr_expm1, args1, {NULL}, cases_uniform, 0x3c900000, 0x409c0000},
740 {"fmaxf", (funcptr)mpfr_max, args2f, {NULL}, minmax_cases_float, 0, 0x7f7fffff},
741 {"fmax", (funcptr)mpfr_max, args2, {NULL}, minmax_cases, 0, 0x7fefffff},
742 {"fminf", (funcptr)mpfr_min, args2f, {NULL}, minmax_cases_float, 0, 0x7f7fffff},
743 {"fmin", (funcptr)mpfr_min, args2, {NULL}, minmax_cases, 0, 0x7fefffff},
744 {"lgammaf", (funcptr)test_lgamma, args1f, {NULL}, cases_uniform_float, 0x01800000, 0x7f800000},
745 {"lgamma", (funcptr)test_lgamma, args1, {NULL}, cases_uniform, 0x00100000, 0x7ff00000},
746 {"log1pf", (funcptr)mpfr_log1p, args1f, {NULL}, log1p_cases_float, 0, 0},
747 {"log1p", (funcptr)mpfr_log1p, args1, {NULL}, log1p_cases, 0, 0},
748 {"log2f", (funcptr)mpfr_log2, args1f, {NULL}, log_cases_float, 0, 0},
749 {"log2", (funcptr)mpfr_log2, args1, {NULL}, log_cases, 0, 0},
750 {"tgammaf", (funcptr)mpfr_gamma, args1f, {NULL}, cases_uniform_float, 0x2f800000, 0x43000000},
751 {"tgamma", (funcptr)mpfr_gamma, args1, {NULL}, cases_uniform, 0x3c000000, 0x40800000},
757 #define random_sign ( random_upto(1) ? 0x80000000 : 0 )
760 return !((x[0] & 0x7FFFFFFF) || x[1]); in iszero()
766 cases_uniform(out,0x00100000,0x7fefffff); in complex_log_cases()
767 cases_uniform(out+2,0x00100000,0x7fefffff); in complex_log_cases()
773 cases_uniform_float(out,0x00800000,0x7f7fffff); in complex_log_cases_float()
774 cases_uniform_float(out+2,0x00800000,0x7f7fffff); in complex_log_cases_float()
820 cases_uniform(out,0x3fe00000, 0x40000000); in complex_pow_cases()
821 cases_uniform(out+2,0x3fe00000, 0x40000000); in complex_pow_cases()
822 cases_uniform(out+4,0x3f800000, 0x40600000); in complex_pow_cases()
823 cases_uniform(out+6,0x3f800000, 0x40600000); in complex_pow_cases()
832 cases_uniform_float(out,0x3f000000, 0x40000000); in complex_pow_cases_float()
833 cases_uniform_float(out+2,0x3f000000, 0x40000000); in complex_pow_cases_float()
834 cases_uniform_float(out+4,0x3d600000, 0x41900000); in complex_pow_cases_float()
835 cases_uniform_float(out+6,0x3d600000, 0x41900000); in complex_pow_cases_float()
840 cases_uniform(out,0,0x7fefffff); in complex_arithmetic_cases()
841 cases_uniform(out+2,0,0x7fefffff); in complex_arithmetic_cases()
842 cases_uniform(out+4,0,0x7fefffff); in complex_arithmetic_cases()
843 cases_uniform(out+6,0,0x7fefffff); in complex_arithmetic_cases()
848 cases_uniform_float(out,0,0x7f7fffff); in complex_arithmetic_cases_float()
849 cases_uniform_float(out+2,0,0x7f7fffff); in complex_arithmetic_cases_float()
850 cases_uniform_float(out+4,0,0x7f7fffff); in complex_arithmetic_cases_float()
851 cases_uniform_float(out+6,0,0x7f7fffff); in complex_arithmetic_cases_float()
869 premax = preptr = 0; in float32_case()
875 -127, -126, -125, -24, -4, -3, -2, -1, 0, 1, 2, 3, 4, in float32_case()
895 preptr = 0; in float32_case()
896 for (sign = 0; sign <= 1; sign++) { in float32_case()
897 for (eptr = 0; eptr < sizeof(exps)/sizeof(*exps); eptr++) { in float32_case()
898 se = (sign ? 0x80000000 : 0) | ((exps[eptr]+127) << 23); in float32_case()
902 specifics[preptr++] = se | 0; in float32_case()
906 specifics[preptr++] = se | 0x7FFFFF; in float32_case()
910 for (j = 1; j && j <= 0x400000; j <<= 1) in float32_case()
915 for (j = 1; j && j <= 0x400000; j <<= 1) in float32_case()
916 specifics[preptr++] = se | (0x7FFFFF ^ j); in float32_case()
920 for (j = 2; j && j <= 0x100000; j <<= 1) in float32_case()
925 for (j = 4; j && j <= 0x200000; j <<= 1) in float32_case()
926 specifics[preptr++] = se | (0x7FFFFF ^ (j-1)); in float32_case()
959 * - with prob 1/5, all 0s down to some point and then random in float32_case()
960 * - with prob 1/5, all 0s up to some point and then random in float32_case()
966 case 0: in float32_case()
981 f &= 0x7FFFFF; in float32_case()
982 f |= (random32() & 0xFF800000);/* FIXME - do better */ in float32_case()
996 premax = preptr = 0; in float64_case()
1003 -1, 0, 1, 2, 3, 4, 29, 30, 31, 32, 53, 61, 62, 63, 64, 127, in float64_case()
1023 preptr = 0; in float64_case()
1024 for (sign = 0; sign <= 1; sign++) { in float64_case()
1025 for (eptr = 0; eptr < sizeof(exps)/sizeof(*exps); eptr++) { in float64_case()
1026 se = (sign ? 0x80000000 : 0) | ((exps[eptr]+1023) << 20); in float64_case()
1030 specifics[preptr][0] = 0; in float64_case()
1031 specifics[preptr][1] = 0; in float64_case()
1032 specifics[preptr++][0] |= se; in float64_case()
1036 specifics[preptr][0] = 0xFFFFF; in float64_case()
1037 specifics[preptr][1] = ~0; in float64_case()
1038 specifics[preptr++][0] |= se; in float64_case()
1042 for (j = 1; j && j <= 0x80000000; j <<= 1) { in float64_case()
1043 specifics[preptr][0] = 0; in float64_case()
1045 specifics[preptr++][0] |= se; in float64_case()
1046 if (j & 0xFFFFF) { in float64_case()
1047 specifics[preptr][0] = j; in float64_case()
1048 specifics[preptr][1] = 0; in float64_case()
1049 specifics[preptr++][0] |= se; in float64_case()
1055 for (j = 1; j && j <= 0x80000000; j <<= 1) { in float64_case()
1056 specifics[preptr][0] = 0xFFFFF; in float64_case()
1058 specifics[preptr++][0] |= se; in float64_case()
1059 if (j & 0xFFFFF) { in float64_case()
1060 specifics[preptr][0] = 0xFFFFF ^ j; in float64_case()
1061 specifics[preptr][1] = ~0; in float64_case()
1062 specifics[preptr++][0] |= se; in float64_case()
1068 for (j = 2; j && j <= 0x80000000; j <<= 1) { in float64_case()
1069 specifics[preptr][0] = 0; in float64_case()
1071 specifics[preptr++][0] |= se; in float64_case()
1073 for (j = 1; j && j <= 0x20000; j <<= 1) { in float64_case()
1074 specifics[preptr][0] = 2*j-1; in float64_case()
1075 specifics[preptr][1] = ~0; in float64_case()
1076 specifics[preptr++][0] |= se; in float64_case()
1081 for (j = 4; j && j <= 0x80000000; j <<= 1) { in float64_case()
1082 specifics[preptr][0] = 0xFFFFF; in float64_case()
1084 specifics[preptr++][0] |= se; in float64_case()
1086 for (j = 1; j && j <= 0x40000; j <<= 1) { in float64_case()
1087 specifics[preptr][0] = 0xFFFFF ^ (j-1); in float64_case()
1088 specifics[preptr][1] = 0; in float64_case()
1089 specifics[preptr++][0] |= se; in float64_case()
1109 t = specifics[n][0]; in float64_case()
1110 specifics[n][0] = specifics[preptr-1][0]; in float64_case()
1111 specifics[preptr-1][0] = t; /* (not really needed) */ in float64_case()
1112 ret[0] = t; in float64_case()
1127 * - with prob 1/5, all 0s down to some point and then random in float64_case()
1128 * - with prob 1/5, all 0s up to some point and then random in float64_case()
1135 case 0: in float64_case()
1143 f = ~0; in float64_case()
1152 f = 0; in float64_case()
1161 g = 0; in float64_case()
1170 g = ~0; in float64_case()
1174 g &= 0xFFFFF; in float64_case()
1175 g |= (random32() & 0xFFF00000);/* FIXME - do better */ in float64_case()
1176 ret[0] = g; in float64_case()
1184 out[0] = highbound - random_upto_biased(highbound-lowbound, 8); in cases_biased()
1185 out[1] = random_upto(0xFFFFFFFF); in cases_biased()
1186 out[0] |= random_sign; in cases_biased()
1193 out[0] = highbound - random_upto_biased(highbound-lowbound, 8); in cases_biased_positive()
1194 out[1] = random_upto(0xFFFFFFFF); in cases_biased_positive()
1201 out[0] = highbound - random_upto_biased(highbound-lowbound, 8); in cases_biased_float()
1202 out[1] = 0; in cases_biased_float()
1203 out[0] |= random_sign; in cases_biased_float()
1244 out[0] = highbound - random_upto(highbound-lowbound); in cases_uniform()
1245 out[1] = random_upto(0xFFFFFFFF); in cases_uniform()
1246 out[0] |= random_sign; in cases_uniform()
1252 out[0] = highbound - random_upto(highbound-lowbound); in cases_uniform_float()
1253 out[1] = 0; in cases_uniform_float()
1254 out[0] |= random_sign; in cases_uniform_float()
1261 out[0] = highbound - random_upto(highbound-lowbound); in cases_uniform_positive()
1262 out[1] = random_upto(0xFFFFFFFF); in cases_uniform_positive()
1268 out[0] = highbound - random_upto(highbound-lowbound); in cases_uniform_float_positive()
1269 out[1] = 0; in cases_uniform_float_positive()
1277 out[0] = random_upto(0x7FEFFFFF); in log_cases()
1278 out[1] = random_upto(0xFFFFFFFF); in log_cases()
1285 out[0] = random_upto(0x7F7FFFFF); in log_cases_float()
1286 out[1] = 0; in log_cases_float()
1293 if (sign == 0) { in log1p_cases()
1294 cases_uniform_positive(out, 0x3c700000, 0x43400000); in log1p_cases()
1296 cases_uniform_positive(out, 0x3c000000, 0x3ff00000); in log1p_cases()
1298 out[0] |= sign; in log1p_cases()
1304 if (sign == 0) { in log1p_cases_float()
1305 cases_uniform_float_positive(out, 0x32000000, 0x4c000000); in log1p_cases_float()
1307 cases_uniform_float_positive(out, 0x30000000, 0x3f800000); in log1p_cases_float()
1309 out[0] |= sign; in log1p_cases_float()
1315 out[0] = random_upto(0x7FEFFFFF); in minmax_cases()
1316 out[1] = random_upto(0xFFFFFFFF); in minmax_cases()
1317 out[0] |= random_sign; in minmax_cases()
1318 out[2] = random_upto(0x7FEFFFFF); in minmax_cases()
1319 out[3] = random_upto(0xFFFFFFFF); in minmax_cases()
1327 out[0] = random_upto(0x7F7FFFFF); in minmax_cases_float()
1328 out[1] = 0; in minmax_cases_float()
1329 out[0] |= random_sign; in minmax_cases_float()
1330 out[2] = random_upto(0x7F7FFFFF); in minmax_cases_float()
1331 out[3] = 0; in minmax_cases_float()
1339 out[0] = ((0x3fc00000 + random_upto(0x036fffff)) | in rred_cases()
1341 out[1] = random_upto(0xFFFFFFFF); in rred_cases()
1348 out[0] = ((0x3e000000 + random_upto(0x0cffffff)) | in rred_cases_float()
1350 out[1] = 0; /* for iszero */ in rred_cases_float()
1359 if (expdiff < 0) { in atan2_cases()
1363 swap = 0; in atan2_cases()
1364 out[swap ^ 0] = random_upto(0x7FEFFFFF-((expdiff+1)<<20)); in atan2_cases()
1365 out[swap ^ 2] = random_upto(((expdiff+1)<<20)-1) + out[swap ^ 0]; in atan2_cases()
1366 out[1] = random_upto(0xFFFFFFFF); in atan2_cases()
1367 out[3] = random_upto(0xFFFFFFFF); in atan2_cases()
1368 out[0] |= random_sign; in atan2_cases()
1378 if (expdiff < 0) { in atan2_cases_float()
1382 swap = 0; in atan2_cases_float()
1383 out[swap ^ 0] = random_upto(0x7F7FFFFF-((expdiff+1)<<23)); in atan2_cases_float()
1384 out[swap ^ 2] = random_upto(((expdiff+1)<<23)-1) + out[swap ^ 0]; in atan2_cases_float()
1385 out[0] |= random_sign; in atan2_cases_float()
1387 out[1] = out[3] = 0; /* for iszero */ in atan2_cases_float()
1394 * Pick an exponent e (-0x33 to +0x7FE) for x, and here's the in pow_cases()
1397 * For e < 0x3FE, the range is [-0x400/(0x3FE-e),+0x432/(0x3FE-e)] in pow_cases()
1398 * For e > 0x3FF, the range is [-0x432/(e-0x3FF),+0x400/(e-0x3FF)] in pow_cases()
1400 * For e == 0x3FE or e == 0x3FF, the range gets infinite at one in pow_cases()
1403 * 0x3ff00000.00000001 whereas 52 is anything at least as big in pow_cases()
1404 * as 0x3ff80000.00000000; for e == 0x3fe, 1 necessarily means in pow_cases()
1405 * 0x3fefffff.ffffffff and 52 is anything at most as big as in pow_cases()
1406 * 0x3fe80000.00000000). Then, as it happens, a sensible in pow_cases()
1407 * maximum power is 2^(63-n) for e == 0x3fe, and 2^(62-n) for in pow_cases()
1408 * e == 0x3ff. in pow_cases()
1419 const uint32 pmin = 0x3e100000; in pow_cases()
1425 0x3FE - random_upto_biased(0x431,2) : /* small */ in pow_cases()
1426 0x3FF + random_upto_biased(0x3FF,2)); /* big */ in pow_cases()
1431 if (e < 0x3FE || e > 0x3FF) { in pow_cases()
1433 if (e < 0x3FE) in pow_cases()
1434 imin = 0x40000 / (0x3FE - e), imax = 0x43200 / (0x3FE - e); in pow_cases()
1436 imin = 0x43200 / (e - 0x3FF), imax = 0x40000 / (e - 0x3FF); in pow_cases()
1441 n = (e > 0 ? 53 : 52+e); in pow_cases()
1445 if (e == 0x3FE) in pow_cases()
1449 dmax = (dmax << 20) + 0x3FF00000; in pow_cases()
1454 out[0] = 0; in pow_cases()
1457 out[0] = 1; in pow_cases()
1458 out[1] = random_upto(0xFFFFFFFF); in pow_cases()
1460 out[0] = random_upto((1 << (n-33)) - 1) + (1 << (n-33)); in pow_cases()
1461 out[1] = random_upto(0xFFFFFFFF); in pow_cases()
1463 /* Negate the mantissa if e == 0x3FE. */ in pow_cases()
1464 if (e == 0x3FE) { in pow_cases()
1466 out[0] = -out[0]; in pow_cases()
1467 if (out[1]) out[0]--; in pow_cases()
1470 out[0] &= 0xFFFFF; in pow_cases()
1471 out[0] |= ((e > 0 ? e : 0) << 20); in pow_cases()
1478 out[2] = (dmin - random_upto_biased(dmin-pmin, 10)) | 0x80000000; in pow_cases()
1480 out[3] = random_upto(0xFFFFFFFF); in pow_cases()
1485 * Pick an exponent e (-0x16 to +0xFE) for x, and here's the in pow_cases_float()
1488 * For e < 0x7E, the range is [-0x80/(0x7E-e),+0x95/(0x7E-e)] in pow_cases_float()
1489 * For e > 0x7F, the range is [-0x95/(e-0x7F),+0x80/(e-0x7F)] in pow_cases_float()
1491 * For e == 0x7E or e == 0x7F, the range gets infinite at one in pow_cases_float()
1494 * 0x3f800001 whereas 23 is anything at least as big as in pow_cases_float()
1495 * 0x3fc00000; for e == 0x7e, 1 necessarily means 0x3f7fffff in pow_cases_float()
1496 * and 23 is anything at most as big as 0x3f400000). Then, as in pow_cases_float()
1498 * 0x7e, and 2^(30-n) for e == 0x7f. in pow_cases_float()
1509 const uint32 pmin = 0x38000000; in pow_cases_float()
1515 0x7E - random_upto_biased(0x94,2) : /* small */ in pow_cases_float()
1516 0x7F + random_upto_biased(0x7f,2)); /* big */ in pow_cases_float()
1521 if (e < 0x7E || e > 0x7F) { in pow_cases_float()
1523 if (e < 0x7E) in pow_cases_float()
1524 imin = 0x8000 / (0x7e - e), imax = 0x9500 / (0x7e - e); in pow_cases_float()
1526 imin = 0x9500 / (e - 0x7f), imax = 0x8000 / (e - 0x7f); in pow_cases_float()
1531 n = (e > 0 ? 24 : 23+e); in pow_cases_float()
1535 if (e == 0x7E) in pow_cases_float()
1539 dmax = (dmax << 23) + 0x3F800000; in pow_cases_float()
1543 out[0] = random_upto((1 << (n-1)) - 1) + (1 << (n-1)); in pow_cases_float()
1544 out[1] = 0; in pow_cases_float()
1545 /* Negate the mantissa if e == 0x7E. */ in pow_cases_float()
1546 if (e == 0x7E) { in pow_cases_float()
1547 out[0] = -out[0]; in pow_cases_float()
1550 out[0] &= 0x7FFFFF; in pow_cases_float()
1551 out[0] |= ((e > 0 ? e : 0) << 23); in pow_cases_float()
1558 out[2] = (dmin - random_upto_biased(dmin-pmin, 10)) | 0x80000000; in pow_cases_float()
1560 out[3] = 0; in pow_cases_float()
1564 int declined = 0; in vet_for_decline()
1574 declined |= lib_fo && is_dhard(args+0); in vet_for_decline()
1582 declined |= lib_fo && is_shard(args+0); in vet_for_decline()
1589 declined |= lib_fo && is_dhard(args+0); in vet_for_decline()
1598 declined |= lib_fo && is_shard(args+0); in vet_for_decline()
1602 declined |= lib_fo && is_dhard(args+0); in vet_for_decline()
1608 declined |= lib_fo && is_shard(args+0); in vet_for_decline()
1636 declined |= lib_fo && is_dhard(result+0); in vet_for_decline()
1643 declined |= lib_fo && is_shard(result+0); in vet_for_decline()
1647 declined |= lib_fo && is_dhard(result+0); in vet_for_decline()
1652 declined |= lib_fo && is_shard(result+0); in vet_for_decline()
1689 rejected = 0; /* FIXME */ in docase()
1698 printf(" op1=%08x.%08x", args[0], args[1]); in docase()
1706 printf(" op1=%08x", args[0]); in docase()
1711 printf(" op1=%08x.%08x", args[0], args[1]); in docase()
1718 printf(" op1=%08x", args[0]); in docase()
1722 printf(" op1=%08x.%08x", args[0], args[1]); in docase()
1727 printf(" op1r=%08x.%08x", args[0], args[1]); in docase()
1731 printf(" op1r=%08x.%08x", args[0], args[1]); in docase()
1738 printf(" op1r=%08x", args[0]); in docase()
1742 printf(" op1r=%08x", args[0]); in docase()
1759 if (rejected == 0) { in docase()
1762 set_mpfr_d(a, args[0], args[1]); in docase()
1765 get_mpfr_d(r, &result[0], &result[1], &result[2]); in docase()
1768 get_mpfr_d(r, &result[0], &result[1], &result[2]); in docase()
1771 set_mpc_d(ac, args[0], args[1], args[2], args[3]); in docase()
1774 get_mpfr_d(r, &result[0], &result[1], &result[2]); in docase()
1777 get_mpfr_d(r, &result[0], &result[1], &result[2]); in docase()
1780 set_mpfr_f(a, args[0]); in docase()
1783 get_mpfr_f(r, &result[0], &result[1]); in docase()
1786 get_mpfr_f(r, &result[0], &result[1]); in docase()
1789 set_mpc_f(ac, args[0], args[2]); in docase()
1792 get_mpfr_f(r, &result[0], &result[1]); in docase()
1795 get_mpfr_f(r, &result[0], &result[1]); in docase()
1798 set_mpfr_d(a, args[0], args[1]); in docase()
1803 get_mpfr_d(r, &result[0], &result[1], &result[2]); in docase()
1806 get_mpfr_d(r, &result[0], &result[1], &result[2]); in docase()
1809 set_mpfr_f(a, args[0]); in docase()
1814 get_mpfr_f(r, &result[0], &result[1]); in docase()
1817 get_mpfr_f(r, &result[0], &result[1]); in docase()
1820 set_mpfr_d(a, args[0], args[1]); in docase()
1823 get_mpfr_d(r, &result[0], &result[1], &result[2]); in docase()
1828 get_mpfr_d(r, &result[0], &result[1], &result[2]); in docase()
1831 set_mpfr_f(a, args[0]); in docase()
1834 get_mpfr_f(r, &result[0], &result[1]); in docase()
1839 get_mpfr_f(r, &result[0], &result[1]); in docase()
1870 errstr = ((testclassify)(fn->func))(args, &result[0]); in docase()
1873 errstr = ((testclassifyf)(fn->func))(args, &result[0]); in docase()
1876 set_mpc_d(ac, args[0], args[1], args[2], args[3]); in docase()
1879 get_mpc_d(rc, &result[0], &result[1], &result[2], &result[4], &result[5], &result[6]); in docase()
1882 … get_mpc_d(rc, &result[0], &result[1], &result[2], &result[4], &result[5], &result[6]); in docase()
1885 set_mpc_d(ac, args[0], args[1], args[2], args[3]); in docase()
1890 get_mpc_d(rc, &result[0], &result[1], &result[2], &result[4], &result[5], &result[6]); in docase()
1893 … get_mpc_d(rc, &result[0], &result[1], &result[2], &result[4], &result[5], &result[6]); in docase()
1896 set_mpc_f(ac, args[0], args[2]); in docase()
1899 get_mpc_f(rc, &result[0], &result[1], &result[4], &result[5]); in docase()
1902 get_mpc_f(rc, &result[0], &result[1], &result[4], &result[5]); in docase()
1905 set_mpc_f(ac, args[0], args[2]); in docase()
1910 get_mpc_f(rc, &result[0], &result[1], &result[4], &result[5]); in docase()
1913 get_mpc_f(rc, &result[0], &result[1], &result[4], &result[5]); in docase()
1927 if (rejected == 0) { in docase()
1930 if ((result[0] & 0x7FFFFFFF) == 0 && result[1] == 0) { in docase()
1932 * If the output is +0 or -0 apart from the extra in docase()
1963 if (result[2] < 0x40000000) { in docase()
1969 printextra = 0; in docase()
1976 } else if (!(result[0] & 0x7ff00000)) { in docase()
1994 } else if ((result[0] & 0x7FFFFFFF) > 0x7FEFFFFF) { in docase()
2001 (args[0] & 0x80000000) != 0 && /* negative */ in docase()
2007 printextra = 0; in docase()
2010 /* lgamma(0) is also a pole. */ in docase()
2013 printextra = 0; in docase()
2018 if (!printextra || (rejected && !(rejected==1 && result[2]!=0))) { in docase()
2020 result[0], result[1]); in docase()
2023 result[0], result[1], (result[2] >> 20) & 0xFFF); in docase()
2034 if (rejected == 0) { in docase()
2037 if ((result[0] & 0x7FFFFFFF) == 0) { in docase()
2044 if (result[1] < 0x40000000) { in docase()
2046 printextra = 0; in docase()
2050 } else if (!(result[0] & 0x7f800000)) { in docase()
2065 } else if ((result[0] & 0x7FFFFFFF) > 0x7F7FFFFF) { in docase()
2072 (args[0] & 0x80000000) != 0 && /* negative */ in docase()
2078 printextra = 0; in docase()
2081 /* lgamma(0) is also a pole. */ in docase()
2084 printextra = 0; in docase()
2089 if (!printextra || (rejected && !(rejected==1 && result[1]!=0))) { in docase()
2091 result[0]); in docase()
2094 result[0], (result[1] >> 20) & 0xFFF); in docase()
2103 printf(" result=%08x.%08x", result[0], result[1]); in docase()
2108 printf(" result=%08x", result[0]); in docase()
2111 printf(" result=%08x.%08x res2=%08x", result[0], result[1], in docase()
2116 result[0], result[1], result[2], result[3]); in docase()
2121 printf(" result=%08x res2=%08x", result[0], result[2]); in docase()
2127 printf(" result=%x", result[0]); in docase()
2131 if (0/* errstr */) { in docase()
2132 printf(" resultr=%08x.%08x", result[0], result[1]); in docase()
2136 result[0], result[1], (result[2] >> 20) & 0xFFF); in docase()
2138 result[4], result[5], (result[6] >> 20) & 0xFFF); in docase()
2145 if (0/* errstr */) { in docase()
2146 printf(" resultr=%08x", result[0]); in docase()
2150 result[0], (result[1] >> 20) & 0xFFF); in docase()
2152 result[4], (result[5] >> 20) & 0xFFF); in docase()
2159 if (errstr && *(errstr+1) == '\0') { in docase()
2160 printf(" errno=0 status=%c",*errstr); in docase()
2163 } else if (errstr && errstr[0] == 'E') { in docase()
2166 printf(" error=%s", errstr && *errstr ? errstr : "0"); in docase()
2171 vet_for_decline(fn, args, result, 0); in docase()
2190 for (i = 0; i < number; i++) { in gencases()
2199 int e = 0x412 + scale; in doubletop()
2200 while (!(x & 0x100000)) in doubletop()
2206 int e = 0x95 + scale; in floatval()
2207 while (!(x & 0x800000)) in floatval()