fmaxl.S 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  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: 48 + %rsp
  46. # parameter 2: 64 + %rsp
  47. ..B1.1:
  48. .cfi_startproc
  49. ..___tag_value_fmaxl.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.34
  62. ..B1.4:
  63. movzwl 72(%rsp), %eax
  64. andl $32767, %eax
  65. cmpl $32767, %eax
  66. je ..B1.17
  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. fstpt 16(%rsp)
  83. fldt 16(%rsp)
  84. fldt 64(%rsp)
  85. fxch %st(1)
  86. fcomip %st(1), %st
  87. jbe ..B1.11
  88. ..B1.10:
  89. fstp %st(0)
  90. jmp ..B1.13
  91. ..B1.11:
  92. fldt 16(%rsp)
  93. fucomip %st(1), %st
  94. jp ..B1.12
  95. je ..B1.16
  96. ..B1.12:
  97. fstpt 16(%rsp)
  98. ..B1.13:
  99. testb %sil, %sil
  100. je ..B1.15
  101. ..B1.14:
  102. fldcw 34(%rsp)
  103. ..B1.15:
  104. fldt 16(%rsp)
  105. addq $40, %rsp
  106. .cfi_def_cfa_offset 8
  107. ret
  108. .cfi_def_cfa_offset 48
  109. ..B1.16:
  110. testb $-128, 73(%rsp)
  111. jne ..B1.10
  112. jmp ..B1.12
  113. ..B1.17:
  114. cmpl $-2147483648, 68(%rsp)
  115. jne ..B1.19
  116. ..B1.18:
  117. cmpl $0, 64(%rsp)
  118. je ..B1.5
  119. ..B1.19:
  120. movzwl 34(%rsp), %edx
  121. movl %edx, %eax
  122. andl $768, %eax
  123. cmpl $768, %eax
  124. je ..B1.33
  125. ..B1.20:
  126. orl $-64768, %edx
  127. movw %dx, 32(%rsp)
  128. ..B1.21:
  129. fldcw 32(%rsp)
  130. ..B1.22:
  131. fldt 48(%rsp)
  132. fldt 64(%rsp)
  133. fmulp %st, %st(1)
  134. fstpt (%rsp)
  135. ..B1.23:
  136. fldcw 34(%rsp)
  137. movzwl 56(%rsp), %ecx
  138. ..B1.24:
  139. andl $32767, %ecx
  140. cmpl $32767, %ecx
  141. jne ..B1.27
  142. ..B1.25:
  143. cmpl $-2147483648, 52(%rsp)
  144. jne ..B1.28
  145. ..B1.26:
  146. cmpl $0, 48(%rsp)
  147. jne ..B1.28
  148. ..B1.27:
  149. fldt 48(%rsp)
  150. addq $40, %rsp
  151. .cfi_def_cfa_offset 8
  152. ret
  153. .cfi_def_cfa_offset 48
  154. ..B1.28:
  155. movzwl 72(%rsp), %eax
  156. andl $32767, %eax
  157. cmpl $32767, %eax
  158. jne ..B1.31
  159. ..B1.29:
  160. cmpl $-2147483648, 68(%rsp)
  161. jne ..B1.32
  162. ..B1.30:
  163. cmpl $0, 64(%rsp)
  164. jne ..B1.32
  165. ..B1.31:
  166. fldt 64(%rsp)
  167. addq $40, %rsp
  168. .cfi_def_cfa_offset 8
  169. ret
  170. .cfi_def_cfa_offset 48
  171. ..B1.32:
  172. fldt (%rsp)
  173. addq $40, %rsp
  174. .cfi_def_cfa_offset 8
  175. ret
  176. .cfi_def_cfa_offset 48
  177. ..B1.33:
  178. fldt 48(%rsp)
  179. fldt 64(%rsp)
  180. fmulp %st, %st(1)
  181. fstpt (%rsp)
  182. jmp ..B1.24
  183. ..B1.34:
  184. cmpl $-2147483648, 52(%rsp)
  185. jne ..B1.19
  186. ..B1.35:
  187. cmpl $0, 48(%rsp)
  188. je ..B1.4
  189. jmp ..B1.19
  190. .align 16,0x90
  191. .cfi_endproc
  192. .type fmaxl,@function
  193. .size fmaxl,.-fmaxl
  194. .data
  195. # -- End fmaxl
  196. .data
  197. .section .note.GNU-stack, ""
  198. // -- Begin DWARF2 SEGMENT .eh_frame
  199. .section .eh_frame,"a",@progbits
  200. .eh_frame_seg:
  201. .align 1
  202. # End