sqrtf_wmt.S 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  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 "sqrtf_wmt.c"
  38. .text
  39. ..TXTST0:
  40. # -- Begin sqrtf
  41. .text
  42. .align 16,0x90
  43. .globl sqrtf
  44. sqrtf:
  45. # parameter 1: 8 + %ebp
  46. ..B1.1:
  47. ..L1:
  48. pushl %ebp
  49. movl %esp, %ebp
  50. andl $-16, %esp
  51. subl $16, %esp
  52. flds 8(%ebp)
  53. movl 8(%ebp), %edx
  54. cmpl $2139095040, %edx
  55. ja ..B1.3
  56. ..B1.2:
  57. fstps 8(%esp)
  58. movss 8(%esp), %xmm0
  59. sqrtss %xmm0, %xmm0
  60. movss %xmm0, (%esp)
  61. flds (%esp)
  62. movl %ebp, %esp
  63. popl %ebp
  64. ret
  65. ..B1.3:
  66. movl %edx, %eax
  67. andl $2147483647, %eax
  68. cmpl $2139095040, %eax
  69. ja ..B1.8
  70. ..B1.4:
  71. cmpl $-2147483648, %edx
  72. je ..B1.6
  73. ..B1.5:
  74. fstp %st(0)
  75. call ..L2
  76. ..L2:
  77. popl %eax
  78. lea _GLOBAL_OFFSET_TABLE_+[. - ..L2](%eax), %eax
  79. movss _ConstantTable@GOTOFF(%eax), %xmm0
  80. mulss 16+_ConstantTable@GOTOFF(%eax), %xmm0
  81. movss %xmm0, (%esp)
  82. flds (%esp)
  83. ..B1.6:
  84. movl %ebp, %esp
  85. popl %ebp
  86. ret
  87. ..B1.8:
  88. fadd %st(0), %st
  89. movl %ebp, %esp
  90. popl %ebp
  91. ret
  92. .align 16,0x90
  93. .type sqrtf,@function
  94. .size sqrtf,.-sqrtf
  95. .data
  96. # -- End sqrtf
  97. .section .rodata, "a"
  98. .align 16
  99. .align 16
  100. _ConstantTable:
  101. .long 0
  102. .long 2147483648
  103. .long 0
  104. .long 0
  105. .long 2139095040
  106. .long 4286578688
  107. .long 0
  108. .long 0
  109. .type _ConstantTable,@object
  110. .size _ConstantTable,32
  111. .data
  112. .section .note.GNU-stack, ""
  113. # End