csinh.S 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408
  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 "csinh.c"
  38. .text
  39. ..TXTST0:
  40. # -- Begin csinh
  41. .text
  42. .align 16,0x90
  43. .globl csinh
  44. csinh:
  45. # parameter 1: 12 + %ebp
  46. ..B1.1:
  47. ..L1:
  48. pushl %ebp
  49. movl %esp, %ebp
  50. andl $-64, %esp
  51. pushl %esi
  52. pushl %edi
  53. pushl %ebx
  54. subl $116, %esp
  55. fldz
  56. movl %gs:20, %edx
  57. movl 8(%ebp), %edi
  58. xorl %esp, %edx
  59. movl %edx, 88(%esp)
  60. fstl 72(%esp)
  61. fstpl 80(%esp)
  62. ..B1.2:
  63. fnstcw 62(%esp)
  64. ..B1.3:
  65. movzwl 18(%ebp), %esi
  66. andl $32752, %esi
  67. shrl $4, %esi
  68. call ..L2
  69. ..L2:
  70. popl %ebx
  71. lea _GLOBAL_OFFSET_TABLE_+[. - ..L2](%ebx), %ebx
  72. cmpl $2047, %esi
  73. jge ..B1.19
  74. ..B1.4:
  75. testl %esi, %esi
  76. jle ..B1.56
  77. ..B1.5:
  78. movzwl 26(%ebp), %ecx
  79. andl $32752, %ecx
  80. shrl $4, %ecx
  81. cmpl $2047, %ecx
  82. jge ..B1.20
  83. ..B1.6:
  84. testl %ecx, %ecx
  85. jle ..B1.54
  86. ..B1.7:
  87. cmpl $1034, %esi
  88. jl ..B1.11
  89. ..B1.8:
  90. fldl _DBL_MAX_NORMAL@GOTOFF(%ebx)
  91. fmul %st(0), %st
  92. fstpl 8(%esp)
  93. fldl 20(%ebp)
  94. fstl (%esp)
  95. addl $-16, %esp
  96. fstpl (%esp)
  97. movl %ecx, 32(%esp)
  98. call cos@PLT
  99. ..B1.62:
  100. movl 32(%esp), %ecx
  101. addl $16, %esp
  102. testl %ecx, %ecx
  103. fmull 8(%esp)
  104. fmull 12(%ebp)
  105. fstpl 72(%esp)
  106. jle ..B1.10
  107. ..B1.9:
  108. addl $-16, %esp
  109. fldl 16(%esp)
  110. fstpl (%esp)
  111. call sin@PLT
  112. ..B1.63:
  113. addl $16, %esp
  114. fldl 8(%esp)
  115. fmulp %st, %st(1)
  116. fstpl 80(%esp)
  117. jmp ..B1.44
  118. ..B1.10:
  119. fldl 8(%esp)
  120. fmull (%esp)
  121. fstpl 80(%esp)
  122. jmp ..B1.44
  123. ..B1.11:
  124. movzwl 62(%esp), %ecx
  125. movl %ecx, %edx
  126. andl $768, %edx
  127. cmpl $768, %edx
  128. je ..B1.53
  129. ..B1.12:
  130. orl $-64768, %ecx
  131. movw %cx, 60(%esp)
  132. ..B1.13:
  133. fldcw 60(%esp)
  134. ..B1.14:
  135. movl $1, 56(%esp)
  136. ..B1.15:
  137. fldl 12(%ebp)
  138. fstpl 48(%esp)
  139. addl $-32, %esp
  140. fldl 20(%ebp)
  141. lea 32(%esp), %edx
  142. lea 44(%esp), %ecx
  143. fstpt (%esp)
  144. movl %edx, 12(%esp)
  145. movl %ecx, 16(%esp)
  146. call sincosl@PLT
  147. ..B1.16:
  148. fldl 80(%esp)
  149. lea 56(%esp), %edx
  150. lea 68(%esp), %ecx
  151. fstpt (%esp)
  152. movl %edx, 12(%esp)
  153. movl %ecx, 16(%esp)
  154. call sinhcoshl@PLT
  155. ..B1.65:
  156. addl $32, %esp
  157. ..B1.17:
  158. fldt 24(%esp)
  159. fldt 12(%esp)
  160. fmulp %st, %st(1)
  161. fstpl 72(%esp)
  162. fldt 36(%esp)
  163. fldt (%esp)
  164. fmulp %st, %st(1)
  165. fstpl 80(%esp)
  166. cmpl $0, 56(%esp)
  167. je ..B1.44
  168. ..B1.18:
  169. fldcw 62(%esp)
  170. jmp ..B1.44
  171. ..B1.19:
  172. movzwl 26(%ebp), %ecx
  173. andl $32752, %ecx
  174. shrl $4, %ecx
  175. ..B1.20:
  176. testl %ecx, %ecx
  177. jne ..B1.24
  178. ..B1.21:
  179. testl $1048575, 24(%ebp)
  180. jne ..B1.24
  181. ..B1.22:
  182. cmpl $0, 20(%ebp)
  183. jne ..B1.24
  184. ..B1.23:
  185. fldl 12(%ebp)
  186. addl $-16, %esp
  187. fstpl (%esp)
  188. call sinh@PLT
  189. ..B1.66:
  190. fldl 20(%ebp)
  191. addl $16, %esp
  192. fstpl 80(%esp)
  193. fstpl 72(%esp)
  194. jmp ..B1.44
  195. ..B1.24:
  196. cmpl $2047, %ecx
  197. jge ..B1.38
  198. ..B1.25:
  199. movl 16(%ebp), %edx
  200. andl $1048575, %edx
  201. testl %esi, %esi
  202. jne ..B1.32
  203. ..B1.26:
  204. testl %edx, %edx
  205. jne ..B1.37
  206. ..B1.27:
  207. cmpl $0, 12(%ebp)
  208. jne ..B1.33
  209. ..B1.28:
  210. fldl 20(%ebp)
  211. addl $-16, %esp
  212. fstl (%esp)
  213. fstpl 16(%esp)
  214. movl %ecx, 32(%esp)
  215. call cos@PLT
  216. ..B1.67:
  217. fldl 16(%esp)
  218. fxch %st(1)
  219. fmull 12(%ebp)
  220. movl 32(%esp), %ecx
  221. addl $16, %esp
  222. fstpl 72(%esp)
  223. testl %ecx, %ecx
  224. jle ..B1.31
  225. ..B1.29:
  226. addl $-16, %esp
  227. fstpl (%esp)
  228. call sin@PLT
  229. ..B1.68:
  230. addl $16, %esp
  231. ..B1.31:
  232. fldl _DBL_MAX_NORMAL@GOTOFF(%ebx)
  233. fxch %st(1)
  234. fstpl 80(%esp)
  235. fsubl _DBL_MIN_NORMAL@GOTOFF(%ebx)
  236. fstpl 64(%esp)
  237. jmp ..B1.44
  238. ..B1.32:
  239. testl %edx, %edx
  240. jne ..B1.37
  241. ..B1.73:
  242. cmpl $0, 12(%ebp)
  243. ..B1.33:
  244. jne ..B1.37
  245. ..B1.34:
  246. fldl 12(%ebp)
  247. cmpl $1023, %ecx
  248. fstl 16(%esp)
  249. fmul %st(0), %st
  250. fstpl 24(%esp)
  251. jge ..B1.36
  252. ..B1.35:
  253. fldl 16(%esp)
  254. fstpl 72(%esp)
  255. fldl 24(%esp)
  256. fmull 20(%ebp)
  257. fstpl 80(%esp)
  258. jmp ..B1.44
  259. ..B1.36:
  260. fldl 20(%ebp)
  261. fstl 8(%esp)
  262. addl $-16, %esp
  263. fstpl (%esp)
  264. call sin@PLT
  265. ..B1.70:
  266. addl $16, %esp
  267. fstpl (%esp)
  268. addl $-16, %esp
  269. fldl 24(%esp)
  270. fstpl (%esp)
  271. call cos@PLT
  272. ..B1.69:
  273. addl $16, %esp
  274. fldl 16(%esp)
  275. fmulp %st, %st(1)
  276. fstpl 72(%esp)
  277. fldl 24(%esp)
  278. fmull (%esp)
  279. fstpl 80(%esp)
  280. jmp ..B1.44
  281. ..B1.37:
  282. fldl 12(%ebp)
  283. fmul %st(0), %st
  284. fstl 72(%esp)
  285. fstpl 80(%esp)
  286. jmp ..B1.44
  287. ..B1.38:
  288. fldl 20(%ebp)
  289. addl $-16, %esp
  290. fstpl (%esp)
  291. call sin@PLT
  292. ..B1.71:
  293. addl $16, %esp
  294. fstl 80(%esp)
  295. cmpl $2047, %esi
  296. je ..B1.42
  297. ..B1.39:
  298. testl %esi, %esi
  299. jne ..B1.43
  300. ..B1.40:
  301. testl $1048575, 16(%ebp)
  302. jne ..B1.43
  303. ..B1.41:
  304. cmpl $0, 12(%ebp)
  305. jne ..B1.43
  306. ..B1.42:
  307. fstp %st(0)
  308. fldl 12(%ebp)
  309. addl $-16, %esp
  310. fstpl (%esp)
  311. call sinh@PLT
  312. ..B1.72:
  313. addl $16, %esp
  314. fstpl 72(%esp)
  315. jmp ..B1.44
  316. ..B1.43:
  317. fldl 12(%ebp)
  318. fmulp %st, %st(1)
  319. fstpl 72(%esp)
  320. ..B1.44:
  321. movzwl 78(%esp), %edx
  322. testl $32752, %edx
  323. jne ..B1.47
  324. ..B1.45:
  325. testl $1048575, 76(%esp)
  326. jne ..B1.50
  327. ..B1.46:
  328. cmpl $0, 72(%esp)
  329. jne ..B1.50
  330. ..B1.47:
  331. movzwl 86(%esp), %edx
  332. testl $32752, %edx
  333. jne ..B1.51
  334. ..B1.48:
  335. testl $1048575, 84(%esp)
  336. jne ..B1.50
  337. ..B1.49:
  338. cmpl $0, 80(%esp)
  339. je ..B1.51
  340. ..B1.50:
  341. fldl _DBL_MIN_NORMAL@GOTOFF(%ebx)
  342. fmul %st(0), %st
  343. fstpl 64(%esp)
  344. ..B1.51:
  345. movl 72(%esp), %edx
  346. movl %edx, (%edi)
  347. movl 76(%esp), %ecx
  348. movl 80(%esp), %esi
  349. movl 84(%esp), %edx
  350. movl %ecx, 4(%edi)
  351. movl %esi, 8(%edi)
  352. movl %edx, 12(%edi)
  353. movl 88(%esp), %edx
  354. xorl %esp, %edx
  355. cmpl %gs:20, %edx
  356. jne ..B1.59
  357. ..B1.52:
  358. movl %edi, %eax
  359. addl $116, %esp
  360. popl %ebx
  361. popl %edi
  362. popl %esi
  363. movl %ebp, %esp
  364. popl %ebp
  365. ret $4
  366. ..B1.53:
  367. movl $0, 56(%esp)
  368. jmp ..B1.15
  369. ..B1.54:
  370. testl $1048575, 24(%ebp)
  371. jne ..B1.7
  372. ..B1.55:
  373. cmpl $0, 20(%ebp)
  374. jne ..B1.7
  375. jmp ..B1.20
  376. ..B1.56:
  377. testl $1048575, 16(%ebp)
  378. jne ..B1.5
  379. ..B1.57:
  380. cmpl $0, 12(%ebp)
  381. jne ..B1.5
  382. jmp ..B1.19
  383. ..B1.59:
  384. call __stack_chk_fail@PLT
  385. .align 16,0x90
  386. .type csinh,@function
  387. .size csinh,.-csinh
  388. .data
  389. # -- End csinh
  390. .section .rodata, "a"
  391. .align 16
  392. .align 16
  393. _DBL_MAX_NORMAL:
  394. .long -1
  395. .long 2146435071
  396. .type _DBL_MAX_NORMAL,@object
  397. .size _DBL_MAX_NORMAL,8
  398. .space 8, 0x00 # pad
  399. .align 16
  400. _DBL_MIN_NORMAL:
  401. .long 0
  402. .long 1048576
  403. .type _DBL_MIN_NORMAL,@object
  404. .size _DBL_MIN_NORMAL,8
  405. .data
  406. .section .note.GNU-stack, ""
  407. # End