feraiseexcept.S 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  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: %edi
  46. ..B1.1:
  47. .cfi_startproc
  48. ..___tag_value_feraiseexcept.1:
  49. ..L2:
  50. testl $1, %edi
  51. je ..B1.3
  52. ..B1.2:
  53. lea d_zero(%rip), %rax
  54. movsd (%rax), %xmm0
  55. divsd (%rax), %xmm0
  56. movsd %xmm0, -8(%rsp)
  57. ..B1.3:
  58. testl $4, %edi
  59. je ..B1.5
  60. ..B1.4:
  61. movq p_one(%rip), %rax
  62. movq p_zero(%rip), %rdx
  63. movsd (%rax), %xmm0
  64. divsd (%rdx), %xmm0
  65. movsd %xmm0, -8(%rsp)
  66. ..B1.5:
  67. testl $2, %edi
  68. je ..B1.7
  69. ..B1.6:
  70. lea d_tiny(%rip), %rax
  71. movsd (%rax), %xmm0
  72. addsd (%rax), %xmm0
  73. movsd %xmm0, -8(%rsp)
  74. ..B1.7:
  75. testl $8, %edi
  76. je ..B1.9
  77. ..B1.8:
  78. lea d_huge(%rip), %rax
  79. movsd (%rax), %xmm0
  80. mulsd (%rax), %xmm0
  81. movsd %xmm0, -8(%rsp)
  82. ..B1.9:
  83. testl $16, %edi
  84. je ..B1.11
  85. ..B1.10:
  86. lea d_norm(%rip), %rax
  87. movsd (%rax), %xmm0
  88. mulsd (%rax), %xmm0
  89. movsd %xmm0, -8(%rsp)
  90. ..B1.11:
  91. testl $32, %edi
  92. je ..B1.13
  93. ..B1.12:
  94. movq p_one(%rip), %rax
  95. movq p_norm(%rip), %rdx
  96. movsd (%rax), %xmm0
  97. addsd (%rdx), %xmm0
  98. movsd %xmm0, -8(%rsp)
  99. ..B1.13:
  100. xorl %eax, %eax
  101. ret
  102. .align 16,0x90
  103. .cfi_endproc
  104. .type feraiseexcept,@function
  105. .size feraiseexcept,.-feraiseexcept
  106. .data
  107. # -- End feraiseexcept
  108. .section .rodata, "a"
  109. .align 8
  110. .align 8
  111. d_zero:
  112. .long 0x00000000,0x00000000
  113. .type d_zero,@object
  114. .size d_zero,8
  115. .align 8
  116. d_one:
  117. .long 0x00000000,0x3ff00000
  118. .type d_one,@object
  119. .size d_one,8
  120. .align 8
  121. d_tiny:
  122. .long 0xffffffff,0x000fffff
  123. .type d_tiny,@object
  124. .size d_tiny,8
  125. .align 8
  126. d_huge:
  127. .long 0xffffffff,0x7fefffff
  128. .type d_huge,@object
  129. .size d_huge,8
  130. .align 8
  131. d_norm:
  132. .long 0x00000000,0x00100000
  133. .type d_norm,@object
  134. .size d_norm,8
  135. .section .data.rel.ro.local, "aw",@progbits
  136. .align 8
  137. .align 8
  138. p_one:
  139. .quad d_one
  140. .type p_one,@object
  141. .size p_one,8
  142. .align 8
  143. p_zero:
  144. .quad d_zero
  145. .type p_zero,@object
  146. .size p_zero,8
  147. .align 8
  148. p_norm:
  149. .quad d_norm
  150. .type p_norm,@object
  151. .size p_norm,8
  152. .data
  153. .section .note.GNU-stack, ""
  154. // -- Begin DWARF2 SEGMENT .eh_frame
  155. .section .eh_frame,"a",@progbits
  156. .eh_frame_seg:
  157. .align 1
  158. # End