libm_scalbl_k80.S 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264
  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_scalbl_k80.c"
  38. .text
  39. ..TXTST0:
  40. # -- Begin __libm_scalbl_k80
  41. .text
  42. .align 16,0x90
  43. .hidden __libm_scalbl_k80
  44. .globl __libm_scalbl_k80
  45. __libm_scalbl_k80:
  46. # parameter 1: 48 + %esp
  47. # parameter 2: 60 + %esp
  48. # parameter 3: 72 + %esp
  49. ..B1.1:
  50. ..L1:
  51. pushl %esi
  52. pushl %ebx
  53. subl $36, %esp
  54. fldt 60(%esp)
  55. fldt 48(%esp)
  56. fld %st(0)
  57. movl 72(%esp), %ebx
  58. fadd %st(2), %st
  59. cmpl $0, 52(%esp)
  60. jne ..B1.4
  61. ..B1.2:
  62. cmpl $0, 48(%esp)
  63. jne ..B1.4
  64. ..B1.3:
  65. fstp %st(2)
  66. fstp %st(1)
  67. fstpt 24(%esp)
  68. fldt 24(%esp)
  69. addl $36, %esp
  70. popl %ebx
  71. popl %esi
  72. ret
  73. ..B1.4:
  74. movzwl 56(%esp), %eax
  75. andl $32767, %eax
  76. cmpl $32767, %eax
  77. je ..B1.3
  78. ..B1.5:
  79. fstpt 24(%esp)
  80. fldt 24(%esp)
  81. movzwl 32(%esp), %esi
  82. movl %esi, %edx
  83. andl $32767, %edx
  84. lea -1(%ebx,%edx), %ecx
  85. cmpl $32765, %ecx
  86. lea (%ebx,%edx), %eax
  87. ja ..B1.7
  88. ..B1.6:
  89. fstp %st(1)
  90. fstp %st(1)
  91. fstp %st(0)
  92. andl $-32768, %esi
  93. andl $32767, %eax
  94. orl %eax, %esi
  95. movw %si, 32(%esp)
  96. fldt 24(%esp)
  97. addl $36, %esp
  98. popl %ebx
  99. popl %esi
  100. ret
  101. ..B1.7:
  102. call ..L2
  103. ..L2:
  104. popl %ecx
  105. lea _GLOBAL_OFFSET_TABLE_+[. - ..L2](%ecx), %ecx
  106. cmpl $32766, %eax
  107. jle ..B1.9
  108. ..B1.8:
  109. fstp %st(2)
  110. fstp %st(1)
  111. fldt _CONSTANTS@GOTOFF(%ecx)
  112. fmul %st(0), %st
  113. fmulp %st, %st(1)
  114. fstpt 24(%esp)
  115. fldt 24(%esp)
  116. addl $36, %esp
  117. popl %ebx
  118. popl %esi
  119. ret
  120. ..B1.9:
  121. cmpl $-63, %eax
  122. fldt 12+_CONSTANTS@GOTOFF(%ecx)
  123. jge ..B1.11
  124. ..B1.10:
  125. fstp %st(3)
  126. fstp %st(0)
  127. fxch %st(1)
  128. fmul %st(0), %st
  129. fmulp %st, %st(1)
  130. fstpt 24(%esp)
  131. fldt 24(%esp)
  132. addl $36, %esp
  133. popl %ebx
  134. popl %esi
  135. ret
  136. ..B1.11:
  137. cmpl $-19, %eax
  138. jge ..B1.13
  139. ..B1.12:
  140. fstp %st(2)
  141. fstp %st(2)
  142. fldt .L_2il0floatpacket.0@GOTOFF(%ecx)
  143. movzwl 8+.L_2il0floatpacket.0@GOTOFF(%ecx), %eax
  144. andl $-32768, %eax
  145. fstpt (%esp)
  146. fmul %st(0), %st
  147. faddp %st, %st(1)
  148. fstpt 24(%esp)
  149. movzwl 32(%esp), %edx
  150. lea 256(%ebx,%edx), %ebx
  151. andl $-32768, %edx
  152. andl $32767, %ebx
  153. orl $-49409, %edx
  154. orl %ebx, %eax
  155. movw %ax, 8(%esp)
  156. fldt (%esp)
  157. movw %dx, 32(%esp)
  158. fldt 24(%esp)
  159. fmulp %st, %st(1)
  160. fstpt 24(%esp)
  161. fldt 24(%esp)
  162. addl $36, %esp
  163. popl %ebx
  164. popl %esi
  165. ret
  166. ..B1.13:
  167. fstp %st(1)
  168. fldt 24+_CONSTANTS@GOTOFF(%ecx)
  169. fxch %st(1)
  170. fmul %st(0), %st
  171. movzwl 8+.L_2il0floatpacket.0@GOTOFF(%ecx), %eax
  172. faddp %st, %st(2)
  173. fldt .L_2il0floatpacket.1@GOTOFF(%ecx)
  174. andl $-32768, %eax
  175. fmul %st(2), %st
  176. fld %st(0)
  177. fsub %st(3), %st
  178. fsubrp %st, %st(1)
  179. fstpt 12(%esp)
  180. fldt 12(%esp)
  181. fsubrp %st, %st(2)
  182. movzwl 20(%esp), %edx
  183. fxch %st(1)
  184. faddp %st, %st(2)
  185. fmulp %st, %st(1)
  186. lea -16383(%edx), %esi
  187. fldt .L_2il0floatpacket.0@GOTOFF(%ecx)
  188. negl %esi
  189. addl $16383, %esi
  190. lea -32512(%ebx,%edx), %ecx
  191. andl $32767, %esi
  192. andl $32767, %ecx
  193. fstpt (%esp)
  194. orl %esi, %eax
  195. movw %ax, 8(%esp)
  196. movl %edx, %esi
  197. fldt (%esp)
  198. andl $-32768, %esi
  199. fmulp %st, %st(1)
  200. andl $-32768, %eax
  201. orl $-49409, %esi
  202. orl %ecx, %eax
  203. movw %si, 20(%esp)
  204. fldt 12(%esp)
  205. movw %ax, 8(%esp)
  206. fldt (%esp)
  207. fmul %st, %st(1)
  208. fxch %st(1)
  209. fstpt 12(%esp)
  210. fldt 12(%esp)
  211. fxch %st(2)
  212. fmulp %st, %st(1)
  213. faddp %st, %st(1)
  214. fstpt 24(%esp)
  215. fldt 24(%esp)
  216. ..B1.14:
  217. addl $36, %esp
  218. popl %ebx
  219. popl %esi
  220. ret
  221. .align 16,0x90
  222. .type __libm_scalbl_k80,@function
  223. .size __libm_scalbl_k80,.-__libm_scalbl_k80
  224. .data
  225. # -- End __libm_scalbl_k80
  226. .section .rodata, "a"
  227. .align 16
  228. .align 16
  229. .L_2il0floatpacket.0:
  230. .byte 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xff,0x3f,0x00,0x00
  231. .type .L_2il0floatpacket.0,@object
  232. .size .L_2il0floatpacket.0,12
  233. .space 4, 0x00 # pad
  234. .align 16
  235. .L_2il0floatpacket.1:
  236. .byte 0x00,0x00,0x00,0x40,0x00,0x00,0x00,0x80,0x20,0x40,0x00,0x00
  237. .type .L_2il0floatpacket.1,@object
  238. .size .L_2il0floatpacket.1,12
  239. .align 2
  240. _CONSTANTS:
  241. .word 0
  242. .word 0
  243. .word 0
  244. .word 32768
  245. .word 32766
  246. .word 0
  247. .word 0
  248. .word 0
  249. .word 0
  250. .word 32768
  251. .word 1
  252. .word 0
  253. .word 0
  254. .word 0
  255. .word 0
  256. .word 32768
  257. .word 16127
  258. .word 0
  259. .type _CONSTANTS,@object
  260. .size _CONSTANTS,36
  261. .data
  262. .section .note.GNU-stack, ""
  263. # End