Lines Matching refs:st0_ptr

34 static int trig_arg(FPU_REG *st0_ptr, int even)  in trig_arg()  argument
42 if (exponent(st0_ptr) >= 63) { in trig_arg()
50 setpositive(st0_ptr); in trig_arg()
51 tag = FPU_u_div(st0_ptr, &CONST_PI2, &tmp, PR_64_BITS | RC_CHOP | 0x3f, in trig_arg()
58 rem_kernel(significand(st0_ptr), in trig_arg()
61 q, exponent(st0_ptr) - exponent(&CONST_PI2)); in trig_arg()
77 if ((exponent(st0_ptr) <= exponent(&CONST_PI2extra) + 64) in trig_arg()
92 if (signnegative(st0_ptr)) { in trig_arg()
97 setpositive(st0_ptr); in trig_arg()
110 && (exponent(st0_ptr) <= exponent(&CONST_PI2extra) + 64)) in trig_arg()
126 if ((exponent(st0_ptr) == exponent(&CONST_PI2)) && in trig_arg()
127 ((st0_ptr->sigh > CONST_PI2.sigh) in trig_arg()
128 || ((st0_ptr->sigh == CONST_PI2.sigh) in trig_arg()
129 && (st0_ptr->sigl > CONST_PI2.sigl)))) { in trig_arg()
180 static void single_arg_error(FPU_REG *st0_ptr, u_char st0_tag) in single_arg_error() argument
185 real_1op_NaN(st0_ptr); /* return with a NaN in st(0) */ in single_arg_error()
192 static void single_arg_2_error(FPU_REG *st0_ptr, u_char st0_tag) in single_arg_2_error() argument
198 isNaN = (exponent(st0_ptr) == EXP_OVER) in single_arg_2_error()
199 && (st0_ptr->sigh & 0x80000000); in single_arg_2_error()
200 if (isNaN && !(st0_ptr->sigh & 0x40000000)) { /* Signaling ? */ in single_arg_2_error()
205 st0_ptr->sigh |= 0x40000000; in single_arg_2_error()
207 FPU_copy_to_reg0(st0_ptr, TAG_Special); in single_arg_2_error()
212 FPU_copy_to_reg0(st0_ptr, TAG_Special); in single_arg_2_error()
233 static void f2xm1(FPU_REG *st0_ptr, u_char tag) in f2xm1() argument
241 if (exponent(st0_ptr) < 0) { in f2xm1()
244 FPU_to_exp16(st0_ptr, &a); in f2xm1()
247 poly_2xm1(getsign(st0_ptr), &a, st0_ptr); in f2xm1()
257 tag = FPU_Special(st0_ptr); in f2xm1()
265 if (signnegative(st0_ptr)) { in f2xm1()
268 setnegative(st0_ptr); in f2xm1()
272 single_arg_error(st0_ptr, tag); in f2xm1()
276 static void fptan(FPU_REG *st0_ptr, u_char st0_tag) in fptan() argument
280 u_char arg_sign = getsign(st0_ptr); in fptan()
299 if (exponent(st0_ptr) > -40) { in fptan()
300 if ((q = trig_arg(st0_ptr, 0)) == -1) { in fptan()
305 poly_tan(st0_ptr); in fptan()
306 setsign(st0_ptr, (q & 1) ^ (arg_sign != 0)); in fptan()
314 FPU_to_exp16(st0_ptr, st0_ptr); in fptan()
317 FPU_round(st0_ptr, 1, 0, FULL_PRECISION, arg_sign); in fptan()
333 st0_tag = FPU_Special(st0_ptr); in fptan()
352 single_arg_2_error(st0_ptr, st0_tag); in fptan()
355 static void fxtract(FPU_REG *st0_ptr, u_char st0_tag) in fxtract() argument
359 register FPU_REG *st1_ptr = st0_ptr; /* anticipate */ in fxtract()
385 sign = getsign(st0_ptr); in fxtract()
397 st0_tag = FPU_Special(st0_ptr); in fxtract()
408 sign = getsign(st0_ptr); in fxtract()
409 setpositive(st0_ptr); in fxtract()
415 if (real_1op_NaN(st0_ptr) < 0) in fxtract()
419 FPU_copy_to_reg0(st0_ptr, TAG_Special); in fxtract()
448 static void fsqrt_(FPU_REG *st0_ptr, u_char st0_tag) in fsqrt_() argument
457 if (signnegative(st0_ptr)) { in fsqrt_()
463 expon = exponent(st0_ptr); in fsqrt_()
467 setexponent16(st0_ptr, (expon & 1)); in fsqrt_()
470 tag = wm_sqrt(st0_ptr, 0, 0, control_word, SIGN_POS); in fsqrt_()
471 addexponent(st0_ptr, expon >> 1); in fsqrt_()
480 st0_tag = FPU_Special(st0_ptr); in fsqrt_()
483 if (signnegative(st0_ptr)) in fsqrt_()
487 if (signnegative(st0_ptr)) { in fsqrt_()
495 FPU_to_exp16(st0_ptr, st0_ptr); in fsqrt_()
497 expon = exponent16(st0_ptr); in fsqrt_()
502 single_arg_error(st0_ptr, st0_tag); in fsqrt_()
506 static void frndint_(FPU_REG *st0_ptr, u_char st0_tag) in frndint_() argument
515 sign = getsign(st0_ptr); in frndint_()
517 if (exponent(st0_ptr) > 63) in frndint_()
526 if ((flags = FPU_round_to_int(st0_ptr, st0_tag))) in frndint_()
529 setexponent16(st0_ptr, 63); in frndint_()
530 tag = FPU_normalize(st0_ptr); in frndint_()
531 setsign(st0_ptr, sign); in frndint_()
540 st0_tag = FPU_Special(st0_ptr); in frndint_()
547 single_arg_error(st0_ptr, st0_tag); in frndint_()
550 static int fsin(FPU_REG *st0_ptr, u_char tag) in fsin() argument
552 u_char arg_sign = getsign(st0_ptr); in fsin()
557 if (exponent(st0_ptr) > -40) { in fsin()
558 if ((q = trig_arg(st0_ptr, 0)) == -1) { in fsin()
563 poly_sine(st0_ptr); in fsin()
566 changesign(st0_ptr); in fsin()
568 setsign(st0_ptr, getsign(st0_ptr) ^ arg_sign); in fsin()
586 tag = FPU_Special(st0_ptr); in fsin()
594 FPU_to_exp16(st0_ptr, st0_ptr); in fsin()
596 tag = FPU_round(st0_ptr, 1, 0, FULL_PRECISION, arg_sign); in fsin()
606 single_arg_error(st0_ptr, tag); in fsin()
611 static int f_cos(FPU_REG *st0_ptr, u_char tag) in f_cos() argument
615 st0_sign = getsign(st0_ptr); in f_cos()
620 if (exponent(st0_ptr) > -40) { in f_cos()
621 if ((exponent(st0_ptr) < 0) in f_cos()
622 || ((exponent(st0_ptr) == 0) in f_cos()
623 && (significand(st0_ptr) <= in f_cos()
625 poly_cos(st0_ptr); in f_cos()
631 } else if ((q = trig_arg(st0_ptr, FCOS)) != -1) { in f_cos()
632 poly_sine(st0_ptr); in f_cos()
635 changesign(st0_ptr); in f_cos()
664 tag = FPU_Special(st0_ptr); in f_cos()
676 single_arg_error(st0_ptr, tag); /* requires st0_ptr == &st(0) */ in f_cos()
681 static void fcos(FPU_REG *st0_ptr, u_char st0_tag) in fcos() argument
683 f_cos(st0_ptr, st0_tag); in fcos()
686 static void fsincos(FPU_REG *st0_ptr, u_char st0_tag) in fsincos() argument
709 tag = FPU_Special(st0_ptr); in fsincos()
714 single_arg_2_error(st0_ptr, TW_NaN); in fsincos()
726 reg_copy(st0_ptr, &arg); in fsincos()
727 if (!fsin(st0_ptr, st0_tag)) { in fsincos()
779 static void do_fprem(FPU_REG *st0_ptr, u_char st0_tag, int round) in do_fprem() argument
797 st0_sign = FPU_to_exp16(st0_ptr, &st0); in do_fprem()
931 reg_copy(&tmp, st0_ptr); in do_fprem()
938 tag = arith_underflow(st0_ptr); in do_fprem()
939 setsign(st0_ptr, st0_sign); in do_fprem()
943 stdexp(st0_ptr); in do_fprem()
944 setsign(st0_ptr, st0_sign); in do_fprem()
947 FPU_round(st0_ptr, 0, 0, FULL_PRECISION, st0_sign); in do_fprem()
956 st0_tag = FPU_Special(st0_ptr); in do_fprem()
1021 static void fyl2x(FPU_REG *st0_ptr, u_char st0_tag) in fyl2x() argument
1033 if (signpositive(st0_ptr)) { in fyl2x()
1035 FPU_to_exp16(st0_ptr, st0_ptr); in fyl2x()
1038 setexponent16(st0_ptr, exponent(st0_ptr)); in fyl2x()
1040 if ((st0_ptr->sigh == 0x80000000) in fyl2x()
1041 && (st0_ptr->sigl == 0)) { in fyl2x()
1044 e = exponent16(st0_ptr); in fyl2x()
1070 poly_l2(st0_ptr, st1_ptr, sign); in fyl2x()
1084 st0_tag = FPU_Special(st0_ptr); in fyl2x()
1110 if (signnegative(st0_ptr)) { in fyl2x()
1118 if (exponent(st0_ptr) < 0) in fyl2x()
1131 if (real_2op_NaN(st0_ptr, st0_tag, 1, st0_ptr) < 0) in fyl2x()
1136 if ((signnegative(st0_ptr)) || (st1_tag == TAG_Zero)) { in fyl2x()
1153 && (signpositive(st0_ptr))) { in fyl2x()
1154 if (exponent(st0_ptr) >= 0) { in fyl2x()
1155 if ((exponent(st0_ptr) == 0) && in fyl2x()
1156 (st0_ptr->sigh == 0x80000000) && in fyl2x()
1157 (st0_ptr->sigl == 0)) { in fyl2x()
1192 static void fpatan(FPU_REG *st0_ptr, u_char st0_tag) in fpatan() argument
1202 poly_atan(st0_ptr, st0_tag, st1_ptr, st1_tag); in fpatan()
1210 st0_tag = FPU_Special(st0_ptr); in fpatan()
1225 if (real_2op_NaN(st0_ptr, st0_tag, 1, st0_ptr) >= 0) in fpatan()
1232 if (signpositive(st0_ptr)) { in fpatan()
1250 if (signpositive(st0_ptr)) { in fpatan()
1275 if (signpositive(st0_ptr)) { in fpatan()
1302 static void fprem(FPU_REG *st0_ptr, u_char st0_tag) in fprem() argument
1304 do_fprem(st0_ptr, st0_tag, RC_CHOP); in fprem()
1307 static void fprem1(FPU_REG *st0_ptr, u_char st0_tag) in fprem1() argument
1309 do_fprem(st0_ptr, st0_tag, RC_RND); in fprem1()
1312 static void fyl2xp1(FPU_REG *st0_ptr, u_char st0_tag) in fyl2xp1() argument
1322 sign = getsign(st0_ptr); in fyl2xp1()
1325 FPU_to_exp16(st0_ptr, &a); in fyl2xp1()
1336 st0_tag = FPU_Special(st0_ptr); in fyl2xp1()
1358 setsign(st0_ptr, getsign(st0_ptr) ^ getsign(st1_ptr)); in fyl2xp1()
1359 FPU_copy_to_reg1(st0_ptr, st0_tag); in fyl2xp1()
1369 if (real_2op_NaN(st0_ptr, st0_tag, 1, st0_ptr) < 0) in fyl2xp1()
1383 if (signnegative(st0_ptr)) { in fyl2xp1()
1384 if (exponent(st0_ptr) >= 0) { in fyl2xp1()
1403 if (signnegative(st0_ptr)) { in fyl2xp1()
1404 if ((exponent(st0_ptr) >= 0) && in fyl2xp1()
1405 !((st0_ptr->sigh == 0x80000000) && in fyl2xp1()
1406 (st0_ptr->sigl == 0))) { in fyl2xp1()
1425 if (real_2op_NaN(st0_ptr, st0_tag, 1, st0_ptr) < 0) in fyl2xp1()
1430 if (real_2op_NaN(st0_ptr, st0_tag, 1, st0_ptr) < 0) in fyl2xp1()
1434 if (real_2op_NaN(st0_ptr, st0_tag, 1, st0_ptr) < 0) in fyl2xp1()
1436 } else if (signnegative(st0_ptr)) { in fyl2xp1()
1481 static void fscale(FPU_REG *st0_ptr, u_char st0_tag) in fscale() argument
1486 u_char sign = getsign(st0_ptr); in fscale()
1494 setexponent16(st0_ptr, exponent(st0_ptr)); in fscale()
1508 setsign(st0_ptr, sign); in fscale()
1518 scale += exponent16(st0_ptr); in fscale()
1520 setexponent16(st0_ptr, scale); in fscale()
1523 FPU_round(st0_ptr, 0, 0, control_word, sign); in fscale()
1529 st0_tag = FPU_Special(st0_ptr); in fscale()
1541 FPU_to_exp16(st0_ptr, st0_ptr); /* Will not be left on stack */ in fscale()
1562 setsign(st0_ptr, sign); in fscale()
1566 real_2op_NaN(st1_ptr, st1_tag, 0, st0_ptr); in fscale()
1585 real_2op_NaN(st1_ptr, st1_tag, 0, st0_ptr); in fscale()
1604 real_2op_NaN(st1_ptr, st1_tag, 0, st0_ptr); in fscale()
1609 real_2op_NaN(st1_ptr, st1_tag, 0, st0_ptr); in fscale()