ctanh.S 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565
  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 "ctanh.c"
  38. .text
  39. ..TXTST0:
  40. # -- Begin ctanh
  41. .text
  42. .align 16,0x90
  43. .globl ctanh
  44. ctanh:
  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), %esi
  58. xorl %esp, %edx
  59. movl %edx, 80(%esp)
  60. fstl 64(%esp)
  61. fstpl 72(%esp)
  62. ..B1.2:
  63. fnstcw 50(%esp)
  64. ..B1.3:
  65. movzwl 18(%ebp), %edx
  66. andl $32752, %edx
  67. shrl $4, %edx
  68. call ..L2
  69. ..L2:
  70. popl %ebx
  71. lea _GLOBAL_OFFSET_TABLE_+[. - ..L2](%ebx), %ebx
  72. cmpl $2047, %edx
  73. jge ..B1.31
  74. ..B1.4:
  75. testl %edx, %edx
  76. jle ..B1.54
  77. ..B1.5:
  78. movzwl 26(%ebp), %ecx
  79. andl $32752, %ecx
  80. shrl $4, %ecx
  81. cmpl $2047, %ecx
  82. jge ..B1.32
  83. ..B1.6:
  84. cmpl $1032, %edx
  85. jl ..B1.23
  86. ..B1.7:
  87. fldl _DBL_MIN_NORMAL@GOTOFF(%ebx)
  88. movzbl 19(%ebp), %edx
  89. andl $128, %edx
  90. shrl $7, %edx
  91. testl %ecx, %ecx
  92. fldl ones@GOTOFF(%ebx,%edx,8)
  93. fsub %st(1), %st
  94. fstpl 64(%esp)
  95. jne ..B1.15
  96. ..B1.8:
  97. testl $1048575, 24(%ebp)
  98. jne ..B1.13
  99. ..B1.9:
  100. cmpl $0, 20(%ebp)
  101. jne ..B1.13
  102. ..B1.10:
  103. fstp %st(0)
  104. movzbl 27(%ebp), %edx
  105. testl $128, %edx
  106. jne ..B1.12
  107. ..B1.11:
  108. fldl _DBL_PZERO@GOTOFF(%ebx)
  109. fstpl 72(%esp)
  110. jmp ..B1.44
  111. ..B1.12:
  112. fldl _DBL_NZERO@GOTOFF(%ebx)
  113. fstpl 72(%esp)
  114. jmp ..B1.44
  115. ..B1.13:
  116. fldl 20(%ebp)
  117. jmp ..B1.16
  118. ..B1.15:
  119. fldl 20(%ebp)
  120. jne ..B1.19
  121. ..B1.16:
  122. movzbl 27(%ebp), %edx
  123. testl $128, %edx
  124. fadd %st(0), %st
  125. fstpl 56(%esp)
  126. jne ..B1.18
  127. ..B1.17:
  128. fldl _DBL_PZERO@GOTOFF(%ebx)
  129. fstpl 72(%esp)
  130. jmp ..B1.22
  131. ..B1.18:
  132. fldl _DBL_NZERO@GOTOFF(%ebx)
  133. fstpl 72(%esp)
  134. jmp ..B1.22
  135. ..B1.19:
  136. addl $-16, %esp
  137. fstl (%esp)
  138. fstpl 24(%esp)
  139. fstpl 40(%esp)
  140. call sin@PLT
  141. ..B1.104:
  142. fldl 40(%esp)
  143. fldl 24(%esp)
  144. addl $16, %esp
  145. fxch %st(2)
  146. fstpl (%esp)
  147. addl $-16, %esp
  148. fxch %st(1)
  149. fstpl (%esp)
  150. fstpl 40(%esp)
  151. call cos@PLT
  152. ..B1.103:
  153. fldl 40(%esp)
  154. addl $16, %esp
  155. fldl (%esp)
  156. fmulp %st, %st(2)
  157. fxch %st(1)
  158. fstpl 16(%esp)
  159. movzbl 23(%esp), %edx
  160. testl $128, %edx
  161. jne ..B1.21
  162. ..B1.20:
  163. fldl _DBL_PZERO@GOTOFF(%ebx)
  164. fstpl 72(%esp)
  165. jmp ..B1.22
  166. ..B1.21:
  167. fldl _DBL_NZERO@GOTOFF(%ebx)
  168. fstpl 72(%esp)
  169. ..B1.22:
  170. fmul %st(0), %st
  171. fstpl 56(%esp)
  172. jmp ..B1.44
  173. ..B1.23:
  174. movzwl 50(%esp), %ecx
  175. movl %ecx, %edx
  176. andl $768, %edx
  177. cmpl $768, %edx
  178. je ..B1.53
  179. ..B1.24:
  180. orl $-64768, %ecx
  181. movw %cx, 48(%esp)
  182. ..B1.25:
  183. fldcw 48(%esp)
  184. ..B1.26:
  185. movl $1, %edi
  186. ..B1.27:
  187. fldl 12(%ebp)
  188. addl $-32, %esp
  189. lea 32(%esp), %edx
  190. lea 44(%esp), %ecx
  191. fstpt (%esp)
  192. movl %edx, 12(%esp)
  193. movl %ecx, 16(%esp)
  194. call sinhcoshl@PLT
  195. ..B1.28:
  196. fldl 20(%ebp)
  197. lea 56(%esp), %edx
  198. lea 68(%esp), %ecx
  199. fstpt (%esp)
  200. movl %edx, 12(%esp)
  201. movl %ecx, 16(%esp)
  202. call sincosl@PLT
  203. ..B1.106:
  204. addl $32, %esp
  205. ..B1.29:
  206. fldt (%esp)
  207. testl %edi, %edi
  208. fld %st(0)
  209. fmul %st(1), %st
  210. fldt 36(%esp)
  211. fld %st(0)
  212. fmul %st(1), %st
  213. faddp %st, %st(2)
  214. fldt 12(%esp)
  215. fmulp %st, %st(3)
  216. fxch %st(1)
  217. fdivr %st, %st(2)
  218. fxch %st(2)
  219. fstpl 64(%esp)
  220. fldt 24(%esp)
  221. fmulp %st, %st(1)
  222. fdivp %st, %st(1)
  223. fstpl 72(%esp)
  224. je ..B1.44
  225. ..B1.30:
  226. fldcw 50(%esp)
  227. jmp ..B1.44
  228. ..B1.31:
  229. movzwl 26(%ebp), %ecx
  230. andl $32752, %ecx
  231. shrl $4, %ecx
  232. ..B1.32:
  233. cmpl $2047, %edx
  234. je ..B1.62
  235. ..B1.33:
  236. cmpl $2047, %ecx
  237. je ..B1.58
  238. ..B1.34:
  239. testl %edx, %edx
  240. jne ..B1.43
  241. ..B1.35:
  242. testl $1048575, 16(%ebp)
  243. jne ..B1.43
  244. ..B1.36:
  245. cmpl $0, 12(%ebp)
  246. jne ..B1.43
  247. ..B1.37:
  248. testl %ecx, %ecx
  249. jne ..B1.41
  250. ..B1.38:
  251. testl $1048575, 24(%ebp)
  252. jne ..B1.41
  253. ..B1.39:
  254. cmpl $0, 20(%ebp)
  255. jne ..B1.41
  256. ..B1.40:
  257. fldl 12(%ebp)
  258. fstpl 64(%esp)
  259. fldl 20(%ebp)
  260. fstpl 72(%esp)
  261. jmp ..B1.44
  262. ..B1.41:
  263. cmpl $2047, %ecx
  264. jge ..B1.44
  265. ..B1.42:
  266. fldl 12(%ebp)
  267. fstpl 64(%esp)
  268. addl $-16, %esp
  269. fldl 20(%ebp)
  270. fstpl (%esp)
  271. call tan@PLT
  272. ..B1.107:
  273. addl $16, %esp
  274. fstpl 72(%esp)
  275. jmp ..B1.44
  276. ..B1.43:
  277. fldl 12(%ebp)
  278. addl $-16, %esp
  279. fstpl (%esp)
  280. call tanh@PLT
  281. ..B1.108:
  282. fldl 20(%ebp)
  283. addl $16, %esp
  284. fstpl 72(%esp)
  285. fstpl 64(%esp)
  286. ..B1.44:
  287. movzwl 70(%esp), %edx
  288. testl $32752, %edx
  289. jne ..B1.47
  290. ..B1.45:
  291. testl $1048575, 68(%esp)
  292. jne ..B1.50
  293. ..B1.46:
  294. cmpl $0, 64(%esp)
  295. jne ..B1.50
  296. ..B1.47:
  297. movzwl 78(%esp), %edx
  298. testl $32752, %edx
  299. jne ..B1.51
  300. ..B1.48:
  301. testl $1048575, 76(%esp)
  302. jne ..B1.50
  303. ..B1.49:
  304. cmpl $0, 72(%esp)
  305. je ..B1.51
  306. ..B1.50:
  307. fldl _DBL_MIN_NORMAL@GOTOFF(%ebx)
  308. fmul %st(0), %st
  309. fstpl 56(%esp)
  310. ..B1.51:
  311. movl 64(%esp), %edx
  312. movl %edx, (%esi)
  313. movl 68(%esp), %ecx
  314. movl 72(%esp), %edi
  315. movl 76(%esp), %edx
  316. movl %ecx, 4(%esi)
  317. movl %edi, 8(%esi)
  318. movl %edx, 12(%esi)
  319. movl 80(%esp), %edx
  320. xorl %esp, %edx
  321. cmpl %gs:20, %edx
  322. jne ..B1.57
  323. ..B1.52:
  324. movl %esi, %eax
  325. addl $116, %esp
  326. popl %ebx
  327. popl %edi
  328. popl %esi
  329. movl %ebp, %esp
  330. popl %ebp
  331. ret $4
  332. ..B1.53:
  333. xorl %edi, %edi
  334. jmp ..B1.27
  335. ..B1.54:
  336. testl $1048575, 16(%ebp)
  337. jne ..B1.5
  338. ..B1.55:
  339. cmpl $0, 12(%ebp)
  340. jne ..B1.5
  341. jmp ..B1.31
  342. ..B1.57:
  343. call __stack_chk_fail@PLT
  344. ..B1.58:
  345. testl $1048575, 24(%ebp)
  346. jne ..B1.61
  347. ..B1.59:
  348. cmpl $0, 20(%ebp)
  349. jne ..B1.61
  350. ..B1.60:
  351. fldl 20(%ebp)
  352. addl $-16, %esp
  353. fstpl (%esp)
  354. call tan@PLT
  355. ..B1.109:
  356. addl $16, %esp
  357. fstl 64(%esp)
  358. fstpl 72(%esp)
  359. jmp ..B1.44
  360. ..B1.61:
  361. fldl 20(%ebp)
  362. fmul %st(0), %st
  363. fstl 64(%esp)
  364. fstpl 72(%esp)
  365. jmp ..B1.44
  366. ..B1.62:
  367. testl $1048575, 16(%ebp)
  368. jne ..B1.80
  369. ..B1.63:
  370. cmpl $0, 12(%ebp)
  371. jne ..B1.112
  372. ..B1.64:
  373. movzbl 19(%ebp), %edx
  374. andl $128, %edx
  375. shrl $7, %edx
  376. testl %ecx, %ecx
  377. fldl ones@GOTOFF(%ebx,%edx,8)
  378. fstpl 64(%esp)
  379. jne ..B1.70
  380. ..B1.65:
  381. testl $1048575, 24(%ebp)
  382. jne ..B1.71
  383. ..B1.66:
  384. cmpl $0, 20(%ebp)
  385. jne ..B1.71
  386. ..B1.67:
  387. movzbl 27(%ebp), %edx
  388. testl $128, %edx
  389. jne ..B1.69
  390. ..B1.68:
  391. fldl _DBL_PZERO@GOTOFF(%ebx)
  392. fstpl 72(%esp)
  393. jmp ..B1.44
  394. ..B1.69:
  395. fldl _DBL_NZERO@GOTOFF(%ebx)
  396. fstpl 72(%esp)
  397. jmp ..B1.44
  398. ..B1.70:
  399. cmpl $2047, %ecx
  400. je ..B1.92
  401. ..B1.71:
  402. cmpl $1023, %ecx
  403. jge ..B1.77
  404. ..B1.72:
  405. testl %ecx, %ecx
  406. jne ..B1.74
  407. ..B1.73:
  408. fldl 20(%ebp)
  409. fadd %st(0), %st
  410. fstpl 56(%esp)
  411. ..B1.74:
  412. movzbl 27(%ebp), %edx
  413. testl $128, %edx
  414. jne ..B1.76
  415. ..B1.75:
  416. fldl _DBL_PZERO@GOTOFF(%ebx)
  417. fstpl 72(%esp)
  418. jmp ..B1.44
  419. ..B1.76:
  420. fldl _DBL_NZERO@GOTOFF(%ebx)
  421. fstpl 72(%esp)
  422. jmp ..B1.44
  423. ..B1.77:
  424. fldl 20(%ebp)
  425. fstl 8(%esp)
  426. addl $-16, %esp
  427. fstpl (%esp)
  428. call sin@PLT
  429. ..B1.111:
  430. addl $16, %esp
  431. fstpl (%esp)
  432. addl $-16, %esp
  433. fldl 24(%esp)
  434. fstpl (%esp)
  435. call cos@PLT
  436. ..B1.110:
  437. addl $16, %esp
  438. fldl (%esp)
  439. fmulp %st, %st(1)
  440. fstpl 16(%esp)
  441. movzbl 23(%esp), %edx
  442. testl $128, %edx
  443. jne ..B1.79
  444. ..B1.78:
  445. fldl _DBL_PZERO@GOTOFF(%ebx)
  446. fstpl 72(%esp)
  447. jmp ..B1.44
  448. ..B1.79:
  449. fldl _DBL_NZERO@GOTOFF(%ebx)
  450. fstpl 72(%esp)
  451. jmp ..B1.44
  452. ..B1.80:
  453. jne ..B1.82
  454. ..B1.81:
  455. cmpl $0, 12(%ebp)
  456. je ..B1.33
  457. ..B1.82:
  458. fldl 12(%ebp)
  459. testl %ecx, %ecx
  460. fmul %st(0), %st
  461. fstl 64(%esp)
  462. jne ..B1.90
  463. ..B1.83:
  464. testl $1048575, 24(%ebp)
  465. jne ..B1.91
  466. ..B1.84:
  467. cmpl $0, 20(%ebp)
  468. jne ..B1.91
  469. ..B1.85:
  470. fstp %st(0)
  471. movzbl 27(%ebp), %edx
  472. testl $128, %edx
  473. jne ..B1.87
  474. ..B1.86:
  475. fldl _DBL_PZERO@GOTOFF(%ebx)
  476. fstpl 72(%esp)
  477. jmp ..B1.44
  478. ..B1.87:
  479. fldl _DBL_NZERO@GOTOFF(%ebx)
  480. fstpl 72(%esp)
  481. jmp ..B1.44
  482. ..B1.90:
  483. cmpl $2047, %ecx
  484. je ..B1.98
  485. ..B1.91:
  486. fstpl 72(%esp)
  487. jmp ..B1.44
  488. ..B1.92:
  489. testl $1048575, 24(%ebp)
  490. jne ..B1.97
  491. ..B1.93:
  492. cmpl $0, 20(%ebp)
  493. jne ..B1.97
  494. ..B1.94:
  495. movzbl 27(%ebp), %edx
  496. testl $128, %edx
  497. jne ..B1.96
  498. ..B1.95:
  499. fldl _DBL_PZERO@GOTOFF(%ebx)
  500. fstpl 72(%esp)
  501. jmp ..B1.44
  502. ..B1.96:
  503. fldl _DBL_NZERO@GOTOFF(%ebx)
  504. fstpl 72(%esp)
  505. jmp ..B1.44
  506. ..B1.97:
  507. fldl _DBL_PZERO@GOTOFF(%ebx)
  508. fstpl 72(%esp)
  509. fldl 20(%ebp)
  510. fmul %st(0), %st
  511. fstpl 56(%esp)
  512. jmp ..B1.44
  513. ..B1.98:
  514. testl $1048575, 24(%ebp)
  515. jne ..B1.100
  516. ..B1.99:
  517. cmpl $0, 20(%ebp)
  518. je ..B1.91
  519. ..B1.100:
  520. fstp %st(0)
  521. fldl 20(%ebp)
  522. fmul %st(0), %st
  523. fstpl 72(%esp)
  524. jmp ..B1.44
  525. ..B1.112:
  526. testl $1048575, 16(%ebp)
  527. jne ..B1.82
  528. jmp ..B1.81
  529. .align 16,0x90
  530. .type ctanh,@function
  531. .size ctanh,.-ctanh
  532. .data
  533. # -- End ctanh
  534. .section .rodata, "a"
  535. .align 16
  536. .align 16
  537. _DBL_MIN_NORMAL:
  538. .long 0
  539. .long 1048576
  540. .type _DBL_MIN_NORMAL,@object
  541. .size _DBL_MIN_NORMAL,8
  542. .space 8, 0x00 # pad
  543. .align 16
  544. ones:
  545. .long 0x00000000,0x3ff00000
  546. .long 0x00000000,0xbff00000
  547. .type ones,@object
  548. .size ones,16
  549. .align 16
  550. _DBL_PZERO:
  551. .long 0
  552. .long 0
  553. .type _DBL_PZERO,@object
  554. .size _DBL_PZERO,8
  555. .space 8, 0x00 # pad
  556. .align 16
  557. _DBL_NZERO:
  558. .long 0
  559. .long -2147483648
  560. .type _DBL_NZERO,@object
  561. .size _DBL_NZERO,8
  562. .data
  563. .section .note.GNU-stack, ""
  564. # End