📄 e_coshf.s
字号:
}{ .mfi nop.m 999(p0) fma.s1 coshf_FR_podd = coshf_FR_podd_temp2, coshf_FR_Rcub, coshf_FR_R nop.i 999}// sinh_GR_mj contains the table offset for -j// sinh_GR_j contains the table offset for +j// p6 is true when j <= 0{ .mlx(p0) setf.exp coshf_FR_N_temp2 = r40 (p0) movl r40 = 0x0000000000000020 ;; }{ .mfi(p0) sub GR_mJ = r40, r36 (p0) fmerge.se coshf_FR_spos = coshf_FR_N_temp1, f1 (p0) adds GR_J = 0x20, r36 ;; }{ .mii nop.m 999(p0) shl GR_mJ = GR_mJ, 5 ;; (p0) add AD_mJ = r37, GR_mJ ;; }{ .mmi nop.m 999(p0) ldfe coshf_FR_Tmjhi = [AD_mJ],16 (p0) shl GR_J = GR_J, 5 ;; }{ .mfi(p0) ldfs coshf_FR_Tmjlo = [AD_mJ],16 (p0) fcmp.lt.unc.s1 p6,p7 = coshf_FR_X,f9 (p0) add AD_J = r37, GR_J ;; }{ .mmi(p0) ldfe coshf_FR_Tjhi = [AD_J],16 ;; (p0) ldfs coshf_FR_Tjlo = [AD_J],16 nop.i 999 ;;}{ .mfb nop.m 999(p0) fmerge.se coshf_FR_sneg = coshf_FR_N_temp2, f1 (p7) br.cond.spnt L(COSH_BY_EXP) ;; }// ******************************************************// If NOT branch to EXP// ******************************************************// Calculate C_hi// ******************************************************// coshf_FR_C_hi_temp = coshf_FR_sneg * coshf_FR_Tmjhi// coshf_FR_C_hi = coshf_FR_spos * coshf_FR_Tjhi + (coshf_FR_sneg * coshf_FR_Tmjhi){ .mfi nop.m 999(p0) fma.s1 coshf_FR_C_hi_temp = coshf_FR_sneg, coshf_FR_Tmjhi, f0 nop.i 999 ;;}{ .mfi nop.m 999(p0) fma.s1 coshf_FR_C_hi = coshf_FR_spos, coshf_FR_Tjhi, coshf_FR_C_hi_temp nop.i 999}// ******************************************************// Calculate S_hi// ******************************************************// coshf_FR_S_hi_temp1 = coshf_FR_sneg * coshf_FR_Tmjhi// coshf_FR_S_hi = coshf_FR_spos * coshf_FR_Tjhi - coshf_FR_C_hi_temp1{ .mfi nop.m 999(p0) fma.s1 coshf_FR_S_hi_temp1 = coshf_FR_sneg, coshf_FR_Tmjhi, f0 nop.i 999 ;;}// ******************************************************// Calculate C_lo// ******************************************************// coshf_FR_C_lo_temp1 = coshf_FR_spos * coshf_FR_Tjhi - coshf_FR_C_hi// coshf_FR_C_lo_temp2 = coshf_FR_sneg * coshf_FR_Tmjlo + (coshf_FR_spos * coshf_FR_Tjhi - coshf_FR_C_hi)// coshf_FR_C_lo_temp1 = coshf_FR_sneg * coshf_FR_Tmjlo// coshf_FR_C_lo_temp3 = coshf_FR_spos * coshf_FR_Tjlo + (coshf_FR_sneg * coshf_FR_Tmjlo)// coshf_FR_C_lo = coshf_FR_C_lo_temp3 + coshf_FR_C_lo_temp2{ .mfi nop.m 999(p0) fms.s1 coshf_FR_C_lo_temp1 = coshf_FR_spos, coshf_FR_Tjhi, coshf_FR_C_hi nop.i 999}{ .mfi nop.m 999(p0) fms.s1 coshf_FR_S_hi = coshf_FR_spos, coshf_FR_Tjhi, coshf_FR_S_hi_temp1 nop.i 999 ;;}{ .mfi nop.m 999(p0) fma.s1 coshf_FR_C_lo_temp2 = coshf_FR_sneg, coshf_FR_Tmjhi, coshf_FR_C_lo_temp1 nop.i 999}{ .mfi nop.m 999(p0) fma.s1 coshf_FR_C_lo_temp1 = coshf_FR_sneg, coshf_FR_Tmjlo, f0 nop.i 999 ;;}{ .mfi nop.m 999(p0) fma.s1 coshf_FR_C_lo_temp3 = coshf_FR_spos, coshf_FR_Tjlo, coshf_FR_C_lo_temp1 nop.i 999 ;;}{ .mfi nop.m 999(p0) fma.s1 coshf_FR_C_lo = coshf_FR_C_lo_temp3, f1, coshf_FR_C_lo_temp2 nop.i 999 ;;}// ******************************************************// coshf_FR_Y_lo_temp = coshf_FR_C_hi * coshf_FR_peven + coshf_FR_C_lo// coshf_FR_Y_lo = coshf_FR_S_hi * coshf_FR_podd + coshf_FR_Y_lo_temp// coshf_FR_COSH = Y_hi + Y_lo{ .mfi nop.m 999(p0) fma.s1 coshf_FR_Y_lo_temp = coshf_FR_C_hi, coshf_FR_peven, coshf_FR_C_lo nop.i 999 ;;}{ .mfi nop.m 999(p0) fma.s1 coshf_FR_Y_lo = coshf_FR_S_hi, coshf_FR_podd, coshf_FR_Y_lo_temp nop.i 999 ;;}{ .mfb nop.m 999(p0) fma.s.s0 f8 = coshf_FR_C_hi, f1, coshf_FR_Y_lo (p0) br.ret.sptk b0 ;; }L(COSH_BY_EXP): // When p7 is true, we know that an overflow is not going to happen// When p7 is false, we must check for possible overflow// p7 is the over_SAFE flag// f44 = Scale * (Y_hi + Y_lo)// = coshf_FR_spos * (coshf_FR_Tjhi + coshf_FR_Y_lo){ .mfi nop.m 999(p0) fma.s1 coshf_FR_Y_lo_temp = coshf_FR_peven, f1, coshf_FR_podd nop.i 999}// Now we are in EXP. This is the only path where an overflow is possible// but not for certain. So this is the only path where over_SAFE has any use.// r34 still has N-1// There is a danger of double-extended overflow if N-1 > 16382 = 0x3ffe// There is a danger of double overflow if N-1 > 0x3fe = 1022// There is a danger of single overflow if N-1 > 0x7e = 126{ .mlx nop.m 999(p0) movl r32 = 0x000000000000007e ;; }{ .mfi(p0) cmp.gt.unc p0,p7 = r34, r32 nop.f 999 nop.i 999 ;;}{ .mfi nop.m 999(p0) fma.s1 coshf_FR_Y_lo = coshf_FR_Tjhi, coshf_FR_Y_lo_temp, coshf_FR_Tjlo nop.i 999 ;;}{ .mfi nop.m 999(p0) fma.s1 coshf_FR_COSH_temp = coshf_FR_Y_lo, f1, coshf_FR_Tjhi nop.i 999 ;;}{ .mfi nop.m 999(p0) fma.s.s0 f44 = coshf_FR_spos, coshf_FR_COSH_temp, f0 nop.i 999 ;;}// If over_SAFE is set, return{ .mfb nop.m 999(p7) fmerge.s f8 = f44,f44(p7) br.ret.sptk b0 ;;}// Else see if we overflowed// S0 user supplied status// S2 user supplied status + WRE + TD (Overflows)// If WRE is set then an overflow will not occur in EXP.// The input value that would cause a register (WRE) value to overflow is about 2^15// and this input would go into the HUGE path.// Answer with WRE is in f43.{ .mfi nop.m 999(p0) fsetc.s2 0x7F,0x42 nop.i 999;;}{ .mfi nop.m 999(p0) fma.s.s2 f43 = coshf_FR_spos, coshf_FR_COSH_temp, f0 nop.i 999 ;;}// 1 more that the exponent of the largest double (7FE) = 7FF// 7FF - 3FF = 400 (true); 400 + FFFF = 103FF (register-biased)// So 0 103FF 8000000000000000 is one ulp more than// largest double in register bias// 1 more that the exponent of the largest single (FE) = FF// FF - 7F = 80 (true); 80 + FFFF = 1007F (register-biased)// Now set p8 if the answer with WRE is greater than or equal this value// Also set p9 if the answer with WRE is less than or equal to negative this value{ .mlx nop.m 999(p0) movl r32 = 0x000000000001007f ;; }{ .mmf nop.m 999(p0) setf.exp f41 = r32 (p0) fsetc.s2 0x7F,0x40 ;; }{ .mfi nop.m 999(p0) fcmp.ge.unc.s1 p8, p0 = f43, f41 nop.i 999}{ .mfi nop.m 999(p0) fmerge.ns f42 = f41, f41 nop.i 999 ;;}// The error tag for overflow is 65{ .mii nop.m 999 nop.i 999 ;;(p8) mov GR_Parameter_TAG = 65 ;; }{ .mfb nop.m 999(p0) fcmp.le.unc.s1 p9, p0 = f43, f42 (p8) br.cond.spnt __libm_error_region ;;}{ .mii nop.m 999 nop.i 999 ;;(p9) mov GR_Parameter_TAG = 64 }{ .mib nop.m 999 nop.i 999(p9) br.cond.spnt __libm_error_region ;;}{ .mfb nop.m 999(p0) fmerge.s f8 = f44,f44 (p0) br.ret.sptk b0 ;; }L(COSH_HUGE): // for COSH_HUGE, put 24000 in exponent; take sign from input; add 1// SAFE: SAFE is always 0 for HUGE{ .mlx nop.m 999(p0) movl r32 = 0x0000000000015dbf ;; }{ .mfi(p0) setf.exp f9 = r32 nop.f 999 nop.i 999 ;;}{ .mfi nop.m 999(p0) fma.s1 coshf_FR_hi_lo = f1, f9, f1 nop.i 999 ;;}{ .mfi nop.m 999(p0) fma.s.s0 f44 = f9, coshf_FR_hi_lo, f0 (p0) mov GR_Parameter_TAG = 65 }.endp coshfASM_SIZE_DIRECTIVE(coshf).proc __libm_error_region__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 // Save 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{ .mib stfs [GR_Parameter_X] = FR_X // Store Parameter 1 on stack add GR_Parameter_RESULT = 0,GR_Parameter_Y nop.b 0 // 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.many b0=__libm_error_support# // Call error handling function};;{ .mmi nop.m 0 nop.m 0 add GR_Parameter_RESULT = 48,sp};;{ .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};; .endp __libm_error_regionASM_SIZE_DIRECTIVE(__libm_error_region).type __libm_error_support#,@function.global __libm_error_support#
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -