cosf_wmt.S 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590
  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 "cosf_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 cosf
  59. .text
  60. .align 16,0x90
  61. .globl cosf
  62. cosf:
  63. # parameter 1: 8 + %ebp
  64. ..B2.1:
  65. ..L3:
  66. ..B2.2:
  67. pushl %ebp
  68. movl %esp, %ebp
  69. subl $104, %esp
  70. movl %ebx, 36(%esp)
  71. call static_func
  72. movl %eax, %ebx
  73. movss 112(%esp), %xmm0
  74. movl 112(%esp), %ecx
  75. subl $16, %esp
  76. stmxcsr 4(%esp)
  77. movl 4(%esp), %eax
  78. andl $-24577, %eax
  79. cmpl %eax, 4(%esp)
  80. jne .L_2TAG_PACKET_0.0.2
  81. .L_2TAG_PACKET_1.0.2:
  82. movapd %xmm0, %xmm1
  83. cvtps2pd %xmm1, %xmm1
  84. movsd 1296(%ebx), %xmm2
  85. movl $2147483647, %eax
  86. movl $1241513983, %edx
  87. andl %ecx, %eax
  88. subl %eax, %edx
  89. subl $964689920, %eax
  90. orl %eax, %edx
  91. jl .L_2TAG_PACKET_2.0.2
  92. movsd 1312(%ebx), %xmm4
  93. mulsd %xmm1, %xmm2
  94. movsd 1328(%ebx), %xmm3
  95. movapd %xmm2, %xmm5
  96. addsd %xmm4, %xmm2
  97. movd %xmm2, %ecx
  98. subsd %xmm4, %xmm2
  99. mulsd %xmm3, %xmm1
  100. .L_2TAG_PACKET_3.0.2:
  101. movl $384, %eax
  102. movsd 1344(%ebx), %xmm4
  103. subsd %xmm2, %xmm5
  104. addl %ecx, %ecx
  105. movl %ecx, %edx
  106. shll $24, %ecx
  107. sarl $31, %ecx
  108. andl %edx, %eax
  109. addl %ecx, %edx
  110. xorl %ecx, %edx
  111. addsd %xmm5, %xmm1
  112. andl $254, %edx
  113. movsd (%ebx,%edx,8), %xmm3
  114. movsd 1352(%ebx), %xmm0
  115. pshufd $68, %xmm1, %xmm2
  116. mulsd %xmm1, %xmm1
  117. movsd 8(%ebx,%edx,8), %xmm5
  118. movl %eax, %ecx
  119. andl $256, %ecx
  120. shll $23, %ecx
  121. mulsd %xmm2, %xmm3
  122. movd %ecx, %xmm2
  123. subsd %xmm1, %xmm0
  124. addl $128, %eax
  125. andl $256, %eax
  126. shll $23, %eax
  127. subsd %xmm1, %xmm4
  128. psllq $32, %xmm2
  129. movd %eax, %xmm1
  130. xorpd %xmm2, %xmm4
  131. mulsd %xmm5, %xmm0
  132. mulsd %xmm4, %xmm3
  133. psllq $32, %xmm1
  134. xorpd %xmm1, %xmm0
  135. addsd %xmm3, %xmm0
  136. movl 4(%esp), %eax
  137. andl $-24577, %eax
  138. cmpl 4(%esp), %eax
  139. je .L_2TAG_PACKET_4.0.2
  140. stmxcsr 8(%esp)
  141. movl 4(%esp), %eax
  142. andl $24576, %eax
  143. orl %eax, 8(%esp)
  144. ldmxcsr 8(%esp)
  145. .L_2TAG_PACKET_4.0.2:
  146. cvtpd2ps %xmm0, %xmm0
  147. movss %xmm0, (%esp)
  148. flds (%esp)
  149. jmp .L_2TAG_PACKET_5.0.2
  150. .L_2TAG_PACKET_2.0.2:
  151. andl $2147483647, %ecx
  152. cmpl $1040187392, %ecx
  153. ja .L_2TAG_PACKET_6.0.2
  154. movl $1065353216, %eax
  155. movd %eax, %xmm0
  156. cmpl $0, %ecx
  157. je .L_2TAG_PACKET_7.0.2
  158. movl $805306368, %eax
  159. movd %eax, %xmm1
  160. subss %xmm1, %xmm0
  161. .L_2TAG_PACKET_7.0.2:
  162. movl 4(%esp), %eax
  163. andl $-24577, %eax
  164. cmpl 4(%esp), %eax
  165. je .L_2TAG_PACKET_8.0.2
  166. stmxcsr 8(%esp)
  167. movl 4(%esp), %eax
  168. andl $24576, %eax
  169. orl %eax, 8(%esp)
  170. ldmxcsr 8(%esp)
  171. .L_2TAG_PACKET_8.0.2:
  172. movss %xmm0, (%esp)
  173. flds (%esp)
  174. jmp .L_2TAG_PACKET_5.0.2
  175. .L_2TAG_PACKET_0.0.2:
  176. movl 4(%esp), %eax
  177. andl $-24577, %eax
  178. movl %eax, 8(%esp)
  179. ldmxcsr 8(%esp)
  180. jmp .L_2TAG_PACKET_1.0.2
  181. .L_2TAG_PACKET_6.0.2:
  182. movd %xmm0, %eax
  183. andl $2139095040, %eax
  184. cmpl $2139095040, %eax
  185. je .L_2TAG_PACKET_9.0.2
  186. shrl $23, %ecx
  187. subl $142, %ecx
  188. andl $65528, %ecx
  189. movsd 1040(%ebx,%ecx,2), %xmm3
  190. movsd 1048(%ebx,%ecx,2), %xmm5
  191. movsd 1360(%ebx), %xmm2
  192. xorpd %xmm4, %xmm4
  193. movl $17208, %eax
  194. pinsrw $3, %eax, %xmm4
  195. andpd %xmm3, %xmm2
  196. psllq $40, %xmm3
  197. mulsd %xmm1, %xmm2
  198. mulsd %xmm1, %xmm3
  199. mulsd %xmm5, %xmm1
  200. movapd %xmm2, %xmm0
  201. addsd %xmm3, %xmm2
  202. movapd %xmm2, %xmm5
  203. subsd %xmm2, %xmm0
  204. addsd %xmm4, %xmm2
  205. addsd %xmm0, %xmm3
  206. movd %xmm2, %ecx
  207. subsd %xmm4, %xmm2
  208. addsd %xmm3, %xmm1
  209. jmp .L_2TAG_PACKET_3.0.2
  210. .L_2TAG_PACKET_9.0.2:
  211. movl 4(%esp), %eax
  212. andl $-24577, %eax
  213. cmpl 4(%esp), %eax
  214. je .L_2TAG_PACKET_10.0.2
  215. stmxcsr 8(%esp)
  216. movl 4(%esp), %eax
  217. andl $24576, %eax
  218. orl %eax, 8(%esp)
  219. ldmxcsr 8(%esp)
  220. .L_2TAG_PACKET_10.0.2:
  221. subss %xmm0, %xmm0
  222. movss %xmm0, (%esp)
  223. flds (%esp)
  224. .L_2TAG_PACKET_5.0.2:
  225. addl $16, %esp
  226. movl 36(%esp), %ebx
  227. movl %ebp, %esp
  228. popl %ebp
  229. ret
  230. ..B2.3:
  231. .align 16,0x90
  232. .type cosf,@function
  233. .size cosf,.-cosf
  234. .data
  235. # -- End cosf
  236. .section .rodata, "a"
  237. .align 16
  238. .align 16
  239. static_const_table:
  240. .long 0
  241. .long 0
  242. .long 3384690142
  243. .long 1060355388
  244. .long 918535681
  245. .long 3195026356
  246. .long 735532773
  247. .long 1060354999
  248. .long 3431923622
  249. .long 3196074611
  250. .long 2385983684
  251. .long 1060353830
  252. .long 3670374716
  253. .long 3196605580
  254. .long 2769466396
  255. .long 1060351883
  256. .long 3087185898
  257. .long 3197121906
  258. .long 2627920248
  259. .long 1060349159
  260. .long 624330694
  261. .long 3197386271
  262. .long 418831766
  263. .long 1060345660
  264. .long 1991825541
  265. .long 3197649836
  266. .long 900924147
  267. .long 1060341387
  268. .long 3917367244
  269. .long 3197912443
  270. .long 2243801771
  271. .long 1060336343
  272. .long 2803392399
  273. .long 3198165367
  274. .long 316258674
  275. .long 1060330532
  276. .long 2429158325
  277. .long 3198295476
  278. .long 1563320407
  279. .long 1060323956
  280. .long 1382541649
  281. .long 3198424870
  282. .long 1522351063
  283. .long 1060316620
  284. .long 4207787592
  285. .long 3198553470
  286. .long 1992674941
  287. .long 1060308528
  288. .long 321119318
  289. .long 3198681201
  290. .long 2434209605
  291. .long 1060299685
  292. .long 2865853451
  293. .long 3198807983
  294. .long 4249822861
  295. .long 1060290096
  296. .long 1666812989
  297. .long 3198933742
  298. .long 2181617495
  299. .long 1060279768
  300. .long 2082609563
  301. .long 3199058401
  302. .long 1475857720
  303. .long 1060268706
  304. .long 3726787968
  305. .long 3199181885
  306. .long 687004205
  307. .long 1060256917
  308. .long 2478530408
  309. .long 3199254748
  310. .long 250409509
  311. .long 1060244408
  312. .long 3681356269
  313. .long 3199315204
  314. .long 2463945945
  315. .long 1060231186
  316. .long 1535093810
  317. .long 3199374963
  318. .long 2878576948
  319. .long 1060217260
  320. .long 350661592
  321. .long 3199433988
  322. .long 3162654741
  323. .long 1060202638
  324. .long 2042383238
  325. .long 3199492243
  326. .long 2490283769
  327. .long 1060187329
  328. .long 1925003623
  329. .long 3199549694
  330. .long 1813501338
  331. .long 1060171342
  332. .long 1689375324
  333. .long 3199606306
  334. .long 3838419993
  335. .long 1060154686
  336. .long 902054988
  337. .long 3199662045
  338. .long 115411415
  339. .long 1060137373
  340. .long 1388494065
  341. .long 3199716877
  342. .long 1077921708
  343. .long 1060119411
  344. .long 3024934267
  345. .long 3199770769
  346. .long 3311502568
  347. .long 1060091288
  348. .long 3823857331
  349. .long 3199823689
  350. .long 1148832537
  351. .long 1060052839
  352. .long 17970311
  353. .long 3199875606
  354. .long 652328457
  355. .long 1060013161
  356. .long 3322544997
  357. .long 3199926486
  358. .long 1395127179
  359. .long 1059972278
  360. .long 2361617751
  361. .long 3199976301
  362. .long 1772140623
  363. .long 1059930215
  364. .long 1401987205
  365. .long 3200025020
  366. .long 3231311734
  367. .long 1059886997
  368. .long 3250975870
  369. .long 3200072613
  370. .long 1618129506
  371. .long 1059842651
  372. .long 742418353
  373. .long 3200119053
  374. .long 4288148241
  375. .long 1059797202
  376. .long 2580634211
  377. .long 3200164310
  378. .long 4268074870
  379. .long 1059750679
  380. .long 3348027550
  381. .long 3200208358
  382. .long 1659779181
  383. .long 1059703110
  384. .long 755484892
  385. .long 3200251171
  386. .long 3567792879
  387. .long 1059654522
  388. .long 2993330
  389. .long 3200273337
  390. .long 2550341159
  391. .long 1059604946
  392. .long 488211833
  393. .long 3200293469
  394. .long 2313428161
  395. .long 1059554411
  396. .long 3436142021
  397. .long 3200312945
  398. .long 453708735
  399. .long 1059502948
  400. .long 1407782048
  401. .long 3200331755
  402. .long 1264637048
  403. .long 1059450587
  404. .long 1575056534
  405. .long 3200349886
  406. .long 2771364651
  407. .long 1059397360
  408. .long 4275292648
  409. .long 3200367327
  410. .long 944109265
  411. .long 1059343300
  412. .long 3039475318
  413. .long 3200384069
  414. .long 2500108843
  415. .long 1059288438
  416. .long 1799297257
  417. .long 3200400101
  418. .long 3344537919
  419. .long 1059232808
  420. .long 2028347177
  421. .long 3200415413
  422. .long 1369913724
  423. .long 1059176444
  424. .long 2767093429
  425. .long 3200429996
  426. .long 664370609
  427. .long 1059119379
  428. .long 646746141
  429. .long 3200443842
  430. .long 1372808103
  431. .long 1059061535
  432. .long 2796885356
  433. .long 3200456941
  434. .long 941816458
  435. .long 1058944809
  436. .long 1097233945
  437. .long 3200469287
  438. .long 1373383079
  439. .long 1058826890
  440. .long 2262842797
  441. .long 3200480871
  442. .long 2796081240
  443. .long 1058707849
  444. .long 2093526290
  445. .long 3200491687
  446. .long 3945677176
  447. .long 1058587758
  448. .long 2671784286
  449. .long 3200501728
  450. .long 1979618421
  451. .long 1058466690
  452. .long 3789723003
  453. .long 3200510988
  454. .long 879820317
  455. .long 1058344717
  456. .long 2964703016
  457. .long 3200519462
  458. .long 2674059679
  459. .long 1058221912
  460. .long 4043704933
  461. .long 3200527144
  462. .long 2950925715
  463. .long 1058098350
  464. .long 36665700
  465. .long 3200534031
  466. .long 2811721921
  467. .long 1057935027
  468. .long 3193221610
  469. .long 3200540116
  470. .long 3297207428
  471. .long 1057685321
  472. .long 2063766514
  473. .long 3200545398
  474. .long 544295963
  475. .long 1057434550
  476. .long 163641427
  477. .long 3200549873
  478. .long 3381119115
  479. .long 1057182863
  480. .long 3096463640
  481. .long 3200553537
  482. .long 3054827835
  483. .long 1056896220
  484. .long 1381230637
  485. .long 3200556390
  486. .long 3419039295
  487. .long 1056390099
  488. .long 522802171
  489. .long 3200558429
  490. .long 1693671239
  491. .long 1055850091
  492. .long 3836476539
  493. .long 3200559652
  494. .long 1466910230
  495. .long 1054802127
  496. .long 3861233235
  497. .long 3200560060
  498. .long 0
  499. .long 0
  500. .long 1832810809
  501. .long 1078222640
  502. .long 4036845384
  503. .long 1030771879
  504. .long 1832810809
  505. .long 1078222640
  506. .long 4036845384
  507. .long 1030771879
  508. .long 1916669064
  509. .long 1072155675
  510. .long 660066805
  511. .long 1024797180
  512. .long 3829231700
  513. .long 1062745828
  514. .long 2884172442
  515. .long 1017445907
  516. .long 540874025
  517. .long 1055617650
  518. .long 4198409884
  519. .long 1011844330
  520. .long 2839315448
  521. .long 1046639136
  522. .long 4204424928
  523. .long 1000582120
  524. .long 1329339431
  525. .long 1038229673
  526. .long 1295478839
  527. .long 993391741
  528. .long 658191860
  529. .long 1024797180
  530. .long 3691886121
  531. .long 979325773
  532. .long 1966800710
  533. .long 1020436418
  534. .long 1882642597
  535. .long 977095991
  536. .long 2100977488
  537. .long 1012908661
  538. .long 1840335565
  539. .long 967470816
  540. .long 4198093645
  541. .long 1000582120
  542. .long 3307942521
  543. .long 957055414
  544. .long 2839123165
  545. .long 996851343
  546. .long 1387472776
  547. .long 952638316
  548. .long 2788761024
  549. .long 988712873
  550. .long 3005712498
  551. .long 944467026
  552. .long 3694676832
  553. .long 979325773
  554. .long 1326507024
  555. .long 934847846
  556. .long 221775557
  557. .long 970149340
  558. .long 1133527550
  559. .long 924162364
  560. .long 4286578688
  561. .long 1072693247
  562. .long 0
  563. .long 0
  564. .long 1845493760
  565. .long 1078222640
  566. .long 0
  567. .long 0
  568. .long 0
  569. .long 1127743488
  570. .long 0
  571. .long 0
  572. .long 2908765579
  573. .long 3193641918
  574. .long 0
  575. .long 0
  576. .long 2308576600
  577. .long 1086551075
  578. .long 1646446368
  579. .long 1084878895
  580. .long 4278190080
  581. .long 4294967295
  582. .long 0
  583. .long 0
  584. .type static_const_table,@object
  585. .size static_const_table,1376
  586. .data
  587. .section .note.GNU-stack, ""
  588. # End