cos_wmt.S 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765
  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 "cos_wmt.c"
  38. .text
  39. ..TXTST0:
  40. # -- Begin static_func
  41. .text
  42. .align 16,0x90
  43. static_func:
  44. ..B1.1:
  45. ..L1:
  46. call ..L2
  47. ..L2:
  48. popl %eax
  49. lea _GLOBAL_OFFSET_TABLE_+[. - ..L2](%eax), %eax
  50. lea static_const_table@GOTOFF(%eax), %eax
  51. ret
  52. .align 16,0x90
  53. .type static_func,@function
  54. .size static_func,.-static_func
  55. .data
  56. # -- End static_func
  57. .text
  58. # -- Begin cos
  59. .text
  60. .align 16,0x90
  61. .globl cos
  62. cos:
  63. # parameter 1: 8 + %ebp
  64. ..B2.1:
  65. ..L3:
  66. ..B2.2:
  67. pushl %ebp
  68. movl %esp, %ebp
  69. subl $120, %esp
  70. movl %ebx, 56(%esp)
  71. call static_func
  72. movl %eax, %ebx
  73. movsd 128(%esp), %xmm0
  74. pextrw $3, %xmm0, %eax
  75. andl $32767, %eax
  76. subl $12336, %eax
  77. cmpl $4293, %eax
  78. ja .L_2TAG_PACKET_0.0.2
  79. movsd 2160(%ebx), %xmm1
  80. mulsd %xmm0, %xmm1
  81. movapd 2240(%ebx), %xmm5
  82. movsd 2224(%ebx), %xmm4
  83. andpd %xmm0, %xmm4
  84. orps %xmm4, %xmm5
  85. movsd 2128(%ebx), %xmm3
  86. movapd 2112(%ebx), %xmm2
  87. addpd %xmm5, %xmm1
  88. cvttsd2si %xmm1, %edx
  89. cvtsi2sdl %edx, %xmm1
  90. mulsd %xmm1, %xmm3
  91. unpcklpd %xmm1, %xmm1
  92. addl $1865232, %edx
  93. movapd %xmm0, %xmm4
  94. andl $63, %edx
  95. movapd 2096(%ebx), %xmm5
  96. lea (%ebx), %eax
  97. shll $5, %edx
  98. addl %edx, %eax
  99. mulpd %xmm1, %xmm2
  100. subsd %xmm3, %xmm0
  101. mulsd 2144(%ebx), %xmm1
  102. subsd %xmm3, %xmm4
  103. movsd 8(%eax), %xmm7
  104. unpcklpd %xmm0, %xmm0
  105. movapd %xmm4, %xmm3
  106. subsd %xmm2, %xmm4
  107. mulpd %xmm0, %xmm5
  108. subpd %xmm2, %xmm0
  109. movapd 2064(%ebx), %xmm6
  110. mulsd %xmm4, %xmm7
  111. subsd %xmm4, %xmm3
  112. mulpd %xmm0, %xmm5
  113. mulpd %xmm0, %xmm0
  114. subsd %xmm2, %xmm3
  115. movapd (%eax), %xmm2
  116. subsd %xmm3, %xmm1
  117. movsd 24(%eax), %xmm3
  118. addsd %xmm3, %xmm2
  119. subsd %xmm2, %xmm7
  120. mulsd %xmm4, %xmm2
  121. mulpd %xmm0, %xmm6
  122. mulsd %xmm4, %xmm3
  123. mulpd %xmm0, %xmm2
  124. mulpd %xmm0, %xmm0
  125. addpd 2080(%ebx), %xmm5
  126. mulsd (%eax), %xmm4
  127. addpd 2048(%ebx), %xmm6
  128. mulpd %xmm0, %xmm5
  129. movapd %xmm3, %xmm0
  130. addsd 8(%eax), %xmm3
  131. mulpd %xmm7, %xmm1
  132. movapd %xmm4, %xmm7
  133. addsd %xmm3, %xmm4
  134. addpd %xmm5, %xmm6
  135. movsd 8(%eax), %xmm5
  136. subsd %xmm3, %xmm5
  137. subsd %xmm4, %xmm3
  138. addsd 16(%eax), %xmm1
  139. mulpd %xmm2, %xmm6
  140. addsd %xmm0, %xmm5
  141. addsd %xmm7, %xmm3
  142. addsd %xmm5, %xmm1
  143. addsd %xmm3, %xmm1
  144. addsd %xmm6, %xmm1
  145. unpckhpd %xmm6, %xmm6
  146. addsd %xmm6, %xmm1
  147. addsd %xmm1, %xmm4
  148. movsd %xmm4, (%esp)
  149. fldl (%esp)
  150. jmp .L_2TAG_PACKET_1.0.2
  151. .L_2TAG_PACKET_0.0.2:
  152. jg .L_2TAG_PACKET_2.0.2
  153. pextrw $3, %xmm0, %eax
  154. andl $32767, %eax
  155. pinsrw $3, %eax, %xmm0
  156. movsd 2192(%ebx), %xmm1
  157. subsd %xmm0, %xmm1
  158. movsd %xmm1, (%esp)
  159. fldl (%esp)
  160. jmp .L_2TAG_PACKET_1.0.2
  161. .L_2TAG_PACKET_2.0.2:
  162. movl 132(%esp), %eax
  163. andl $2146435072, %eax
  164. cmpl $2146435072, %eax
  165. je .L_2TAG_PACKET_3.0.2
  166. subl $32, %esp
  167. movsd %xmm0, (%esp)
  168. lea 40(%esp), %eax
  169. movl %eax, 8(%esp)
  170. movl $1, %eax
  171. movl %eax, 12(%esp)
  172. call __libm_sincos_huge
  173. addl $32, %esp
  174. fldl 8(%esp)
  175. jmp .L_2TAG_PACKET_1.0.2
  176. .L_2TAG_PACKET_3.0.2:
  177. fldl 128(%esp)
  178. fmull 2208(%ebx)
  179. .L_2TAG_PACKET_1.0.2:
  180. movl 56(%esp), %ebx
  181. movl %ebp, %esp
  182. popl %ebp
  183. ret
  184. ..B2.3:
  185. .align 16,0x90
  186. .type cos,@function
  187. .size cos,.-cos
  188. .data
  189. # -- End cos
  190. .section .rodata, "a"
  191. .align 16
  192. .align 16
  193. static_const_table:
  194. .long 0
  195. .long 0
  196. .long 0
  197. .long 0
  198. .long 0
  199. .long 0
  200. .long 0
  201. .long 1072693248
  202. .long 393047345
  203. .long 3212032302
  204. .long 3156849708
  205. .long 1069094822
  206. .long 3758096384
  207. .long 3158189848
  208. .long 0
  209. .long 1072693248
  210. .long 18115067
  211. .long 3214126342
  212. .long 1013556747
  213. .long 1070135480
  214. .long 3221225472
  215. .long 3160567065
  216. .long 0
  217. .long 1072693248
  218. .long 2476548698
  219. .long 3215330282
  220. .long 785751814
  221. .long 1070765062
  222. .long 2684354560
  223. .long 3161838221
  224. .long 0
  225. .long 1072693248
  226. .long 2255197647
  227. .long 3216211105
  228. .long 2796464483
  229. .long 1071152610
  230. .long 3758096384
  231. .long 3160878317
  232. .long 0
  233. .long 1072693248
  234. .long 1945768569
  235. .long 3216915048
  236. .long 939980347
  237. .long 1071524701
  238. .long 536870912
  239. .long 1012796809
  240. .long 0
  241. .long 1072693248
  242. .long 1539668340
  243. .long 3217396327
  244. .long 967731400
  245. .long 1071761211
  246. .long 536870912
  247. .long 1015752157
  248. .long 0
  249. .long 1072693248
  250. .long 1403757309
  251. .long 3217886718
  252. .long 621354454
  253. .long 1071926515
  254. .long 536870912
  255. .long 1013450602
  256. .long 0
  257. .long 1072693248
  258. .long 2583490354
  259. .long 1070236281
  260. .long 1719614413
  261. .long 1072079006
  262. .long 536870912
  263. .long 3163282740
  264. .long 0
  265. .long 1071644672
  266. .long 2485417816
  267. .long 1069626316
  268. .long 1796544321
  269. .long 1072217216
  270. .long 536870912
  271. .long 3162686945
  272. .long 0
  273. .long 1071644672
  274. .long 2598800519
  275. .long 1068266419
  276. .long 688824739
  277. .long 1072339814
  278. .long 3758096384
  279. .long 1010431536
  280. .long 0
  281. .long 1071644672
  282. .long 2140183630
  283. .long 3214756396
  284. .long 4051746225
  285. .long 1072445618
  286. .long 2147483648
  287. .long 3161907377
  288. .long 0
  289. .long 1071644672
  290. .long 1699043957
  291. .long 3216902261
  292. .long 3476196678
  293. .long 1072533611
  294. .long 536870912
  295. .long 1014257638
  296. .long 0
  297. .long 1071644672
  298. .long 1991047213
  299. .long 1067753521
  300. .long 1455828442
  301. .long 1072602945
  302. .long 3758096384
  303. .long 1015505073
  304. .long 0
  305. .long 1070596096
  306. .long 240740309
  307. .long 3215727903
  308. .long 3489094832
  309. .long 1072652951
  310. .long 536870912
  311. .long 1014325783
  312. .long 0
  313. .long 1070596096
  314. .long 257503056
  315. .long 3214647653
  316. .long 2748392742
  317. .long 1072683149
  318. .long 1073741824
  319. .long 3163061750
  320. .long 0
  321. .long 1069547520
  322. .long 0
  323. .long 0
  324. .long 0
  325. .long 1072693248
  326. .long 0
  327. .long 0
  328. .long 0
  329. .long 0
  330. .long 257503056
  331. .long 1067164005
  332. .long 2748392742
  333. .long 1072683149
  334. .long 1073741824
  335. .long 3163061750
  336. .long 0
  337. .long 3217031168
  338. .long 240740309
  339. .long 1068244255
  340. .long 3489094832
  341. .long 1072652951
  342. .long 536870912
  343. .long 1014325783
  344. .long 0
  345. .long 3218079744
  346. .long 1991047213
  347. .long 3215237169
  348. .long 1455828442
  349. .long 1072602945
  350. .long 3758096384
  351. .long 1015505073
  352. .long 0
  353. .long 3218079744
  354. .long 1699043957
  355. .long 1069418613
  356. .long 3476196678
  357. .long 1072533611
  358. .long 536870912
  359. .long 1014257638
  360. .long 0
  361. .long 3219128320
  362. .long 2140183630
  363. .long 1067272748
  364. .long 4051746225
  365. .long 1072445618
  366. .long 2147483648
  367. .long 3161907377
  368. .long 0
  369. .long 3219128320
  370. .long 2598800519
  371. .long 3215750067
  372. .long 688824739
  373. .long 1072339814
  374. .long 3758096384
  375. .long 1010431536
  376. .long 0
  377. .long 3219128320
  378. .long 2485417816
  379. .long 3217109964
  380. .long 1796544321
  381. .long 1072217216
  382. .long 536870912
  383. .long 3162686945
  384. .long 0
  385. .long 3219128320
  386. .long 2583490354
  387. .long 3217719929
  388. .long 1719614413
  389. .long 1072079006
  390. .long 536870912
  391. .long 3163282740
  392. .long 0
  393. .long 3219128320
  394. .long 1403757309
  395. .long 1070403070
  396. .long 621354454
  397. .long 1071926515
  398. .long 536870912
  399. .long 1013450602
  400. .long 0
  401. .long 3220176896
  402. .long 1539668340
  403. .long 1069912679
  404. .long 967731400
  405. .long 1071761211
  406. .long 536870912
  407. .long 1015752157
  408. .long 0
  409. .long 3220176896
  410. .long 1945768569
  411. .long 1069431400
  412. .long 939980347
  413. .long 1071524701
  414. .long 536870912
  415. .long 1012796809
  416. .long 0
  417. .long 3220176896
  418. .long 2255197647
  419. .long 1068727457
  420. .long 2796464483
  421. .long 1071152610
  422. .long 3758096384
  423. .long 3160878317
  424. .long 0
  425. .long 3220176896
  426. .long 2476548698
  427. .long 1067846634
  428. .long 785751814
  429. .long 1070765062
  430. .long 2684354560
  431. .long 3161838221
  432. .long 0
  433. .long 3220176896
  434. .long 18115067
  435. .long 1066642694
  436. .long 1013556747
  437. .long 1070135480
  438. .long 3221225472
  439. .long 3160567065
  440. .long 0
  441. .long 3220176896
  442. .long 393047345
  443. .long 1064548654
  444. .long 3156849708
  445. .long 1069094822
  446. .long 3758096384
  447. .long 3158189848
  448. .long 0
  449. .long 3220176896
  450. .long 0
  451. .long 0
  452. .long 0
  453. .long 0
  454. .long 0
  455. .long 0
  456. .long 0
  457. .long 3220176896
  458. .long 393047345
  459. .long 1064548654
  460. .long 3156849708
  461. .long 3216578470
  462. .long 3758096384
  463. .long 1010706200
  464. .long 0
  465. .long 3220176896
  466. .long 18115067
  467. .long 1066642694
  468. .long 1013556747
  469. .long 3217619128
  470. .long 3221225472
  471. .long 1013083417
  472. .long 0
  473. .long 3220176896
  474. .long 2476548698
  475. .long 1067846634
  476. .long 785751814
  477. .long 3218248710
  478. .long 2684354560
  479. .long 1014354573
  480. .long 0
  481. .long 3220176896
  482. .long 2255197647
  483. .long 1068727457
  484. .long 2796464483
  485. .long 3218636258
  486. .long 3758096384
  487. .long 1013394669
  488. .long 0
  489. .long 3220176896
  490. .long 1945768569
  491. .long 1069431400
  492. .long 939980347
  493. .long 3219008349
  494. .long 536870912
  495. .long 3160280457
  496. .long 0
  497. .long 3220176896
  498. .long 1539668340
  499. .long 1069912679
  500. .long 967731400
  501. .long 3219244859
  502. .long 536870912
  503. .long 3163235805
  504. .long 0
  505. .long 3220176896
  506. .long 1403757309
  507. .long 1070403070
  508. .long 621354454
  509. .long 3219410163
  510. .long 536870912
  511. .long 3160934250
  512. .long 0
  513. .long 3220176896
  514. .long 2583490354
  515. .long 3217719929
  516. .long 1719614413
  517. .long 3219562654
  518. .long 536870912
  519. .long 1015799092
  520. .long 0
  521. .long 3219128320
  522. .long 2485417816
  523. .long 3217109964
  524. .long 1796544321
  525. .long 3219700864
  526. .long 536870912
  527. .long 1015203297
  528. .long 0
  529. .long 3219128320
  530. .long 2598800519
  531. .long 3215750067
  532. .long 688824739
  533. .long 3219823462
  534. .long 3758096384
  535. .long 3157915184
  536. .long 0
  537. .long 3219128320
  538. .long 2140183630
  539. .long 1067272748
  540. .long 4051746225
  541. .long 3219929266
  542. .long 2147483648
  543. .long 1014423729
  544. .long 0
  545. .long 3219128320
  546. .long 1699043957
  547. .long 1069418613
  548. .long 3476196678
  549. .long 3220017259
  550. .long 536870912
  551. .long 3161741286
  552. .long 0
  553. .long 3219128320
  554. .long 1991047213
  555. .long 3215237169
  556. .long 1455828442
  557. .long 3220086593
  558. .long 3758096384
  559. .long 3162988721
  560. .long 0
  561. .long 3218079744
  562. .long 240740309
  563. .long 1068244255
  564. .long 3489094832
  565. .long 3220136599
  566. .long 536870912
  567. .long 3161809431
  568. .long 0
  569. .long 3218079744
  570. .long 257503056
  571. .long 1067164005
  572. .long 2748392742
  573. .long 3220166797
  574. .long 1073741824
  575. .long 1015578102
  576. .long 0
  577. .long 3217031168
  578. .long 0
  579. .long 0
  580. .long 0
  581. .long 3220176896
  582. .long 0
  583. .long 0
  584. .long 0
  585. .long 0
  586. .long 257503056
  587. .long 3214647653
  588. .long 2748392742
  589. .long 3220166797
  590. .long 1073741824
  591. .long 1015578102
  592. .long 0
  593. .long 1069547520
  594. .long 240740309
  595. .long 3215727903
  596. .long 3489094832
  597. .long 3220136599
  598. .long 536870912
  599. .long 3161809431
  600. .long 0
  601. .long 1070596096
  602. .long 1991047213
  603. .long 1067753521
  604. .long 1455828442
  605. .long 3220086593
  606. .long 3758096384
  607. .long 3162988721
  608. .long 0
  609. .long 1070596096
  610. .long 1699043957
  611. .long 3216902261
  612. .long 3476196678
  613. .long 3220017259
  614. .long 536870912
  615. .long 3161741286
  616. .long 0
  617. .long 1071644672
  618. .long 2140183630
  619. .long 3214756396
  620. .long 4051746225
  621. .long 3219929266
  622. .long 2147483648
  623. .long 1014423729
  624. .long 0
  625. .long 1071644672
  626. .long 2598800519
  627. .long 1068266419
  628. .long 688824739
  629. .long 3219823462
  630. .long 3758096384
  631. .long 3157915184
  632. .long 0
  633. .long 1071644672
  634. .long 2485417816
  635. .long 1069626316
  636. .long 1796544321
  637. .long 3219700864
  638. .long 536870912
  639. .long 1015203297
  640. .long 0
  641. .long 1071644672
  642. .long 2583490354
  643. .long 1070236281
  644. .long 1719614413
  645. .long 3219562654
  646. .long 536870912
  647. .long 1015799092
  648. .long 0
  649. .long 1071644672
  650. .long 1403757309
  651. .long 3217886718
  652. .long 621354454
  653. .long 3219410163
  654. .long 536870912
  655. .long 3160934250
  656. .long 0
  657. .long 1072693248
  658. .long 1539668340
  659. .long 3217396327
  660. .long 967731400
  661. .long 3219244859
  662. .long 536870912
  663. .long 3163235805
  664. .long 0
  665. .long 1072693248
  666. .long 1945768569
  667. .long 3216915048
  668. .long 939980347
  669. .long 3219008349
  670. .long 536870912
  671. .long 3160280457
  672. .long 0
  673. .long 1072693248
  674. .long 2255197647
  675. .long 3216211105
  676. .long 2796464483
  677. .long 3218636258
  678. .long 3758096384
  679. .long 1013394669
  680. .long 0
  681. .long 1072693248
  682. .long 2476548698
  683. .long 3215330282
  684. .long 785751814
  685. .long 3218248710
  686. .long 2684354560
  687. .long 1014354573
  688. .long 0
  689. .long 1072693248
  690. .long 18115067
  691. .long 3214126342
  692. .long 1013556747
  693. .long 3217619128
  694. .long 3221225472
  695. .long 1013083417
  696. .long 0
  697. .long 1072693248
  698. .long 393047345
  699. .long 3212032302
  700. .long 3156849708
  701. .long 3216578470
  702. .long 3758096384
  703. .long 1010706200
  704. .long 0
  705. .long 1072693248
  706. .long 1431655765
  707. .long 3217380693
  708. .long 0
  709. .long 3219128320
  710. .long 286331153
  711. .long 1065423121
  712. .long 1431655765
  713. .long 1067799893
  714. .long 436314138
  715. .long 3207201184
  716. .long 381774871
  717. .long 3210133868
  718. .long 2773927732
  719. .long 1053236707
  720. .long 436314138
  721. .long 1056571808
  722. .long 442499072
  723. .long 1032893537
  724. .long 442499072
  725. .long 1032893537
  726. .long 1413480448
  727. .long 1069097467
  728. .long 0
  729. .long 0
  730. .long 771977331
  731. .long 996350346
  732. .long 0
  733. .long 0
  734. .long 1841940611
  735. .long 1076125488
  736. .long 0
  737. .long 0
  738. .long 0
  739. .long 1127743488
  740. .long 0
  741. .long 0
  742. .long 0
  743. .long 1072693248
  744. .long 0
  745. .long 0
  746. .long 0
  747. .long 2147483648
  748. .long 0
  749. .long 0
  750. .long 0
  751. .long 2147483648
  752. .long 0
  753. .long 0
  754. .long 0
  755. .long 1071644672
  756. .long 0
  757. .long 1071644672
  758. .type static_const_table,@object
  759. .size static_const_table,2256
  760. .data
  761. .hidden __libm_sincos_huge
  762. .section .note.GNU-stack, ""
  763. # End