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