ctanhf.S 12 KB

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