scalb_wmt.S 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328
  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 "scalb_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 scalb
  59. .text
  60. .align 16,0x90
  61. .globl scalb
  62. scalb:
  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. movsd 136(%esp), %xmm1
  76. movq %xmm0, (%esp)
  77. movq %xmm1, 8(%esp)
  78. pextrw $3, %xmm0, %eax
  79. pextrw $3, %xmm1, %edx
  80. andl $32752, %eax
  81. andl $32752, %edx
  82. subl $16, %eax
  83. subl $16368, %edx
  84. cmpl $32736, %eax
  85. jae .L_2TAG_PACKET_0.0.3
  86. cmpl $256, %edx
  87. jae .L_2TAG_PACKET_0.0.3
  88. movq 144(%ebx), %xmm7
  89. .L_2TAG_PACKET_1.0.3:
  90. movdqa %xmm1, %xmm2
  91. addsd %xmm7, %xmm2
  92. movd %xmm2, %ecx
  93. shll $4, %ecx
  94. addl %ecx, %eax
  95. movdqa %xmm2, %xmm3
  96. subsd %xmm7, %xmm3
  97. comisd %xmm1, %xmm3
  98. jne .L_2TAG_PACKET_2.0.3
  99. cmpl $32736, %eax
  100. jae .L_2TAG_PACKET_3.0.3
  101. psllq $52, %xmm2
  102. paddq %xmm2, %xmm0
  103. .L_2TAG_PACKET_4.0.3:
  104. movq %xmm0, 16(%esp)
  105. fldl 16(%esp)
  106. jmp .L_2TAG_PACKET_5.0.3
  107. .L_2TAG_PACKET_6.0.3:
  108. fldl (%esp)
  109. faddl 8(%esp)
  110. jmp .L_2TAG_PACKET_5.0.3
  111. .L_2TAG_PACKET_2.0.3:
  112. fldl 48(%ebx)
  113. fmull (%ebx)
  114. jmp .L_2TAG_PACKET_5.0.3
  115. .L_2TAG_PACKET_7.0.3:
  116. pextrw $3, %xmm1, %ecx
  117. comisd %xmm7, %xmm0
  118. je .L_2TAG_PACKET_8.0.3
  119. cmpl $32736, %eax
  120. je .L_2TAG_PACKET_9.0.3
  121. pextrw $3, %xmm0, %eax
  122. shrl $12, %eax
  123. andl $8, %eax
  124. testl $32768, %ecx
  125. je .L_2TAG_PACKET_10.0.3
  126. fldl 48(%ebx,%eax)
  127. jmp .L_2TAG_PACKET_5.0.3
  128. .L_2TAG_PACKET_9.0.3:
  129. xorl $32768, %ecx
  130. .L_2TAG_PACKET_8.0.3:
  131. testl $32768, %ecx
  132. je .L_2TAG_PACKET_2.0.3
  133. .L_2TAG_PACKET_11.0.3:
  134. fldl (%esp)
  135. jmp .L_2TAG_PACKET_5.0.3
  136. .L_2TAG_PACKET_12.0.3:
  137. movq 80(%ebx), %xmm7
  138. movq 96(%ebx), %xmm6
  139. pandn %xmm1, %xmm7
  140. comisd %xmm6, %xmm7
  141. jc .L_2TAG_PACKET_2.0.3
  142. pextrw $3, %xmm0, %eax
  143. shrl $12, %eax
  144. andl $8, %eax
  145. .L_2TAG_PACKET_10.0.3:
  146. fldl (%ebx,%eax)
  147. jmp .L_2TAG_PACKET_5.0.3
  148. .L_2TAG_PACKET_0.0.3:
  149. movl %edx, %ecx
  150. pxor %xmm7, %xmm7
  151. shrl $4, %ecx
  152. ucomisd %xmm1, %xmm0
  153. jp .L_2TAG_PACKET_6.0.3
  154. addl $12, %ecx
  155. cmpl $16384, %edx
  156. je .L_2TAG_PACKET_7.0.3
  157. movdqa %xmm1, %xmm2
  158. comisd %xmm7, %xmm1
  159. je .L_2TAG_PACKET_11.0.3
  160. movd %ecx, %xmm3
  161. cmpl $32736, %eax
  162. je .L_2TAG_PACKET_12.0.3
  163. psllq %xmm3, %xmm2
  164. testl %edx, %edx
  165. jl .L_2TAG_PACKET_2.0.3
  166. pcmpeqd %xmm7, %xmm2
  167. cmpl $832, %edx
  168. jae .L_2TAG_PACKET_13.0.3
  169. pmovmskb %xmm2, %ecx
  170. cmpl $65535, %ecx
  171. jne .L_2TAG_PACKET_2.0.3
  172. comisd %xmm7, %xmm0
  173. je .L_2TAG_PACKET_11.0.3
  174. cmpl $256, %edx
  175. jae .L_2TAG_PACKET_14.0.3
  176. mulsd 112(%ebx), %xmm0
  177. movq 160(%ebx), %xmm7
  178. pextrw $3, %xmm0, %eax
  179. andl $32752, %eax
  180. subl $16, %eax
  181. jmp .L_2TAG_PACKET_1.0.3
  182. .L_2TAG_PACKET_3.0.3:
  183. jge .L_2TAG_PACKET_15.0.3
  184. sarl $4, %eax
  185. cmpl $-53, %eax
  186. jl .L_2TAG_PACKET_16.0.3
  187. movd 176(%ebx), %xmm3
  188. movq 128(%ebx), %xmm4
  189. pxor %xmm7, %xmm7
  190. pshufd $236, %xmm2, %xmm2
  191. paddd %xmm3, %xmm2
  192. psllq $52, %xmm2
  193. paddq %xmm2, %xmm0
  194. mulsd %xmm4, %xmm0
  195. comisd %xmm7, %xmm0
  196. jne .L_2TAG_PACKET_4.0.3
  197. movl $53, %ecx
  198. jmp .L_2TAG_PACKET_17.0.3
  199. .L_2TAG_PACKET_13.0.3:
  200. comisd %xmm7, %xmm0
  201. je .L_2TAG_PACKET_11.0.3
  202. .L_2TAG_PACKET_14.0.3:
  203. pextrw $3, %xmm1, %edx
  204. testl $32768, %edx
  205. jne .L_2TAG_PACKET_16.0.3
  206. .L_2TAG_PACKET_15.0.3:
  207. lea 16(%ebx), %edx
  208. movl $53, %ecx
  209. pxor %xmm1, %xmm1
  210. jmp .L_2TAG_PACKET_18.0.3
  211. .L_2TAG_PACKET_16.0.3:
  212. lea 32(%ebx), %edx
  213. movl $54, %ecx
  214. movq 64(%ebx), %xmm1
  215. jmp .L_2TAG_PACKET_18.0.3
  216. .L_2TAG_PACKET_18.0.3:
  217. pxor %xmm7, %xmm7
  218. pextrw $3, %xmm0, %eax
  219. shrl $12, %eax
  220. andl $8, %eax
  221. addl %edx, %eax
  222. movq (%edx), %xmm0
  223. mulsd (%eax), %xmm0
  224. pand %xmm0, %xmm1
  225. comisd %xmm7, %xmm1
  226. jne .L_2TAG_PACKET_4.0.3
  227. .L_2TAG_PACKET_17.0.3:
  228. movq %xmm0, 16(%esp)
  229. subl $32, %esp
  230. lea 128(%esp), %eax
  231. movl %eax, (%esp)
  232. lea 136(%esp), %eax
  233. movl %eax, 4(%esp)
  234. lea 48(%esp), %eax
  235. movl %eax, 8(%esp)
  236. movl %ecx, %eax
  237. movl %eax, 12(%esp)
  238. call __libm_error_support
  239. addl $32, %esp
  240. fldl 16(%esp)
  241. .L_2TAG_PACKET_5.0.3:
  242. movl 64(%esp), %ebx
  243. movl %ebp, %esp
  244. popl %ebp
  245. ret
  246. ..B2.3:
  247. .align 16,0x90
  248. .type scalb,@function
  249. .size scalb,.-scalb
  250. .data
  251. # -- End scalb
  252. .text
  253. # -- Begin __libm_error_support
  254. .text
  255. .align 16,0x90
  256. __libm_error_support:
  257. # parameter 1: 4 + %esp
  258. # parameter 2: 8 + %esp
  259. # parameter 3: 12 + %esp
  260. # parameter 4: 16 + %esp
  261. ..B3.1:
  262. ..L4:
  263. ret
  264. .align 16,0x90
  265. .type __libm_error_support,@function
  266. .size __libm_error_support,.-__libm_error_support
  267. .data
  268. # -- End __libm_error_support
  269. .section .rodata, "a"
  270. .align 16
  271. .align 16
  272. static_const_table:
  273. .long 0
  274. .long 2146435072
  275. .long 0
  276. .long 4293918720
  277. .long 0
  278. .long 2121269248
  279. .long 0
  280. .long 4268752896
  281. .long 0
  282. .long 24117248
  283. .long 0
  284. .long 2171600896
  285. .long 0
  286. .long 0
  287. .long 0
  288. .long 2147483648
  289. .long 4294967295
  290. .long 4294967295
  291. .long 4294967295
  292. .long 4294967295
  293. .long 0
  294. .long 2147483648
  295. .long 0
  296. .long 2147483648
  297. .long 1
  298. .long 1048576
  299. .long 1
  300. .long 1048576
  301. .long 0
  302. .long 1130364928
  303. .long 0
  304. .long 1130364928
  305. .long 0
  306. .long 1015021568
  307. .long 0
  308. .long 1015021568
  309. .long 0
  310. .long 1127743488
  311. .long 0
  312. .long 1127743488
  313. .long 4294967241
  314. .long 1127743487
  315. .long 4294967241
  316. .long 1127743487
  317. .long 55
  318. .long 55
  319. .long 55
  320. .long 55
  321. .type static_const_table,@object
  322. .size static_const_table,192
  323. .data
  324. .section .note.GNU-stack, ""
  325. # End