feraiseexcept.S 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  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 "feraiseexcept.c"
  38. .text
  39. ..TXTST0:
  40. # -- Begin feraiseexcept
  41. .text
  42. .align 16,0x90
  43. .globl feraiseexcept
  44. feraiseexcept:
  45. # parameter 1: 16 + %esp
  46. ..B1.1:
  47. ..L1:
  48. subl $12, %esp
  49. movl 16(%esp), %eax
  50. testb $1, %al
  51. call ..L2
  52. ..L2:
  53. popl %edx
  54. lea _GLOBAL_OFFSET_TABLE_+[. - ..L2](%edx), %edx
  55. je ..B1.3
  56. ..B1.2:
  57. flds d_zero@GOTOFF(%edx)
  58. fwait
  59. flds d_zero@GOTOFF(%edx)
  60. fwait
  61. fdivrp %st, %st(1)
  62. fwait
  63. fstps (%esp)
  64. fwait
  65. ..B1.3:
  66. testb $4, %al
  67. je ..B1.5
  68. ..B1.4:
  69. movl p_one@GOTOFF(%edx), %ecx
  70. flds (%ecx)
  71. fwait
  72. movl p_zero@GOTOFF(%edx), %ecx
  73. flds (%ecx)
  74. fwait
  75. fdivrp %st, %st(1)
  76. fwait
  77. fstps (%esp)
  78. fwait
  79. ..B1.5:
  80. testb $2, %al
  81. je ..B1.7
  82. ..B1.6:
  83. flds d_tiny@GOTOFF(%edx)
  84. fwait
  85. flds d_tiny@GOTOFF(%edx)
  86. fwait
  87. faddp %st, %st(1)
  88. fwait
  89. fstps (%esp)
  90. fwait
  91. ..B1.7:
  92. testb $8, %al
  93. je ..B1.9
  94. ..B1.8:
  95. flds d_huge@GOTOFF(%edx)
  96. fwait
  97. flds d_huge@GOTOFF(%edx)
  98. fwait
  99. fmulp %st, %st(1)
  100. fwait
  101. fstps (%esp)
  102. fwait
  103. ..B1.9:
  104. testb $16, %al
  105. je ..B1.11
  106. ..B1.10:
  107. flds d_norm@GOTOFF(%edx)
  108. fwait
  109. flds d_norm@GOTOFF(%edx)
  110. fwait
  111. fmulp %st, %st(1)
  112. fwait
  113. fstps (%esp)
  114. fwait
  115. ..B1.11:
  116. testb $32, %al
  117. je ..B1.13
  118. ..B1.12:
  119. movl p_one@GOTOFF(%edx), %eax
  120. movl p_norm@GOTOFF(%edx), %edx
  121. flds (%eax)
  122. fwait
  123. flds (%edx)
  124. fwait
  125. faddp %st, %st(1)
  126. fwait
  127. fstps (%esp)
  128. fwait
  129. ..B1.13:
  130. xorl %eax, %eax
  131. addl $12, %esp
  132. ret
  133. .align 16,0x90
  134. .type feraiseexcept,@function
  135. .size feraiseexcept,.-feraiseexcept
  136. .data
  137. # -- End feraiseexcept
  138. .section .rodata, "a"
  139. .align 4
  140. .align 4
  141. d_zero:
  142. .long 0
  143. .type d_zero,@object
  144. .size d_zero,4
  145. .align 4
  146. d_one:
  147. .long 1065353216
  148. .type d_one,@object
  149. .size d_one,4
  150. .align 4
  151. d_tiny:
  152. .long 8388607
  153. .type d_tiny,@object
  154. .size d_tiny,4
  155. .align 4
  156. d_huge:
  157. .long 2139095039
  158. .type d_huge,@object
  159. .size d_huge,4
  160. .align 4
  161. d_norm:
  162. .long 8388608
  163. .type d_norm,@object
  164. .size d_norm,4
  165. .section .data.rel.ro.local, "aw",@progbits
  166. .align 4
  167. .align 4
  168. p_one:
  169. .long d_one
  170. .type p_one,@object
  171. .size p_one,4
  172. .align 4
  173. p_zero:
  174. .long d_zero
  175. .type p_zero,@object
  176. .size p_zero,4
  177. .align 4
  178. p_norm:
  179. .long d_norm
  180. .type p_norm,@object
  181. .size p_norm,4
  182. .data
  183. .section .note.GNU-stack, ""
  184. # End