libm_exp_k32.S 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237
  1. /*
  2. * Math library
  3. *
  4. * Copyright (C) 2016 Intel Corporation. All rights reserved.
  5. *
  6. * Redistribution and use in source and binary forms, with or without
  7. * modification, are permitted provided that the following conditions
  8. * are met:
  9. *
  10. * * Redistributions of source code must retain the above copyright
  11. * notice, this list of conditions and the following disclaimer.
  12. * * Redistributions in binary form must reproduce the above copyright
  13. * notice, this list of conditions and the following disclaimer in
  14. * the documentation and/or other materials provided with the
  15. * distribution.
  16. * * Neither the name of Intel Corporation nor the names of its
  17. * contributors may be used to endorse or promote products derived
  18. * from this software without specific prior written permission.
  19. *
  20. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  21. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  22. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  23. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  24. * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  25. * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  26. * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  27. * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  28. * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  29. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  30. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  31. *
  32. *
  33. * Author Name <jingwei.zhang@intel.com>
  34. * History:
  35. * 03-14-2016 Initial version. numerics svn rev. 12864
  36. */
  37. .file "libm_exp_k32.c"
  38. .text
  39. ..TXTST0:
  40. # -- Begin __libm_exp_k32
  41. .text
  42. .align 16,0x90
  43. .hidden __libm_exp_k32
  44. .globl __libm_exp_k32
  45. __libm_exp_k32:
  46. # parameter 1: 8 + %ebp
  47. ..B1.1:
  48. ..L1:
  49. pushl %ebp
  50. movl %esp, %ebp
  51. andl $-16, %esp
  52. pushl %edi
  53. pushl %ebx
  54. subl $24, %esp
  55. movl 12(%ebp), %eax
  56. movl %eax, %edx
  57. andl $2147483647, %edx
  58. shrl $31, %eax
  59. cmpl $1012924416, %edx
  60. jb ..B1.3
  61. ..B1.2:
  62. fldl 8(%ebp)
  63. xorl %edx, %edx
  64. call ..L2
  65. ..L2:
  66. popl %edi
  67. lea _GLOBAL_OFFSET_TABLE_+[. - ..L2](%edi), %edi
  68. fld1
  69. fldl _TWO_52H@GOTOFF(%edi)
  70. fldl .L_2il0floatpacket.0@GOTOFF(%edi)
  71. fmul %st(3), %st
  72. movl %edx, 16(%esp)
  73. fadd %st(1), %st
  74. fstpl (%esp)
  75. fldl (%esp)
  76. movl (%esp), %ecx
  77. movl %ecx, %ebx
  78. shll $25, %ebx
  79. fsubp %st, %st(1)
  80. fldl .L_2il0floatpacket.1@GOTOFF(%edi)
  81. fmul %st(1), %st
  82. sarl $25, %ebx
  83. fsubrp %st, %st(3)
  84. fld %st(2)
  85. subl %ebx, %ecx
  86. fxch %st(3)
  87. fstl 8(%ebp)
  88. fldl .L_2il0floatpacket.2@GOTOFF(%edi)
  89. fmulp %st, %st(2)
  90. shll $4, %ebx
  91. fxch %st(1)
  92. fsubr %st, %st(3)
  93. fld %st(3)
  94. fxch %st(2)
  95. fsub %st(4), %st
  96. shrl $7, %ecx
  97. fsubp %st, %st(1)
  98. addl SC2_BIAS@GOTOFF(%edi,%eax,4), %ecx
  99. fadd %st, %st(1)
  100. fld %st(1)
  101. fmul %st(2), %st
  102. fxch %st(3)
  103. fadd %st(4), %st
  104. fstpl 8(%esp)
  105. fldl .L_2il0floatpacket.3@GOTOFF(%edi)
  106. fldl .L_2il0floatpacket.6@GOTOFF(%edi)
  107. movl %edx, 8(%esp)
  108. fmul %st(4), %st
  109. fldl 8(%esp)
  110. shll $20, %ecx
  111. fadd %st, %st(2)
  112. movl %ecx, 20(%esp)
  113. fxch %st(2)
  114. fsubrp %st, %st(6)
  115. fxch %st(5)
  116. faddp %st, %st(2)
  117. fldl .L_2il0floatpacket.4@GOTOFF(%edi)
  118. fmul %st(4), %st
  119. fxch %st(5)
  120. faddl .L_2il0floatpacket.7@GOTOFF(%edi)
  121. fmulp %st, %st(3)
  122. fxch %st(4)
  123. faddl .L_2il0floatpacket.5@GOTOFF(%edi)
  124. fmul %st(3), %st
  125. faddp %st, %st(2)
  126. fxch %st(1)
  127. fmul %st(2), %st
  128. fldl .L_2il0floatpacket.8@GOTOFF(%edi)
  129. fmulp %st, %st(3)
  130. faddp %st, %st(2)
  131. faddp %st, %st(1)
  132. fldl 1032+__libm_exp_table_128@GOTOFF(%edi,%ebx)
  133. fld %st(0)
  134. fmul %st(2), %st
  135. fxch %st(2)
  136. fadd %st(3), %st
  137. fxch %st(3)
  138. fmulp %st, %st(1)
  139. fxch %st(2)
  140. fmull 1024+__libm_exp_table_128@GOTOFF(%edi,%ebx)
  141. faddp %st, %st(1)
  142. faddp %st, %st(1)
  143. fmull 16(%esp)
  144. fmull _SC2@GOTOFF(%edi,%eax,8)
  145. addl $24, %esp
  146. popl %ebx
  147. popl %edi
  148. movl %ebp, %esp
  149. popl %ebp
  150. ret
  151. ..B1.3:
  152. fld1
  153. faddl 8(%ebp)
  154. ..B1.4:
  155. addl $24, %esp
  156. popl %ebx
  157. popl %edi
  158. movl %ebp, %esp
  159. popl %ebp
  160. ret
  161. .align 16,0x90
  162. .type __libm_exp_k32,@function
  163. .size __libm_exp_k32,.-__libm_exp_k32
  164. .data
  165. # -- End __libm_exp_k32
  166. .section .rodata, "a"
  167. .align 8
  168. .align 8
  169. .L_2il0floatpacket.0:
  170. .long 0x652b82fe,0x40671547
  171. .type .L_2il0floatpacket.0,@object
  172. .size .L_2il0floatpacket.0,8
  173. .align 8
  174. .L_2il0floatpacket.1:
  175. .long 0x00000000,0x3f762e42
  176. .type .L_2il0floatpacket.1,@object
  177. .size .L_2il0floatpacket.1,8
  178. .align 8
  179. .L_2il0floatpacket.2:
  180. .long 0x3de6af28,0x3e2fdf47
  181. .type .L_2il0floatpacket.2,@object
  182. .size .L_2il0floatpacket.2,8
  183. .align 8
  184. .L_2il0floatpacket.3:
  185. .long 0x00000000,0xbff00000
  186. .type .L_2il0floatpacket.3,@object
  187. .size .L_2il0floatpacket.3,8
  188. .align 8
  189. .L_2il0floatpacket.4:
  190. .long 0x87372663,0x3f56c16c
  191. .type .L_2il0floatpacket.4,@object
  192. .size .L_2il0floatpacket.4,8
  193. .align 8
  194. .L_2il0floatpacket.5:
  195. .long 0x5555541d,0x3fa55555
  196. .type .L_2il0floatpacket.5,@object
  197. .size .L_2il0floatpacket.5,8
  198. .align 8
  199. .L_2il0floatpacket.6:
  200. .long 0x6887cd7c,0x3f811111
  201. .type .L_2il0floatpacket.6,@object
  202. .size .L_2il0floatpacket.6,8
  203. .align 8
  204. .L_2il0floatpacket.7:
  205. .long 0x55555405,0x3fc55555
  206. .type .L_2il0floatpacket.7,@object
  207. .size .L_2il0floatpacket.7,8
  208. .align 8
  209. .L_2il0floatpacket.8:
  210. .long 0x00000000,0x3fe00000
  211. .type .L_2il0floatpacket.8,@object
  212. .size .L_2il0floatpacket.8,8
  213. .align 4
  214. _TWO_52H:
  215. .long 0
  216. .long 1127743488
  217. .type _TWO_52H,@object
  218. .size _TWO_52H,8
  219. .align 4
  220. SC2_BIAS:
  221. .long 511
  222. .long 1535
  223. .type SC2_BIAS,@object
  224. .size SC2_BIAS,8
  225. .align 4
  226. _SC2:
  227. .long 0
  228. .long 1609564160
  229. .long 0
  230. .long 535822336
  231. .type _SC2,@object
  232. .size _SC2,16
  233. .data
  234. .hidden __libm_exp_table_128
  235. .section .note.GNU-stack, ""
  236. # End