fdiml.S 6.9 KB

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