libm_scalbl_k80.S 6.8 KB

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