github.com/likebike/go--@v0.0.0-20190911215757-0bd925d16e96/go/src/math/log10_s390x.s (about) 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 WORD $0xEC5320AF //risbg %r5,%r3,32,128+47,0 66 BYTE $0x00 67 BYTE $0x55 68 MOVH $0x0, R1 69 WORD $0xEC15001F //risbgn %r1,%r5,64-64+0,64-64+0+32-1,64-0-32 70 BYTE $0x20 71 BYTE $0x59 72 WORD $0xC0590016 //iilf %r5,1507327 73 BYTE $0xFF 74 BYTE $0xFF 75 MOVW R4, R10 76 MOVW R5, R11 77 CMPBLE R10, R11, L2 78 WORD $0xC0297FEF //iilf %r2,2146435071 79 BYTE $0xFF 80 BYTE $0xFF 81 MOVW R4, R10 82 MOVW R2, R11 83 CMPBLE R10, R11, L16 84 L3: 85 L1: 86 FMOVD F0, ret+8(FP) 87 RET 88 89 L2: 90 WORD $0xB3120000 //ltdbr %f0,%f0 91 BLEU L13 92 WORD $0xED009080 //mdb %f0,.L20-.L19(%r9) 93 BYTE $0x00 94 BYTE $0x1C 95 FMOVD F0, x-8(SP) 96 WORD $0x5B20F008 //s %r2, 8(%r15) 97 WORD $0xEC3239BC //risbg %r3,%r2,57,128+60,64-13 98 BYTE $0x33 99 BYTE $0x55 100 ANDW $0xFFFF0000, R2 101 WORD $0xEC12001F //risbgn %r1,%r2,64-64+0,64-64+0+32-1,64-0-32 102 BYTE $0x20 103 BYTE $0x59 104 ADDW $0x4000000, R2 105 BLEU L17 106 L8: 107 SRW $8, R2, R2 108 ORW $0x45000000, R2 109 L4: 110 FMOVD log10rodataL19<>+120(SB), F2 111 LDGR R1, F4 112 WFMADB V4, V0, V2, V0 113 FMOVD log10rodataL19<>+112(SB), F4 114 FMOVD log10rodataL19<>+104(SB), F6 115 WFMADB V0, V6, V4, V6 116 FMOVD log10rodataL19<>+96(SB), F4 117 FMOVD log10rodataL19<>+88(SB), F1 118 WFMADB V0, V1, V4, V1 119 WFMDB V0, V0, V4 120 FMOVD log10rodataL19<>+80(SB), F2 121 WFMADB V6, V4, V1, V6 122 FMOVD log10rodataL19<>+72(SB), F1 123 WFMADB V0, V2, V1, V2 124 FMOVD log10rodataL19<>+64(SB), F1 125 WORD $0xEC3339BC //risbg %r3,%r3,57,128+60,0 126 BYTE $0x00 127 BYTE $0x55 128 WFMADB V4, V6, V2, V6 129 FMOVD log10rodataL19<>+56(SB), F2 130 WFMADB V0, V1, V2, V1 131 VLVGF $0, R2, V2 132 WFMADB V4, V6, V1, V4 133 LDEBR F2, F2 134 FMOVD log10rodataL19<>+48(SB), F6 135 WFMADB V0, V4, V6, V4 136 FMOVD log10rodataL19<>+40(SB), F1 137 FMOVD log10rodataL19<>+32(SB), F6 138 MOVD $log10tab2074<>+0(SB), R1 139 WFMADB V2, V1, V6, V2 140 WORD $0x68331000 //ld %f3,0(%r3,%r1) 141 WFMADB V0, V4, V3, V0 142 FMOVD log10rodataL19<>+24(SB), F4 143 FMADD F4, F2, F0 144 FMOVD F0, ret+8(FP) 145 RET 146 147 L16: 148 WORD $0xEC2328B7 //risbg %r2,%r3,40,128+55,64-8 149 BYTE $0x38 150 BYTE $0x55 151 WORD $0xEC3339BC //risbg %r3,%r3,57,128+60,64-13 152 BYTE $0x33 153 BYTE $0x55 154 ORW $0x45000000, R2 155 BR L4 156 L13: 157 BGE L18 //jnl .L18 158 BVS L18 159 FMOVD log10rodataL19<>+16(SB), F0 160 BR L1 161 L17: 162 SRAW $1, R2, R2 163 SUBW $0x40000000, R2 164 BR L8 165 L18: 166 FMOVD log10rodataL19<>+8(SB), F0 167 WORD $0xED009000 //ddb %f0,.L36-.L19(%r9) 168 BYTE $0x00 169 BYTE $0x1D 170 BR L1