Lines Matching refs:st0_ptr

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