Text file
src/math/log10_s390x.s
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 #include "textflag.h"
6
7 // Minimax polynomial coefficients and other constants
8 DATA log10rodataL19<>+0(SB)/8, $0.000000000000000000E+00
9 DATA log10rodataL19<>+8(SB)/8, $-1.0
10 DATA log10rodataL19<>+16(SB)/8, $0x7FF8000000000000 //+NanN
11 DATA log10rodataL19<>+24(SB)/8, $.15375570329280596749
12 DATA log10rodataL19<>+32(SB)/8, $.60171950900703668594E+04
13 DATA log10rodataL19<>+40(SB)/8, $-1.9578460454940795898
14 DATA log10rodataL19<>+48(SB)/8, $0.78962633073318517310E-01
15 DATA log10rodataL19<>+56(SB)/8, $-.71784211884836937993E-02
16 DATA log10rodataL19<>+64(SB)/8, $0.87011165920689940661E-03
17 DATA log10rodataL19<>+72(SB)/8, $-.11865158981621437541E-03
18 DATA log10rodataL19<>+80(SB)/8, $0.17258413403018680410E-04
19 DATA log10rodataL19<>+88(SB)/8, $0.40752932047883484315E-06
20 DATA log10rodataL19<>+96(SB)/8, $-.26149194688832680410E-05
21 DATA log10rodataL19<>+104(SB)/8, $0.92453396963875026759E-08
22 DATA log10rodataL19<>+112(SB)/8, $-.64572084905921579630E-07
23 DATA log10rodataL19<>+120(SB)/8, $-5.5
24 DATA log10rodataL19<>+128(SB)/8, $18446744073709551616.
25 GLOBL log10rodataL19<>+0(SB), RODATA, $136
26
27 // Table of log10 correction terms
28 DATA log10tab2074<>+0(SB)/8, $0.254164497922885069E-01
29 DATA log10tab2074<>+8(SB)/8, $0.179018857989381839E-01
30 DATA log10tab2074<>+16(SB)/8, $0.118926768029048674E-01
31 DATA log10tab2074<>+24(SB)/8, $0.722595568238080033E-02
32 DATA log10tab2074<>+32(SB)/8, $0.376393570022739135E-02
33 DATA log10tab2074<>+40(SB)/8, $0.138901135928814326E-02
34 DATA log10tab2074<>+48(SB)/8, $0
35 DATA log10tab2074<>+56(SB)/8, $-0.490780466387818203E-03
36 DATA log10tab2074<>+64(SB)/8, $-0.159811431402137571E-03
37 DATA log10tab2074<>+72(SB)/8, $0.925796337165100494E-03
38 DATA log10tab2074<>+80(SB)/8, $0.270683176738357035E-02
39 DATA log10tab2074<>+88(SB)/8, $0.513079030821304758E-02
40 DATA log10tab2074<>+96(SB)/8, $0.815089785397996303E-02
41 DATA log10tab2074<>+104(SB)/8, $0.117253060262419215E-01
42 DATA log10tab2074<>+112(SB)/8, $0.158164239345343963E-01
43 DATA log10tab2074<>+120(SB)/8, $0.203903595489229786E-01
44 GLOBL log10tab2074<>+0(SB), RODATA, $128
45
46 // Log10 returns the decimal logarithm of the argument.
47 //
48 // Special cases are:
49 // Log(+Inf) = +Inf
50 // Log(0) = -Inf
51 // Log(x < 0) = NaN
52 // Log(NaN) = NaN
53 // The algorithm used is minimax polynomial approximation
54 // with coefficients determined with a Remez exchange algorithm.
55
56 TEXT ·log10Asm(SB),NOSPLIT,$8-16
57 FMOVD x+0(FP), F0
58 MOVD $log10rodataL19<>+0(SB), R9
59 FMOVD F0, x-8(SP)
60 WORD $0xC0298006 //iilf %r2,2147909631
61 BYTE $0x7F
62 BYTE $0xFF
63 WORD $0x5840F008 //l %r4, 8(%r15)
64 SUBW R4, R2, R3
65 RISBGZ $32, $47, $0, R3, R5
66 MOVH $0x0, R1
67 RISBGN $0, $31, $32, R5, R1
68 WORD $0xC0590016 //iilf %r5,1507327
69 BYTE $0xFF
70 BYTE $0xFF
71 MOVW R4, R10
72 MOVW R5, R11
73 CMPBLE R10, R11, L2
74 WORD $0xC0297FEF //iilf %r2,2146435071
75 BYTE $0xFF
76 BYTE $0xFF
77 MOVW R4, R10
78 MOVW R2, R11
79 CMPBLE R10, R11, L16
80 L3:
81 L1:
82 FMOVD F0, ret+8(FP)
83 RET
84
85 L2:
86 LTDBR F0, F0
87 BLEU L13
88 WORD $0xED009080 //mdb %f0,.L20-.L19(%r9)
89 BYTE $0x00
90 BYTE $0x1C
91 FMOVD F0, x-8(SP)
92 WORD $0x5B20F008 //s %r2, 8(%r15)
93 RISBGZ $57, $60, $51, R2, R3
94 ANDW $0xFFFF0000, R2
95 RISBGN $0, $31, $32, R2, R1
96 ADDW $0x4000000, R2
97 BLEU L17
98 L8:
99 SRW $8, R2, R2
100 ORW $0x45000000, R2
101 L4:
102 FMOVD log10rodataL19<>+120(SB), F2
103 LDGR R1, F4
104 WFMADB V4, V0, V2, V0
105 FMOVD log10rodataL19<>+112(SB), F4
106 FMOVD log10rodataL19<>+104(SB), F6
107 WFMADB V0, V6, V4, V6
108 FMOVD log10rodataL19<>+96(SB), F4
109 FMOVD log10rodataL19<>+88(SB), F1
110 WFMADB V0, V1, V4, V1
111 WFMDB V0, V0, V4
112 FMOVD log10rodataL19<>+80(SB), F2
113 WFMADB V6, V4, V1, V6
114 FMOVD log10rodataL19<>+72(SB), F1
115 WFMADB V0, V2, V1, V2
116 FMOVD log10rodataL19<>+64(SB), F1
117 RISBGZ $57, $60, $0, R3, R3
118 WFMADB V4, V6, V2, V6
119 FMOVD log10rodataL19<>+56(SB), F2
120 WFMADB V0, V1, V2, V1
121 VLVGF $0, R2, V2
122 WFMADB V4, V6, V1, V4
123 LDEBR F2, F2
124 FMOVD log10rodataL19<>+48(SB), F6
125 WFMADB V0, V4, V6, V4
126 FMOVD log10rodataL19<>+40(SB), F1
127 FMOVD log10rodataL19<>+32(SB), F6
128 MOVD $log10tab2074<>+0(SB), R1
129 WFMADB V2, V1, V6, V2
130 WORD $0x68331000 //ld %f3,0(%r3,%r1)
131 WFMADB V0, V4, V3, V0
132 FMOVD log10rodataL19<>+24(SB), F4
133 FMADD F4, F2, F0
134 FMOVD F0, ret+8(FP)
135 RET
136
137 L16:
138 RISBGZ $40, $55, $56, R3, R2
139 RISBGZ $57, $60, $51, R3, R3
140 ORW $0x45000000, R2
141 BR L4
142 L13:
143 BGE L18 //jnl .L18
144 BVS L18
145 FMOVD log10rodataL19<>+16(SB), F0
146 BR L1
147 L17:
148 SRAW $1, R2, R2
149 SUBW $0x40000000, R2
150 BR L8
151 L18:
152 FMOVD log10rodataL19<>+8(SB), F0
153 WORD $0xED009000 //ddb %f0,.L36-.L19(%r9)
154 BYTE $0x00
155 BYTE $0x1D
156 BR L1
157
View as plain text