...
Run Format

Text file src/math/sinh_s390x.s

Documentation: math

     1	// Copyright 2016 The Go Authors. All rights reserved.
     2	// Use of this source code is governed by a BSD-style
     3	// license that can be found in the LICENSE file.
     4	
     5	
     6	#include "textflag.h"
     7	
     8	// Constants
     9	DATA sinhrodataL21<>+0(SB)/8, $0.231904681384629956E-16
    10	DATA sinhrodataL21<>+8(SB)/8, $0.693147180559945286E+00
    11	DATA sinhrodataL21<>+16(SB)/8, $704.E0
    12	GLOBL sinhrodataL21<>+0(SB), RODATA, $24
    13	DATA sinhrlog2<>+0(SB)/8, $0x3ff7154760000000
    14	GLOBL sinhrlog2<>+0(SB), RODATA, $8
    15	DATA sinhxinf<>+0(SB)/8, $0x7ff0000000000000
    16	GLOBL sinhxinf<>+0(SB), RODATA, $8
    17	DATA sinhxinit<>+0(SB)/8, $0x3ffb504f333f9de6
    18	GLOBL sinhxinit<>+0(SB), RODATA, $8
    19	DATA sinhxlim1<>+0(SB)/8, $800.E0
    20	GLOBL sinhxlim1<>+0(SB), RODATA, $8
    21	DATA sinhxadd<>+0(SB)/8, $0xc3200001610007fb
    22	GLOBL sinhxadd<>+0(SB), RODATA, $8
    23	DATA sinhx4ff<>+0(SB)/8, $0x4ff0000000000000
    24	GLOBL sinhx4ff<>+0(SB), RODATA, $8
    25	
    26	// Minimax polynomial approximations
    27	DATA sinhe0<>+0(SB)/8, $0.11715728752538099300E+01
    28	GLOBL sinhe0<>+0(SB), RODATA, $8
    29	DATA sinhe1<>+0(SB)/8, $0.11715728752538099300E+01
    30	GLOBL sinhe1<>+0(SB), RODATA, $8
    31	DATA sinhe2<>+0(SB)/8, $0.58578643762688526692E+00
    32	GLOBL sinhe2<>+0(SB), RODATA, $8
    33	DATA sinhe3<>+0(SB)/8, $0.19526214587563004497E+00
    34	GLOBL sinhe3<>+0(SB), RODATA, $8
    35	DATA sinhe4<>+0(SB)/8, $0.48815536475176217404E-01
    36	GLOBL sinhe4<>+0(SB), RODATA, $8
    37	DATA sinhe5<>+0(SB)/8, $0.97631072948627397816E-02
    38	GLOBL sinhe5<>+0(SB), RODATA, $8
    39	DATA sinhe6<>+0(SB)/8, $0.16271839297756073153E-02
    40	GLOBL sinhe6<>+0(SB), RODATA, $8
    41	DATA sinhe7<>+0(SB)/8, $0.23245485387271142509E-03
    42	GLOBL sinhe7<>+0(SB), RODATA, $8
    43	DATA sinhe8<>+0(SB)/8, $0.29080955860869629131E-04
    44	GLOBL sinhe8<>+0(SB), RODATA, $8
    45	DATA sinhe9<>+0(SB)/8, $0.32311267157667725278E-05
    46	GLOBL sinhe9<>+0(SB), RODATA, $8
    47	
    48	// Sinh returns the hyperbolic sine of the argument.
    49	//
    50	// Special cases are:
    51	//      Sinh(±0) = ±0
    52	//      Sinh(±Inf) = ±Inf
    53	//      Sinh(NaN) = NaN
    54	// The algorithm used is minimax polynomial approximation
    55	// with coefficients determined with a Remez exchange algorithm.
    56	
    57	TEXT ·sinhAsm(SB),NOSPLIT,$0-16
    58		FMOVD   x+0(FP), F0
    59		//specail case Sinh(±0) = ±0
    60		FMOVD   $(0.0), F1
    61		FCMPU   F0, F1
    62		BEQ     sinhIsZero
    63		//specail case Sinh(±Inf = ±Inf
    64		FMOVD   $1.797693134862315708145274237317043567981e+308, F1
    65		FCMPU   F1, F0
    66		BLEU    sinhIsInf
    67		FMOVD   $-1.797693134862315708145274237317043567981e+308, F1
    68		FCMPU   F1, F0
    69		BGT             sinhIsInf
    70	
    71		MOVD    $sinhrodataL21<>+0(SB), R5
    72		WORD    $0xB3120000     //ltdbr %f0,%f0
    73		MOVD    sinhxinit<>+0(SB), R1
    74		FMOVD   F0, F4
    75		MOVD    R1, R3
    76		BLTU    L19
    77		FMOVD   F0, F2
    78	L2:
    79		WORD    $0xED205010     //cdb %f2,.L22-.L21(%r5)
    80		BYTE    $0x00
    81		BYTE    $0x19
    82		BGE     L15     //jnl   .L15
    83		BVS     L15
    84		WFCEDBS V2, V2, V0
    85		BEQ     L20
    86	L12:
    87		FMOVD   F4, F0
    88		FMOVD   F0, ret+8(FP)
    89		RET
    90	
    91	L15:
    92		WFCEDBS V2, V2, V0
    93		BVS     L12
    94		MOVD    $sinhxlim1<>+0(SB), R2
    95		FMOVD   0(R2), F0
    96		WFCHDBS V0, V2, V0
    97		BEQ     L6
    98		WFCHEDBS        V4, V2, V6
    99		MOVD    $sinhxinf<>+0(SB), R1
   100		FMOVD   0(R1), F0
   101		BNE     LEXITTAGsinh
   102		WFCHDBS V2, V4, V2
   103		BNE     L16
   104		FNEG    F0, F0
   105		FMOVD   F0, ret+8(FP)
   106		RET
   107	
   108	L19:
   109		FNEG    F0, F2
   110		BR      L2
   111	L6:
   112		MOVD    $sinhxadd<>+0(SB), R2
   113		FMOVD   0(R2), F0
   114		MOVD    sinhrlog2<>+0(SB), R2
   115		LDGR    R2, F6
   116		WFMSDB  V4, V6, V0, V16
   117		FMOVD   sinhrodataL21<>+8(SB), F6
   118		WFADB   V0, V16, V0
   119		FMOVD   sinhrodataL21<>+0(SB), F3
   120		WFMSDB  V0, V6, V4, V6
   121		MOVD    $sinhe9<>+0(SB), R2
   122		WFMADB  V0, V3, V6, V0
   123		FMOVD   0(R2), F1
   124		MOVD    $sinhe7<>+0(SB), R2
   125		WFMDB   V0, V0, V6
   126		FMOVD   0(R2), F5
   127		MOVD    $sinhe8<>+0(SB), R2
   128		FMOVD   0(R2), F3
   129		MOVD    $sinhe6<>+0(SB), R2
   130		WFMADB  V6, V1, V5, V1
   131		FMOVD   0(R2), F5
   132		MOVD    $sinhe5<>+0(SB), R2
   133		FMOVD   0(R2), F7
   134		MOVD    $sinhe3<>+0(SB), R2
   135		WFMADB  V6, V3, V5, V3
   136		FMOVD   0(R2), F5
   137		MOVD    $sinhe4<>+0(SB), R2
   138		WFMADB  V6, V7, V5, V7
   139		FMOVD   0(R2), F5
   140		MOVD    $sinhe2<>+0(SB), R2
   141		VLEG    $0, 0(R2), V20
   142		WFMDB   V6, V6, V18
   143		WFMADB  V6, V5, V20, V5
   144		WFMADB  V1, V18, V7, V1
   145		FNEG    F0, F0
   146		WFMADB  V3, V18, V5, V3
   147		MOVD    $sinhe1<>+0(SB), R3
   148		WFCEDBS V2, V4, V2
   149		FMOVD   0(R3), F5
   150		MOVD    $sinhe0<>+0(SB), R3
   151		WFMADB  V6, V1, V5, V1
   152		FMOVD   0(R3), F5
   153		VLGVG   $0, V16, R2
   154		WFMADB  V6, V3, V5, V6
   155		RLL     $3, R2, R2
   156		WORD    $0xEC12000F     //risbgn %r1,%r2,64-64+0,64-64+0+16-1,64-0-16
   157		BYTE    $0x30
   158		BYTE    $0x59
   159		BEQ     L9
   160		WFMSDB  V0, V1, V6, V0
   161		MOVD    $sinhx4ff<>+0(SB), R3
   162		FNEG    F0, F0
   163		FMOVD   0(R3), F2
   164		FMUL    F2, F0
   165		ANDW    $0xFFFF, R2
   166		WORD    $0xA53FEFB6     //llill %r3,61366
   167		SUBW    R2, R3, R2
   168		WORD    $0xEC12000F     //risbgn %r1,%r2,64-64+0,64-64+0+16-1,64-0-16
   169		BYTE    $0x30
   170		BYTE    $0x59
   171		LDGR    R1, F2
   172		FMUL    F2, F0
   173		FMOVD   F0, ret+8(FP)
   174		RET
   175	
   176	L20:
   177		MOVD    $sinhxadd<>+0(SB), R2
   178		FMOVD   0(R2), F2
   179		MOVD    sinhrlog2<>+0(SB), R2
   180		LDGR    R2, F0
   181		WFMSDB  V4, V0, V2, V6
   182		FMOVD   sinhrodataL21<>+8(SB), F0
   183		FADD    F6, F2
   184		MOVD    $sinhe9<>+0(SB), R2
   185		FMSUB   F0, F2, F4
   186		FMOVD   0(R2), F1
   187		FMOVD   sinhrodataL21<>+0(SB), F3
   188		MOVD    $sinhe7<>+0(SB), R2
   189		FMADD   F3, F2, F4
   190		FMOVD   0(R2), F0
   191		MOVD    $sinhe8<>+0(SB), R2
   192		WFMDB   V4, V4, V2
   193		FMOVD   0(R2), F3
   194		MOVD    $sinhe6<>+0(SB), R2
   195		FMOVD   0(R2), F5
   196		LGDR    F6, R2
   197		RLL     $3, R2, R2
   198		WORD    $0xEC12000F     //risbgn %r1,%r2,64-64+0,64-64+0+16-1,64-0-16
   199		BYTE    $0x30
   200		BYTE    $0x59
   201		WFMADB  V2, V1, V0, V1
   202		LDGR    R1, F0
   203		MOVD    $sinhe5<>+0(SB), R1
   204		WFMADB  V2, V3, V5, V3
   205		FMOVD   0(R1), F5
   206		MOVD    $sinhe3<>+0(SB), R1
   207		FMOVD   0(R1), F6
   208		WFMDB   V2, V2, V7
   209		WFMADB  V2, V5, V6, V5
   210		WORD    $0xA7487FB6     //lhi %r4,32694
   211		FNEG    F4, F4
   212		ANDW    $0xFFFF, R2
   213		SUBW    R2, R4, R2
   214		WORD    $0xEC32000F     //risbgn %r3,%r2,64-64+0,64-64+0+16-1,64-0-16
   215		BYTE    $0x30
   216		BYTE    $0x59
   217		LDGR    R3, F6
   218		WFADB   V0, V6, V16
   219		MOVD    $sinhe4<>+0(SB), R1
   220		WFMADB  V1, V7, V5, V1
   221		WFMDB   V4, V16, V4
   222		FMOVD   0(R1), F5
   223		MOVD    $sinhe2<>+0(SB), R1
   224		VLEG    $0, 0(R1), V16
   225		MOVD    $sinhe1<>+0(SB), R1
   226		WFMADB  V2, V5, V16, V5
   227		VLEG    $0, 0(R1), V16
   228		WFMADB  V3, V7, V5, V3
   229		WFMADB  V2, V1, V16, V1
   230		FSUB    F6, F0
   231		FMUL    F1, F4
   232		MOVD    $sinhe0<>+0(SB), R1
   233		FMOVD   0(R1), F6
   234		WFMADB  V2, V3, V6, V2
   235		WFMADB  V0, V2, V4, V0
   236		FMOVD   F0, ret+8(FP)
   237		RET
   238	
   239	L9:
   240		WFMADB  V0, V1, V6, V0
   241		MOVD    $sinhx4ff<>+0(SB), R3
   242		FMOVD   0(R3), F2
   243		FMUL    F2, F0
   244		WORD    $0xA72AF000     //ahi   %r2,-4096
   245		WORD    $0xEC12000F     //risbgn %r1,%r2,64-64+0,64-64+0+16-1,64-0-16
   246		BYTE    $0x30
   247		BYTE    $0x59
   248		LDGR    R1, F2
   249		FMUL    F2, F0
   250		FMOVD   F0, ret+8(FP)
   251		RET
   252	
   253	L16:
   254		FMOVD   F0, ret+8(FP)
   255		RET
   256	
   257	LEXITTAGsinh:
   258	sinhIsInf:
   259	sinhIsZero:
   260		FMOVD   F0, ret+8(FP)
   261		RET

View as plain text