fmaxl.S 4.9 KB

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