cosf_gen.S 12 KB

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