Lines Matching refs:X

4906 #	fp0 = sin(X) or cos(X)						#
4908 # For ssincos(X): #
4909 # fp0 = sin(X) #
4910 # fp1 = cos(X) #
4923 # 2. If |X| >= 15Pi or |X| < 2**(-40), go to 7. #
4925 # 3. Decompose X as X = N(Pi/2) + r where |r| <= Pi/4. Let #
4942 # 7. If |X| > 1, go to 9. #
4944 # 8. (|X|<2**(-40)) If SIN is invoked, return X; #
4947 # 9. Overwrite X by X := X rem 2Pi. Now that |X| <= Pi, #
4951 # 1. If |X| >= 15Pi or |X| < 2**(-40), go to 6. #
4953 # 2. Decompose X as X = N(Pi/2) + r where |r| <= Pi/4. Let #
4961 # SIN(X) = sgn1 * cos(r) and COS(X) = sgn2*sin(r) where #
4966 # SIN(X) = sgn1 * sin(r) and COS(X) = sgn1*cos(r) where #
4970 # 6. If |X| > 1, go to 8. #
4972 # 7. (|X|<2**(-40)) SIN(X) = X and COS(X) = 1. Exit. #
4974 # 8. Overwrite X by X := X rem 2Pi. Now that |X| <= Pi, #
4998 set X,FP_SCR0
4999 # set XDCARE,X+2
5000 set XFRAC,X+4
5026 #--SAVE FPCR, FP1. CHECK IF |X| IS TOO SMALL OR LARGE
5029 fmov.x %fp0,X(%a6) # save input at X
5031 # "COMPACTIFY" X
5036 cmpi.l %d1,&0x3FD78000 # is |X| >= 2**(-40)?
5041 cmp.l %d1,&0x4004BC7E # is |X| < 15 PI?
5045 #--THIS IS THE USUAL CASE, |X| <= 15 PI.
5049 fmul.d TWOBYPI(%pc),%fp1 # X*2/PI
5061 fsub.x (%a1)+,%fp0 # X-Y1
5062 fsub.s (%a1),%fp0 # fp0 = R = (X-Y1)-Y2
5115 fmul.x X(%a6),%fp0 # R'*S
5147 fmov.x %fp0,X(%a6) # X IS S
5154 eor.l %d1,X(%a6) # X IS NOW S'= SGN*S
5615 # fp0 = tan(X) #
5625 # 1. If |X| >= 15Pi or |X| < 2**(-40), go to 6. #
5627 # 2. Decompose X as X = N(Pi/2) + r where |r| <= Pi/4. Let #
5632 # 4. (k is even) Tan(X) = tan(r) and tan(r) is approximated by a #
5638 # 4. (k is odd) Tan(X) = -cot(r). Since tan(r) is approximated by #
5644 # 6. If |X| > 1, go to 8. #
5646 # 7. (|X|<2**(-40)) Tan(X) = X. Exit. #
5648 # 8. Overwrite X by X := X rem 2Pi. Now that |X| <= Pi, go back #
5766 cmp.l %d1,&0x3FD78000 # |X| >= 2**(-40)?
5770 cmp.l %d1,&0x4004BC7E # |X| < 15 PI?
5775 #--THIS IS THE USUAL CASE, |X| <= 15 PI.
5778 fmul.d TWOBYPI(%pc),%fp1 # X*2/PI
5787 fsub.x (%a1)+,%fp0 # X-Y1
5789 fsub.s (%a1),%fp0 # FP0 IS R = (X-Y1)-Y2
5876 #--IF |X| > 15PI, WE USE THE GENERAL ARGUMENT REDUCTION.
5877 #--IF |X| < 2**(-40), RETURN X OR 1.
5889 #--TAN(X) = X FOR DENORMALIZED X
5930 #--ON ENTRY, FP0 IS X, ON RETURN, FP0 IS X REM PI/2, |X| <= PI/4.
5951 #--THAT INT( X * (2/PI) / 2**(L) ) < 2**29.
5964 fmul.x FP_SCR0(%a6),%fp2 # fp2 = X * 2**(-L)*(2/PI)
6071 # Step 7. Define X' = -1/X. Approximate arctan(X') by an odd #
6073 # Arctan(X) = sign(X)*Pi/2 + arctan(X'). Exit. #
6246 fmov.x %fp0,X(%a6)
6249 cmp.l %d1,&0x3FFB8000 # |X| >= 1/16?
6254 cmp.l %d1,&0x4002FFFF # |X| < 16 ?
6258 #--THE MOST LIKELY CASE, |X| IN [1/16, 16). WE USE TABLE TECHNIQUE
6259 #--THE IDEA IS ATAN(X) = ATAN(F) + ATAN( [X-F] / [1+XF] ).
6260 #--SO IF F IS CHOSEN TO BE CLOSE TO X AND ATAN(F) IS STORED IN
6262 #--U = (X-F)/(1+XF) IS SMALL (REMEMBER F IS CLOSE TO X). IT IS
6268 #--ATAN(X) DIRECTLY WILL NEED TO USE A RATIONAL APPROXIMATION
6272 #--NOW WE SEE X AS +-2^K * 1.BBBBBBB....B <- 1. + 63 BITS
6274 #--THAT IS IT MATCHES THE EXPONENT AND FIRST 5 BITS OF X, THE
6308 mov.l X(%a6),%d1 # LOAD SIGN AND EXPO. AGAIN
6411 #--X'+X'*Y*(C1+Y*(C2+Y*(C3+Y*(C4+Y*C5)))), X' = -1/X, Y = X'*X'
6413 #--X'+X'*Y*( [C1+Z*(C3+Z*C5)] + [Y*(C2+Z*C4)] ), Z = Y*Y.
6418 fdiv.x %fp0,%fp1 # FP1 IS -1/X
6422 fmov.x %fp1,%fp0 # FP0 IS X'
6423 fmul.x %fp0,%fp0 # FP0 IS Y = X'*X'
6442 fmul.x X(%a6),%fp0 # X'*Y
6448 fadd.x X(%a6),%fp0
6465 #--RETURN SIGN(X)*(PIBY2 - TINY) = SIGN(X)*PIBY2 - SIGN(X)*TINY
6482 #--ENTRY POINT FOR ATAN(X) FOR DENORMALIZED ARGUMENT
6495 # fp0 = arcsin(X) #
6506 # 1. If |X| >= 1, go to 3. #
6508 # 2. (|X| < 1) Calculate asin(X) by #
6509 # z := sqrt( [1-X][1+X] ) #
6510 # asin(X) = atan( x / z ). #
6513 # 3. If |X| > 1, go to 5. #
6515 # 4. (|X| = 1) sgn := sign(X), return asin(X) := sgn * Pi/2. Exit.#
6517 # 5. (|X| > 1) Generate an invalid operation by 0 * infinity. #
6692 # fp0 = exp(X) or exp(X)-1 #
6706 # Step 2. Return ans := ans + sign(X)*2^(-126). Exit. #
6714 # 1.1 If |X| >= 2^(-65), go to Step 1.3. #
6716 # 1.3 If |X| < 16380 log(2), go to Step 2. #
6720 # compact representation of |X| is used. This format is a #
6722 # are the sign and biased exponent field of |X|; the #
6724 # (including the explicit bit) bits of |X|. Consequently, #
6729 # |X| < 16380 log(2). There is no harm to have a small #
6730 # number of cases where |X| is less than, but close to, #
6733 # Step 2. Calculate N = round-to-nearest-int( X * 64/log2 ). #
6736 # 2.2 N := round-to-nearest-integer( X * 64/log2 ). #
6744 # Z := X * constant #
6753 # Z = X*(64/log2)*(1+eps), |eps| <= 2^(-24). #
6757 # Step 3. Calculate X - N*log2/64. #
6758 # 3.1 R := X + N*L1, #
6766 # c) The calculation X+N*L1 is also exact due to #
6767 # cancellation. Thus, R is practically X+N(L1+L2) to full #
6772 # N = rnd-to-int( X*64/log2 (1+eps) ), |eps|<=2^(-24) #
6773 # X*64/log2 (1+eps) = N + f, |f| <= 0.5 #
6774 # X*64/log2 - N = f - eps*X 64/log2 #
6775 # X - N*log2/64 = f*log2/64 - eps*X #
6778 # Now |X| <= 16446 log2, thus #
6780 # |X - N*log2/64| <= (0.5 + 16446/2^(18))*log2/64 #
6811 # Step 6. Reconstruction of exp(X) #
6812 # exp(X) = 2^M * 2^(J/64) * exp(R). #
6817 # Notes: If AdjFlag = 0, we have X = Mlog2 + Jlog2/64 + R, #
6818 # |M| <= 16380, and Scale = 2^M. Moreover, exp(X) will #
6821 # X = (M1+M)log2 + Jlog2/64 + R, |M1+M| >= 16380. #
6822 # Hence, exp(X) may overflow or underflow or neither. #
6831 # Step 7. Return 1 + X. #
6832 # 7.1 ans := X #
6835 # Notes: For non-zero X, the inexact exception will always be #
6837 # Note also that we use the FMOVEM instruction to move X #
6839 # the FMOVEM may not seem relevant since X is normalized, #
6844 # Step 8. Handle exp(X) where |X| >= 16380log2. #
6845 # 8.1 If |X| > 16480 log2, go to Step 9. #
6847 # 8.2 N := round-to-integer( X * 64/log2 ) #
6857 # Step 9. Handle exp(X), |X| > 16480 log2. #
6858 # 9.1 If X < 0, go to 9.3 #
6863 # Notes: Exp(X) will surely overflow or underflow, depending on #
6864 # X's sign. "Huge" and "Tiny" are respectively large/tiny #
7105 mov.l (%a0),%d1 # load part of input X
7106 and.l &0x7FFF0000,%d1 # biased expo. of X
7112 #--The case |X| >= 2^(-65)
7113 mov.w 4(%a0),%d1 # expo. and partial sig. of |X|
7120 #--This is the normal branch: 2^(-65) <= |X| < 16380 log2.
7124 fmul.s &0x42B8AA3B,%fp0 # 64/log2 * X
7127 fmov.l %fp0,%d1 # N = int( X * 64/log2 )
7142 #--fp1,fp2 saved on the stack. fp0 is N, fp1 is X,
7147 fadd.x %fp1,%fp0 # X + N*L1
7186 #--EXP(X) = 2^M * ( 2^(J/64) + 2^(J/64)*(EXP(R)-1) )
7208 fmovm.x (%a0),&0x80 # load X
7210 fadd.s &0x3F800000,%fp0 # 1+X in user mode
7221 fmul.s &0x42B8AA3B,%fp0 # 64/log2 * X
7224 fmov.l %fp0,%d1 # N = int( X * 64/log2 )
7246 tst.b (%a0) # is X positive or negative?
7252 #--entry point for EXP(X), X is denormalized
7255 ori.l &0x00800000,(%sp) # sign(X)*2^(-126)
7265 #--entry point for EXPM1(X), here X is finite, non-zero, non-NaN
7269 mov.l (%a0),%d1 # load part of input X
7270 and.l &0x7FFF0000,%d1 # biased expo. of X
7272 bge.b EM1CON1 # |X| >= 1/4
7277 #--The case |X| >= 1/4
7278 mov.w 4(%a0),%d1 # expo. and partial sig. of |X|
7280 ble.b EM1MAIN # 1/4 <= |X| <= 70log2
7285 #--This is the case: 1/4 <= |X| <= 70 log2.
7289 fmul.s &0x42B8AA3B,%fp0 # 64/log2 * X
7291 fmov.l %fp0,%d1 # N = int( X * 64/log2 )
7304 #--fp1,fp2 saved on the stack. fp0 is N, fp1 is X,
7309 fadd.x %fp1,%fp0 # X + N*L1
7396 #--Step 7 |X| < 1/4.
7401 #--Step 8 |X| < 2^(-65)
7428 #--Step 9 exp(X)-1 by a simple polynomial
7429 fmov.x (%a0),%fp0 # fp0 is X
7430 fmul.x %fp0,%fp0 # fp0 is S := X*X
7465 fmul.x (%a0),%fp1 # fp1 is X*S*(B2...
7479 #--Step 10 |X| > 70 log2
7491 #--entry point for EXPM1(X), here X is denormalized
7511 # fp0 = exponent(X) or mantissa(X) #
7573 # fp0 = cosh(X) #
7584 # 1. If |X| > 16380 log2, go to 3. #
7586 # 2. (|X| <= 16380 log2) Cosh(X) is obtained by the formulae #
7587 # y = |X|, z = exp(Y), and #
7588 # cosh(X) = (1/2)*( z + 1/z ). #
7591 # 3. (|X| > 16380 log2). If |X| > 16480 log2, go to 5. #
7593 # 4. (16380 log2 < |X| <= 16480 log2) #
7594 # cosh(X) = sign(X) * exp(|X|)/2. #
7595 # However, invoking exp(|X|) may cause premature #
7596 # overflow. Thus, we calculate sinh(X) as follows: #
7597 # Y := |X| #
7603 # 5. (|X| > 16480 log2) sinh(X) must overflow. Return #
7623 #--THIS IS THE USUAL CASE, |X| < 16380 LOG2
7624 #--COSH(X) = (1/2) * ( EXP(X) + 1/EXP(X) )
7626 fabs.x %fp0 # |X|
7630 fmovm.x &0x01,-(%sp) # save |X| to stack
7631 lea (%sp),%a0 # pass ptr to |X|
7632 bsr setox # FP0 IS EXP(|X|)
7633 add.l &0xc,%sp # erase |X| from stack
7634 fmul.s &0x3F000000,%fp0 # (1/2)EXP(|X|)
7638 fdiv.x %fp0,%fp1 # 1/(2 EXP(|X|))
7650 fsub.d T1(%pc),%fp0 # (|X|-16381LOG2_LEAD)
7651 fsub.d T2(%pc),%fp0 # |X| - 16381 LOG2, ACCURATE
7670 #--COSH(X) = 1 FOR DENORMALIZED X
7687 # fp0 = sinh(X) #
7698 # 1. If |X| > 16380 log2, go to 3. #
7700 # 2. (|X| <= 16380 log2) Sinh(X) is obtained by the formula #
7701 # y = |X|, sgn = sign(X), and z = expm1(Y), #
7702 # sinh(X) = sgn*(1/2)*( z + z/(1+z) ). #
7705 # 3. If |X| > 16480 log2, go to 5. #
7707 # 4. (16380 log2 < |X| <= 16480 log2) #
7708 # sinh(X) = sign(X) * exp(|X|)/2. #
7709 # However, invoking exp(|X|) may cause premature overflow. #
7710 # Thus, we calculate sinh(X) as follows: #
7711 # Y := |X| #
7712 # sgn := sign(X) #
7718 # 5. (|X| > 16480 log2) sinh(X) must overflow. Return #
7719 # sign(X)*Huge*Huge to generate overflow and an infinity with #
7736 #--THIS IS THE USUAL CASE, |X| < 16380 LOG2
7737 #--Y = |X|, Z = EXPM1(Y), SINH(X) = SIGN(X)*(1/2)*( Z + Z/(1+Z) )
7739 fabs.x %fp0 # Y = |X|
7769 fsub.d T1(%pc),%fp0 # (|X|-16381LOG2_LEAD)
7776 fsub.d T2(%pc),%fp0 # |X| - 16381 LOG2, ACCURATE
7792 #--SINH(X) = X FOR DENORMALIZED X
7805 # fp0 = tanh(X) #
7816 # 1. If |X| >= (5/2) log2 or |X| <= 2**(-40), go to 3. #
7818 # 2. (2**(-40) < |X| < (5/2) log2) Calculate tanh(X) by #
7819 # sgn := sign(X), y := 2|X|, z := expm1(Y), and #
7820 # tanh(X) = sgn*( z/(2+z) ). #
7823 # 3. (|X| <= 2**(-40) or |X| >= (5/2) log2). If |X| < 1, #
7826 # 4. (|X| >= (5/2) log2) If |X| >= 50 log2, go to 6. #
7828 # 5. ((5/2) log2 <= |X| < 50 log2) Calculate tanh(X) by #
7829 # sgn := sign(X), y := 2|X|, z := exp(Y), #
7830 # tanh(X) = sgn - [ sgn*2/(1+z) ]. #
7833 # 6. (|X| >= 50 log2) Tanh(X) = +-1 (round to nearest). Thus, we #
7834 # calculate Tanh(X) by #
7835 # sgn := sign(X), Tiny := 2**(-126), #
7836 # tanh(X) := sgn - sgn*Tiny. #
7839 # 7. (|X| < 2**(-40)). Tanh(X) = X. Exit. #
7843 set X,FP_SCR0
7844 set XFRAC,X+4
7854 fmov.x %fp0,X(%a6)
7857 mov.l %d1,X(%a6)
7859 cmp.l %d1, &0x3fd78000 # is |X| < 2^(-40)?
7861 cmp.l %d1, &0x3fffddce # is |X| > (5/2)LOG2?
7865 #--Y = 2|X|, Z = EXPM1(Y), TANH(X) = SIGN(X) * Z / (Z+2).
7867 mov.l X(%a6),%d1
7870 add.l &0x00010000,%d1 # EXPONENT OF 2|X|
7871 mov.l %d1,X(%a6)
7873 fmov.x X(%a6),%fp0 # FP0 IS Y = 2|X|
7900 #-- (5/2) LOG2 < |X| < 50 LOG2,
7901 #--TANH(X) = 1 - (2/[EXP(2X)+1]). LET Y = 2|X|, SGN = SIGN(X),
7902 #--TANH(X) = SGN - SGN*2/[EXP(Y)+1].
7904 mov.l X(%a6),%d1
7907 add.l &0x00010000,%d1 # EXPO OF 2|X|
7908 mov.l %d1,X(%a6) # Y = 2|X|
7911 fmov.x X(%a6),%fp0 # Y = 2|X|
7923 eor.l &0xC0000000,%d1 # -SIGN(X)*2
7924 fmov.s %d1,%fp1 # -SIGN(X)*2 IN SGL FMT
7925 fdiv.x %fp0,%fp1 # -SIGN(X)2 / [EXP(Y)+1 ]
7939 fmov.x X(%a6),%fp0 # last inst - possible exception set
7942 #---RETURN SGN(X) - SGN(X)EPS
7944 mov.l X(%a6),%d1
7949 eor.l &0x80800000,%d1 # -SIGN(X)*EPS
7956 #--TANH(X) = X FOR DENORMALIZED X
7963 # slognp1(): computes the log(1+X) of a normalized input #
7964 # slognp1d(): computes the log(1+X) of a denormalized input #
7971 # fp0 = log(X) or log(1+X) #
7981 # Step 1. If |X-1| < 1/16, approximate log(X) by an odd #
7982 # polynomial in u, where u = 2(X-1)/(X+1). Otherwise, #
7985 # Step 2. X = 2**k * Y where 1 <= Y < 2. Define F to be the first #
7994 # log(X) = log( 2**k * Y ) = k*log(2) + log(F) + log(1+u) #
7999 # Step 1: If |X| < 1/16, approximate log(1+X) by an odd #
8000 # polynomial in u where u = 2X/(2+X). Otherwise, move on #
8003 # Step 2: Let 1+X = 2**k * Y, where 1 <= Y < 2. Define F as done #
8005 # log(1+X) as k*log(2) + log(F) + poly where poly #
8224 mov.l (%a0),X(%a6)
8225 mov.l 4(%a0),X+4(%a6)
8226 mov.l 8(%a0),X+8(%a6)
8228 cmp.l %d1,&0 # CHECK IF X IS NEGATIVE
8230 # X IS POSITIVE, CHECK IF X IS NEAR 1
8231 cmp.l %d1,&0x3ffef07d # IS X < 15/16?
8233 cmp.l %d1,&0x3fff8841 # IS X > 17/16?
8237 #--THIS SHOULD BE THE USUAL CASE, X NOT VERY CLOSE TO 1
8239 #--X = 2^(K) * Y, 1 <= Y < 2. THUS, Y = 1.XXXXXXXX....XX IN BINARY.
8241 #--THE IDEA IS THAT LOG(X) = K*LOG2 + LOG(Y)
8250 asr.l &8,%d1 # SHIFTED 16 BITS, BIASED EXPO. OF X
8257 mov.l &0x3FFF0000,X(%a6) # X IS NOW Y, I.E. 2^(-K)*X
8268 fmov.x X(%a6),%fp0
8455 fadd.s one(%pc),%fp0 # X := ROUND(1+Z)
8456 fmov.x %fp0,X(%a6)
8458 mov.l X(%a6),%d1
8465 #--IF 1+Z > 3/2 OR 1+Z < 1/2, THEN X, WHICH IS ROUNDING 1+Z,
8467 #--SIMPLY INVOKE LOG(X) FOR LOG(1+Z).
8470 #--NEXT SEE IF EXP(-1/16) < X < EXP(1/16)
8477 #--EXP(-1/16) < X < EXP(1/16). LOG(1+Z) = LOG(1+U/2) - LOG(1-U/2)
8478 #--WHERE U = 2Z/(2+Z) = 2Z/(1+X).
8480 fadd.s one(%pc),%fp0 # FP0 IS 1+X
8536 #--FPCR SAVED. D0 IS X IN COMPACT FORM.
8566 # fp0 = arctanh(X) #
8577 # 1. If |X| >= 1, go to 3. #
8579 # 2. (|X| < 1) Calculate atanh(X) by #
8580 # sgn := sign(X) #
8581 # y := |X| #
8583 # atanh(X) := sgn * (1/2) * logp1(z) #
8586 # 3. If |X| > 1, go to 5. #
8588 # 4. (|X| = 1) Generate infinity with an appropriate sign and #
8590 # sgn := sign(X) #
8591 # atan(X) := sgn / (+0). #
8594 # 5. (|X| > 1) Generate an invalid operation by 0 * infinity. #
8607 #--THIS IS THE USUAL CASE, |X| < 1
8608 #--Y = |X|, Z = 2Y/(1-Y), ATANH(X) = SIGN(X) * (1/2) * LOG1P(Z).
8610 fabs.x (%a0),%fp0 # Y = |X|
8618 or.l &0x3F000000,%d1 # SIGN(X)*HALF
8635 fabs.x (%a0),%fp0 # |X|
8641 #--ATANH(X) = X FOR DENORMALIZED X
8656 # fp0 = log_10(X) or log_2(X) #
8668 # Step 0. If X < 0, create a NaN and raise the invalid operation #
8673 # Step 1. Call slognd to obtain Y = log(X), the natural log of X. #
8674 # Notes: Even if X is denormalized, log(X) is always normalized. #
8676 # Step 2. Compute log_10(X) = log(X) * (1/log(10)). #
8682 # Step 0. If X < 0, create a NaN and raise the invalid operation #
8687 # Step 1. Call sLogN to obtain Y = log(X), the natural log of X. #
8689 # Step 2. Compute log_10(X) = log(X) * (1/log(10)). #
8695 # Step 0. If X < 0, create a NaN and raise the invalid operation #
8700 # Step 1. Call slognd to obtain Y = log(X), the natural log of X. #
8701 # Notes: Even if X is denormalized, log(X) is always normalized. #
8703 # Step 2. Compute log_10(X) = log(X) * (1/log(2)). #
8709 # Step 0. If X < 0, create a NaN and raise the invalid operation #
8714 # Step 1. If X is not an integer power of two, i.e., X != 2^k, #
8718 # 2.1 Get integer k, X = 2^k. #
8722 # Step 3. Call sLogN to obtain Y = log(X), the natural log of X. #
8724 # Step 4. Compute log_2(X) = log(X) * (1/log(2)). #
8737 #--entry point for Log10(X), X is normalized
8747 bsr slogn # log(X), X normal.
8753 #--entry point for Log10(X), X is denormalized
8759 bsr slognd # log(X), X denorm.
8765 #--entry point for Log2(X), X is normalized
8771 bne.b continue # X is not 2^k
8777 #--X = 2^k.
8789 bsr slogn # log(X), X normal.
8798 #--entry point for Log2(X), X is denormalized
8804 bsr slognd # log(X), X denorm.
8810 # stwotox(): computes 2**X for a normalized input #
8811 # stwotoxd(): computes 2**X for a denormalized input #
8812 # stentox(): computes 10**X for a normalized input #
8813 # stentoxd(): computes 10**X for a denormalized input #
8820 # fp0 = 2**X or 10**X #
8831 # 1. If |X| > 16480, go to ExpBig. #
8833 # 2. If |X| < 2**(-70), go to ExpSm. #
8835 # 3. Decompose X as X = N/64 + r where |r| <= 1/128. Furthermore #
8844 # 1. If |X| > 16480*log_10(2) (base 10 log of 2), go to ExpBig. #
8846 # 2. If |X| < 2**(-70), go to ExpSm. #
8848 # 3. Set y := X*log_2(10)*64 (base 2 log of 10). Set #
8990 fmov.x %fp0,X(%a6)
8993 cmp.l %d1,&0x3FB98000 # |X| >= 2**(-70)?
8998 cmp.l %d1,&0x400D80C0 # |X| > 16480?
9003 #--USUAL CASE, 2^(-70) <= |X| <= 16480
9006 fmul.s &0x42800000,%fp1 # 64 * X
9007 fmov.l %fp1,INT(%a6) # N = ROUND-TO-INT(64 X)
9035 fsub.x %fp1,%fp0 # X - (1/64)*INT(64 X)
9051 #--|X| IS SMALL, RETURN 1 + X
9054 fadd.s &0x3F800000,%fp0 # RETURN 1 + X
9058 #--|X| IS LARGE, GENERATE OVERFLOW IF X > 0; ELSE GENERATE UNDERFLOW
9060 mov.l X(%a6),%d1
9071 #--ENTRY POINT FOR 2**(X) FOR DENORMALIZED ARGUMENT
9087 fmov.x %fp0,X(%a6)
9090 cmp.l %d1,&0x3FB98000 # |X| >= 2**(-70)?
9095 cmp.l %d1,&0x400B9B07 # |X| <= 16480*log2/log10 ?
9100 #--USUAL CASE, 2^(-70) <= |X| <= 16480 LOG 2 / LOG 10
9103 fmul.d L2TEN64(%pc),%fp1 # X*64*LOG10/LOG2
9104 fmov.l %fp1,INT(%a6) # N=INT(X*64*LOG10/LOG2)
9134 fsub.x %fp1,%fp0 # X - N L_LEAD
9137 fsub.x %fp2,%fp0 # X - N L_TRAIL
9178 #--EXP(X) = 2^M*2^(J/64) + 2^M*2^(J/64)*(EXP(R)-1) - (1 OR 0)
9195 #--ENTRY POINT FOR 10**(X) FOR DENORMALIZED ARGUMENT
9341 # smod(): computes the fp MOD of the input values X,Y. #
9342 # srem(): computes the fp (IEEE) REM of the input values X,Y. #
9345 # a0 = pointer to extended precision input X #
9349 # The input operands X and Y can be either normalized or #
9353 # fp0 = FREM(X,Y) or FMOD(X,Y) #
9357 # Step 1. Save and strip signs of X and Y: signX := sign(X), #
9358 # signY := sign(Y), X := |X|, Y := |Y|, #
9362 # Step 2. Set L := expo(X)-expo(Y), k := 0, Q := 0. #
9364 # R := X, go to Step 4. #
9366 # R := 2^(-L)X, j := L. #
9369 # Step 3. Perform MOD(X,Y) #
9376 # Step 4. At this point, R = X - QY = MOD(X,Y). Set #
9380 # Step 5. R = MOD(X,Y), but REM(X,Y) is requested. #
9381 # 5.1 If R < Y/2, then R = MOD(X,Y) = REM(X,Y). Go to #
9394 # Step 9. At this point, R = 2^(-j)*X - Q Y = Y. Thus, #
9395 # X = 2^(j)*(Q+1)Y. set Q := 2^(j)*(Q+1), #
9432 #..Save sign of X and Y
9487 mov.l DST_LO(%a1),%d2 # (D0,D1,D2) is |X|
9526 mov.l %d0,-(%sp) # save biased exp(X)
9527 sub.l %d3,%d0 # L := expo(X)-expo(Y)
9537 #..expo(X) < expo(Y). Thus X = mod(X,Y)
9543 addq.l &0x4,%sp # erase exp(X)
9544 #..At this point R = 2^(-L)X; Q = 0; k = 0; and k+j = L
9571 #..At this point, Carry=0, R < Y. R = 2^(k-L)X - QY; k+j = L; j >= 0.
9581 #..At this point, R=(Carry,D1,D2) = 2^(k-L)X - QY, j+k=L, j >= 0, R < 2Y.
9586 #..k = L, j = 0, Carry = 0, R = (D1,D2) = X - QY, R < Y.
9673 #..Get sign of X