ldexp_wmt.S 6.4 KB

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