fdiml.S 7.1 KB

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