⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 e_sinh.s

📁 Glibc 2.3.2源代码(解压后有100多M)
💻 S
📖 第 1 页 / 共 3 页
字号:
.file "sinh.s"// Copyright (C) 2000, 2001, Intel Corporation// All rights reserved.// // Contributed 2/2/2000 by John Harrison, Ted Kubaska, Bob Norin, Shane Story,// and Ping Tak Peter Tang of the Computational Software Lab, Intel Corporation.//// Redistribution and use in source and binary forms, with or without// modification, are permitted provided that the following conditions are// met://// * Redistributions of source code must retain the above copyright// notice, this list of conditions and the following disclaimer.//// * Redistributions in binary form must reproduce the above copyright// notice, this list of conditions and the following disclaimer in the// documentation and/or other materials provided with the distribution.//// * The name of Intel Corporation may not be used to endorse or promote// products derived from this software without specific prior written// permission.//// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR ITS // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY OR TORT (INCLUDING// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // // Intel Corporation is the author of this code, and requests that all// problem reports or change requests be submitted to it directly at // http://developer.intel.com/opensource.//// History//==============================================================// 2/02/00  Initial version// 4/04/00  Unwind support added// 8/15/00  Bundle added after call to __libm_error_support to properly//          set [the previously overwritten] GR_Parameter_RESULT.// 10/12/00 Update to set denormal operand and underflow flags// 1/22/01  Fixed to set inexact flag for small args.//// API//==============================================================// double = sinh(double)// input  floating point f8// output floating point f8//// Registers used//==============================================================// general registers: // r32 -> r47// predicate registers used:// p6 p7 p8 p9// floating-point registers used:// f9 -> f15; f32 -> f45; // f8 has input, then output//// Overview of operation//==============================================================// There are four paths// 1. |x| < 0.25        SINH_BY_POLY// 2. |x| < 32          SINH_BY_TBL// 3. |x| < 2^14        SINH_BY_EXP// 4. |x_ >= 2^14       SINH_HUGE//// For double extended we get infinity for x >= 400c b174 ddc0 31ae c0ea//                                           >= 1.0110001.... x 2^13//                                           >= 11357.2166//// But for double we get infinity for x >= 408633ce8fb9f87e//                                      >= 1.0110...x 2^9//                                      >= +7.10476e+002//// And for single we get infinity for x >= 42b3a496//                                      >= 1.0110... 2^6//                                      >= 89.8215//// SAFE: If there is danger of overflow set SAFE to 0//       NOT implemented: if there is danger of underflow, set SAFE to 0// SAFE for all paths listed below//// 1. SINH_BY_POLY// ===============// If |x| is less than the tiny threshold, then clear SAFE // For double, the tiny threshold is -1022 = -0x3fe => -3fe + ffff = fc01//             register-biased, this is fc01// For single, the tiny threshold is -126  = -7e    => -7e  + ffff = ff81// If |x| < tiny threshold, set SAFE = 0//// 2. SINH_BY_TBL// =============// SAFE: SAFE is always 1 for TBL; //// 3. SINH_BY_EXP// ==============// There is a danger of double-extended overflow   if N-1 > 16382 = 0x3ffe// r34 has N-1; 16382 is in register biased form, 0x13ffd// There is danger of double overflow if N-1 > 0x3fe//                       in register biased form, 0x103fd// Analagously, there is danger of single overflow if N-1 > 0x7e//                       in register biased form, 0x1007d// SAFE: If there is danger of overflow set SAFE to 0//// 4. SINH_HUGE// ============// SAFE: SAFE is always 0 for HUGE#include "libm_support.h"//// Assembly macros//==============================================================sinh_FR_X            = f44sinh_FR_X2           = f9sinh_FR_X4           = f10sinh_FR_SGNX         = f40sinh_FR_all_ones     = f45sinh_FR_tmp          = f42sinh_FR_Inv_log2by64 = f9sinh_FR_log2by64_lo  = f11sinh_FR_log2by64_hi  = f10sinh_FR_A1           = f9sinh_FR_A2           = f10sinh_FR_A3           = f11sinh_FR_Rcub         = f12sinh_FR_M_temp       = f13sinh_FR_R_temp       = f13sinh_FR_Rsq          = f13sinh_FR_R            = f14sinh_FR_M            = f38sinh_FR_B1           = f15sinh_FR_B2           = f32sinh_FR_B3           = f33sinh_FR_peven_temp1  = f34sinh_FR_peven_temp2  = f35sinh_FR_peven        = f36sinh_FR_podd_temp1   = f34sinh_FR_podd_temp2   = f35sinh_FR_podd         = f37sinh_FR_poly_podd_temp1    =  f11 sinh_FR_poly_podd_temp2    =  f13sinh_FR_poly_peven_temp1   =  f11sinh_FR_poly_peven_temp2   =  f13sinh_FR_J_temp       = f9sinh_FR_J            = f10sinh_FR_Mmj          = f39sinh_FR_N_temp1      = f11sinh_FR_N_temp2      = f12sinh_FR_N            = f13sinh_FR_spos         = f14sinh_FR_sneg         = f15sinh_FR_Tjhi         = f32sinh_FR_Tjlo         = f33sinh_FR_Tmjhi        = f34sinh_FR_Tmjlo        = f35sinh_GR_mJ           = r35sinh_GR_J            = r36sinh_AD_mJ           = r38sinh_AD_J            = r39sinh_GR_all_ones     = r40sinh_FR_S_hi         = f9sinh_FR_S_hi_temp    = f10sinh_FR_S_lo_temp1   = f11 sinh_FR_S_lo_temp2   = f12 sinh_FR_S_lo_temp3   = f13 sinh_FR_S_lo         = f38sinh_FR_C_hi         = f39sinh_FR_C_hi_temp1   = f10sinh_FR_Y_hi         = f11 sinh_FR_Y_lo_temp    = f12 sinh_FR_Y_lo         = f13 sinh_FR_SINH         = f9sinh_FR_P1           = f14sinh_FR_P2           = f15sinh_FR_P3           = f32sinh_FR_P4           = f33sinh_FR_P5           = f34sinh_FR_P6           = f35sinh_FR_TINY_THRESH  = f9sinh_FR_SINH_temp    = f10sinh_FR_SCALE        = f11 sinh_FR_signed_hi_lo = f10GR_SAVE_PFS          = r41GR_SAVE_B0           = r42GR_SAVE_GP           = r43GR_Parameter_X       = r44GR_Parameter_Y       = r45GR_Parameter_RESULT  = r46// Data tables//==============================================================#ifdef _LIBC.rodata#else.data#endif.align 16double_sinh_arg_reduction:ASM_TYPE_DIRECTIVE(double_sinh_arg_reduction,@object)   data8 0xB8AA3B295C17F0BC, 0x00004005   data8 0xB17217F7D1000000, 0x00003FF8   data8 0xCF79ABC9E3B39804, 0x00003FD0ASM_SIZE_DIRECTIVE(double_sinh_arg_reduction)double_sinh_p_table:ASM_TYPE_DIRECTIVE(double_sinh_p_table,@object)   data8 0xAAAAAAAAAAAAAAAB, 0x00003FFC   data8 0x8888888888888412, 0x00003FF8   data8 0xD00D00D00D4D39F2, 0x00003FF2   data8 0xB8EF1D28926D8891, 0x00003FEC   data8 0xD732377688025BE9, 0x00003FE5   data8 0xB08AF9AE78C1239F, 0x00003FDEASM_SIZE_DIRECTIVE(double_sinh_p_table)double_sinh_ab_table:ASM_TYPE_DIRECTIVE(double_sinh_ab_table,@object)   data8 0xAAAAAAAAAAAAAAAC, 0x00003FFC   data8 0x88888888884ECDD5, 0x00003FF8   data8 0xD00D0C6DCC26A86B, 0x00003FF2   data8 0x8000000000000002, 0x00003FFE   data8 0xAAAAAAAAAA402C77, 0x00003FFA   data8 0xB60B6CC96BDB144D, 0x00003FF5ASM_SIZE_DIRECTIVE(double_sinh_ab_table)double_sinh_j_table:ASM_TYPE_DIRECTIVE(double_sinh_j_table,@object)   data8 0xB504F333F9DE6484, 0x00003FFE, 0x1EB2FB13, 0x00000000   data8 0xB6FD91E328D17791, 0x00003FFE, 0x1CE2CBE2, 0x00000000   data8 0xB8FBAF4762FB9EE9, 0x00003FFE, 0x1DDC3CBC, 0x00000000   data8 0xBAFF5AB2133E45FB, 0x00003FFE, 0x1EE9AA34, 0x00000000   data8 0xBD08A39F580C36BF, 0x00003FFE, 0x9EAEFDC1, 0x00000000   data8 0xBF1799B67A731083, 0x00003FFE, 0x9DBF517B, 0x00000000   data8 0xC12C4CCA66709456, 0x00003FFE, 0x1EF88AFB, 0x00000000   data8 0xC346CCDA24976407, 0x00003FFE, 0x1E03B216, 0x00000000   data8 0xC5672A115506DADD, 0x00003FFE, 0x1E78AB43, 0x00000000   data8 0xC78D74C8ABB9B15D, 0x00003FFE, 0x9E7B1747, 0x00000000   data8 0xC9B9BD866E2F27A3, 0x00003FFE, 0x9EFE3C0E, 0x00000000   data8 0xCBEC14FEF2727C5D, 0x00003FFE, 0x9D36F837, 0x00000000   data8 0xCE248C151F8480E4, 0x00003FFE, 0x9DEE53E4, 0x00000000   data8 0xD06333DAEF2B2595, 0x00003FFE, 0x9E24AE8E, 0x00000000   data8 0xD2A81D91F12AE45A, 0x00003FFE, 0x1D912473, 0x00000000   data8 0xD4F35AABCFEDFA1F, 0x00003FFE, 0x1EB243BE, 0x00000000   data8 0xD744FCCAD69D6AF4, 0x00003FFE, 0x1E669A2F, 0x00000000   data8 0xD99D15C278AFD7B6, 0x00003FFE, 0x9BBC610A, 0x00000000   data8 0xDBFBB797DAF23755, 0x00003FFE, 0x1E761035, 0x00000000   data8 0xDE60F4825E0E9124, 0x00003FFE, 0x9E0BE175, 0x00000000   data8 0xE0CCDEEC2A94E111, 0x00003FFE, 0x1CCB12A1, 0x00000000   data8 0xE33F8972BE8A5A51, 0x00003FFE, 0x1D1BFE90, 0x00000000   data8 0xE5B906E77C8348A8, 0x00003FFE, 0x1DF2F47A, 0x00000000   data8 0xE8396A503C4BDC68, 0x00003FFE, 0x1EF22F22, 0x00000000   data8 0xEAC0C6E7DD24392F, 0x00003FFE, 0x9E3F4A29, 0x00000000   data8 0xED4F301ED9942B84, 0x00003FFE, 0x1EC01A5B, 0x00000000   data8 0xEFE4B99BDCDAF5CB, 0x00003FFE, 0x1E8CAC3A, 0x00000000   data8 0xF281773C59FFB13A, 0x00003FFE, 0x9DBB3FAB, 0x00000000   data8 0xF5257D152486CC2C, 0x00003FFE, 0x1EF73A19, 0x00000000   data8 0xF7D0DF730AD13BB9, 0x00003FFE, 0x9BB795B5, 0x00000000   data8 0xFA83B2DB722A033A, 0x00003FFE, 0x1EF84B76, 0x00000000   data8 0xFD3E0C0CF486C175, 0x00003FFE, 0x9EF5818B, 0x00000000   data8 0x8000000000000000, 0x00003FFF, 0x00000000, 0x00000000   data8 0x8164D1F3BC030773, 0x00003FFF, 0x1F77CACA, 0x00000000   data8 0x82CD8698AC2BA1D7, 0x00003FFF, 0x1EF8A91D, 0x00000000   data8 0x843A28C3ACDE4046, 0x00003FFF, 0x1E57C976, 0x00000000   data8 0x85AAC367CC487B15, 0x00003FFF, 0x9EE8DA92, 0x00000000   data8 0x871F61969E8D1010, 0x00003FFF, 0x1EE85C9F, 0x00000000   data8 0x88980E8092DA8527, 0x00003FFF, 0x1F3BF1AF, 0x00000000   data8 0x8A14D575496EFD9A, 0x00003FFF, 0x1D80CA1E, 0x00000000   data8 0x8B95C1E3EA8BD6E7, 0x00003FFF, 0x9D0373AF, 0x00000000   data8 0x8D1ADF5B7E5BA9E6, 0x00003FFF, 0x9F167097, 0x00000000   data8 0x8EA4398B45CD53C0, 0x00003FFF, 0x1EB70051, 0x00000000   data8 0x9031DC431466B1DC, 0x00003FFF, 0x1F6EB029, 0x00000000   data8 0x91C3D373AB11C336, 0x00003FFF, 0x1DFD6D8E, 0x00000000   data8 0x935A2B2F13E6E92C, 0x00003FFF, 0x9EB319B0, 0x00000000   data8 0x94F4EFA8FEF70961, 0x00003FFF, 0x1EBA2BEB, 0x00000000   data8 0x96942D3720185A00, 0x00003FFF, 0x1F11D537, 0x00000000   data8 0x9837F0518DB8A96F, 0x00003FFF, 0x1F0D5A46, 0x00000000   data8 0x99E0459320B7FA65, 0x00003FFF, 0x9E5E7BCA, 0x00000000   data8 0x9B8D39B9D54E5539, 0x00003FFF, 0x9F3AAFD1, 0x00000000   data8 0x9D3ED9A72CFFB751, 0x00003FFF, 0x9E86DACC, 0x00000000   data8 0x9EF5326091A111AE, 0x00003FFF, 0x9F3EDDC2, 0x00000000   data8 0xA0B0510FB9714FC2, 0x00003FFF, 0x1E496E3D, 0x00000000   data8 0xA27043030C496819, 0x00003FFF, 0x9F490BF6, 0x00000000   data8 0xA43515AE09E6809E, 0x00003FFF, 0x1DD1DB48, 0x00000000   data8 0xA5FED6A9B15138EA, 0x00003FFF, 0x1E65EBFB, 0x00000000   data8 0xA7CD93B4E965356A, 0x00003FFF, 0x9F427496, 0x00000000   data8 0xA9A15AB4EA7C0EF8, 0x00003FFF, 0x1F283C4A, 0x00000000   data8 0xAB7A39B5A93ED337, 0x00003FFF, 0x1F4B0047, 0x00000000   data8 0xAD583EEA42A14AC6, 0x00003FFF, 0x1F130152, 0x00000000   data8 0xAF3B78AD690A4375, 0x00003FFF, 0x9E8367C0, 0x00000000   data8 0xB123F581D2AC2590, 0x00003FFF, 0x9F705F90, 0x00000000   data8 0xB311C412A9112489, 0x00003FFF, 0x1EFB3C53, 0x00000000   data8 0xB504F333F9DE6484, 0x00003FFF, 0x1F32FB13, 0x00000000ASM_SIZE_DIRECTIVE(double_sinh_j_table).align 32.global sinh#.section .text.proc  sinh#.align 32sinh: #ifdef _LIBC.global __ieee754_sinh.type __ieee754_sinh,@function__ieee754_sinh:#endif// X infinity or NAN?// Take invalid fault if enabled{ .mfi      alloc r32 = ar.pfs,0,12,4,0                  (p0)     fclass.m.unc  p6,p0 = f8, 0xe3	//@qnan | @snan | @inf          mov sinh_GR_all_ones = -1};;{ .mfb         nop.m 999(p6)     fma.d.s0   f8 = f8,f1,f8               (p6)     br.ret.spnt     b0 ;;                          }// Put 0.25 in f9; p6 true if x < 0.25// Make constant that will generate inexact when squared{ .mlx         setf.sig sinh_FR_all_ones = sinh_GR_all_ones (p0)     movl            r32 = 0x000000000000fffd ;;         }{ .mfi(p0)     setf.exp        f9 = r32                         (p0)     fclass.m.unc  p7,p0 = f8, 0x07	//@zero         nop.i 999 ;;}{ .mfb         nop.m 999(p0)     fmerge.s      sinh_FR_X    = f0,f8             (p7)     br.ret.spnt     b0 ;;                          }// Identify denormal operands.{ .mfi         nop.m 999         fclass.m.unc  p10,p0 = f8, 0x09        //  + denorm         nop.i 999};;{ .mfi         nop.m 999         fclass.m.unc  p11,p0 = f8, 0x0a        //  - denorm         nop.i 999 }{ .mfi         nop.m 999(p0)     fmerge.s      sinh_FR_SGNX = f8,f1                      nop.i 999 ;;}{ .mfi         nop.m 999(p0)     fcmp.lt.unc.s1  p0,p7 = sinh_FR_X,f9                      nop.i 999 ;;}{ .mib         nop.m 999         nop.i 999(p7)     br.cond.sptk    L(SINH_BY_TBL) ;;                      }L(SINH_BY_POLY): // POLY cannot overflow so there is no need to call __libm_error_support// Set tiny_SAFE (p7) to 1(0) if answer is not tiny // Currently we do not use tiny_SAFE. So the setting of tiny_SAFE is// commented out.//(p0)     movl            r32            = 0x000000000000fc01           //(p0)     setf.exp        f10            = r32                         //(p0)     fcmp.lt.unc.s1  p6,p7          = f8,f10                     // Here is essentially the algorithm for SINH_BY_POLY. Care is take for the order // of multiplication; and P_1 is not exactly 1/3!, P_2 is not exactly 1/5!, etc.// Note that ax = |x|// sinh(x) = sign * (series(e^x) - series(e^-x))/2//         = sign * (ax + ax^3/3! + ax^5/5! + ax^7/7! + ax^9/9! + ax^11/11! + ax^13/13!)//         = sign * (ax   + ax * ( ax^2 * (1/3! + ax^4 * (1/7! + ax^4*1/11!)) )//                        + ax * ( ax^4 * (1/5! + ax^4 * (1/9! + ax^4*1/13!)) ) )//         = sign * (ax   + ax*p_odd + (ax*p_even))//         = sign * (ax   + Y_lo)// sinh(x) = sign * (Y_hi + Y_lo)// Get the values of P_x from the table{ .mfb(p0)  addl           r34   = @ltoff(double_sinh_p_table), gp(p10) fma.d.s0       f8 =  f8,f8,f8(p10) br.ret.spnt    b0};;{ .mfb      ld8 r34 = [r34](p11) fnma.d.s0      f8 =  f8,f8,f8(p11) br.ret.spnt    b0};;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -