nearbyintf_gen.S 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336
  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 "nearbyintf_gen.c"
  38. .text
  39. ..TXTST0:
  40. # -- Begin nearbyintf
  41. .text
  42. .align 16,0x90
  43. .globl nearbyintf
  44. nearbyintf:
  45. # parameter 1: %xmm0
  46. ..B1.1:
  47. .cfi_startproc
  48. ..___tag_value_nearbyintf.1:
  49. ..L2:
  50. subq $24, %rsp
  51. .cfi_def_cfa_offset 32
  52. movss %xmm0, 8(%rsp)
  53. ..B1.2:
  54. stmxcsr 4(%rsp)
  55. ..B1.3:
  56. movzwl 10(%rsp), %eax
  57. andl $32640, %eax
  58. shrl $7, %eax
  59. cmpl $150, %eax
  60. jge ..B1.10
  61. ..B1.4:
  62. movl 4(%rsp), %edx
  63. andl $24576, %edx
  64. cmpl $8192, %edx
  65. je ..B1.32
  66. ..B1.5:
  67. cmpl $16384, %edx
  68. jne ..B1.15
  69. ..B1.6:
  70. cmpl $127, %eax
  71. jl ..B1.11
  72. ..B1.7:
  73. negl %eax
  74. movl $8388607, %edx
  75. addl $22, %eax
  76. movl 8(%rsp), %esi
  77. movl %esi, %edi
  78. movl %eax, %ecx
  79. andl $8388607, %edi
  80. shll %cl, %edx
  81. andl $-8388608, %esi
  82. andl %edi, %edx
  83. orl %edx, %esi
  84. movl %esi, %eax
  85. andl $8388607, %eax
  86. movl %esi, 8(%rsp)
  87. testl $-2147483648, %esi
  88. jne ..B1.10
  89. ..B1.8:
  90. cmpl %edi, %eax
  91. je ..B1.10
  92. ..B1.9:
  93. movss 8(%rsp), %xmm0
  94. addss .L_2il0floatpacket.1(%rip), %xmm0
  95. addq $24, %rsp
  96. .cfi_def_cfa_offset 8
  97. ret
  98. .cfi_def_cfa_offset 32
  99. ..B1.10:
  100. movss 8(%rsp), %xmm0
  101. addq $24, %rsp
  102. .cfi_def_cfa_offset 8
  103. ret
  104. .cfi_def_cfa_offset 32
  105. ..B1.11:
  106. testl %eax, %eax
  107. jne ..B1.14
  108. ..B1.12:
  109. testl $8388607, 8(%rsp)
  110. je ..B1.10
  111. ..B1.14:
  112. movb 11(%rsp), %dl
  113. lea _pone_nzero(%rip), %rcx
  114. andb $-128, %dl
  115. shrb $7, %dl
  116. movzbl %dl, %esi
  117. movl 8(%rsp), %eax
  118. movl %eax, (%rsp)
  119. movss (%rcx,%rsi,4), %xmm0
  120. addq $24, %rsp
  121. .cfi_def_cfa_offset 8
  122. ret
  123. .cfi_def_cfa_offset 32
  124. ..B1.15:
  125. cmpl $24576, %edx
  126. jne ..B1.20
  127. ..B1.16:
  128. cmpl $127, %eax
  129. jl ..B1.18
  130. ..B1.17:
  131. negl %eax
  132. movl $8388607, %edx
  133. addl $22, %eax
  134. movl %eax, %ecx
  135. shll %cl, %edx
  136. movl 8(%rsp), %esi
  137. movl %esi, %edi
  138. andl %edx, %esi
  139. andl $-8388608, %edi
  140. andl $8388607, %esi
  141. orl %esi, %edi
  142. movl %edi, 8(%rsp)
  143. movss 8(%rsp), %xmm0
  144. addq $24, %rsp
  145. .cfi_def_cfa_offset 8
  146. ret
  147. .cfi_def_cfa_offset 32
  148. ..B1.18:
  149. movb 11(%rsp), %dl
  150. lea _zeros(%rip), %rcx
  151. andb $-128, %dl
  152. movl 8(%rsp), %eax
  153. movl %eax, (%rsp)
  154. shrb $7, %dl
  155. movzbl %dl, %esi
  156. movss (%rcx,%rsi,4), %xmm0
  157. ..B1.19:
  158. addq $24, %rsp
  159. .cfi_def_cfa_offset 8
  160. ret
  161. .cfi_def_cfa_offset 32
  162. ..B1.20:
  163. cmpl $127, %eax
  164. jl ..B1.27
  165. ..B1.21:
  166. movl 8(%rsp), %edi
  167. movl %edi, %esi
  168. andl $8388607, %esi
  169. lea 10(%rax), %ecx
  170. negl %eax
  171. movl %esi, %r8d
  172. addl $22, %eax
  173. movl $8388607, %edx
  174. shll %cl, %r8d
  175. movl %eax, %ecx
  176. shll %cl, %edx
  177. andl $-8388608, %edi
  178. andl %edx, %esi
  179. orl %esi, %edi
  180. movl %edi, 8(%rsp)
  181. testl %r8d, %r8d
  182. jge ..B1.10
  183. ..B1.22:
  184. cmpl $-2147483648, %r8d
  185. jne ..B1.24
  186. ..B1.23:
  187. movzwl 10(%rsp), %ecx
  188. movl $1, %eax
  189. shrl $7, %ecx
  190. negl %ecx
  191. addl $22, %ecx
  192. shll %cl, %eax
  193. testl %eax, 8(%rsp)
  194. je ..B1.10
  195. ..B1.24:
  196. movb 11(%rsp), %al
  197. lea _ones(%rip), %rdx
  198. andb $-128, %al
  199. shrb $7, %al
  200. movss 8(%rsp), %xmm0
  201. movzbl %al, %ecx
  202. addss (%rdx,%rcx,4), %xmm0
  203. addq $24, %rsp
  204. .cfi_def_cfa_offset 8
  205. ret
  206. .cfi_def_cfa_offset 32
  207. ..B1.27:
  208. cmpl $126, %eax
  209. jg ..B1.31
  210. ..B1.28:
  211. jne ..B1.30
  212. ..B1.29:
  213. testl $8388607, 8(%rsp)
  214. jg ..B1.31
  215. ..B1.30:
  216. movb 11(%rsp), %dl
  217. lea _zeros(%rip), %rcx
  218. andb $-128, %dl
  219. shrb $7, %dl
  220. movzbl %dl, %esi
  221. movl 8(%rsp), %eax
  222. movl %eax, (%rsp)
  223. movss (%rcx,%rsi,4), %xmm0
  224. addq $24, %rsp
  225. .cfi_def_cfa_offset 8
  226. ret
  227. .cfi_def_cfa_offset 32
  228. ..B1.31:
  229. movb 11(%rsp), %al
  230. lea _ones(%rip), %rdx
  231. andb $-128, %al
  232. shrb $7, %al
  233. movzbl %al, %ecx
  234. movss (%rdx,%rcx,4), %xmm0
  235. addq $24, %rsp
  236. .cfi_def_cfa_offset 8
  237. ret
  238. .cfi_def_cfa_offset 32
  239. ..B1.32:
  240. cmpl $127, %eax
  241. jl ..B1.37
  242. ..B1.33:
  243. negl %eax
  244. movl $8388607, %edx
  245. addl $22, %eax
  246. movl 8(%rsp), %esi
  247. movl %esi, %edi
  248. movl %eax, %ecx
  249. andl $8388607, %edi
  250. shll %cl, %edx
  251. andl $-8388608, %esi
  252. andl %edi, %edx
  253. orl %edx, %esi
  254. movl %esi, %eax
  255. andl $8388607, %eax
  256. movl %esi, 8(%rsp)
  257. testl $-2147483648, %esi
  258. je ..B1.10
  259. ..B1.34:
  260. cmpl %edi, %eax
  261. je ..B1.10
  262. ..B1.35:
  263. movss 8(%rsp), %xmm0
  264. addss .L_2il0floatpacket.0(%rip), %xmm0
  265. addq $24, %rsp
  266. .cfi_def_cfa_offset 8
  267. ret
  268. .cfi_def_cfa_offset 32
  269. ..B1.37:
  270. testl %eax, %eax
  271. jne ..B1.40
  272. ..B1.38:
  273. testl $8388607, 8(%rsp)
  274. je ..B1.10
  275. ..B1.40:
  276. movb 11(%rsp), %dl
  277. lea _pzero_none(%rip), %rcx
  278. andb $-128, %dl
  279. shrb $7, %dl
  280. movzbl %dl, %esi
  281. movl 8(%rsp), %eax
  282. movl %eax, (%rsp)
  283. movss (%rcx,%rsi,4), %xmm0
  284. addq $24, %rsp
  285. .cfi_def_cfa_offset 8
  286. ret
  287. .align 16,0x90
  288. .cfi_endproc
  289. .type nearbyintf,@function
  290. .size nearbyintf,.-nearbyintf
  291. .data
  292. # -- End nearbyintf
  293. .section .rodata, "a"
  294. .align 4
  295. .align 4
  296. .L_2il0floatpacket.0:
  297. .long 0xbf800000
  298. .type .L_2il0floatpacket.0,@object
  299. .size .L_2il0floatpacket.0,4
  300. .align 4
  301. .L_2il0floatpacket.1:
  302. .long 0x3f800000
  303. .type .L_2il0floatpacket.1,@object
  304. .size .L_2il0floatpacket.1,4
  305. .align 4
  306. _pone_nzero:
  307. .long 1065353216
  308. .long 2147483648
  309. .type _pone_nzero,@object
  310. .size _pone_nzero,8
  311. .align 4
  312. _zeros:
  313. .long 0
  314. .long 2147483648
  315. .type _zeros,@object
  316. .size _zeros,8
  317. .align 4
  318. _ones:
  319. .long 1065353216
  320. .long 3212836864
  321. .type _ones,@object
  322. .size _ones,8
  323. .align 4
  324. _pzero_none:
  325. .long 0
  326. .long 3212836864
  327. .type _pzero_none,@object
  328. .size _pzero_none,8
  329. .data
  330. .section .note.GNU-stack, ""
  331. // -- Begin DWARF2 SEGMENT .eh_frame
  332. .section .eh_frame,"a",@progbits
  333. .eh_frame_seg:
  334. .align 1
  335. # End