Text file
src/math/asinh_s390x.s
1 // Copyright 2017 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 #include "textflag.h"
6
7 // Minimax polynomial coefficients and other constants
8 DATA ·asinhrodataL18<> + 0(SB)/8, $0.749999999977387502E-01
9 DATA ·asinhrodataL18<> + 8(SB)/8, $-.166666666666657082E+00
10 DATA ·asinhrodataL18<> + 16(SB)/8, $0.303819368237360639E-01
11 DATA ·asinhrodataL18<> + 24(SB)/8, $-.446428569571752982E-01
12 DATA ·asinhrodataL18<> + 32(SB)/8, $0.173500047922695924E-01
13 DATA ·asinhrodataL18<> + 40(SB)/8, $-.223719767210027185E-01
14 DATA ·asinhrodataL18<> + 48(SB)/8, $0.113655037946822130E-01
15 DATA ·asinhrodataL18<> + 56(SB)/8, $0.579747490622448943E-02
16 DATA ·asinhrodataL18<> + 64(SB)/8, $-.139372433914359122E-01
17 DATA ·asinhrodataL18<> + 72(SB)/8, $-.218674325255800840E-02
18 DATA ·asinhrodataL18<> + 80(SB)/8, $-.891074277756961157E-02
19 DATA ·asinhrodataL18<> + 88(SB)/8, $.41375273347623353626
20 DATA ·asinhrodataL18<> + 96(SB)/8, $.51487302528619766235E+04
21 DATA ·asinhrodataL18<> + 104(SB)/8, $-1.67526912689208984375
22 DATA ·asinhrodataL18<> + 112(SB)/8, $0.181818181818181826E+00
23 DATA ·asinhrodataL18<> + 120(SB)/8, $-.165289256198351540E-01
24 DATA ·asinhrodataL18<> + 128(SB)/8, $0.200350613573012186E-02
25 DATA ·asinhrodataL18<> + 136(SB)/8, $-.273205381970859341E-03
26 DATA ·asinhrodataL18<> + 144(SB)/8, $0.397389654305194527E-04
27 DATA ·asinhrodataL18<> + 152(SB)/8, $0.938370938292558173E-06
28 DATA ·asinhrodataL18<> + 160(SB)/8, $0.212881813645679599E-07
29 DATA ·asinhrodataL18<> + 168(SB)/8, $-.602107458843052029E-05
30 DATA ·asinhrodataL18<> + 176(SB)/8, $-.148682720127920854E-06
31 DATA ·asinhrodataL18<> + 184(SB)/8, $-5.5
32 DATA ·asinhrodataL18<> + 192(SB)/8, $1.0
33 DATA ·asinhrodataL18<> + 200(SB)/8, $1.0E-20
34 GLOBL ·asinhrodataL18<> + 0(SB), RODATA, $208
35
36 // Table of log correction terms
37 DATA ·asinhtab2080<> + 0(SB)/8, $0.585235384085551248E-01
38 DATA ·asinhtab2080<> + 8(SB)/8, $0.412206153771168640E-01
39 DATA ·asinhtab2080<> + 16(SB)/8, $0.273839003221648339E-01
40 DATA ·asinhtab2080<> + 24(SB)/8, $0.166383778368856480E-01
41 DATA ·asinhtab2080<> + 32(SB)/8, $0.866678223433169637E-02
42 DATA ·asinhtab2080<> + 40(SB)/8, $0.319831684989627514E-02
43 DATA ·asinhtab2080<> + 48(SB)/8, $0.0
44 DATA ·asinhtab2080<> + 56(SB)/8, $-.113006378583725549E-02
45 DATA ·asinhtab2080<> + 64(SB)/8, $-.367979419636602491E-03
46 DATA ·asinhtab2080<> + 72(SB)/8, $0.213172484510484979E-02
47 DATA ·asinhtab2080<> + 80(SB)/8, $0.623271047682013536E-02
48 DATA ·asinhtab2080<> + 88(SB)/8, $0.118140812789696885E-01
49 DATA ·asinhtab2080<> + 96(SB)/8, $0.187681358930914206E-01
50 DATA ·asinhtab2080<> + 104(SB)/8, $0.269985148668178992E-01
51 DATA ·asinhtab2080<> + 112(SB)/8, $0.364186619761331328E-01
52 DATA ·asinhtab2080<> + 120(SB)/8, $0.469505379381388441E-01
53 GLOBL ·asinhtab2080<> + 0(SB), RODATA, $128
54
55 // Asinh returns the inverse hyperbolic sine of the argument.
56 //
57 // Special cases are:
58 // Asinh(±0) = ±0
59 // Asinh(±Inf) = ±Inf
60 // Asinh(NaN) = NaN
61 // The algorithm used is minimax polynomial approximation
62 // with coefficients determined with a Remez exchange algorithm.
63
64 TEXT ·asinhAsm(SB), NOSPLIT, $0-16
65 FMOVD x+0(FP), F0
66 MOVD $·asinhrodataL18<>+0(SB), R9
67 LGDR F0, R12
68 WORD $0xC0293FDF //iilf %r2,1071644671
69 BYTE $0xFF
70 BYTE $0xFF
71 SRAD $32, R12
72 WORD $0xB917001C //llgtr %r1,%r12
73 MOVW R1, R6
74 MOVW R2, R7
75 CMPBLE R6, R7, L2
76 WORD $0xC0295FEF //iilf %r2,1609564159
77 BYTE $0xFF
78 BYTE $0xFF
79 MOVW R2, R7
80 CMPBLE R6, R7, L14
81 L3:
82 WORD $0xC0297FEF //iilf %r2,2146435071
83 BYTE $0xFF
84 BYTE $0xFF
85 CMPW R1, R2
86 BGT L1
87 LTDBR F0, F0
88 FMOVD F0, F10
89 BLTU L15
90 L9:
91 FMOVD $0, F0
92 WFADB V0, V10, V0
93 WORD $0xC0398006 //iilf %r3,2147909631
94 BYTE $0x7F
95 BYTE $0xFF
96 LGDR F0, R5
97 SRAD $32, R5
98 MOVH $0x0, R2
99 SUBW R5, R3
100 FMOVD $0, F8
101 RISBGZ $32, $47, $0, R3, R4
102 BYTE $0x18 //lr %r1,%r4
103 BYTE $0x14
104 RISBGN $0, $31, $32, R4, R2
105 SUBW $0x100000, R1
106 SRAW $8, R1, R1
107 ORW $0x45000000, R1
108 BR L6
109 L2:
110 MOVD $0x30000000, R2
111 CMPW R1, R2
112 BGT L16
113 FMOVD 200(R9), F2
114 FMADD F2, F0, F0
115 L1:
116 FMOVD F0, ret+8(FP)
117 RET
118 L14:
119 LTDBR F0, F0
120 BLTU L17
121 FMOVD F0, F10
122 L4:
123 FMOVD 192(R9), F2
124 WFMADB V0, V0, V2, V0
125 LTDBR F0, F0
126 FSQRT F0, F8
127 L5:
128 WFADB V8, V10, V0
129 WORD $0xC0398006 //iilf %r3,2147909631
130 BYTE $0x7F
131 BYTE $0xFF
132 LGDR F0, R5
133 SRAD $32, R5
134 MOVH $0x0, R2
135 SUBW R5, R3
136 RISBGZ $32, $47, $0, R3, R4
137 SRAW $8, R4, R1
138 RISBGN $0, $31, $32, R4, R2
139 ORW $0x45000000, R1
140 L6:
141 LDGR R2, F2
142 FMOVD 184(R9), F0
143 WFMADB V8, V2, V0, V8
144 FMOVD 176(R9), F4
145 WFMADB V10, V2, V8, V2
146 FMOVD 168(R9), F0
147 FMOVD 160(R9), F6
148 FMOVD 152(R9), F1
149 WFMADB V2, V6, V4, V6
150 WFMADB V2, V1, V0, V1
151 WFMDB V2, V2, V4
152 FMOVD 144(R9), F0
153 WFMADB V6, V4, V1, V6
154 FMOVD 136(R9), F1
155 RISBGZ $57, $60, $51, R3, R3
156 WFMADB V2, V0, V1, V0
157 FMOVD 128(R9), F1
158 WFMADB V4, V6, V0, V6
159 FMOVD 120(R9), F0
160 WFMADB V2, V1, V0, V1
161 VLVGF $0, R1, V0
162 WFMADB V4, V6, V1, V4
163 LDEBR F0, F0
164 FMOVD 112(R9), F6
165 WFMADB V2, V4, V6, V4
166 MOVD $·asinhtab2080<>+0(SB), R1
167 FMOVD 104(R9), F1
168 WORD $0x68331000 //ld %f3,0(%r3,%r1)
169 FMOVD 96(R9), F6
170 WFMADB V2, V4, V3, V2
171 WFMADB V0, V1, V6, V0
172 FMOVD 88(R9), F4
173 WFMADB V0, V4, V2, V0
174 MOVD R12, R6
175 CMPBGT R6, $0, L1
176
177 WORD $0xB3130000 //lcdbr %f0,%f0
178 FMOVD F0, ret+8(FP)
179 RET
180 L16:
181 WFMDB V0, V0, V1
182 FMOVD 80(R9), F6
183 WFMDB V1, V1, V4
184 FMOVD 72(R9), F2
185 WFMADB V4, V2, V6, V2
186 FMOVD 64(R9), F3
187 FMOVD 56(R9), F6
188 WFMADB V4, V2, V3, V2
189 FMOVD 48(R9), F3
190 WFMADB V4, V6, V3, V6
191 FMOVD 40(R9), F5
192 FMOVD 32(R9), F3
193 WFMADB V4, V2, V5, V2
194 WFMADB V4, V6, V3, V6
195 FMOVD 24(R9), F5
196 FMOVD 16(R9), F3
197 WFMADB V4, V2, V5, V2
198 WFMADB V4, V6, V3, V6
199 FMOVD 8(R9), F5
200 FMOVD 0(R9), F3
201 WFMADB V4, V2, V5, V2
202 WFMADB V4, V6, V3, V4
203 WFMDB V0, V1, V6
204 WFMADB V1, V4, V2, V4
205 FMADD F4, F6, F0
206 FMOVD F0, ret+8(FP)
207 RET
208 L17:
209 WORD $0xB31300A0 //lcdbr %f10,%f0
210 BR L4
211 L15:
212 WORD $0xB31300A0 //lcdbr %f10,%f0
213 BR L9
214
View as plain text