cacoshf.S 16 KB

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