libm_exp_k32.S 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220
  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. .globl __libm_exp_k32
  44. __libm_exp_k32:
  45. # parameter 1: %xmm0
  46. ..B1.1:
  47. .cfi_startproc
  48. ..___tag_value___libm_exp_k32.1:
  49. ..L2:
  50. movsd %xmm0, -16(%rsp)
  51. movl -12(%rsp), %eax
  52. movl %eax, %edx
  53. andl $2147483647, %edx
  54. shrl $31, %eax
  55. cmpl $1012924416, %edx
  56. jb ..B1.3
  57. ..B1.2:
  58. movsd .L_2il0floatpacket.0(%rip), %xmm1
  59. lea _TWO_52H(%rip), %rdx
  60. movsd .L_2il0floatpacket.1(%rip), %xmm3
  61. lea SC2_BIAS(%rip), %rsi
  62. movsd .L_2il0floatpacket.2(%rip), %xmm4
  63. lea _SC2(%rip), %r10
  64. movsd .L_2il0floatpacket.4(%rip), %xmm13
  65. movsd (%rdx), %xmm2
  66. movsd .L_2il0floatpacket.6(%rip), %xmm10
  67. mulsd %xmm0, %xmm1
  68. movsd .L_2il0floatpacket.9(%rip), %xmm6
  69. addsd %xmm2, %xmm1
  70. movsd %xmm1, -40(%rsp)
  71. movsd -40(%rsp), %xmm5
  72. movsd .L_2il0floatpacket.3(%rip), %xmm7
  73. subsd %xmm2, %xmm5
  74. mulsd %xmm5, %xmm3
  75. mulsd %xmm4, %xmm5
  76. subsd %xmm3, %xmm0
  77. movaps %xmm0, %xmm8
  78. movsd %xmm0, -16(%rsp)
  79. subsd %xmm5, %xmm8
  80. movaps %xmm8, %xmm9
  81. subsd %xmm8, %xmm0
  82. addsd %xmm8, %xmm6
  83. subsd %xmm5, %xmm0
  84. movsd %xmm6, -32(%rsp)
  85. addsd %xmm0, %xmm9
  86. movaps %xmm9, %xmm11
  87. mulsd %xmm9, %xmm11
  88. mulsd %xmm11, %xmm13
  89. mulsd %xmm11, %xmm10
  90. addsd .L_2il0floatpacket.5(%rip), %xmm13
  91. addsd .L_2il0floatpacket.7(%rip), %xmm10
  92. mulsd %xmm11, %xmm13
  93. mulsd %xmm9, %xmm10
  94. movl $0, -32(%rsp)
  95. addsd %xmm10, %xmm13
  96. movsd -32(%rsp), %xmm14
  97. movsd .L_2il0floatpacket.8(%rip), %xmm12
  98. addsd %xmm14, %xmm7
  99. mulsd %xmm11, %xmm13
  100. mulsd %xmm11, %xmm12
  101. subsd %xmm7, %xmm8
  102. addsd %xmm12, %xmm13
  103. addsd %xmm8, %xmm0
  104. movl -40(%rsp), %ecx
  105. movl %ecx, %r8d
  106. shll $25, %r8d
  107. addsd %xmm13, %xmm0
  108. sarl $25, %r8d
  109. subl %r8d, %ecx
  110. movslq %r8d, %r8
  111. shlq $4, %r8
  112. movq __libm_exp_table_128@GOTPCREL(%rip), %r9
  113. shrl $7, %ecx
  114. movslq (%rsi,%rax,4), %rdi
  115. movsd 1032(%r9,%r8), %xmm15
  116. addq %rcx, %rdi
  117. movaps %xmm15, %xmm1
  118. mulsd %xmm0, %xmm1
  119. addsd %xmm14, %xmm0
  120. mulsd %xmm14, %xmm15
  121. mulsd 1024(%r9,%r8), %xmm0
  122. shlq $52, %rdi
  123. addsd %xmm0, %xmm1
  124. movq %rdi, -24(%rsp)
  125. addsd %xmm15, %xmm1
  126. mulsd -24(%rsp), %xmm1
  127. mulsd (%r10,%rax,8), %xmm1
  128. jmp ..B1.4
  129. ..B1.3:
  130. movsd .L_2il0floatpacket.9(%rip), %xmm1
  131. addsd -16(%rsp), %xmm1
  132. ..B1.4:
  133. movaps %xmm1, %xmm0
  134. ret
  135. .align 16,0x90
  136. .cfi_endproc
  137. .type __libm_exp_k32,@function
  138. .size __libm_exp_k32,.-__libm_exp_k32
  139. .data
  140. # -- End __libm_exp_k32
  141. .section .rodata, "a"
  142. .align 8
  143. .align 8
  144. .L_2il0floatpacket.0:
  145. .long 0x652b82fe,0x40671547
  146. .type .L_2il0floatpacket.0,@object
  147. .size .L_2il0floatpacket.0,8
  148. .align 8
  149. .L_2il0floatpacket.1:
  150. .long 0x00000000,0x3f762e42
  151. .type .L_2il0floatpacket.1,@object
  152. .size .L_2il0floatpacket.1,8
  153. .align 8
  154. .L_2il0floatpacket.2:
  155. .long 0x3de6af28,0x3e2fdf47
  156. .type .L_2il0floatpacket.2,@object
  157. .size .L_2il0floatpacket.2,8
  158. .align 8
  159. .L_2il0floatpacket.3:
  160. .long 0x00000000,0xbff00000
  161. .type .L_2il0floatpacket.3,@object
  162. .size .L_2il0floatpacket.3,8
  163. .align 8
  164. .L_2il0floatpacket.4:
  165. .long 0x87372663,0x3f56c16c
  166. .type .L_2il0floatpacket.4,@object
  167. .size .L_2il0floatpacket.4,8
  168. .align 8
  169. .L_2il0floatpacket.5:
  170. .long 0x5555541d,0x3fa55555
  171. .type .L_2il0floatpacket.5,@object
  172. .size .L_2il0floatpacket.5,8
  173. .align 8
  174. .L_2il0floatpacket.6:
  175. .long 0x6887cd7c,0x3f811111
  176. .type .L_2il0floatpacket.6,@object
  177. .size .L_2il0floatpacket.6,8
  178. .align 8
  179. .L_2il0floatpacket.7:
  180. .long 0x55555405,0x3fc55555
  181. .type .L_2il0floatpacket.7,@object
  182. .size .L_2il0floatpacket.7,8
  183. .align 8
  184. .L_2il0floatpacket.8:
  185. .long 0x00000000,0x3fe00000
  186. .type .L_2il0floatpacket.8,@object
  187. .size .L_2il0floatpacket.8,8
  188. .align 8
  189. .L_2il0floatpacket.9:
  190. .long 0x00000000,0x3ff00000
  191. .type .L_2il0floatpacket.9,@object
  192. .size .L_2il0floatpacket.9,8
  193. .align 4
  194. _TWO_52H:
  195. .long 0
  196. .long 1127743488
  197. .type _TWO_52H,@object
  198. .size _TWO_52H,8
  199. .align 4
  200. SC2_BIAS:
  201. .long 511
  202. .long 1535
  203. .type SC2_BIAS,@object
  204. .size SC2_BIAS,8
  205. .align 4
  206. _SC2:
  207. .long 0
  208. .long 1609564160
  209. .long 0
  210. .long 535822336
  211. .type _SC2,@object
  212. .size _SC2,16
  213. .data
  214. .section .note.GNU-stack, ""
  215. // -- Begin DWARF2 SEGMENT .eh_frame
  216. .section .eh_frame,"a",@progbits
  217. .eh_frame_seg:
  218. .align 1
  219. # End