scalblnl.S 7.6 KB

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