cproj.S 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  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 "cproj.c"
  38. .text
  39. ..TXTST0:
  40. # -- Begin cproj
  41. .text
  42. .align 16,0x90
  43. .globl cproj
  44. cproj:
  45. # parameter 1: 12 + %ebp
  46. ..B1.1:
  47. ..L1:
  48. pushl %ebp
  49. movl %esp, %ebp
  50. andl $-16, %esp
  51. subl $32, %esp
  52. fldz
  53. movl %gs:20, %ecx
  54. movl 8(%ebp), %eax
  55. xorl %esp, %ecx
  56. movl %ecx, 16(%esp)
  57. movzwl 18(%ebp), %ecx
  58. andl $32752, %ecx
  59. call ..L2
  60. ..L2:
  61. popl %edx
  62. lea _GLOBAL_OFFSET_TABLE_+[. - ..L2](%edx), %edx
  63. cmpl $32752, %ecx
  64. je ..B1.15
  65. ..B1.2:
  66. movzwl 26(%ebp), %ecx
  67. andl $32752, %ecx
  68. cmpl $32752, %ecx
  69. je ..B1.6
  70. ..B1.3:
  71. fstp %st(0)
  72. movl 12(%ebp), %ecx
  73. movl %ecx, (%eax)
  74. movl 16(%ebp), %ecx
  75. movl %ecx, 4(%eax)
  76. movl 20(%ebp), %ecx
  77. movl %ecx, 8(%eax)
  78. movl 24(%ebp), %ecx
  79. movl %ecx, 12(%eax)
  80. movl 16(%esp), %ecx
  81. xorl %esp, %ecx
  82. cmpl %gs:20, %ecx
  83. jne ..B1.5
  84. ..B1.4:
  85. movl %ebp, %esp
  86. popl %ebp
  87. ret $4
  88. ..B1.5:
  89. movl %edx, %ebx
  90. call __stack_chk_fail@PLT
  91. ..B1.6:
  92. testl $1048575, 24(%ebp)
  93. jne ..B1.3
  94. ..B1.7:
  95. cmpl $0, 20(%ebp)
  96. jne ..B1.3
  97. ..B1.8:
  98. fstl 8(%esp)
  99. fstpl (%esp)
  100. ..B1.9:
  101. fldl DBL_PINFA@GOTOFF(%edx)
  102. movzbl 27(%ebp), %ecx
  103. testl $128, %ecx
  104. fstpl (%esp)
  105. je ..B1.11
  106. ..B1.10:
  107. fldl DBL_NZEROA@GOTOFF(%edx)
  108. fstpl 8(%esp)
  109. jmp ..B1.12
  110. ..B1.11:
  111. fldl DBL_PZEROA@GOTOFF(%edx)
  112. fstpl 8(%esp)
  113. ..B1.12:
  114. movl (%esp), %ecx
  115. movl %ecx, (%eax)
  116. movl 4(%esp), %ecx
  117. movl %ecx, 4(%eax)
  118. movl 8(%esp), %ecx
  119. movl %ecx, 8(%eax)
  120. movl 12(%esp), %ecx
  121. movl %ecx, 12(%eax)
  122. movl 16(%esp), %ecx
  123. xorl %esp, %ecx
  124. cmpl %gs:20, %ecx
  125. jne ..B1.5
  126. jmp ..B1.4
  127. ..B1.15:
  128. testl $1048575, 16(%ebp)
  129. jne ..B1.2
  130. ..B1.16:
  131. cmpl $0, 12(%ebp)
  132. je ..B1.8
  133. jmp ..B1.2
  134. .align 16,0x90
  135. .type cproj,@function
  136. .size cproj,.-cproj
  137. .data
  138. # -- End cproj
  139. .section .rodata, "a"
  140. .align 16
  141. .align 16
  142. DBL_PINFA:
  143. .long 0
  144. .long 2146435072
  145. .type DBL_PINFA,@object
  146. .size DBL_PINFA,8
  147. .space 8, 0x00 # pad
  148. .align 16
  149. DBL_NZEROA:
  150. .long 0
  151. .long 2147483648
  152. .type DBL_NZEROA,@object
  153. .size DBL_NZEROA,8
  154. .space 8, 0x00 # pad
  155. .align 16
  156. DBL_PZEROA:
  157. .long 0
  158. .long 0
  159. .type DBL_PZEROA,@object
  160. .size DBL_PZEROA,8
  161. .data
  162. .section .note.GNU-stack, ""
  163. # End