fminl.S 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  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: 48 + %rsp
  46. # parameter 2: 64 + %rsp
  47. ..B1.1:
  48. .cfi_startproc
  49. ..___tag_value_fminl.1:
  50. ..L2:
  51. subq $40, %rsp
  52. .cfi_def_cfa_offset 48
  53. xorb %sil, %sil
  54. ..B1.2:
  55. fnstcw 34(%rsp)
  56. ..B1.3:
  57. movzwl 56(%rsp), %ecx
  58. movl %ecx, %eax
  59. andl $32767, %eax
  60. cmpl $32767, %eax
  61. je ..B1.29
  62. ..B1.4:
  63. movzwl 72(%rsp), %eax
  64. andl $32767, %eax
  65. cmpl $32767, %eax
  66. je ..B1.12
  67. ..B1.5:
  68. movzwl 34(%rsp), %edx
  69. movl %edx, %eax
  70. andl $768, %eax
  71. cmpl $768, %eax
  72. je ..B1.9
  73. ..B1.6:
  74. orl $-64768, %edx
  75. movw %dx, 32(%rsp)
  76. ..B1.7:
  77. fldcw 32(%rsp)
  78. ..B1.8:
  79. movb $1, %sil
  80. ..B1.9:
  81. fldt 48(%rsp)
  82. fldt 64(%rsp)
  83. fcomi %st(1), %st
  84. fcmovnbe %st(1), %st
  85. fstp %st(1)
  86. fstpt 16(%rsp)
  87. testb %sil, %sil
  88. je ..B1.11
  89. ..B1.10:
  90. fldcw 34(%rsp)
  91. ..B1.11:
  92. fldt 16(%rsp)
  93. addq $40, %rsp
  94. .cfi_def_cfa_offset 8
  95. ret
  96. .cfi_def_cfa_offset 48
  97. ..B1.12:
  98. cmpl $-2147483648, 68(%rsp)
  99. jne ..B1.14
  100. ..B1.13:
  101. cmpl $0, 64(%rsp)
  102. je ..B1.5
  103. ..B1.14:
  104. movzwl 34(%rsp), %edx
  105. movl %edx, %eax
  106. andl $768, %eax
  107. cmpl $768, %eax
  108. je ..B1.28
  109. ..B1.15:
  110. orl $-64768, %edx
  111. movw %dx, 32(%rsp)
  112. ..B1.16:
  113. fldcw 32(%rsp)
  114. ..B1.17:
  115. fldt 48(%rsp)
  116. fldt 64(%rsp)
  117. fmulp %st, %st(1)
  118. fstpt (%rsp)
  119. ..B1.18:
  120. fldcw 34(%rsp)
  121. movzwl 56(%rsp), %ecx
  122. ..B1.19:
  123. andl $32767, %ecx
  124. cmpl $32767, %ecx
  125. jne ..B1.22
  126. ..B1.20:
  127. cmpl $-2147483648, 52(%rsp)
  128. jne ..B1.23
  129. ..B1.21:
  130. cmpl $0, 48(%rsp)
  131. jne ..B1.23
  132. ..B1.22:
  133. fldt 48(%rsp)
  134. addq $40, %rsp
  135. .cfi_def_cfa_offset 8
  136. ret
  137. .cfi_def_cfa_offset 48
  138. ..B1.23:
  139. movzwl 72(%rsp), %eax
  140. andl $32767, %eax
  141. cmpl $32767, %eax
  142. jne ..B1.26
  143. ..B1.24:
  144. cmpl $-2147483648, 68(%rsp)
  145. jne ..B1.27
  146. ..B1.25:
  147. cmpl $0, 64(%rsp)
  148. jne ..B1.27
  149. ..B1.26:
  150. fldt 64(%rsp)
  151. addq $40, %rsp
  152. .cfi_def_cfa_offset 8
  153. ret
  154. .cfi_def_cfa_offset 48
  155. ..B1.27:
  156. fldt (%rsp)
  157. addq $40, %rsp
  158. .cfi_def_cfa_offset 8
  159. ret
  160. .cfi_def_cfa_offset 48
  161. ..B1.28:
  162. fldt 48(%rsp)
  163. fldt 64(%rsp)
  164. fmulp %st, %st(1)
  165. fstpt (%rsp)
  166. jmp ..B1.19
  167. ..B1.29:
  168. cmpl $-2147483648, 52(%rsp)
  169. jne ..B1.14
  170. ..B1.30:
  171. cmpl $0, 48(%rsp)
  172. je ..B1.4
  173. jmp ..B1.14
  174. .align 16,0x90
  175. .cfi_endproc
  176. .type fminl,@function
  177. .size fminl,.-fminl
  178. .data
  179. # -- End fminl
  180. .data
  181. .section .note.GNU-stack, ""
  182. // -- Begin DWARF2 SEGMENT .eh_frame
  183. .section .eh_frame,"a",@progbits
  184. .eh_frame_seg:
  185. .align 1
  186. # End