fminl.S 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  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 "fminl.c"
  38. .text
  39. ..TXTST0:
  40. # -- Begin fminl
  41. .text
  42. .align 16,0x90
  43. .globl fminl
  44. fminl:
  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. subl $32, %esp
  53. ..B1.2:
  54. fnstcw 14(%esp)
  55. ..B1.3:
  56. movzwl 16(%ebp), %eax
  57. movl %eax, %edx
  58. andl $32767, %edx
  59. cmpl $32767, %edx
  60. je ..B1.33
  61. ..B1.4:
  62. movzwl 28(%ebp), %edx
  63. andl $32767, %edx
  64. cmpl $32767, %edx
  65. je ..B1.16
  66. ..B1.5:
  67. movzwl 14(%esp), %edx
  68. movl %edx, %eax
  69. andl $768, %eax
  70. cmpl $768, %eax
  71. je ..B1.15
  72. ..B1.6:
  73. orl $-64768, %edx
  74. movw %dx, 12(%esp)
  75. ..B1.7:
  76. fldcw 12(%esp)
  77. ..B1.8:
  78. movl $1, %edx
  79. ..B1.9:
  80. fldt 8(%ebp)
  81. fstpt 16(%esp)
  82. fldt 16(%esp)
  83. fldt 20(%ebp)
  84. fcom %st(1)
  85. fnstsw %ax
  86. fxch %st(1)
  87. fstp %st(0)
  88. sahf
  89. jbe ..B1.11
  90. ..B1.10:
  91. fstp %st(0)
  92. jmp ..B1.12
  93. ..B1.11:
  94. fstpt 16(%esp)
  95. ..B1.12:
  96. testl %edx, %edx
  97. je ..B1.14
  98. ..B1.13:
  99. fldcw 14(%esp)
  100. ..B1.14:
  101. fldt 16(%esp)
  102. movl %ebp, %esp
  103. popl %ebp
  104. ret
  105. ..B1.15:
  106. xorl %edx, %edx
  107. jmp ..B1.9
  108. ..B1.16:
  109. cmpl $-2147483648, 24(%ebp)
  110. jne ..B1.18
  111. ..B1.17:
  112. cmpl $0, 20(%ebp)
  113. je ..B1.5
  114. ..B1.18:
  115. movzwl 14(%esp), %ecx
  116. movl %ecx, %edx
  117. andl $768, %edx
  118. cmpl $768, %edx
  119. je ..B1.32
  120. ..B1.19:
  121. orl $-64768, %ecx
  122. movw %cx, 12(%esp)
  123. ..B1.20:
  124. fldcw 12(%esp)
  125. ..B1.21:
  126. fldt 8(%ebp)
  127. fldt 20(%ebp)
  128. fmulp %st, %st(1)
  129. fstpt (%esp)
  130. ..B1.22:
  131. fldcw 14(%esp)
  132. movzwl 16(%ebp), %eax
  133. ..B1.23:
  134. andl $32767, %eax
  135. cmpl $32767, %eax
  136. je ..B1.25
  137. ..B1.24:
  138. fldt 8(%ebp)
  139. movl %ebp, %esp
  140. popl %ebp
  141. ret
  142. ..B1.25:
  143. cmpl $-2147483648, 12(%ebp)
  144. jne ..B1.27
  145. ..B1.26:
  146. cmpl $0, 8(%ebp)
  147. je ..B1.24
  148. ..B1.27:
  149. movzwl 28(%ebp), %eax
  150. andl $32767, %eax
  151. cmpl $32767, %eax
  152. je ..B1.29
  153. ..B1.28:
  154. fldt 20(%ebp)
  155. movl %ebp, %esp
  156. popl %ebp
  157. ret
  158. ..B1.29:
  159. cmpl $-2147483648, 24(%ebp)
  160. jne ..B1.31
  161. ..B1.30:
  162. cmpl $0, 20(%ebp)
  163. je ..B1.28
  164. ..B1.31:
  165. fldt (%esp)
  166. movl %ebp, %esp
  167. popl %ebp
  168. ret
  169. ..B1.32:
  170. fldt 8(%ebp)
  171. fldt 20(%ebp)
  172. fmulp %st, %st(1)
  173. fstpt (%esp)
  174. jmp ..B1.23
  175. ..B1.33:
  176. cmpl $-2147483648, 12(%ebp)
  177. jne ..B1.18
  178. ..B1.34:
  179. cmpl $0, 8(%ebp)
  180. je ..B1.4
  181. jmp ..B1.18
  182. .align 16,0x90
  183. .type fminl,@function
  184. .size fminl,.-fminl
  185. .data
  186. # -- End fminl
  187. .data
  188. .section .note.GNU-stack, ""
  189. # End