scalbnl.S 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321
  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 "scalbnl.c"
  38. .text
  39. ..TXTST0:
  40. # -- Begin scalbnl
  41. .text
  42. .align 16,0x90
  43. .globl scalbnl
  44. scalbnl:
  45. # parameter 1: 32 + %rsp
  46. # parameter 2: %edi
  47. ..B1.1:
  48. .cfi_startproc
  49. ..___tag_value_scalbnl.1:
  50. ..L2:
  51. subq $24, %rsp
  52. .cfi_def_cfa_offset 32
  53. ..B1.2:
  54. fnstcw 18(%rsp)
  55. ..B1.3:
  56. movzwl 40(%rsp), %r8d
  57. movl %r8d, %esi
  58. andl $32767, %esi
  59. cmpl $32767, %esi
  60. je ..B1.39
  61. ..B1.4:
  62. testl %esi, %esi
  63. jne ..B1.12
  64. ..B1.5:
  65. cmpq $0, 32(%rsp)
  66. je ..B1.15
  67. ..B1.6:
  68. movzwl 18(%rsp), %edx
  69. movl %edx, %eax
  70. andl $768, %eax
  71. cmpl $768, %eax
  72. je ..B1.38
  73. ..B1.7:
  74. orl $-64768, %edx
  75. movw %dx, 16(%rsp)
  76. ..B1.8:
  77. fldcw 16(%rsp)
  78. ..B1.9:
  79. fldt 32(%rsp)
  80. lea _TWO_75(%rip), %rax
  81. fmull (%rax)
  82. fstpt 32(%rsp)
  83. ..B1.10:
  84. fldcw 18(%rsp)
  85. ..B1.11:
  86. movzwl 40(%rsp), %r8d
  87. movl %r8d, %esi
  88. andl $32767, %esi
  89. addl $-75, %esi
  90. ..B1.12:
  91. movl $65536, %edx
  92. cmpl $65536, %edi
  93. cmovg %edx, %edi
  94. movl $-65536, %ecx
  95. xorb %al, %al
  96. cmpl $-65536, %edi
  97. cmovle %ecx, %edi
  98. lea (%rsi,%rdi), %edx
  99. testl %edx, %edx
  100. jle ..B1.23
  101. ..B1.13:
  102. cmpl $32767, %edx
  103. jge ..B1.16
  104. ..B1.14:
  105. andl $-32768, %r8d
  106. andl $32767, %edx
  107. orl %edx, %r8d
  108. movw %r8w, 40(%rsp)
  109. fldt 32(%rsp)
  110. addq $24, %rsp
  111. .cfi_def_cfa_offset 8
  112. ret
  113. .cfi_def_cfa_offset 32
  114. ..B1.15:
  115. fldt 32(%rsp)
  116. addq $24, %rsp
  117. .cfi_def_cfa_offset 8
  118. ret
  119. .cfi_def_cfa_offset 32
  120. ..B1.16:
  121. movzwl 18(%rsp), %ecx
  122. movl %ecx, %edx
  123. andl $768, %edx
  124. cmpl $768, %edx
  125. je ..B1.20
  126. ..B1.17:
  127. orl $-64768, %ecx
  128. movw %cx, 16(%rsp)
  129. ..B1.18:
  130. fldcw 16(%rsp)
  131. ..B1.19:
  132. movb $1, %al
  133. ..B1.20:
  134. movb 41(%rsp), %dl
  135. lea _large_value_80(%rip), %rsi
  136. andb $-128, %dl
  137. shrb $7, %dl
  138. fldt (%rsi)
  139. movzbl %dl, %ecx
  140. shlq $4, %rcx
  141. testb %al, %al
  142. fldt (%rsi,%rcx)
  143. fmulp %st, %st(1)
  144. fstpt (%rsp)
  145. je ..B1.22
  146. ..B1.21:
  147. fldcw 18(%rsp)
  148. ..B1.22:
  149. fldt (%rsp)
  150. addq $24, %rsp
  151. .cfi_def_cfa_offset 8
  152. ret
  153. .cfi_def_cfa_offset 32
  154. ..B1.23:
  155. cmpl $-63, %edx
  156. jl ..B1.31
  157. ..B1.24:
  158. andl $-32768, %r8d
  159. lea 75(%rsi,%rdi), %eax
  160. andl $32767, %eax
  161. orl %eax, %r8d
  162. movzwl 18(%rsp), %eax
  163. movl %eax, %edx
  164. andl $768, %edx
  165. movw %r8w, 40(%rsp)
  166. cmpl $768, %edx
  167. je ..B1.30
  168. ..B1.25:
  169. orl $-64768, %eax
  170. movw %ax, 16(%rsp)
  171. ..B1.26:
  172. fldcw 16(%rsp)
  173. ..B1.27:
  174. fldt 32(%rsp)
  175. lea 8+_TWO_75(%rip), %rax
  176. fmull (%rax)
  177. fstpt (%rsp)
  178. ..B1.28:
  179. fldcw 18(%rsp)
  180. ..B1.29:
  181. fldt (%rsp)
  182. addq $24, %rsp
  183. .cfi_def_cfa_offset 8
  184. ret
  185. .cfi_def_cfa_offset 32
  186. ..B1.30:
  187. fldt 32(%rsp)
  188. lea 8+_TWO_75(%rip), %rax
  189. fmull (%rax)
  190. fstpt (%rsp)
  191. jmp ..B1.29
  192. ..B1.31:
  193. movzwl 18(%rsp), %ecx
  194. movl %ecx, %edx
  195. andl $768, %edx
  196. cmpl $768, %edx
  197. je ..B1.35
  198. ..B1.32:
  199. orl $-64768, %ecx
  200. movw %cx, 16(%rsp)
  201. ..B1.33:
  202. fldcw 16(%rsp)
  203. ..B1.34:
  204. movb $1, %al
  205. ..B1.35:
  206. movb 41(%rsp), %dl
  207. lea _small_value_80(%rip), %rsi
  208. andb $-128, %dl
  209. shrb $7, %dl
  210. fldt (%rsi)
  211. movzbl %dl, %ecx
  212. shlq $4, %rcx
  213. testb %al, %al
  214. fldt (%rsi,%rcx)
  215. fmulp %st, %st(1)
  216. fstpt (%rsp)
  217. je ..B1.37
  218. ..B1.36:
  219. fldcw 18(%rsp)
  220. ..B1.37:
  221. fldt (%rsp)
  222. addq $24, %rsp
  223. .cfi_def_cfa_offset 8
  224. ret
  225. .cfi_def_cfa_offset 32
  226. ..B1.38:
  227. fldt 32(%rsp)
  228. lea _TWO_75(%rip), %rax
  229. fmull (%rax)
  230. fstpt 32(%rsp)
  231. jmp ..B1.11
  232. ..B1.39:
  233. movzwl 18(%rsp), %edx
  234. movl %edx, %eax
  235. andl $768, %eax
  236. cmpl $768, %eax
  237. je ..B1.45
  238. ..B1.40:
  239. orl $-64768, %edx
  240. movw %dx, 16(%rsp)
  241. ..B1.41:
  242. fldcw 16(%rsp)
  243. ..B1.42:
  244. fldt 32(%rsp)
  245. fstpt (%rsp)
  246. ..B1.43:
  247. fldcw 18(%rsp)
  248. ..B1.44:
  249. fldt (%rsp)
  250. addq $24, %rsp
  251. .cfi_def_cfa_offset 8
  252. ret
  253. .cfi_def_cfa_offset 32
  254. ..B1.45:
  255. fldt 32(%rsp)
  256. fstpt (%rsp)
  257. jmp ..B1.44
  258. .align 16,0x90
  259. .cfi_endproc
  260. .type scalbnl,@function
  261. .size scalbnl,.-scalbnl
  262. .data
  263. # -- End scalbnl
  264. .section .rodata, "a"
  265. .align 4
  266. .align 4
  267. _TWO_75:
  268. .long 0
  269. .long 1151336448
  270. .long 0
  271. .long 994050048
  272. .type _TWO_75,@object
  273. .size _TWO_75,16
  274. .align 2
  275. _large_value_80:
  276. .word 0
  277. .word 0
  278. .word 0
  279. .word 32768
  280. .word 26383
  281. .word 0
  282. .word 0
  283. .word 0
  284. .word 0
  285. .word 0
  286. .word 0
  287. .word 32768
  288. .word 59151
  289. .word 0
  290. .word 0
  291. .word 0
  292. .type _large_value_80,@object
  293. .size _large_value_80,32
  294. .align 2
  295. _small_value_80:
  296. .word 0
  297. .word 0
  298. .word 0
  299. .word 32768
  300. .word 6383
  301. .word 0
  302. .word 0
  303. .word 0
  304. .word 0
  305. .word 0
  306. .word 0
  307. .word 32768
  308. .word 39151
  309. .word 0
  310. .word 0
  311. .word 0
  312. .type _small_value_80,@object
  313. .size _small_value_80,32
  314. .data
  315. .section .note.GNU-stack, ""
  316. // -- Begin DWARF2 SEGMENT .eh_frame
  317. .section .eh_frame,"a",@progbits
  318. .eh_frame_seg:
  319. .align 1
  320. # End