libm_hypot2_k64.S 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320
  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_hypot2_k64.c"
  38. .text
  39. ..TXTST0:
  40. # -- Begin __libm_hypot2_k64
  41. .text
  42. .align 16,0x90
  43. .globl __libm_hypot2_k64
  44. __libm_hypot2_k64:
  45. # parameter 1: %rdi
  46. # parameter 2: %xmm0
  47. # parameter 3: %xmm1
  48. ..B1.1:
  49. .cfi_startproc
  50. ..___tag_value___libm_hypot2_k64.1:
  51. ..L2:
  52. movsd %xmm0, -24(%rsp)
  53. movzwl -18(%rsp), %eax
  54. testl $32752, %eax
  55. movsd %xmm1, -16(%rsp)
  56. jne ..B1.8
  57. ..B1.2:
  58. testl $1048575, -20(%rsp)
  59. jne ..B1.8
  60. ..B1.3:
  61. cmpl $0, -24(%rsp)
  62. jne ..B1.8
  63. ..B1.4:
  64. movzwl -10(%rsp), %eax
  65. testl $32752, %eax
  66. jne ..B1.8
  67. ..B1.5:
  68. testl $1048575, -12(%rsp)
  69. jne ..B1.8
  70. ..B1.6:
  71. cmpl $0, -16(%rsp)
  72. jne ..B1.8
  73. ..B1.7:
  74. movq -24(%rsp), %rax
  75. movq -16(%rsp), %rdx
  76. pxor %xmm0, %xmm0
  77. movq %rax, (%rdi)
  78. movq %rdx, 8(%rdi)
  79. ret
  80. ..B1.8:
  81. movsd -24(%rsp), %xmm0
  82. movsd -16(%rsp), %xmm2
  83. andps .L_2il0floatpacket.6(%rip), %xmm0
  84. andps .L_2il0floatpacket.6(%rip), %xmm2
  85. comisd %xmm2, %xmm0
  86. jbe ..B1.10
  87. ..B1.9:
  88. movsd %xmm0, -8(%rsp)
  89. movaps %xmm0, %xmm1
  90. jmp ..B1.11
  91. ..B1.10:
  92. movsd %xmm2, -8(%rsp)
  93. movaps %xmm2, %xmm1
  94. movaps %xmm0, %xmm2
  95. ..B1.11:
  96. movsd %xmm2, -16(%rsp)
  97. movzwl -10(%rsp), %eax
  98. andl $32752, %eax
  99. shrl $4, %eax
  100. testl %eax, %eax
  101. je ..B1.13
  102. ..B1.12:
  103. addl $-1023, %eax
  104. jmp ..B1.17
  105. ..B1.13:
  106. testl $1048575, -12(%rsp)
  107. jne ..B1.16
  108. ..B1.14:
  109. cmpl $0, -16(%rsp)
  110. jne ..B1.16
  111. ..B1.15:
  112. movl $-10000, %eax
  113. jmp ..B1.17
  114. ..B1.16:
  115. lea 48+_CONSTANTS(%rip), %rax
  116. movaps %xmm2, %xmm0
  117. mulsd (%rax), %xmm0
  118. movsd %xmm0, -24(%rsp)
  119. movzwl -18(%rsp), %eax
  120. andl $32752, %eax
  121. shrl $4, %eax
  122. addl $-2046, %eax
  123. ..B1.17:
  124. movzwl -2(%rsp), %edx
  125. andl $32752, %edx
  126. shrl $4, %edx
  127. testl %edx, %edx
  128. je ..B1.19
  129. ..B1.18:
  130. addl $-1023, %edx
  131. jmp ..B1.20
  132. ..B1.19:
  133. lea 48+_CONSTANTS(%rip), %rax
  134. movaps %xmm1, %xmm0
  135. addl $-2046, %edx
  136. mulsd (%rax), %xmm0
  137. movsd %xmm0, -24(%rsp)
  138. movzwl -18(%rsp), %eax
  139. andl $32752, %eax
  140. shrl $4, %eax
  141. ..B1.20:
  142. addl $-56, %edx
  143. cmpl %edx, %eax
  144. lea _CONSTANTS(%rip), %rax
  145. pxor %xmm0, %xmm0
  146. jg ..L3
  147. movaps %xmm0, %xmm2
  148. ..L3:
  149. comisd (%rax), %xmm1
  150. jb ..B1.22
  151. ..B1.21:
  152. lea 40+_CONSTANTS(%rip), %rax
  153. movsd (%rax), %xmm0
  154. mulsd %xmm0, %xmm1
  155. mulsd %xmm0, %xmm2
  156. mulsd %xmm0, %xmm1
  157. mulsd %xmm0, %xmm2
  158. movsd %xmm1, -8(%rsp)
  159. movsd %xmm2, -16(%rsp)
  160. movsd .L_2il0floatpacket.0(%rip), %xmm0
  161. jmp ..B1.28
  162. ..B1.22:
  163. lea 8+_CONSTANTS(%rip), %rax
  164. comisd (%rax), %xmm1
  165. jb ..B1.24
  166. ..B1.23:
  167. lea 40+_CONSTANTS(%rip), %rax
  168. movsd (%rax), %xmm0
  169. mulsd %xmm0, %xmm1
  170. mulsd %xmm0, %xmm2
  171. movsd %xmm1, -8(%rsp)
  172. movsd %xmm2, -16(%rsp)
  173. movsd .L_2il0floatpacket.3(%rip), %xmm0
  174. jmp ..B1.28
  175. ..B1.24:
  176. lea 16+_CONSTANTS(%rip), %rax
  177. movsd (%rax), %xmm3
  178. comisd %xmm1, %xmm3
  179. jb ..B1.26
  180. ..B1.25:
  181. lea 32+_CONSTANTS(%rip), %rax
  182. movsd (%rax), %xmm0
  183. mulsd %xmm0, %xmm1
  184. mulsd %xmm0, %xmm2
  185. mulsd %xmm0, %xmm1
  186. mulsd %xmm0, %xmm2
  187. movsd %xmm1, -8(%rsp)
  188. movsd %xmm2, -16(%rsp)
  189. movsd .L_2il0floatpacket.4(%rip), %xmm0
  190. jmp ..B1.28
  191. ..B1.26:
  192. lea 24+_CONSTANTS(%rip), %rax
  193. movsd (%rax), %xmm3
  194. comisd %xmm1, %xmm3
  195. jb ..B1.28
  196. ..B1.27:
  197. lea 32+_CONSTANTS(%rip), %rax
  198. movsd (%rax), %xmm0
  199. mulsd %xmm0, %xmm1
  200. mulsd %xmm0, %xmm2
  201. movsd %xmm1, -8(%rsp)
  202. movsd %xmm2, -16(%rsp)
  203. movsd .L_2il0floatpacket.5(%rip), %xmm0
  204. ..B1.28:
  205. movsd .L_2il0floatpacket.1(%rip), %xmm9
  206. mulsd %xmm1, %xmm9
  207. movaps %xmm9, %xmm3
  208. movsd .L_2il0floatpacket.1(%rip), %xmm14
  209. subsd %xmm1, %xmm3
  210. mulsd %xmm2, %xmm14
  211. subsd %xmm3, %xmm9
  212. movsd .L_2il0floatpacket.2(%rip), %xmm5
  213. movaps %xmm9, %xmm6
  214. mulsd %xmm9, %xmm6
  215. subsd %xmm9, %xmm1
  216. mulsd %xmm5, %xmm9
  217. movaps %xmm14, %xmm4
  218. movaps %xmm6, %xmm8
  219. mulsd %xmm1, %xmm9
  220. subsd %xmm2, %xmm4
  221. mulsd %xmm1, %xmm1
  222. subsd %xmm4, %xmm14
  223. addsd %xmm9, %xmm8
  224. subsd %xmm14, %xmm2
  225. movaps %xmm14, %xmm12
  226. movaps %xmm8, %xmm7
  227. mulsd %xmm14, %xmm12
  228. subsd %xmm6, %xmm7
  229. mulsd %xmm5, %xmm14
  230. subsd %xmm7, %xmm9
  231. mulsd %xmm2, %xmm14
  232. mulsd %xmm2, %xmm2
  233. addsd %xmm1, %xmm9
  234. movaps %xmm8, %xmm10
  235. addsd %xmm12, %xmm10
  236. movaps %xmm10, %xmm13
  237. movaps %xmm10, %xmm1
  238. addsd %xmm14, %xmm13
  239. subsd %xmm8, %xmm1
  240. movaps %xmm13, %xmm11
  241. subsd %xmm1, %xmm12
  242. subsd %xmm10, %xmm11
  243. addsd %xmm9, %xmm12
  244. subsd %xmm11, %xmm14
  245. movsd %xmm13, (%rdi)
  246. addsd %xmm12, %xmm14
  247. addsd %xmm2, %xmm14
  248. movsd %xmm14, 8(%rdi)
  249. ret
  250. .align 16,0x90
  251. .cfi_endproc
  252. .type __libm_hypot2_k64,@function
  253. .size __libm_hypot2_k64,.-__libm_hypot2_k64
  254. .data
  255. # -- End __libm_hypot2_k64
  256. .section .rodata, "a"
  257. .align 16
  258. .align 16
  259. .L_2il0floatpacket.6:
  260. .long 0xffffffff,0x7fffffff,0x00000000,0x00000000
  261. .type .L_2il0floatpacket.6,@object
  262. .size .L_2il0floatpacket.6,16
  263. .align 8
  264. .L_2il0floatpacket.0:
  265. .long 0x00000000,0x40a00800
  266. .type .L_2il0floatpacket.0,@object
  267. .size .L_2il0floatpacket.0,8
  268. .align 8
  269. .L_2il0floatpacket.1:
  270. .long 0x02000000,0x41a00000
  271. .type .L_2il0floatpacket.1,@object
  272. .size .L_2il0floatpacket.1,8
  273. .align 8
  274. .L_2il0floatpacket.2:
  275. .long 0x00000000,0x40000000
  276. .type .L_2il0floatpacket.2,@object
  277. .size .L_2il0floatpacket.2,8
  278. .align 8
  279. .L_2il0floatpacket.3:
  280. .long 0x00000000,0x40900800
  281. .type .L_2il0floatpacket.3,@object
  282. .size .L_2il0floatpacket.3,8
  283. .align 8
  284. .L_2il0floatpacket.4:
  285. .long 0x00000000,0xc0a00800
  286. .type .L_2il0floatpacket.4,@object
  287. .size .L_2il0floatpacket.4,8
  288. .align 8
  289. .L_2il0floatpacket.5:
  290. .long 0x00000000,0xc0900800
  291. .type .L_2il0floatpacket.5,@object
  292. .size .L_2il0floatpacket.5,8
  293. .align 4
  294. _CONSTANTS:
  295. .long 0
  296. .long 1727004672
  297. .long 4294967295
  298. .long 1608515583
  299. .long 4294967295
  300. .long 481296383
  301. .long 0
  302. .long 651165696
  303. .long 0
  304. .long 1610612736
  305. .long 0
  306. .long 534773760
  307. .long 0
  308. .long 2145386496
  309. .long 0
  310. .long 1126170624
  311. .type _CONSTANTS,@object
  312. .size _CONSTANTS,64
  313. .data
  314. .section .note.GNU-stack, ""
  315. // -- Begin DWARF2 SEGMENT .eh_frame
  316. .section .eh_frame,"a",@progbits
  317. .eh_frame_seg:
  318. .align 1
  319. # End