ctan.S 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237
  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 "ctan.c"
  38. .text
  39. ..TXTST0:
  40. # -- Begin ctan
  41. .text
  42. .align 16,0x90
  43. .globl ctan
  44. ctan:
  45. # parameter 1: 12 + %ebp
  46. ..B1.1:
  47. ..L1:
  48. pushl %ebp
  49. movl %esp, %ebp
  50. andl $-16, %esp
  51. pushl %esi
  52. pushl %ebx
  53. subl $72, %esp
  54. fldz
  55. fldl 20(%ebp)
  56. fldl 12(%ebp)
  57. movzwl 26(%ebp), %ecx
  58. andl $32752, %ecx
  59. movl %gs:20, %edx
  60. movl 8(%ebp), %esi
  61. xorl %esp, %edx
  62. movl %edx, 64(%esp)
  63. cmpl $32752, %ecx
  64. fstpl 56(%esp)
  65. fxch %st(1)
  66. fstl 16(%esp)
  67. fstl 24(%esp)
  68. fstl 32(%esp)
  69. fstpl 40(%esp)
  70. fstpl 48(%esp)
  71. jl ..B1.4
  72. ..B1.2:
  73. testl $1048575, 24(%ebp)
  74. jne ..B1.5
  75. ..B1.3:
  76. cmpl $0, 20(%ebp)
  77. jne ..B1.5
  78. ..B1.4:
  79. movzbl 27(%ebp), %edx
  80. notl %edx
  81. movzbl 55(%esp), %ecx
  82. andl $128, %edx
  83. andl $127, %ecx
  84. orl %edx, %ecx
  85. movb %cl, 55(%esp)
  86. ..B1.5:
  87. addl $-32, %esp
  88. call ..L2
  89. ..L2:
  90. popl %ebx
  91. lea _GLOBAL_OFFSET_TABLE_+[. - ..L2](%ebx), %ebx
  92. lea 32(%esp), %ecx
  93. movl %ecx, (%esp)
  94. lea 4(%esp), %edx
  95. movl 48(%ecx), %ecx
  96. movl %ecx, (%edx)
  97. movl 84(%esp), %ecx
  98. movl %ecx, 4(%edx)
  99. movl 88(%esp), %ecx
  100. movl %ecx, 8(%edx)
  101. movl 92(%esp), %ecx
  102. movl %ecx, 12(%edx)
  103. call ctanh@PLT
  104. ..B1.14:
  105. addl $28, %esp
  106. fldl (%esp)
  107. movzwl 6(%esp), %edx
  108. andl $32752, %edx
  109. fstl 16(%esp)
  110. cmpl $32752, %edx
  111. fstpl 40(%esp)
  112. fldl 8(%esp)
  113. fstl 24(%esp)
  114. fstpl 32(%esp)
  115. jl ..B1.8
  116. ..B1.6:
  117. testl $1048575, 20(%esp)
  118. jne ..B1.9
  119. ..B1.7:
  120. cmpl $0, 16(%esp)
  121. jne ..B1.9
  122. ..B1.8:
  123. movzbl 23(%esp), %edx
  124. notl %edx
  125. movzbl 47(%esp), %ecx
  126. andl $128, %edx
  127. andl $127, %ecx
  128. orl %edx, %ecx
  129. movb %cl, 47(%esp)
  130. ..B1.9:
  131. movl 32(%esp), %edx
  132. movl %edx, (%esi)
  133. movl 40(%esp), %edx
  134. movl %edx, 8(%esi)
  135. movl 36(%esp), %ecx
  136. movl 44(%esp), %edx
  137. movl %ecx, 4(%esi)
  138. movl %edx, 12(%esi)
  139. movl 64(%esp), %edx
  140. xorl %esp, %edx
  141. cmpl %gs:20, %edx
  142. jne ..B1.11
  143. ..B1.10:
  144. movl %esi, %eax
  145. addl $72, %esp
  146. popl %ebx
  147. popl %esi
  148. movl %ebp, %esp
  149. popl %ebp
  150. ret $4
  151. ..B1.11:
  152. call __stack_chk_fail@PLT
  153. .align 16,0x90
  154. .type ctan,@function
  155. .size ctan,.-ctan
  156. .data
  157. # -- End ctan
  158. .text
  159. # -- Begin ctanf
  160. .text
  161. .align 16,0x90
  162. .globl ctanf
  163. ctanf:
  164. # parameter 1: 48 + %esp
  165. ..B2.1:
  166. ..L3:
  167. pushl %ebx
  168. subl $40, %esp
  169. xorl %eax, %eax
  170. movl %eax, 16(%esp)
  171. movl %eax, 20(%esp)
  172. movl %eax, 24(%esp)
  173. movl %eax, 28(%esp)
  174. movzwl 54(%esp), %eax
  175. andl $32640, %eax
  176. movl 52(%esp), %edx
  177. cmpl $32640, %eax
  178. movl 48(%esp), %ecx
  179. movl %edx, 32(%esp)
  180. movl %ecx, 36(%esp)
  181. jl ..B2.3
  182. ..B2.2:
  183. testl $8388607, 52(%esp)
  184. jne ..B2.4
  185. ..B2.3:
  186. movzbl 55(%esp), %eax
  187. notl %eax
  188. movzbl 35(%esp), %edx
  189. andl $128, %eax
  190. andl $127, %edx
  191. orl %eax, %edx
  192. movb %dl, 35(%esp)
  193. ..B2.4:
  194. addl $8, %esp
  195. call ..L4
  196. ..L4:
  197. popl %ebx
  198. lea _GLOBAL_OFFSET_TABLE_+[. - ..L4](%ebx), %ebx
  199. pushl 28(%esp)
  200. pushl 28(%esp)
  201. call ctanhf@PLT
  202. ..B2.10:
  203. movl %eax, 16(%esp)
  204. movl %eax, 28(%esp)
  205. shrl $16, %eax
  206. andl $32640, %eax
  207. cmpl $32640, %eax
  208. movl %edx, 20(%esp)
  209. movl %edx, 24(%esp)
  210. jl ..B2.6
  211. ..B2.5:
  212. testl $8388607, 16(%esp)
  213. jne ..B2.7
  214. ..B2.6:
  215. movzbl 19(%esp), %eax
  216. notl %eax
  217. movzbl 31(%esp), %edx
  218. andl $128, %eax
  219. andl $127, %edx
  220. orl %eax, %edx
  221. movb %dl, 31(%esp)
  222. ..B2.7:
  223. movl 24(%esp), %eax
  224. movl 28(%esp), %edx
  225. addl $40, %esp
  226. popl %ebx
  227. ret
  228. .align 16,0x90
  229. .type ctanf,@function
  230. .size ctanf,.-ctanf
  231. .data
  232. # -- End ctanf
  233. .data
  234. .section .note.GNU-stack, ""
  235. # End