libm_cosl_k80.S 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703
  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 "libm_cosl_k80.c"
  38. .text
  39. ..TXTST0:
  40. # -- Begin __libm_cosl_k80
  41. .text
  42. .align 16,0x90
  43. .hidden __libm_cosl_k80
  44. .globl __libm_cosl_k80
  45. __libm_cosl_k80:
  46. # parameter 1: 8 + %ebp
  47. # parameter 2: 20 + %ebp
  48. ..B1.1:
  49. ..L1:
  50. pushl %ebp
  51. movl %esp, %ebp
  52. andl $-64, %esp
  53. pushl %esi
  54. pushl %ebx
  55. subl $184, %esp
  56. movl %gs:20, %eax
  57. xorl %esp, %eax
  58. movl %eax, 144(%esp)
  59. movzwl 16(%ebp), %eax
  60. andl $32767, %eax
  61. call ..L2
  62. ..L2:
  63. popl %ebx
  64. lea _GLOBAL_OFFSET_TABLE_+[. - ..L2](%ebx), %ebx
  65. cmpl $16378, %eax
  66. movl 20(%ebp), %esi
  67. jge ..B1.18
  68. ..B1.2:
  69. cmpl $16372, %eax
  70. jge ..B1.16
  71. ..B1.3:
  72. cmpl $16364, %eax
  73. jge ..B1.14
  74. ..B1.4:
  75. cmpl $16308, %eax
  76. jge ..B1.12
  77. ..B1.5:
  78. testl %eax, %eax
  79. jne ..B1.8
  80. ..B1.6:
  81. cmpl $0, 12(%ebp)
  82. jne ..B1.8
  83. ..B1.7:
  84. cmpl $0, 8(%ebp)
  85. je ..B1.9
  86. ..B1.8:
  87. fldl _ones@GOTOFF(%ebx)
  88. fldt _small_value_80@GOTOFF(%ebx)
  89. fsubr %st(1), %st
  90. fstpt (%esi)
  91. fldl _zeros@GOTOFF(%ebx)
  92. fstpt 12(%esi)
  93. jmp ..B1.10
  94. ..B1.9:
  95. fldl _ones@GOTOFF(%ebx)
  96. fstpt (%esi)
  97. fldt (%esi)
  98. fldl _zeros@GOTOFF(%ebx)
  99. fstpt 12(%esi)
  100. ..B1.10:
  101. movl 144(%esp), %eax
  102. xorl %esp, %eax
  103. cmpl %gs:20, %eax
  104. jne ..B1.28
  105. ..B1.11:
  106. addl $184, %esp
  107. popl %ebx
  108. popl %esi
  109. movl %ebp, %esp
  110. popl %ebp
  111. ret
  112. ..B1.12:
  113. fldl _ones@GOTOFF(%ebx)
  114. fstpt (%esi)
  115. fldt (%esi)
  116. fldt 8(%ebp)
  117. fldt _CP3@GOTOFF(%ebx)
  118. fmul %st(1), %st
  119. fmulp %st, %st(1)
  120. fstpt 12(%esi)
  121. movl 144(%esp), %eax
  122. xorl %esp, %eax
  123. cmpl %gs:20, %eax
  124. jne ..B1.28
  125. ..B1.13:
  126. addl $184, %esp
  127. popl %ebx
  128. popl %esi
  129. movl %ebp, %esp
  130. popl %ebp
  131. ret
  132. ..B1.14:
  133. fldt 8(%ebp)
  134. fmul %st(0), %st
  135. fldl _ones@GOTOFF(%ebx)
  136. fstpt (%esi)
  137. fldt (%esi)
  138. fldt 12+_CP2@GOTOFF(%ebx)
  139. fmul %st(2), %st
  140. fldt _CP2@GOTOFF(%ebx)
  141. faddp %st, %st(1)
  142. fmulp %st, %st(2)
  143. fxch %st(1)
  144. fstpt 12(%esi)
  145. movl 144(%esp), %eax
  146. xorl %esp, %eax
  147. cmpl %gs:20, %eax
  148. jne ..B1.28
  149. ..B1.15:
  150. addl $184, %esp
  151. popl %ebx
  152. popl %esi
  153. movl %ebp, %esp
  154. popl %ebp
  155. ret
  156. ..B1.16:
  157. fldt 8(%ebp)
  158. fmul %st(0), %st
  159. fld %st(0)
  160. fmul %st(1), %st
  161. fldl _ones@GOTOFF(%ebx)
  162. fstpt (%esi)
  163. fldt (%esi)
  164. fldt 36+_CP1@GOTOFF(%ebx)
  165. fmul %st(2), %st
  166. fldt 12+_CP1@GOTOFF(%ebx)
  167. faddp %st, %st(1)
  168. fmul %st(2), %st
  169. fldt 24+_CP1@GOTOFF(%ebx)
  170. fmulp %st, %st(3)
  171. fldt _CP1@GOTOFF(%ebx)
  172. faddp %st, %st(3)
  173. fxch %st(3)
  174. fmulp %st, %st(2)
  175. fxch %st(1)
  176. faddp %st, %st(2)
  177. fxch %st(1)
  178. fstpt 12(%esi)
  179. movl 144(%esp), %eax
  180. xorl %esp, %eax
  181. cmpl %gs:20, %eax
  182. jne ..B1.28
  183. ..B1.17:
  184. addl $184, %esp
  185. popl %ebx
  186. popl %esi
  187. movl %ebp, %esp
  188. popl %ebp
  189. ret
  190. ..B1.18:
  191. cmpl $16382, %eax
  192. jge ..B1.20
  193. ..B1.19:
  194. fldt 8(%ebp)
  195. fldl _TWO_52H@GOTOFF(%ebx)
  196. movzbl 17(%ebp), %eax
  197. andl $128, %eax
  198. shrl $7, %eax
  199. fxch %st(1)
  200. fmull _ones@GOTOFF(%ebx,%eax,8)
  201. xorl %eax, %eax
  202. fmul %st, %st(1)
  203. xorl %edx, %edx
  204. fld %st(1)
  205. fadd %st(1), %st
  206. fsubp %st, %st(2)
  207. fld %st(1)
  208. fsubr %st(1), %st
  209. fxch %st(1)
  210. fstpt 112(%esp)
  211. fldt 112(%esp)
  212. fstpt 8(%ebp)
  213. jmp ..B1.23
  214. ..B1.20:
  215. je ..B1.33
  216. ..B1.21:
  217. fldt 8(%ebp)
  218. lea 128(%esp), %edx
  219. movzbl 17(%ebp), %eax
  220. andl $128, %eax
  221. shrl $7, %eax
  222. fmull _ones@GOTOFF(%ebx,%eax,8)
  223. fstpt (%esp)
  224. fldt (%esp)
  225. movl $0, 12(%esp)
  226. fstpt 8(%ebp)
  227. movl %edx, 16(%esp)
  228. call __libm_reduce_pi04l
  229. ..B1.38:
  230. movl %eax, %edx
  231. ..B1.22:
  232. fldl 128(%esp)
  233. lea 3(%edx), %eax
  234. fldl _TWO_52H@GOTOFF(%ebx)
  235. fmul %st(1), %st
  236. fld %st(0)
  237. shrl $2, %eax
  238. fadd %st(2), %st
  239. andl $1, %eax
  240. fsubp %st, %st(1)
  241. fld %st(0)
  242. fxch %st(1)
  243. fsubr %st, %st(2)
  244. fxch %st(2)
  245. faddl 136(%esp)
  246. fadd %st, %st(1)
  247. fxch %st(1)
  248. fstpt 112(%esp)
  249. ..B1.23:
  250. fldt 112(%esp)
  251. fld %st(2)
  252. fmul %st(2), %st
  253. fld %st(2)
  254. fmulp %st, %st(2)
  255. incl %edx
  256. faddp %st, %st(1)
  257. fstpt 96(%esp)
  258. fldt 96(%esp)
  259. fld %st(2)
  260. fmul %st(3), %st
  261. testb $2, %dl
  262. fld %st(0)
  263. fadd %st(2), %st
  264. fstpt 48(%esp)
  265. fldt 48(%esp)
  266. fld %st(1)
  267. fmul %st(3), %st
  268. fxch %st(1)
  269. fmulp %st, %st(3)
  270. faddp %st, %st(2)
  271. fxch %st(1)
  272. fstpt 80(%esp)
  273. fldt 80(%esp)
  274. fld %st(1)
  275. fmul %st(2), %st
  276. fld %st(0)
  277. faddp %st, %st(2)
  278. fldl _TWO_53H@GOTOFF(%ebx)
  279. fstpt 64(%esp)
  280. fldl _ones@GOTOFF(%ebx,%eax,8)
  281. je ..B1.25
  282. ..B1.24:
  283. fldt 84+_SP@GOTOFF(%ebx)
  284. fmul %st(3), %st
  285. fxch %st(1)
  286. fstpt 32(%esp)
  287. fldt 60+_SP@GOTOFF(%ebx)
  288. faddp %st, %st(1)
  289. fmul %st(2), %st
  290. fldt 36+_SP@GOTOFF(%ebx)
  291. faddp %st, %st(1)
  292. fmul %st(2), %st
  293. fldt 12+_SP@GOTOFF(%ebx)
  294. faddp %st, %st(1)
  295. fmul %st(2), %st
  296. fldt 72+_SP@GOTOFF(%ebx)
  297. fldt 96+_SP@GOTOFF(%ebx)
  298. fmul %st(4), %st
  299. faddp %st, %st(1)
  300. fmul %st(3), %st
  301. fldt 48+_SP@GOTOFF(%ebx)
  302. faddp %st, %st(1)
  303. fmul %st(3), %st
  304. fldt 24+_SP@GOTOFF(%ebx)
  305. faddp %st, %st(1)
  306. fmulp %st, %st(3)
  307. fldt _SP@GOTOFF(%ebx)
  308. faddp %st, %st(3)
  309. fldt 48(%esp)
  310. fmulp %st, %st(3)
  311. faddp %st, %st(2)
  312. fldt 80(%esp)
  313. fldt 96(%esp)
  314. fldt 120+_SP@GOTOFF(%ebx)
  315. fmul %st, %st(2)
  316. fxch %st(2)
  317. faddp %st, %st(4)
  318. fxch %st(1)
  319. fmulp %st, %st(2)
  320. fldt 108+_SP@GOTOFF(%ebx)
  321. fmul %st, %st(4)
  322. fxch %st(4)
  323. faddp %st, %st(2)
  324. fld %st(1)
  325. fxch %st(4)
  326. fmulp %st, %st(1)
  327. faddp %st, %st(2)
  328. fxch %st(1)
  329. fadd %st, %st(2)
  330. fld %st(3)
  331. fldt 64(%esp)
  332. fmul %st(4), %st
  333. fadd %st, %st(4)
  334. fsubrp %st, %st(4)
  335. fmul %st(3), %st
  336. fxch %st(2)
  337. fsub %st(3), %st
  338. faddp %st, %st(1)
  339. fxch %st(2)
  340. fmul %st(4), %st
  341. fldt 112(%esp)
  342. fmulp %st, %st(3)
  343. fxch %st(2)
  344. faddp %st, %st(1)
  345. faddp %st, %st(2)
  346. fld %st(2)
  347. fadd %st(1), %st
  348. fsubr %st, %st(3)
  349. fxch %st(1)
  350. faddp %st, %st(3)
  351. fxch %st(2)
  352. faddp %st, %st(1)
  353. fldt 32(%esp)
  354. fmul %st, %st(2)
  355. fxch %st(2)
  356. fstpt (%esi)
  357. fmulp %st, %st(1)
  358. fstpt 12(%esi)
  359. fldl _ones@GOTOFF(%ebx)
  360. jmp ..B1.26
  361. ..B1.25:
  362. fstp %st(4)
  363. fstp %st(4)
  364. fldt 84+_CP@GOTOFF(%ebx)
  365. fmul %st(1), %st
  366. fldt 60+_CP@GOTOFF(%ebx)
  367. faddp %st, %st(1)
  368. fmul %st(1), %st
  369. fldt 36+_CP@GOTOFF(%ebx)
  370. faddp %st, %st(1)
  371. fmul %st(1), %st
  372. fldt 12+_CP@GOTOFF(%ebx)
  373. faddp %st, %st(1)
  374. fmul %st(1), %st
  375. fldt 72+_CP@GOTOFF(%ebx)
  376. fldt 96+_CP@GOTOFF(%ebx)
  377. fmul %st(3), %st
  378. faddp %st, %st(1)
  379. fmul %st(2), %st
  380. fldt 48+_CP@GOTOFF(%ebx)
  381. faddp %st, %st(1)
  382. fmul %st(2), %st
  383. fldt 24+_CP@GOTOFF(%ebx)
  384. faddp %st, %st(1)
  385. fmulp %st, %st(2)
  386. fldt _CP@GOTOFF(%ebx)
  387. faddp %st, %st(2)
  388. fldt 48(%esp)
  389. fmulp %st, %st(2)
  390. faddp %st, %st(1)
  391. fldt 80(%esp)
  392. fldt 96(%esp)
  393. fldt 120+_CP@GOTOFF(%ebx)
  394. fmul %st, %st(2)
  395. fxch %st(2)
  396. faddp %st, %st(3)
  397. fxch %st(1)
  398. fmulp %st, %st(5)
  399. fldt 108+_CP@GOTOFF(%ebx)
  400. fmul %st, %st(3)
  401. fxch %st(3)
  402. faddp %st, %st(5)
  403. fld %st(4)
  404. fxch %st(3)
  405. fmulp %st, %st(1)
  406. faddp %st, %st(1)
  407. fadd %st, %st(1)
  408. fldt 64(%esp)
  409. fmul %st(2), %st
  410. fadd %st, %st(2)
  411. fsubrp %st, %st(2)
  412. fld %st(1)
  413. fxch %st(2)
  414. fsubr %st, %st(4)
  415. fxch %st(4)
  416. faddp %st, %st(1)
  417. fldl _ones@GOTOFF(%ebx)
  418. fadd %st, %st(2)
  419. fld %st(0)
  420. fsub %st(3), %st
  421. faddp %st, %st(5)
  422. fxch %st(4)
  423. faddp %st, %st(1)
  424. fxch %st(1)
  425. fmul %st(2), %st
  426. fstpt (%esi)
  427. fmulp %st, %st(1)
  428. fstpt 12(%esi)
  429. ..B1.26:
  430. movl 144(%esp), %eax
  431. xorl %esp, %eax
  432. cmpl %gs:20, %eax
  433. jne ..B1.28
  434. ..B1.27:
  435. addl $184, %esp
  436. popl %ebx
  437. popl %esi
  438. movl %ebp, %esp
  439. popl %ebp
  440. ret
  441. ..B1.28:
  442. fstp %st(0)
  443. call __stack_chk_fail@PLT
  444. ..B1.33:
  445. movl 12(%ebp), %eax
  446. cmpl $-921707870, %eax
  447. jb ..B1.19
  448. ..B1.34:
  449. jne ..B1.21
  450. ..B1.35:
  451. cmpl $560513589, 8(%ebp)
  452. jbe ..B1.19
  453. jmp ..B1.21
  454. .align 16,0x90
  455. .type __libm_cosl_k80,@function
  456. .size __libm_cosl_k80,.-__libm_cosl_k80
  457. .data
  458. # -- End __libm_cosl_k80
  459. .section .rodata, "a"
  460. .align 4
  461. .align 4
  462. _ones:
  463. .long 0
  464. .long 1072693248
  465. .long 0
  466. .long 3220176896
  467. .type _ones,@object
  468. .size _ones,16
  469. .align 4
  470. _zeros:
  471. .long 0
  472. .long 0
  473. .long 0
  474. .long 2147483648
  475. .type _zeros,@object
  476. .size _zeros,16
  477. .align 4
  478. _TWO_52H:
  479. .long 0
  480. .long 1127743488
  481. .type _TWO_52H,@object
  482. .size _TWO_52H,8
  483. .align 4
  484. _TWO_53H:
  485. .long 0
  486. .long 1128792064
  487. .type _TWO_53H,@object
  488. .size _TWO_53H,8
  489. .align 2
  490. _small_value_80:
  491. .word 0
  492. .word 0
  493. .word 0
  494. .word 32768
  495. .word 6383
  496. .word 0
  497. .word 0
  498. .word 0
  499. .word 0
  500. .word 32768
  501. .word 39151
  502. .word 0
  503. .type _small_value_80,@object
  504. .size _small_value_80,24
  505. .align 2
  506. _CP3:
  507. .word 0
  508. .word 65450
  509. .word 65535
  510. .word 65535
  511. .word 49149
  512. .word 0
  513. .type _CP3,@object
  514. .size _CP3,12
  515. .align 2
  516. _CP2:
  517. .word 63855
  518. .word 65535
  519. .word 65535
  520. .word 65535
  521. .word 49149
  522. .word 0
  523. .word 18238
  524. .word 17476
  525. .word 43656
  526. .word 43690
  527. .word 16378
  528. .word 0
  529. .type _CP2,@object
  530. .size _CP2,24
  531. .align 2
  532. _CP1:
  533. .word 65535
  534. .word 65535
  535. .word 65535
  536. .word 65535
  537. .word 49149
  538. .word 0
  539. .word 47533
  540. .word 43689
  541. .word 43690
  542. .word 43690
  543. .word 16378
  544. .word 0
  545. .word 14131
  546. .word 49466
  547. .word 24756
  548. .word 46603
  549. .word 49141
  550. .word 0
  551. .word 37142
  552. .word 18013
  553. .word 35855
  554. .word 53259
  555. .word 16367
  556. .word 0
  557. .type _CP1,@object
  558. .size _CP1,48
  559. .align 2
  560. _SP:
  561. .word 43691
  562. .word 43690
  563. .word 43690
  564. .word 43690
  565. .word 49136
  566. .word 0
  567. .word 34948
  568. .word 34952
  569. .word 34952
  570. .word 34952
  571. .word 16368
  572. .word 0
  573. .word 53243
  574. .word 3328
  575. .word 208
  576. .word 53261
  577. .word 49138
  578. .word 0
  579. .word 30577
  580. .word 46649
  581. .word 7466
  582. .word 47343
  583. .word 16364
  584. .word 0
  585. .word 11760
  586. .word 43464
  587. .word 11071
  588. .word 55090
  589. .word 49125
  590. .word 0
  591. .word 47000
  592. .word 43232
  593. .word 12444
  594. .word 45202
  595. .word 16350
  596. .word 0
  597. .word 52983
  598. .word 47009
  599. .word 40440
  600. .word 55103
  601. .word 49110
  602. .word 0
  603. .word 35433
  604. .word 14927
  605. .word 40941
  606. .word 51860
  607. .word 16334
  608. .word 0
  609. .word 1340
  610. .word 16361
  611. .word 50747
  612. .word 38523
  613. .word 49094
  614. .word 0
  615. .word 0
  616. .word 0
  617. .word 0
  618. .word 43680
  619. .word 49148
  620. .word 0
  621. .word 0
  622. .word 0
  623. .word 0
  624. .word 34816
  625. .word 16376
  626. .word 0
  627. .type _SP,@object
  628. .size _SP,132
  629. .align 2
  630. _CP:
  631. .word 51631
  632. .word 16464
  633. .word 16497
  634. .word 44012
  635. .word 16306
  636. .word 0
  637. .word 43685
  638. .word 43690
  639. .word 43690
  640. .word 43690
  641. .word 16372
  642. .word 0
  643. .word 46557
  644. .word 2912
  645. .word 24758
  646. .word 46603
  647. .word 49141
  648. .word 0
  649. .word 28380
  650. .word 3328
  651. .word 208
  652. .word 53261
  653. .word 16367
  654. .word 0
  655. .word 23816
  656. .word 50302
  657. .word 32187
  658. .word 37874
  659. .word 49129
  660. .word 0
  661. .word 49866
  662. .word 64527
  663. .word 51070
  664. .word 36726
  665. .word 16354
  666. .word 0
  667. .word 65056
  668. .word 3638
  669. .word 41889
  670. .word 51659
  671. .word 49114
  672. .word 0
  673. .word 13834
  674. .word 11317
  675. .word 33607
  676. .word 55101
  677. .word 16338
  678. .word 0
  679. .word 40709
  680. .word 42374
  681. .word 64411
  682. .word 45709
  683. .word 49098
  684. .word 0
  685. .word 0
  686. .word 0
  687. .word 0
  688. .word 32768
  689. .word 49150
  690. .word 0
  691. .word 0
  692. .word 0
  693. .word 0
  694. .word 43008
  695. .word 16378
  696. .word 0
  697. .type _CP,@object
  698. .size _CP,132
  699. .data
  700. .hidden __libm_reduce_pi04l
  701. .section .note.GNU-stack, ""
  702. # End