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 f_sin(FPU_REG *st0_ptr, u_char tag) in f_sin() argument
552 u_char arg_sign = getsign(st0_ptr); in f_sin()
557 if (exponent(st0_ptr) > -40) { in f_sin()
558 if ((q = trig_arg(st0_ptr, 0)) == -1) { in f_sin()
563 poly_sine(st0_ptr); in f_sin()
566 changesign(st0_ptr); in f_sin()
568 setsign(st0_ptr, getsign(st0_ptr) ^ arg_sign); in f_sin()
586 tag = FPU_Special(st0_ptr); in f_sin()
594 FPU_to_exp16(st0_ptr, st0_ptr); in f_sin()
596 tag = FPU_round(st0_ptr, 1, 0, FULL_PRECISION, arg_sign); in f_sin()
606 single_arg_error(st0_ptr, tag); in f_sin()
611 static void fsin(FPU_REG *st0_ptr, u_char tag) in fsin() argument
613 f_sin(st0_ptr, tag); in fsin()
616 static int f_cos(FPU_REG *st0_ptr, u_char tag) in f_cos() argument
620 st0_sign = getsign(st0_ptr); in f_cos()
625 if (exponent(st0_ptr) > -40) { in f_cos()
626 if ((exponent(st0_ptr) < 0) in f_cos()
627 || ((exponent(st0_ptr) == 0) in f_cos()
628 && (significand(st0_ptr) <= in f_cos()
630 poly_cos(st0_ptr); in f_cos()
636 } else if ((q = trig_arg(st0_ptr, FCOS)) != -1) { in f_cos()
637 poly_sine(st0_ptr); in f_cos()
640 changesign(st0_ptr); in f_cos()
669 tag = FPU_Special(st0_ptr); in f_cos()
681 single_arg_error(st0_ptr, tag); /* requires st0_ptr == &st(0) */ in f_cos()
686 static void fcos(FPU_REG *st0_ptr, u_char st0_tag) in fcos() argument
688 f_cos(st0_ptr, st0_tag); in fcos()
691 static void fsincos(FPU_REG *st0_ptr, u_char st0_tag) in fsincos() argument
714 tag = FPU_Special(st0_ptr); in fsincos()
719 single_arg_2_error(st0_ptr, TW_NaN); in fsincos()
731 reg_copy(st0_ptr, &arg); in fsincos()
732 if (!f_sin(st0_ptr, st0_tag)) { in fsincos()
784 static void do_fprem(FPU_REG *st0_ptr, u_char st0_tag, int round) in do_fprem() argument
802 st0_sign = FPU_to_exp16(st0_ptr, &st0); in do_fprem()
936 reg_copy(&tmp, st0_ptr); in do_fprem()
943 tag = arith_underflow(st0_ptr); in do_fprem()
944 setsign(st0_ptr, st0_sign); in do_fprem()
948 stdexp(st0_ptr); in do_fprem()
949 setsign(st0_ptr, st0_sign); in do_fprem()
952 FPU_round(st0_ptr, 0, 0, FULL_PRECISION, st0_sign); in do_fprem()
961 st0_tag = FPU_Special(st0_ptr); in do_fprem()
1026 static void fyl2x(FPU_REG *st0_ptr, u_char st0_tag) in fyl2x() argument
1038 if (signpositive(st0_ptr)) { in fyl2x()
1040 FPU_to_exp16(st0_ptr, st0_ptr); in fyl2x()
1043 setexponent16(st0_ptr, exponent(st0_ptr)); in fyl2x()
1045 if ((st0_ptr->sigh == 0x80000000) in fyl2x()
1046 && (st0_ptr->sigl == 0)) { in fyl2x()
1049 e = exponent16(st0_ptr); in fyl2x()
1075 poly_l2(st0_ptr, st1_ptr, sign); in fyl2x()
1089 st0_tag = FPU_Special(st0_ptr); in fyl2x()
1115 if (signnegative(st0_ptr)) { in fyl2x()
1123 if (exponent(st0_ptr) < 0) in fyl2x()
1136 if (real_2op_NaN(st0_ptr, st0_tag, 1, st0_ptr) < 0) in fyl2x()
1141 if ((signnegative(st0_ptr)) || (st1_tag == TAG_Zero)) { in fyl2x()
1158 && (signpositive(st0_ptr))) { in fyl2x()
1159 if (exponent(st0_ptr) >= 0) { in fyl2x()
1160 if ((exponent(st0_ptr) == 0) && in fyl2x()
1161 (st0_ptr->sigh == 0x80000000) && in fyl2x()
1162 (st0_ptr->sigl == 0)) { in fyl2x()
1197 static void fpatan(FPU_REG *st0_ptr, u_char st0_tag) in fpatan() argument
1207 poly_atan(st0_ptr, st0_tag, st1_ptr, st1_tag); in fpatan()
1215 st0_tag = FPU_Special(st0_ptr); in fpatan()
1230 if (real_2op_NaN(st0_ptr, st0_tag, 1, st0_ptr) >= 0) in fpatan()
1237 if (signpositive(st0_ptr)) { in fpatan()
1255 if (signpositive(st0_ptr)) { in fpatan()
1280 if (signpositive(st0_ptr)) { in fpatan()
1307 static void fprem(FPU_REG *st0_ptr, u_char st0_tag) in fprem() argument
1309 do_fprem(st0_ptr, st0_tag, RC_CHOP); in fprem()
1312 static void fprem1(FPU_REG *st0_ptr, u_char st0_tag) in fprem1() argument
1314 do_fprem(st0_ptr, st0_tag, RC_RND); in fprem1()
1317 static void fyl2xp1(FPU_REG *st0_ptr, u_char st0_tag) in fyl2xp1() argument
1327 sign = getsign(st0_ptr); in fyl2xp1()
1330 FPU_to_exp16(st0_ptr, &a); in fyl2xp1()
1341 st0_tag = FPU_Special(st0_ptr); in fyl2xp1()
1363 setsign(st0_ptr, getsign(st0_ptr) ^ getsign(st1_ptr)); in fyl2xp1()
1364 FPU_copy_to_reg1(st0_ptr, st0_tag); in fyl2xp1()
1374 if (real_2op_NaN(st0_ptr, st0_tag, 1, st0_ptr) < 0) in fyl2xp1()
1388 if (signnegative(st0_ptr)) { in fyl2xp1()
1389 if (exponent(st0_ptr) >= 0) { in fyl2xp1()
1408 if (signnegative(st0_ptr)) { in fyl2xp1()
1409 if ((exponent(st0_ptr) >= 0) && in fyl2xp1()
1410 !((st0_ptr->sigh == 0x80000000) && in fyl2xp1()
1411 (st0_ptr->sigl == 0))) { in fyl2xp1()
1430 if (real_2op_NaN(st0_ptr, st0_tag, 1, st0_ptr) < 0) in fyl2xp1()
1435 if (real_2op_NaN(st0_ptr, st0_tag, 1, st0_ptr) < 0) in fyl2xp1()
1439 if (real_2op_NaN(st0_ptr, st0_tag, 1, st0_ptr) < 0) in fyl2xp1()
1441 } else if (signnegative(st0_ptr)) { in fyl2xp1()
1486 static void fscale(FPU_REG *st0_ptr, u_char st0_tag) in fscale() argument
1491 u_char sign = getsign(st0_ptr); in fscale()
1499 setexponent16(st0_ptr, exponent(st0_ptr)); in fscale()
1513 setsign(st0_ptr, sign); in fscale()
1523 scale += exponent16(st0_ptr); in fscale()
1525 setexponent16(st0_ptr, scale); in fscale()
1528 FPU_round(st0_ptr, 0, 0, control_word, sign); in fscale()
1534 st0_tag = FPU_Special(st0_ptr); in fscale()
1546 FPU_to_exp16(st0_ptr, st0_ptr); /* Will not be left on stack */ in fscale()
1567 setsign(st0_ptr, sign); in fscale()
1571 real_2op_NaN(st1_ptr, st1_tag, 0, st0_ptr); in fscale()
1590 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()
1614 real_2op_NaN(st1_ptr, st1_tag, 0, st0_ptr); in fscale()