atanhf_gen.S 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324
  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 "atanhf_gen.c"
  38. .text
  39. ..TXTST0:
  40. # -- Begin atanhf
  41. .text
  42. .align 16,0x90
  43. .globl atanhf
  44. atanhf:
  45. # parameter 1: %xmm0
  46. ..B1.1:
  47. .cfi_startproc
  48. ..___tag_value_atanhf.1:
  49. ..L2:
  50. movd %xmm0, %edx
  51. movss %xmm0, -16(%rsp)
  52. movl %edx, %eax
  53. andl $2147483647, %eax
  54. cmpl $1065353216, %eax
  55. jae ..B1.12
  56. ..B1.2:
  57. cmpl $1056964608, %eax
  58. jae ..B1.11
  59. ..B1.3:
  60. cmpl $838860800, %eax
  61. jae ..B1.10
  62. ..B1.4:
  63. shrl $31, %edx
  64. cmpl $8388608, %eax
  65. jb ..B1.6
  66. ..B1.5:
  67. movss .L_2il0floatpacket.15(%rip), %xmm1
  68. addss %xmm0, %xmm1
  69. mulss %xmm1, %xmm0
  70. ret
  71. ..B1.6:
  72. testl %eax, %eax
  73. je ..B1.8
  74. ..B1.7:
  75. lea _small_value_32(%rip), %rax
  76. pxor %xmm2, %xmm2
  77. pxor %xmm1, %xmm1
  78. cvtss2sd -16(%rsp), %xmm2
  79. movss (%rax,%rdx,4), %xmm0
  80. mulss .L_2il0floatpacket.14(%rip), %xmm0
  81. cvtss2sd %xmm0, %xmm0
  82. cvtsd2ss %xmm0, %xmm1
  83. addsd %xmm0, %xmm2
  84. pxor %xmm0, %xmm0
  85. movss %xmm1, -40(%rsp)
  86. cvtsd2ss %xmm2, %xmm0
  87. ret
  88. ..B1.8:
  89. movss -16(%rsp), %xmm0
  90. ..B1.9:
  91. ret
  92. ..B1.10:
  93. pxor %xmm3, %xmm3
  94. cvtss2sd -16(%rsp), %xmm3
  95. movaps %xmm3, %xmm1
  96. mulsd %xmm3, %xmm1
  97. movaps %xmm1, %xmm0
  98. mulsd %xmm1, %xmm0
  99. movsd .L_2il0floatpacket.5(%rip), %xmm4
  100. movsd .L_2il0floatpacket.9(%rip), %xmm2
  101. mulsd %xmm0, %xmm4
  102. mulsd %xmm0, %xmm2
  103. addsd .L_2il0floatpacket.6(%rip), %xmm4
  104. addsd .L_2il0floatpacket.10(%rip), %xmm2
  105. mulsd %xmm0, %xmm4
  106. mulsd %xmm0, %xmm2
  107. addsd .L_2il0floatpacket.7(%rip), %xmm4
  108. addsd .L_2il0floatpacket.11(%rip), %xmm2
  109. mulsd %xmm0, %xmm4
  110. mulsd %xmm0, %xmm2
  111. addsd .L_2il0floatpacket.8(%rip), %xmm4
  112. addsd .L_2il0floatpacket.12(%rip), %xmm2
  113. mulsd %xmm0, %xmm4
  114. mulsd %xmm1, %xmm2
  115. addsd %xmm2, %xmm4
  116. mulsd %xmm3, %xmm4
  117. addsd %xmm3, %xmm4
  118. cvtsd2ss %xmm4, %xmm4
  119. movaps %xmm4, %xmm0
  120. ret
  121. ..B1.11:
  122. pxor %xmm1, %xmm1
  123. pxor %xmm4, %xmm4
  124. cvtss2sd -16(%rsp), %xmm1
  125. movsd .L_2il0floatpacket.16(%rip), %xmm2
  126. pxor %xmm6, %xmm6
  127. movaps %xmm2, %xmm0
  128. pxor %xmm8, %xmm8
  129. movq __libm_rcp_table_256@GOTPCREL(%rip), %r9
  130. addsd %xmm1, %xmm0
  131. subsd %xmm1, %xmm2
  132. movsd %xmm0, -32(%rsp)
  133. movsd %xmm2, -24(%rsp)
  134. movzwl -26(%rsp), %ecx
  135. movl %ecx, %eax
  136. movzwl -18(%rsp), %esi
  137. movl %esi, %edx
  138. andl $-32753, %ecx
  139. andl $-32753, %esi
  140. orl $-49168, %ecx
  141. orl $-49168, %esi
  142. movw %cx, -26(%rsp)
  143. andl $32752, %eax
  144. movw %si, -18(%rsp)
  145. andl $32752, %edx
  146. movl -28(%rsp), %edi
  147. movl -20(%rsp), %r8d
  148. andl $1048575, %edi
  149. andl $1048575, %r8d
  150. shrl $12, %edi
  151. shrl $12, %r8d
  152. cvtss2sd (%r9,%rdi,4), %xmm4
  153. cvtss2sd (%r9,%r8,4), %xmm6
  154. mulsd -32(%rsp), %xmm4
  155. mulsd -24(%rsp), %xmm6
  156. movsd .L_2il0floatpacket.0(%rip), %xmm3
  157. movsd .L_2il0floatpacket.1(%rip), %xmm7
  158. addsd %xmm3, %xmm4
  159. addsd %xmm3, %xmm6
  160. movaps %xmm7, %xmm0
  161. mulsd %xmm4, %xmm0
  162. mulsd %xmm6, %xmm7
  163. movsd .L_2il0floatpacket.2(%rip), %xmm5
  164. shrl $4, %eax
  165. addsd %xmm5, %xmm0
  166. addsd %xmm5, %xmm7
  167. mulsd %xmm4, %xmm0
  168. mulsd %xmm6, %xmm7
  169. mulsd %xmm4, %xmm0
  170. mulsd %xmm6, %xmm7
  171. addsd %xmm4, %xmm0
  172. addsd %xmm6, %xmm7
  173. shrl $4, %edx
  174. addl $-1023, %eax
  175. addl $-1023, %edx
  176. subsd %xmm7, %xmm0
  177. subl %edx, %eax
  178. cvtsi2sd %eax, %xmm8
  179. movq __libm_logf_table_256@GOTPCREL(%rip), %r10
  180. mulsd .L_2il0floatpacket.3(%rip), %xmm8
  181. movsd (%r10,%rdi,8), %xmm9
  182. movsd %xmm4, -32(%rsp)
  183. movsd %xmm6, -24(%rsp)
  184. subsd (%r10,%r8,8), %xmm9
  185. addsd %xmm8, %xmm9
  186. addsd %xmm9, %xmm0
  187. mulsd .L_2il0floatpacket.4(%rip), %xmm0
  188. cvtsd2ss %xmm0, %xmm0
  189. ret
  190. ..B1.12:
  191. cmpl $2139095040, %eax
  192. ja ..B1.17
  193. ..B1.13:
  194. cmpl $1065353216, %eax
  195. jne ..B1.15
  196. ..B1.14:
  197. lea _ones(%rip), %rax
  198. shrl $31, %edx
  199. pxor %xmm1, %xmm1
  200. movss (%rax,%rdx,4), %xmm0
  201. divss %xmm1, %xmm0
  202. ret
  203. ..B1.15:
  204. movss .L_2il0floatpacket.13(%rip), %xmm1
  205. pxor %xmm0, %xmm0
  206. mulss %xmm1, %xmm0
  207. ..B1.16:
  208. ret
  209. ..B1.17:
  210. movss -16(%rsp), %xmm0
  211. ret
  212. .align 16,0x90
  213. .cfi_endproc
  214. .type atanhf,@function
  215. .size atanhf,.-atanhf
  216. .data
  217. # -- End atanhf
  218. .section .rodata, "a"
  219. .align 8
  220. .align 8
  221. .L_2il0floatpacket.0:
  222. .long 0x00000000,0xbff00000
  223. .type .L_2il0floatpacket.0,@object
  224. .size .L_2il0floatpacket.0,8
  225. .align 8
  226. .L_2il0floatpacket.1:
  227. .long 0x6890dd10,0x3fd5555a
  228. .type .L_2il0floatpacket.1,@object
  229. .size .L_2il0floatpacket.1,8
  230. .align 8
  231. .L_2il0floatpacket.2:
  232. .long 0xe7362feb,0xbfe00001
  233. .type .L_2il0floatpacket.2,@object
  234. .size .L_2il0floatpacket.2,8
  235. .align 8
  236. .L_2il0floatpacket.3:
  237. .long 0xfefa39ef,0x3fe62e42
  238. .type .L_2il0floatpacket.3,@object
  239. .size .L_2il0floatpacket.3,8
  240. .align 8
  241. .L_2il0floatpacket.4:
  242. .long 0x00000000,0x3fe00000
  243. .type .L_2il0floatpacket.4,@object
  244. .size .L_2il0floatpacket.4,8
  245. .align 8
  246. .L_2il0floatpacket.5:
  247. .long 0x1c66784b,0x3fc717fd
  248. .type .L_2il0floatpacket.5,@object
  249. .size .L_2il0floatpacket.5,8
  250. .align 8
  251. .L_2il0floatpacket.6:
  252. .long 0xdc2b5888,0x3fb8b0df
  253. .type .L_2il0floatpacket.6,@object
  254. .size .L_2il0floatpacket.6,8
  255. .align 8
  256. .L_2il0floatpacket.7:
  257. .long 0x5a00faf0,0x3fbc8408
  258. .type .L_2il0floatpacket.7,@object
  259. .size .L_2il0floatpacket.7,8
  260. .align 8
  261. .L_2il0floatpacket.8:
  262. .long 0x9016c8e5,0x3fc9999c
  263. .type .L_2il0floatpacket.8,@object
  264. .size .L_2il0floatpacket.8,8
  265. .align 8
  266. .L_2il0floatpacket.9:
  267. .long 0x10091234,0xbf68c8ed
  268. .type .L_2il0floatpacket.9,@object
  269. .size .L_2il0floatpacket.9,8
  270. .align 8
  271. .L_2il0floatpacket.10:
  272. .long 0x64e392ec,0x3fb67c91
  273. .type .L_2il0floatpacket.10,@object
  274. .size .L_2il0floatpacket.10,8
  275. .align 8
  276. .L_2il0floatpacket.11:
  277. .long 0xb0fd5c67,0x3fc248ae
  278. .type .L_2il0floatpacket.11,@object
  279. .size .L_2il0floatpacket.11,8
  280. .align 8
  281. .L_2il0floatpacket.12:
  282. .long 0x51abeffb,0x3fd55555
  283. .type .L_2il0floatpacket.12,@object
  284. .size .L_2il0floatpacket.12,8
  285. .align 8
  286. .L_2il0floatpacket.16:
  287. .long 0x00000000,0x3ff00000
  288. .type .L_2il0floatpacket.16,@object
  289. .size .L_2il0floatpacket.16,8
  290. .align 4
  291. .L_2il0floatpacket.13:
  292. .long 0x7f800000
  293. .type .L_2il0floatpacket.13,@object
  294. .size .L_2il0floatpacket.13,4
  295. .align 4
  296. .L_2il0floatpacket.14:
  297. .long 0x0d800000
  298. .type .L_2il0floatpacket.14,@object
  299. .size .L_2il0floatpacket.14,4
  300. .align 4
  301. .L_2il0floatpacket.15:
  302. .long 0x3f800000
  303. .type .L_2il0floatpacket.15,@object
  304. .size .L_2il0floatpacket.15,4
  305. .align 4
  306. _small_value_32:
  307. .long 226492416
  308. .long 2373976064
  309. .type _small_value_32,@object
  310. .size _small_value_32,8
  311. .align 4
  312. _ones:
  313. .long 1065353216
  314. .long 3212836864
  315. .type _ones,@object
  316. .size _ones,8
  317. .data
  318. .section .note.GNU-stack, ""
  319. // -- Begin DWARF2 SEGMENT .eh_frame
  320. .section .eh_frame,"a",@progbits
  321. .eh_frame_seg:
  322. .align 1
  323. # End