scalbn_wmt.S 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243
  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 "scalbn_wmt.c"
  38. .text
  39. ..TXTST0:
  40. # -- Begin static_func
  41. .text
  42. .align 16,0x90
  43. static_func:
  44. ..B1.1:
  45. ..L1:
  46. call ..L2
  47. ..L2:
  48. popl %eax
  49. lea _GLOBAL_OFFSET_TABLE_+[. - ..L2](%eax), %eax
  50. lea static_const_table@GOTOFF(%eax), %eax
  51. ret
  52. .align 16,0x90
  53. .type static_func,@function
  54. .size static_func,.-static_func
  55. .data
  56. # -- End static_func
  57. .text
  58. # -- Begin scalbn
  59. .text
  60. .align 16,0x90
  61. .globl scalbn
  62. scalbn:
  63. # parameter 1: 8 + %ebp
  64. # parameter 2: 16 + %ebp
  65. ..B2.1:
  66. ..L3:
  67. ..B2.2:
  68. pushl %ebp
  69. movl %esp, %ebp
  70. subl $120, %esp
  71. movl %ebx, 64(%esp)
  72. call static_func
  73. movl %eax, %ebx
  74. movsd 128(%esp), %xmm0
  75. movq %xmm0, (%esp)
  76. movq 64(%ebx), %xmm4
  77. movl 136(%esp), %ecx
  78. movl %ecx, 8(%esp)
  79. movl $65536, %eax
  80. movl $-65536, %edx
  81. cmpl %eax, %ecx
  82. cmovg %eax, %ecx
  83. cmpl %edx, %ecx
  84. cmovl %edx, %ecx
  85. andpd %xmm0, %xmm4
  86. xorpd %xmm4, %xmm0
  87. ucomisd 128(%ebx), %xmm0
  88. jp .L_2TAG_PACKET_0.0.3
  89. je .L_2TAG_PACKET_0.0.3
  90. comisd 80(%ebx), %xmm0
  91. jc .L_2TAG_PACKET_1.0.3
  92. .L_2TAG_PACKET_2.0.3:
  93. movapd %xmm0, %xmm2
  94. movapd (%ebx), %xmm3
  95. psrlq $52, %xmm2
  96. movd %ecx, %xmm1
  97. andpd %xmm3, %xmm2
  98. paddq %xmm1, %xmm2
  99. movd %xmm2, %eax
  100. movapd 16(%ebx), %xmm3
  101. testl %eax, %eax
  102. jle .L_2TAG_PACKET_3.0.3
  103. cmpl $2047, %eax
  104. jge .L_2TAG_PACKET_4.0.3
  105. andpd %xmm3, %xmm0
  106. psllq $52, %xmm2
  107. xorpd %xmm4, %xmm0
  108. orpd %xmm2, %xmm0
  109. movq %xmm0, 16(%esp)
  110. fldl 16(%esp)
  111. jmp .L_2TAG_PACKET_5.0.3
  112. .L_2TAG_PACKET_0.0.3:
  113. fldl (%esp)
  114. jmp .L_2TAG_PACKET_5.0.3
  115. .L_2TAG_PACKET_1.0.3:
  116. comisd 144(%ebx), %xmm0
  117. je .L_2TAG_PACKET_0.0.3
  118. mulsd 96(%ebx), %xmm0
  119. subl $55, %ecx
  120. jmp .L_2TAG_PACKET_2.0.3
  121. .L_2TAG_PACKET_3.0.3:
  122. cmpl $-52, %eax
  123. jl .L_2TAG_PACKET_6.0.3
  124. xorpd %xmm5, %xmm5
  125. andpd %xmm3, %xmm0
  126. shufpd $1, %xmm3, %xmm3
  127. paddq %xmm3, %xmm2
  128. xorpd %xmm4, %xmm0
  129. psllq $52, %xmm2
  130. orpd %xmm2, %xmm0
  131. mulsd 112(%ebx), %xmm0
  132. comisd %xmm5, %xmm0
  133. je .L_2TAG_PACKET_6.0.3
  134. movq %xmm0, 16(%esp)
  135. fldl 16(%esp)
  136. jmp .L_2TAG_PACKET_5.0.3
  137. .L_2TAG_PACKET_4.0.3:
  138. lea 32(%ebx), %edx
  139. movl $176, %ecx
  140. jmp .L_2TAG_PACKET_7.0.3
  141. .L_2TAG_PACKET_6.0.3:
  142. lea 48(%ebx), %edx
  143. movl $177, %ecx
  144. jmp .L_2TAG_PACKET_7.0.3
  145. .L_2TAG_PACKET_7.0.3:
  146. pextrw $3, %xmm4, %eax
  147. shrl $12, %eax
  148. addl %edx, %eax
  149. movq (%edx), %xmm0
  150. mulsd (%eax), %xmm0
  151. movq %xmm0, 16(%esp)
  152. subl $32, %esp
  153. lea 128(%esp), %eax
  154. movl %eax, (%esp)
  155. lea 136(%esp), %eax
  156. movl %eax, 4(%esp)
  157. lea 48(%esp), %eax
  158. movl %eax, 8(%esp)
  159. movl %ecx, %eax
  160. movl %eax, 12(%esp)
  161. call __libm_error_support
  162. addl $32, %esp
  163. fldl 16(%esp)
  164. .L_2TAG_PACKET_5.0.3:
  165. movl 64(%esp), %ebx
  166. movl %ebp, %esp
  167. popl %ebp
  168. ret
  169. ..B2.3:
  170. .align 16,0x90
  171. .type scalbn,@function
  172. .size scalbn,.-scalbn
  173. .data
  174. # -- End scalbn
  175. .text
  176. # -- Begin __libm_error_support
  177. .text
  178. .align 16,0x90
  179. __libm_error_support:
  180. # parameter 1: 4 + %esp
  181. # parameter 2: 8 + %esp
  182. # parameter 3: 12 + %esp
  183. # parameter 4: 16 + %esp
  184. ..B3.1:
  185. ..L4:
  186. ret
  187. .align 16,0x90
  188. .type __libm_error_support,@function
  189. .size __libm_error_support,.-__libm_error_support
  190. .data
  191. # -- End __libm_error_support
  192. .section .rodata, "a"
  193. .align 16
  194. .align 16
  195. static_const_table:
  196. .long 2047
  197. .long 0
  198. .long 4294967241
  199. .long 4294967295
  200. .long 4294967295
  201. .long 2148532223
  202. .long 55
  203. .long 0
  204. .long 0
  205. .long 2121269248
  206. .long 0
  207. .long 4268752896
  208. .long 0
  209. .long 24117248
  210. .long 0
  211. .long 2171600896
  212. .long 0
  213. .long 2147483648
  214. .long 0
  215. .long 2147483648
  216. .long 0
  217. .long 1048576
  218. .long 0
  219. .long 1048576
  220. .long 0
  221. .long 1130364928
  222. .long 0
  223. .long 1130364928
  224. .long 0
  225. .long 1015021568
  226. .long 0
  227. .long 1015021568
  228. .long 0
  229. .long 2146435072
  230. .long 0
  231. .long 2146435072
  232. .long 0
  233. .long 0
  234. .long 0
  235. .long 0
  236. .type static_const_table,@object
  237. .size static_const_table,160
  238. .data
  239. .section .note.GNU-stack, ""
  240. # End