erff.S 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254
  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 "erff.c"
  38. .text
  39. ..TXTST0:
  40. # -- Begin erff
  41. .text
  42. .align 16,0x90
  43. .globl erff
  44. erff:
  45. # parameter 1: %xmm0
  46. ..B1.1:
  47. .cfi_startproc
  48. ..___tag_value_erff.1:
  49. ..L2:
  50. movd %xmm0, %edx
  51. movss %xmm0, -16(%rsp)
  52. movl %edx, %eax
  53. andl $2147483647, %edx
  54. andl $-2147483648, %eax
  55. orl $1065353216, %eax
  56. movl %eax, -24(%rsp)
  57. cmpl $2139095040, %edx
  58. movss -24(%rsp), %xmm0
  59. jge ..B1.8
  60. ..B1.2:
  61. cmpl $1081791744, %edx
  62. jge ..B1.7
  63. ..B1.3:
  64. cmpl $1065353216, %edx
  65. jl ..B1.5
  66. ..B1.4:
  67. movl %edx, %eax
  68. andl $8388607, %edx
  69. orl $1065353216, %edx
  70. pxor %xmm4, %xmm4
  71. movl %edx, -24(%rsp)
  72. lea _dbA(%rip), %rsi
  73. shrl $23, %eax
  74. cvtss2sd -24(%rsp), %xmm4
  75. cvtss2sd %xmm0, %xmm0
  76. subsd .L_2il0floatpacket.0(%rip), %xmm4
  77. movaps %xmm4, %xmm3
  78. lea -1016(,%rax,8), %edx
  79. mulsd %xmm4, %xmm3
  80. lea -508(%rdx,%rax,4), %ecx
  81. movslq %ecx, %rcx
  82. movaps %xmm3, %xmm7
  83. mulsd %xmm3, %xmm7
  84. movsd 152(%rsi,%rcx,8), %xmm6
  85. mulsd %xmm4, %xmm6
  86. movsd 120(%rsi,%rcx,8), %xmm8
  87. mulsd %xmm4, %xmm8
  88. addsd 144(%rsi,%rcx,8), %xmm6
  89. movsd 136(%rsi,%rcx,8), %xmm5
  90. mulsd %xmm3, %xmm6
  91. addsd 112(%rsi,%rcx,8), %xmm8
  92. mulsd %xmm4, %xmm5
  93. mulsd %xmm3, %xmm8
  94. addsd %xmm5, %xmm6
  95. movsd 88(%rsi,%rcx,8), %xmm9
  96. movsd 104(%rsi,%rcx,8), %xmm2
  97. mulsd %xmm4, %xmm9
  98. addsd 128(%rsi,%rcx,8), %xmm6
  99. mulsd %xmm4, %xmm2
  100. mulsd %xmm7, %xmm6
  101. addsd 80(%rsi,%rcx,8), %xmm9
  102. addsd %xmm2, %xmm8
  103. mulsd %xmm3, %xmm9
  104. addsd 96(%rsi,%rcx,8), %xmm8
  105. movsd 72(%rsi,%rcx,8), %xmm1
  106. addsd %xmm6, %xmm8
  107. mulsd %xmm4, %xmm1
  108. mulsd %xmm7, %xmm8
  109. addsd %xmm1, %xmm9
  110. addsd 64(%rsi,%rcx,8), %xmm9
  111. addsd %xmm8, %xmm9
  112. mulsd %xmm0, %xmm9
  113. cvtsd2ss %xmm9, %xmm9
  114. jmp ..B1.6
  115. ..B1.5:
  116. pxor %xmm3, %xmm3
  117. lea 56+_dbA(%rip), %rdi
  118. lea 48+_dbA(%rip), %rax
  119. lea 40+_dbA(%rip), %r8
  120. lea 32+_dbA(%rip), %rdx
  121. lea 24+_dbA(%rip), %r9
  122. lea 16+_dbA(%rip), %rcx
  123. lea 8+_dbA(%rip), %r10
  124. movsd (%rdi), %xmm2
  125. lea _dbA(%rip), %rsi
  126. movsd (%rax), %xmm9
  127. cvtss2sd -16(%rsp), %xmm3
  128. movaps %xmm3, %xmm1
  129. mulsd %xmm3, %xmm1
  130. movaps %xmm1, %xmm0
  131. mulsd %xmm1, %xmm0
  132. mulsd %xmm0, %xmm2
  133. mulsd %xmm0, %xmm9
  134. addsd (%r8), %xmm2
  135. addsd (%rdx), %xmm9
  136. mulsd %xmm0, %xmm2
  137. mulsd %xmm0, %xmm9
  138. addsd (%r9), %xmm2
  139. addsd (%rcx), %xmm9
  140. mulsd %xmm0, %xmm2
  141. mulsd %xmm0, %xmm9
  142. addsd (%r10), %xmm2
  143. addsd (%rsi), %xmm9
  144. mulsd %xmm1, %xmm2
  145. addsd %xmm2, %xmm9
  146. mulsd %xmm3, %xmm9
  147. cvtsd2ss %xmm9, %xmm9
  148. ..B1.6:
  149. movaps %xmm9, %xmm0
  150. ret
  151. ..B1.7:
  152. cvtss2sd %xmm0, %xmm0
  153. lea 256+_dbA(%rip), %rax
  154. mulsd (%rax), %xmm0
  155. cvtsd2ss %xmm0, %xmm0
  156. ret
  157. ..B1.8:
  158. movss -16(%rsp), %xmm1
  159. addss %xmm1, %xmm1
  160. je ..L3
  161. movaps %xmm1, %xmm0
  162. ..L3:
  163. ret
  164. .align 16,0x90
  165. .cfi_endproc
  166. .type erff,@function
  167. .size erff,.-erff
  168. .data
  169. # -- End erff
  170. .section .rodata, "a"
  171. .align 16
  172. .align 16
  173. _dbA:
  174. .long 1346373606
  175. .long 1072827863
  176. .long 1710987328
  177. .long 3218608756
  178. .long 2039146822
  179. .long 1069343472
  180. .long 2052989911
  181. .long 3214639770
  182. .long 3741021613
  183. .long 1064657550
  184. .long 2828932584
  185. .long 3209415657
  186. .long 556515485
  187. .long 1058898537
  188. .long 1493771156
  189. .long 3202627648
  190. .long 1460823802
  191. .long 1072622165
  192. .long 647757120
  193. .long 1069445687
  194. .long 1478820123
  195. .long 3217479081
  196. .long 827266439
  197. .long 1069662880
  198. .long 4153551678
  199. .long 3215381932
  200. .long 3249389370
  201. .long 3213783616
  202. .long 3875823656
  203. .long 1066650297
  204. .long 2479749796
  205. .long 3212012677
  206. .long 4079794357
  207. .long 3210967401
  208. .long 3292960271
  209. .long 1062989018
  210. .long 1338933997
  211. .long 3204757561
  212. .long 4209598023
  213. .long 3207545998
  214. .long 2886434981
  215. .long 1072693201
  216. .long 1721637260
  217. .long 1060257935
  218. .long 960688093
  219. .long 3210436681
  220. .long 1128797080
  221. .long 1064950642
  222. .long 798939459
  223. .long 3213958757
  224. .long 937205111
  225. .long 1067493282
  226. .long 3504975339
  227. .long 3215465534
  228. .long 3388113641
  229. .long 1068080152
  230. .long 9542307
  231. .long 3215088353
  232. .long 1310184383
  233. .long 1065080747
  234. .long 3264801679
  235. .long 1066837484
  236. .long 3394984936
  237. .long 3214223095
  238. .long 4294967295
  239. .long 1072693247
  240. .type _dbA,@object
  241. .size _dbA,264
  242. .align 8
  243. .L_2il0floatpacket.0:
  244. .long 0x00000000,0x3ff80000
  245. .type .L_2il0floatpacket.0,@object
  246. .size .L_2il0floatpacket.0,8
  247. .data
  248. .section .note.GNU-stack, ""
  249. // -- Begin DWARF2 SEGMENT .eh_frame
  250. .section .eh_frame,"a",@progbits
  251. .eh_frame_seg:
  252. .align 1
  253. # End