casinhf.S 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630
  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 "casinhf.c"
  38. .text
  39. ..TXTST0:
  40. # -- Begin casinhf
  41. .text
  42. .align 16,0x90
  43. .globl casinhf
  44. casinhf:
  45. # parameter 1: 8 + %ebp
  46. ..B1.1:
  47. ..L1:
  48. pushl %ebp
  49. movl %esp, %ebp
  50. andl $-16, %esp
  51. pushl %edi
  52. pushl %ebx
  53. subl $120, %esp
  54. fldz
  55. movzwl 10(%ebp), %eax
  56. andl $32640, %eax
  57. shrl $7, %eax
  58. call ..L2
  59. ..L2:
  60. popl %ebx
  61. lea _GLOBAL_OFFSET_TABLE_+[. - ..L2](%ebx), %ebx
  62. cmpl $255, %eax
  63. fsts 104(%esp)
  64. fsts 108(%esp)
  65. jge ..B1.28
  66. ..B1.2:
  67. testl %eax, %eax
  68. jle ..B1.57
  69. ..B1.3:
  70. movzwl 14(%ebp), %edx
  71. andl $32640, %edx
  72. shrl $7, %edx
  73. cmpl $255, %edx
  74. jge ..B1.29
  75. ..B1.4:
  76. testl %edx, %edx
  77. jle ..B1.56
  78. ..B1.5:
  79. flds 12(%ebp)
  80. fsts 100(%esp)
  81. fld1
  82. fsts 92(%esp)
  83. fxch %st(1)
  84. fabs
  85. fld %st(0)
  86. fsub %st(2), %st
  87. fld %st(0)
  88. fmul %st(1), %st
  89. fld %st(2)
  90. faddp %st, %st(4)
  91. fxch %st(3)
  92. fstl 48(%esp)
  93. fmul %st(0), %st
  94. fxch %st(1)
  95. fstl 72(%esp)
  96. flds 8(%ebp)
  97. fsts 96(%esp)
  98. fabs
  99. fld %st(0)
  100. fmul %st(1), %st
  101. fstl 56(%esp)
  102. fadd %st, %st(5)
  103. fxch %st(5)
  104. fsqrt
  105. fstl 64(%esp)
  106. fxch %st(5)
  107. faddp %st, %st(3)
  108. fxch %st(2)
  109. fsqrt
  110. fld %st(0)
  111. fadd %st(5), %st
  112. fxch %st(5)
  113. fucomp %st(2)
  114. fnstsw %ax
  115. fxch %st(1)
  116. fstp %st(0)
  117. fldl .L_2il0floatpacket.6@GOTOFF(%ebx)
  118. fmul %st, %st(4)
  119. sahf
  120. jp ..B1.6
  121. je ..B1.7
  122. ..B1.6:
  123. fldl 64(%esp)
  124. fsubl 72(%esp)
  125. fstpl 40(%esp)
  126. jmp ..B1.8
  127. ..B1.7:
  128. fxch %st(2)
  129. fstl 40(%esp)
  130. fxch %st(2)
  131. ..B1.8:
  132. fldl _Bcross@GOTOFF(%ebx)
  133. fmul %st(5), %st
  134. fcomp %st(4)
  135. fnstsw %ax
  136. sahf
  137. jb ..B1.10
  138. ..B1.9:
  139. fstp %st(2)
  140. fld %st(2)
  141. fdiv %st(4), %st
  142. fstpl (%esp)
  143. fxch %st(2)
  144. fstps 80(%esp)
  145. fxch %st(1)
  146. fstpl 16(%esp)
  147. fstpl 24(%esp)
  148. fstpl 32(%esp)
  149. fstps 84(%esp)
  150. call asin@PLT
  151. jmp ..B1.85
  152. ..B1.10:
  153. flds 92(%esp)
  154. fcomp %st(4)
  155. fnstsw %ax
  156. sahf
  157. jb ..B1.12
  158. ..B1.11:
  159. fstp %st(2)
  160. fldl 48(%esp)
  161. fadd %st(1), %st
  162. fld %st(4)
  163. fadd %st(4), %st
  164. fmul %st(3), %st
  165. fxch %st(1)
  166. fdivrl 56(%esp)
  167. faddl 40(%esp)
  168. fmulp %st, %st(1)
  169. fsqrt
  170. fstpl 8(%esp)
  171. fxch %st(2)
  172. fstl (%esp)
  173. fstps 80(%esp)
  174. fxch %st(1)
  175. fstpl 16(%esp)
  176. fstpl 24(%esp)
  177. fstpl 32(%esp)
  178. fstps 84(%esp)
  179. call atan2@PLT
  180. jmp ..B1.85
  181. ..B1.12:
  182. fldl 48(%esp)
  183. fadd %st(2), %st
  184. fxch %st(2)
  185. fstpl 16(%esp)
  186. fld %st(4)
  187. fadd %st(4), %st
  188. fdiv %st, %st(2)
  189. fldl 72(%esp)
  190. faddl 64(%esp)
  191. fdivrp %st, %st(1)
  192. faddp %st, %st(2)
  193. fmul %st, %st(1)
  194. fxch %st(1)
  195. fsqrt
  196. fmulp %st, %st(2)
  197. fxch %st(1)
  198. fstpl 8(%esp)
  199. fxch %st(1)
  200. fstl (%esp)
  201. fstps 80(%esp)
  202. fstpl 24(%esp)
  203. fstpl 32(%esp)
  204. fstps 84(%esp)
  205. fldl 16(%esp)
  206. fstpl 16(%esp)
  207. call atan2@PLT
  208. ..B1.85:
  209. flds 84(%esp)
  210. fxch %st(1)
  211. fstps 108(%esp)
  212. fldl 32(%esp)
  213. fldl 24(%esp)
  214. fldl 16(%esp)
  215. flds 80(%esp)
  216. ..B1.13:
  217. fldl _Across@GOTOFF(%ebx)
  218. fcomp %st(4)
  219. fnstsw %ax
  220. sahf
  221. jb ..B1.18
  222. ..B1.14:
  223. flds 92(%esp)
  224. fcompp
  225. fnstsw %ax
  226. faddl 48(%esp)
  227. fdivrl 56(%esp)
  228. sahf
  229. jbe ..B1.16
  230. ..B1.15:
  231. fldl 56(%esp)
  232. fdivl 40(%esp)
  233. faddp %st, %st(1)
  234. fmulp %st, %st(1)
  235. jmp ..B1.17
  236. ..B1.16:
  237. fldl 72(%esp)
  238. faddl 64(%esp)
  239. faddp %st, %st(1)
  240. fmulp %st, %st(1)
  241. ..B1.17:
  242. fxch %st(1)
  243. fadds 92(%esp)
  244. fmul %st(1), %st
  245. fsqrt
  246. faddp %st, %st(1)
  247. fstpl (%esp)
  248. fstps 84(%esp)
  249. call log1p@PLT
  250. jmp ..B1.87
  251. ..B1.18:
  252. fstp %st(1)
  253. fstp %st(1)
  254. fstp %st(0)
  255. fld %st(0)
  256. fmul %st(1), %st
  257. fsubs 92(%esp)
  258. fsqrt
  259. faddp %st, %st(1)
  260. fstpl (%esp)
  261. fstps 84(%esp)
  262. call log@PLT
  263. ..B1.87:
  264. flds 84(%esp)
  265. fxch %st(1)
  266. fstps 104(%esp)
  267. ..B1.19:
  268. fcoms 100(%esp)
  269. fnstsw %ax
  270. sahf
  271. jbe ..B1.21
  272. ..B1.20:
  273. movzbl 111(%esp), %edi
  274. movl %edi, %eax
  275. shrl $7, %edi
  276. andl $127, %eax
  277. notl %edi
  278. shll $7, %edi
  279. orl %edi, %eax
  280. movb %al, 111(%esp)
  281. ..B1.21:
  282. fcomps 96(%esp)
  283. fnstsw %ax
  284. sahf
  285. jbe ..B1.23
  286. ..B1.22:
  287. movzbl 107(%esp), %edi
  288. movl %edi, %eax
  289. shrl $7, %edi
  290. andl $127, %eax
  291. notl %edi
  292. shll $7, %edi
  293. orl %edi, %eax
  294. movb %al, 107(%esp)
  295. ..B1.23:
  296. movzwl 106(%esp), %eax
  297. testl $32640, %eax
  298. jne ..B1.25
  299. ..B1.24:
  300. testl $8388607, 104(%esp)
  301. jne ..B1.27
  302. ..B1.25:
  303. movzwl 110(%esp), %eax
  304. testl $32640, %eax
  305. jne ..B1.55
  306. ..B1.26:
  307. testl $8388607, 108(%esp)
  308. je ..B1.55
  309. ..B1.27:
  310. flds .L_2il0floatpacket.9@GOTOFF(%ebx)
  311. fmul %st(0), %st
  312. fstps 88(%esp)
  313. jmp ..B1.55
  314. ..B1.28:
  315. movzwl 14(%ebp), %edx
  316. andl $32640, %edx
  317. shrl $7, %edx
  318. ..B1.29:
  319. testl %edx, %edx
  320. jne ..B1.32
  321. ..B1.30:
  322. testl $8388607, 12(%ebp)
  323. jne ..B1.32
  324. ..B1.31:
  325. fstp %st(0)
  326. addl $4, %esp
  327. pushl 8(%ebp)
  328. call asinhf@PLT
  329. ..B1.88:
  330. movl 12(%ebp), %eax
  331. fstps 104(%esp)
  332. movl %eax, 108(%esp)
  333. jmp ..B1.55
  334. ..B1.32:
  335. testl %eax, %eax
  336. jne ..B1.43
  337. ..B1.33:
  338. testl $8388607, 8(%ebp)
  339. jne ..B1.44
  340. ..B1.34:
  341. cmpl $255, %edx
  342. jl ..B1.36
  343. ..B1.35:
  344. testl $8388607, 12(%ebp)
  345. jne ..B1.44
  346. ..B1.36:
  347. cmpl $127, %edx
  348. jl ..B1.41
  349. ..B1.37:
  350. fstp %st(0)
  351. flds 12(%ebp)
  352. movzbl 15(%ebp), %edi
  353. andl $128, %edi
  354. shrl $7, %edi
  355. fmuls ones@GOTOFF(%ebx,%edi,4)
  356. fstps (%esp)
  357. call acoshf@PLT
  358. ..B1.89:
  359. fstps 104(%esp)
  360. testl %edi, %edi
  361. je ..B1.39
  362. ..B1.38:
  363. flds .L_2il0floatpacket.7@GOTOFF(%ebx)
  364. jmp ..B1.40
  365. ..B1.39:
  366. flds .L_2il0floatpacket.8@GOTOFF(%ebx)
  367. ..B1.40:
  368. flds .L_2il0floatpacket.9@GOTOFF(%ebx)
  369. fadd %st(1), %st
  370. fstps 88(%esp)
  371. fstps 108(%esp)
  372. flds 104(%esp)
  373. jmp ..B1.42
  374. ..B1.41:
  375. movl 12(%ebp), %eax
  376. movl %eax, (%esp)
  377. fstps 84(%esp)
  378. call asinf@PLT
  379. ..B1.90:
  380. flds 84(%esp)
  381. fxch %st(1)
  382. fstps 108(%esp)
  383. ..B1.42:
  384. movzbl 11(%ebp), %eax
  385. andl $128, %eax
  386. shrl $7, %eax
  387. fmuls ones@GOTOFF(%ebx,%eax,4)
  388. fstps 104(%esp)
  389. jmp ..B1.55
  390. ..B1.43:
  391. cmpl $255, %eax
  392. je ..B1.74
  393. ..B1.44:
  394. cmpl $255, %edx
  395. je ..B1.71
  396. ..B1.93:
  397. cmpl $255, %eax
  398. ..B1.45:
  399. je ..B1.59
  400. ..B1.96:
  401. fstp %st(0)
  402. ..B1.46:
  403. jge ..B1.54
  404. ..B1.47:
  405. movzbl 15(%ebp), %eax
  406. testl $128, %eax
  407. je ..B1.49
  408. ..B1.48:
  409. flds .L_2il0floatpacket.7@GOTOFF(%ebx)
  410. jmp ..B1.50
  411. ..B1.49:
  412. flds .L_2il0floatpacket.8@GOTOFF(%ebx)
  413. ..B1.50:
  414. movzbl 11(%ebp), %eax
  415. testl $128, %eax
  416. fsts 108(%esp)
  417. je ..B1.52
  418. ..B1.51:
  419. movl $-8388608, %eax
  420. jmp ..B1.53
  421. ..B1.52:
  422. movl $2139095040, %eax
  423. ..B1.53:
  424. movl %eax, 104(%esp)
  425. movl 8(%ebp), %eax
  426. fadds .L_2il0floatpacket.9@GOTOFF(%ebx)
  427. fstps 88(%esp)
  428. movl %eax, 88(%esp)
  429. jmp ..B1.55
  430. ..B1.54:
  431. flds 8(%ebp)
  432. fmul %st(0), %st
  433. movl 12(%ebp), %eax
  434. movl %eax, 104(%esp)
  435. fstps 108(%esp)
  436. ..B1.55:
  437. movl 104(%esp), %eax
  438. movl 108(%esp), %edx
  439. addl $120, %esp
  440. popl %ebx
  441. popl %edi
  442. movl %ebp, %esp
  443. popl %ebp
  444. ret
  445. ..B1.56:
  446. testl $8388607, 12(%ebp)
  447. jne ..B1.5
  448. jmp ..B1.29
  449. ..B1.57:
  450. testl $8388607, 8(%ebp)
  451. jne ..B1.3
  452. jmp ..B1.28
  453. ..B1.59:
  454. testl $8388607, 8(%ebp)
  455. jne ..B1.92
  456. ..B1.60:
  457. movl 8(%ebp), %eax
  458. cmpl $255, %edx
  459. movl %eax, 104(%esp)
  460. jge ..B1.65
  461. ..B1.61:
  462. movzbl 15(%ebp), %eax
  463. testl $128, %eax
  464. je ..B1.64
  465. ..B1.62:
  466. fstp %st(0)
  467. flds .L_2il0floatpacket.10@GOTOFF(%ebx)
  468. ..B1.64:
  469. movl 12(%ebp), %eax
  470. fstps 108(%esp)
  471. movl %eax, 88(%esp)
  472. jmp ..B1.55
  473. ..B1.65:
  474. fstp %st(0)
  475. testl $8388607, 12(%ebp)
  476. jne ..B1.70
  477. ..B1.66:
  478. movzbl 15(%ebp), %eax
  479. testl $128, %eax
  480. je ..B1.68
  481. ..B1.67:
  482. flds .L_2il0floatpacket.11@GOTOFF(%ebx)
  483. jmp ..B1.69
  484. ..B1.68:
  485. flds .L_2il0floatpacket.12@GOTOFF(%ebx)
  486. ..B1.69:
  487. flds .L_2il0floatpacket.9@GOTOFF(%ebx)
  488. fadd %st(1), %st
  489. fstps 88(%esp)
  490. fstps 108(%esp)
  491. jmp ..B1.55
  492. ..B1.70:
  493. flds 12(%ebp)
  494. fmul %st(0), %st
  495. fstps 108(%esp)
  496. jmp ..B1.55
  497. ..B1.71:
  498. testl $8388607, 12(%ebp)
  499. je ..B1.91
  500. ..B1.72:
  501. cmpl $255, %eax
  502. jge ..B1.45
  503. ..B1.73:
  504. fstp %st(0)
  505. flds 12(%ebp)
  506. fmul %st(0), %st
  507. fsts 104(%esp)
  508. fstps 108(%esp)
  509. jmp ..B1.55
  510. ..B1.74:
  511. testl $8388607, 8(%ebp)
  512. je ..B1.76
  513. ..B1.75:
  514. cmpl $255, %edx
  515. je ..B1.79
  516. ..B1.95:
  517. testl $8388607, 8(%ebp)
  518. ..B1.76:
  519. je ..B1.44
  520. ..B1.77:
  521. cmpl $255, %edx
  522. jge ..B1.44
  523. ..B1.78:
  524. fstp %st(0)
  525. flds 8(%ebp)
  526. fmul %st(0), %st
  527. fsts 104(%esp)
  528. fstps 108(%esp)
  529. jmp ..B1.55
  530. ..B1.79:
  531. testl $8388607, 12(%ebp)
  532. je ..B1.94
  533. ..B1.80:
  534. fstp %st(0)
  535. flds 8(%ebp)
  536. fmul %st(0), %st
  537. fstps 104(%esp)
  538. flds 12(%ebp)
  539. fmul %st(0), %st
  540. fstps 108(%esp)
  541. jmp ..B1.55
  542. ..B1.91:
  543. cmpl $255, %eax
  544. je ..B1.59
  545. jmp ..B1.96
  546. ..B1.92:
  547. fstp %st(0)
  548. cmpl $255, %eax
  549. jl ..B1.47
  550. jmp ..B1.54
  551. ..B1.94:
  552. testl $8388607, 8(%ebp)
  553. jne ..B1.77
  554. jmp ..B1.44
  555. .align 16,0x90
  556. .type casinhf,@function
  557. .size casinhf,.-casinhf
  558. .data
  559. # -- End casinhf
  560. .section .rodata, "a"
  561. .align 16
  562. .align 16
  563. _Bcross:
  564. .long -858993459
  565. .long 1072483532
  566. .type _Bcross,@object
  567. .size _Bcross,8
  568. .space 8, 0x00 # pad
  569. .align 16
  570. _Across:
  571. .long 0
  572. .long 1073217536
  573. .type _Across,@object
  574. .size _Across,8
  575. .space 8, 0x00 # pad
  576. .align 16
  577. ones:
  578. .long 0x3f800000
  579. .long 0xbf800000
  580. .type ones,@object
  581. .size ones,8
  582. .align 8
  583. .L_2il0floatpacket.6:
  584. .long 0x00000000,0x3fe00000
  585. .type .L_2il0floatpacket.6,@object
  586. .size .L_2il0floatpacket.6,8
  587. .align 4
  588. .L_2il0floatpacket.7:
  589. .long 0xbfc90fdb
  590. .type .L_2il0floatpacket.7,@object
  591. .size .L_2il0floatpacket.7,4
  592. .align 4
  593. .L_2il0floatpacket.8:
  594. .long 0x3fc90fdb
  595. .type .L_2il0floatpacket.8,@object
  596. .size .L_2il0floatpacket.8,4
  597. .align 4
  598. .L_2il0floatpacket.9:
  599. .long 0x00800000
  600. .type .L_2il0floatpacket.9,@object
  601. .size .L_2il0floatpacket.9,4
  602. .align 4
  603. .L_2il0floatpacket.10:
  604. .long 0x80000000
  605. .type .L_2il0floatpacket.10,@object
  606. .size .L_2il0floatpacket.10,4
  607. .align 4
  608. .L_2il0floatpacket.11:
  609. .long 0xbf490fdb
  610. .type .L_2il0floatpacket.11,@object
  611. .size .L_2il0floatpacket.11,4
  612. .align 4
  613. .L_2il0floatpacket.12:
  614. .long 0x3f490fdb
  615. .type .L_2il0floatpacket.12,@object
  616. .size .L_2il0floatpacket.12,4
  617. .align 4
  618. .L_2il0floatpacket.13:
  619. .long 0xff800000
  620. .type .L_2il0floatpacket.13,@object
  621. .size .L_2il0floatpacket.13,4
  622. .align 4
  623. .L_2il0floatpacket.14:
  624. .long 0x7f800000
  625. .type .L_2il0floatpacket.14,@object
  626. .size .L_2il0floatpacket.14,4
  627. .data
  628. .section .note.GNU-stack, ""
  629. # End