hypotf.S 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  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 "hypotf.c"
  38. .text
  39. ..TXTST0:
  40. # -- Begin hypotf
  41. .text
  42. .align 16,0x90
  43. .globl hypotf
  44. hypotf:
  45. # parameter 1: 8 + %ebp
  46. # parameter 2: 12 + %ebp
  47. ..B1.1:
  48. ..L1:
  49. pushl %ebp
  50. movl %esp, %ebp
  51. andl $-16, %esp
  52. subl $16, %esp
  53. movzwl 10(%ebp), %ecx
  54. andl $32640, %ecx
  55. movzwl 14(%ebp), %edx
  56. andl $32640, %edx
  57. shrl $7, %ecx
  58. shrl $7, %edx
  59. cmpl $255, %ecx
  60. je ..B1.9
  61. ..B1.2:
  62. cmpl $255, %edx
  63. je ..B1.9
  64. ..B1.3:
  65. movl %ecx, %eax
  66. subl %edx, %eax
  67. addl $28, %eax
  68. cmpl $56, %eax
  69. ja ..B1.5
  70. ..B1.4:
  71. flds 8(%ebp)
  72. addl %edx, %ecx
  73. fmul %st(0), %st
  74. cmpl $378, %ecx
  75. flds 12(%ebp)
  76. fmul %st(0), %st
  77. faddp %st, %st(1)
  78. fsqrt
  79. jg ..B1.7
  80. jmp ..B1.6
  81. ..B1.5:
  82. flds 8(%ebp)
  83. call ..L2
  84. ..L2:
  85. popl %eax
  86. lea _GLOBAL_OFFSET_TABLE_+[. - ..L2](%eax), %eax
  87. fabs
  88. flds 12(%ebp)
  89. fabs
  90. fldl .L_2il0floatpacket.0@GOTOFF(%eax)
  91. fmul %st, %st(2)
  92. fmulp %st, %st(1)
  93. faddp %st, %st(1)
  94. fstps 8(%esp)
  95. flds 8(%esp)
  96. fmuls .L_2il0floatpacket.1@GOTOFF(%eax)
  97. cmpl $2130706432, 8(%esp)
  98. ..B1.6:
  99. movl %ebp, %esp
  100. popl %ebp
  101. ret
  102. ..B1.7:
  103. fstl (%esp)
  104. cmpl $1206910976, 4(%esp)
  105. jl ..B1.6
  106. ..B1.8:
  107. movl %ebp, %esp
  108. popl %ebp
  109. ret
  110. ..B1.9:
  111. andb $127, 11(%ebp)
  112. andb $127, 15(%ebp)
  113. cmpl $255, %ecx
  114. je ..B1.21
  115. ..B1.10:
  116. cmpl $255, %edx
  117. je ..B1.19
  118. ..B1.11:
  119. flds 8(%ebp)
  120. fld %st(0)
  121. fadds 12(%ebp)
  122. fstps 8(%esp)
  123. ..B1.12:
  124. cmpl $255, %ecx
  125. je ..B1.17
  126. ..B1.13:
  127. fstp %st(0)
  128. cmpl $255, %edx
  129. jne ..B1.16
  130. ..B1.14:
  131. testl $8388607, 12(%ebp)
  132. jne ..B1.16
  133. ..B1.15:
  134. flds 12(%ebp)
  135. movl %ebp, %esp
  136. popl %ebp
  137. ret
  138. ..B1.16:
  139. flds 8(%esp)
  140. movl %ebp, %esp
  141. popl %ebp
  142. ret
  143. ..B1.17:
  144. testl $8388607, 8(%ebp)
  145. jne ..B1.13
  146. ..B1.18:
  147. movl %ebp, %esp
  148. popl %ebp
  149. ret
  150. ..B1.19:
  151. testl $8388607, 12(%ebp)
  152. je ..B1.11
  153. ..B1.20:
  154. flds 8(%ebp)
  155. fld %st(0)
  156. fmuls 12(%ebp)
  157. fstps 8(%esp)
  158. jmp ..B1.12
  159. ..B1.21:
  160. testl $8388607, 8(%ebp)
  161. jne ..B1.20
  162. jmp ..B1.10
  163. .align 16,0x90
  164. .type hypotf,@function
  165. .size hypotf,.-hypotf
  166. .data
  167. # -- End hypotf
  168. .section .rodata, "a"
  169. .align 8
  170. .align 8
  171. .L_2il0floatpacket.0:
  172. .long 0x00000000,0x3fe00000
  173. .type .L_2il0floatpacket.0,@object
  174. .size .L_2il0floatpacket.0,8
  175. .align 4
  176. .L_2il0floatpacket.1:
  177. .long 0x40000000
  178. .type .L_2il0floatpacket.1,@object
  179. .size .L_2il0floatpacket.1,4
  180. .data
  181. .section .note.GNU-stack, ""
  182. # End