cacosf.S 16 KB

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