?? e_coshf.s
字號:
(p13) fma.s.s0 f8 = f1, f1, f0 // result if x = 0.0(p13) br.ret.spnt b0 // exit here if x =0.0};;{ .mfi sub rExp_x = rExp_x, rExp_bias // True exponent of x fmerge.s fAbsX = f0, fNormX // Form |x| nop.i 0};;{ .mfi nop.m 0 // x*(64/ln(2)) + Right Shifter fma.s1 fNint = fNormX, f64DivLn2, fRightShifter add rTblAddr = 8, rTblAddr}{ .mfb cmp.gt p7, p0 = -2, rExp_x // Test |x| < 2^(-2) fma.s1 fXsq = fNormX, fNormX, f0 // x*x for small path(p7) br.cond.spnt COSH_SMALL // Branch if 0 < |x| < 2^-2};;{ .mfi nop.m 0 // check for overflow fcmp.ge.s1 p12, p13 = fAbsX, fMIN_SGL_OFLOW_ARG mov rJ_mask = 0x3f // 6-bit mask for J};;{ .mfb nop.m 0 fms.s1 fN = fNint, f1, fRightShifter // n in FP register // branch out if overflow(p12) br.cond.spnt COSH_CERTAIN_OVERFLOW};;{ .mfi getf.sig rNJ = fNint // bits of n, j // check for possible overflow fcmp.gt.s1 p13, p0 = fAbsX, fMAX_SGL_NORM_ARG nop.i 0};;{ .mfi addl rN = 0xFFBF - 63, rNJ // biased and shifted n-1,j fnma.s1 fR = fLn2Div64, fN, fNormX // R = x - N*ln(2)/64 and rJ = rJ_mask, rNJ // bits of j}{ .mfi sub rNJ_neg = r0, rNJ // bits of n, j for -x nop.f 0 andcm rN_mask = -1, rJ_mask // 0xff...fc0 to mask N};;{ .mfi shladd rJ = rJ, 3, rTblAddr // address in the 2^(j/64) table nop.f 0 and rN = rN_mask, rN // biased, shifted n-1}{ .mfi addl rN_neg = 0xFFBF - 63, rNJ_neg // -x biased, shifted n-1,j nop.f 0 and rJ_neg = rJ_mask, rNJ_neg // bits of j for -x};;{ .mfi ld8 rJ = [rJ] // Table value nop.f 0 shl rN = rN, 46 // 2^(n-1) bits in DP format}{ .mfi shladd rJ_neg = rJ_neg, 3, rTblAddr // addr in 2^(j/64) table -x nop.f 0 and rN_neg = rN_mask, rN_neg // biased, shifted n-1 for -x};;{ .mfi ld8 rJ_neg = [rJ_neg] // Table value for -x nop.f 0 shl rN_neg = rN_neg, 46 // 2^(n-1) bits in DP format for -x};;{ .mfi or rN = rN, rJ // bits of 2^n * 2^(j/64) in DP format nop.f 0 nop.i 0};;{ .mmf setf.d fT = rN // 2^(n-1) * 2^(j/64) or rN_neg = rN_neg, rJ_neg // -x bits of 2^n * 2^(j/64) in DP fma.s1 fRSqr = fR, fR, f0 // R^2};;{ .mfi setf.d fT_neg = rN_neg // 2^(n-1) * 2^(j/64) for -x fma.s1 fP = fA3, fR, fA2 // A3*R + A2 nop.i 0}{ .mfi nop.m 0 fnma.s1 fP_neg = fA3, fR, fA2 // A3*R + A2 for -x nop.i 0};;{ .mfi nop.m 0 fma.s1 fP = fP, fRSqr, fR // P = (A3*R + A2)*R^2 + R nop.i 0}{ .mfi nop.m 0 fms.s1 fP_neg = fP_neg, fRSqr, fR // P = (A3*R + A2)*R^2 + R, -x nop.i 0};;{ .mfi nop.m 0 fmpy.s0 fTmp = fLn2Div64, fLn2Div64 // Force inexact nop.i 0};;{ .mfi nop.m 0 fma.s1 fExp = fP, fT, fT // exp(x)/2 nop.i 0}{ .mfb nop.m 0 fma.s1 fExp_neg = fP_neg, fT_neg, fT_neg // exp(-x)/2 // branch out if possible overflow result(p13) br.cond.spnt COSH_POSSIBLE_OVERFLOW};;{ .mfb nop.m 0 // final result in the absence of overflow fma.s.s0 f8 = fExp, f1, fExp_neg // result = (exp(x)+exp(-x))/2 // exit here in the absence of overflow br.ret.sptk b0 // Exit main path, 0.25 <= |x| < 89.41598};;// Here if 0 < |x| < 0.25. Evaluate 8th order polynomial.COSH_SMALL:{ .mmi add rAd1 = 0x200, rTblAddr add rAd2 = 0x210, rTblAddr nop.i 0};;{ .mmi ldfpd fA4, fA3 = [rAd1] ldfpd fA2, fA1 = [rAd2] nop.i 0};;{ .mfi nop.m 0 fma.s1 fX4 = fXsq, fXsq, f0 nop.i 0};;{ .mfi nop.m 0 fma.s1 fA43 = fXsq, fA4, fA3 nop.i 0}{ .mfi nop.m 0 fma.s1 fA21 = fXsq, fA2, fA1 nop.i 0};;{ .mfi nop.m 0 fma.s1 fA4321 = fX4, fA43, fA21 nop.i 0};;// Dummy multiply to generate inexact{ .mfi nop.m 0 fmpy.s0 fTmp = fA4, fA4 nop.i 0}{ .mfb nop.m 0 fma.s.s0 f8 = fA4321, fXsq, f1 br.ret.sptk b0 // Exit if 0 < |x| < 0.25};;COSH_POSSIBLE_OVERFLOW:// Here if fMAX_SGL_NORM_ARG < x < fMIN_SGL_OFLOW_ARG// This cannot happen if input is a single, only if input higher precision.// Overflow is a possibility, not a certainty.// Recompute result using status field 2 with user's rounding mode,// and wre set. If result is larger than largest single, then we have// overflow{ .mfi mov rGt_ln = 0x1007f // Exponent for largest single + 1 ulp fsetc.s2 0x7F,0x42 // Get user's round mode, set wre nop.i 0};;{ .mfi setf.exp fGt_pln = rGt_ln // Create largest single + 1 ulp fma.s.s2 fWre_urm_f8 = fP, fT, fT // Result with wre set nop.i 0};;{ .mfi nop.m 0 fsetc.s2 0x7F,0x40 // Turn off wre in sf2 nop.i 0};;{ .mfi nop.m 0 fcmp.ge.s1 p6, p0 = fWre_urm_f8, fGt_pln // Test for overflow nop.i 0};;{ .mfb nop.m 0 nop.f 0(p6) br.cond.spnt COSH_CERTAIN_OVERFLOW // Branch if overflow};;{ .mfb nop.m 0 fma.s.s0 f8 = fP, fT, fT br.ret.sptk b0 // Exit if really no overflow};;// here if overflowCOSH_CERTAIN_OVERFLOW:{ .mmi addl r17ones_m1 = 0x1FFFE, r0;; setf.exp fTmp = r17ones_m1 nop.i 0};;{ .mfi alloc r32 = ar.pfs, 0, 3, 4, 0 // get some registers fmerge.s FR_X = f8,f8 nop.i 0}{ .mfb mov GR_Parameter_TAG = 65 fma.s.s0 FR_RESULT = fTmp, fTmp, f0 // Set I,O and +INF result br.cond.sptk __libm_error_region};;// Here if x unormCOSH_UNORM:{ .mfb getf.exp rSignexp_x = fNormX // Must recompute if x unorm fcmp.eq.s0 p6, p0 = f8, f0 // Set D flag br.cond.sptk COSH_COMMON // Return to main path};;GLOBAL_IEEE754_END(coshf)LOCAL_LIBM_ENTRY(__libm_error_region).prologue{ .mfi add GR_Parameter_Y=-32,sp // Parameter 2 value nop.f 0.save ar.pfs,GR_SAVE_PFS mov GR_SAVE_PFS=ar.pfs // Save ar.pfs}{ .mfi.fframe 64 add sp=-64,sp // Create new stack nop.f 0 mov GR_SAVE_GP=gp // Save gp};;{ .mmi stfs [GR_Parameter_Y] = FR_Y,16 // Store Parameter 2 on stack add GR_Parameter_X = 16,sp // Parameter 1 address.save b0, GR_SAVE_B0 mov GR_SAVE_B0=b0 // Save b0};;.body{ .mfi stfs [GR_Parameter_X] = FR_X // Store Parameter 1 on stack nop.f 0 add GR_Parameter_RESULT = 0,GR_Parameter_Y // Parameter 3 address}{ .mib stfs [GR_Parameter_Y] = FR_RESULT // Store Parameter 3 on stack add GR_Parameter_Y = -16,GR_Parameter_Y br.call.sptk b0=__libm_error_support# // Call error handling function};;{ .mmi add GR_Parameter_RESULT = 48,sp nop.m 0 nop.i 0};;{ .mmi ldfs f8 = [GR_Parameter_RESULT] // Get return result off stack.restore sp add sp = 64,sp // Restore stack pointer mov b0 = GR_SAVE_B0 // Restore return address};;{ .mib mov gp = GR_SAVE_GP // Restore gp mov ar.pfs = GR_SAVE_PFS // Restore ar.pfs br.ret.sptk b0 // Return};;LOCAL_LIBM_END(__libm_error_region).type __libm_error_support#,@function.global __libm_error_support#
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -