summaryrefslogtreecommitdiffstats
path: root/libm/x86_64/s_cos.S
blob: ab5a0e1b711488a7136c77387ebfdc9fae7107f3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
/*
Copyright (c) 2014, Intel Corporation
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

    * Redistributions of source code must retain the above copyright notice,
    * this list of conditions and the following disclaimer.

    * Redistributions in binary form must reproduce the above copyright notice,
    * this list of conditions and the following disclaimer in the documentation
    * and/or other materials provided with the distribution.

    * Neither the name of Intel Corporation nor the names of its contributors
    * may be used to endorse or promote products derived from this software
    * without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

/******************************************************************************/
//                     ALGORITHM DESCRIPTION
//                     ---------------------
//
//     1. RANGE REDUCTION
//
//     We perform an initial range reduction from X to r with
//
//          X =~= N * pi/32 + r
//
//     so that |r| <= pi/64 + epsilon. We restrict inputs to those
//     where |N| <= 932560. Beyond this, the range reduction is
//     insufficiently accurate. For extremely small inputs, 
//     denormalization can occur internally, impacting performance.
//     This means that the main path is actually only taken for
//     2^-252 <= |X| < 90112.
//
//     To avoid branches, we perform the range reduction to full
//     accuracy each time.
//
//          X - N * (P_1 + P_2 + P_3)
//
//     where P_1 and P_2 are 32-bit numbers (so multiplication by N
//     is exact) and P_3 is a 53-bit number. Together, these
//     approximate pi well enough for all cases in the restricted
//     range.
//
//     The main reduction sequence is:
//
//             y = 32/pi * x
//             N = integer(y)
//     (computed by adding and subtracting off SHIFTER)
//
//             m_1 = N * P_1
//             m_2 = N * P_2
//             r_1 = x - m_1
//             r = r_1 - m_2
//     (this r can be used for most of the calculation)
//
//             c_1 = r_1 - r
//             m_3 = N * P_3
//             c_2 = c_1 - m_2
//             c = c_2 - m_3
//
//     2. MAIN ALGORITHM
//
//     The algorithm uses a table lookup based on B = M * pi / 32
//     where M = N mod 64. The stored values are:
//       sigma             closest power of 2 to cos(B)
//       C_hl              53-bit cos(B) - sigma
//       S_hi + S_lo       2 * 53-bit sin(B)
//
//     The computation is organized as follows:
//
//          sin(B + r + c) = [sin(B) + sigma * r] +
//                           r * (cos(B) - sigma) +
//                           sin(B) * [cos(r + c) - 1] +
//                           cos(B) * [sin(r + c) - r]
//
//     which is approximately:
//
//          [S_hi + sigma * r] +
//          C_hl * r +
//          S_lo + S_hi * [(cos(r) - 1) - r * c] +
//          (C_hl + sigma) * [(sin(r) - r) + c]
//
//     and this is what is actually computed. We separate this sum
//     into four parts:
//
//          hi + med + pols + corr
//
//     where
//
//          hi       = S_hi + sigma r
//          med      = C_hl * r
//          pols     = S_hi * (cos(r) - 1) + (C_hl + sigma) * (sin(r) - r)
//          corr     = S_lo + c * ((C_hl + sigma) - S_hi * r)
//
//     3. POLYNOMIAL
//
//     The polynomial S_hi * (cos(r) - 1) + (C_hl + sigma) *
//     (sin(r) - r) can be rearranged freely, since it is quite
//     small, so we exploit parallelism to the fullest.
//
//          psc4       =   SC_4 * r_1
//          msc4       =   psc4 * r
//          r2         =   r * r
//          msc2       =   SC_2 * r2
//          r4         =   r2 * r2
//          psc3       =   SC_3 + msc4
//          psc1       =   SC_1 + msc2
//          msc3       =   r4 * psc3
//          sincospols =   psc1 + msc3
//          pols       =   sincospols *
//                         <S_hi * r^2 | (C_hl + sigma) * r^3>
//
//     4. CORRECTION TERM
//
//     This is where the "c" component of the range reduction is
//     taken into account; recall that just "r" is used for most of
//     the calculation.
//
//          -c   = m_3 - c_2
//          -d   = S_hi * r - (C_hl + sigma)
//          corr = -c * -d + S_lo
//
//     5. COMPENSATED SUMMATIONS
//
//     The two successive compensated summations add up the high
//     and medium parts, leaving just the low parts to add up at
//     the end.
//
//          rs        =  sigma * r
//          res_int   =  S_hi + rs
//          k_0       =  S_hi - res_int
//          k_2       =  k_0 + rs
//          med       =  C_hl * r
//          res_hi    =  res_int + med
//          k_1       =  res_int - res_hi
//          k_3       =  k_1 + med
//
//     6. FINAL SUMMATION
//
//     We now add up all the small parts:
//
//          res_lo = pols(hi) + pols(lo) + corr + k_1 + k_3
//
//     Now the overall result is just:
//
//          res_hi + res_lo
//
//     7. SMALL ARGUMENTS
//
//     Inputs with |X| < 2^-252 are treated specially as
//     1 - |x|.
//
// Special cases:
//  cos(NaN) = quiet NaN, and raise invalid exception
//  cos(INF) = NaN and raise invalid exception
//  cos(0) = 1
//
/******************************************************************************/

#include <private/bionic_asm.h>
# -- Begin  cos
ENTRY(cos)
# parameter 1: %xmm0
..B1.1:
..___tag_value_cos.1:
        pushq     %rbx
..___tag_value_cos.3:
        subq      $16, %rsp
..___tag_value_cos.5:
        movsd     %xmm0, 8(%rsp)
..B1.2:
        movl      12(%rsp), %eax
        movq      PI32INV(%rip), %xmm1
        andl      $2147418112, %eax
        subl      $808452096, %eax
        cmpl      $281346048, %eax
        ja        .L_2TAG_PACKET_0.0.1
        mulsd     %xmm0, %xmm1
        movapd    ONEHALF(%rip), %xmm5
        movq      SIGN_MASK(%rip), %xmm4
        andpd     %xmm0, %xmm4
        orps      %xmm4, %xmm5
        addpd     %xmm5, %xmm1
        cvttsd2si %xmm1, %edx
        cvtsi2sd  %edx, %xmm1
        movapd    P_2(%rip), %xmm2
        movq      P_1(%rip), %xmm3
        mulsd     %xmm1, %xmm3
        unpcklpd  %xmm1, %xmm1
        addq      $1865232, %rdx
        movq      %xmm0, %xmm4
        andq      $63, %rdx
        movapd    SC_4(%rip), %xmm5
        lea       Ctable(%rip), %rax
        shlq      $5, %rdx
        addq      %rdx, %rax
        mulpd     %xmm1, %xmm2
        subsd     %xmm3, %xmm0
        mulsd     P_3(%rip), %xmm1
        subsd     %xmm3, %xmm4
        movq      8(%rax), %xmm7
        unpcklpd  %xmm0, %xmm0
        movq      %xmm4, %xmm3
        subsd     %xmm2, %xmm4
        mulpd     %xmm0, %xmm5
        subpd     %xmm2, %xmm0
        movapd    SC_2(%rip), %xmm6
        mulsd     %xmm4, %xmm7
        subsd     %xmm4, %xmm3
        mulpd     %xmm0, %xmm5
        mulpd     %xmm0, %xmm0
        subsd     %xmm2, %xmm3
        movapd    (%rax), %xmm2
        subsd     %xmm3, %xmm1
        movq      24(%rax), %xmm3
        addsd     %xmm3, %xmm2
        subsd     %xmm2, %xmm7
        mulsd     %xmm4, %xmm2
        mulpd     %xmm0, %xmm6
        mulsd     %xmm4, %xmm3
        mulpd     %xmm0, %xmm2
        mulpd     %xmm0, %xmm0
        addpd     SC_3(%rip), %xmm5
        mulsd     (%rax), %xmm4
        addpd     SC_1(%rip), %xmm6
        mulpd     %xmm0, %xmm5
        movq      %xmm3, %xmm0
        addsd     8(%rax), %xmm3
        mulpd     %xmm7, %xmm1
        movq      %xmm4, %xmm7
        addsd     %xmm3, %xmm4
        addpd     %xmm5, %xmm6
        movq      8(%rax), %xmm5
        subsd     %xmm3, %xmm5
        subsd     %xmm4, %xmm3
        addsd     16(%rax), %xmm1
        mulpd     %xmm2, %xmm6
        addsd     %xmm5, %xmm0
        addsd     %xmm7, %xmm3
        addsd     %xmm1, %xmm0
        addsd     %xmm3, %xmm0
        addsd     %xmm6, %xmm0
        unpckhpd  %xmm6, %xmm6
        addsd     %xmm6, %xmm0
        addsd     %xmm4, %xmm0
        jmp       ..B1.4
.L_2TAG_PACKET_0.0.1:
        jg        .L_2TAG_PACKET_1.0.1
        pextrw    $3, %xmm0, %eax
        andw      $32767, %ax
        pinsrw    $3, %eax, %xmm0
        movq      ONE(%rip), %xmm1
        subsd     %xmm0, %xmm1
        movq      %xmm1, %xmm0
        jmp       ..B1.4
.L_2TAG_PACKET_1.0.1:
        pextrw    $3, %xmm0, %eax
        andl      $32752, %eax
        cmpl      $32752, %eax
        je        .L_2TAG_PACKET_2.0.1
        pextrw    $3, %xmm0, %ecx
        andl      $32752, %ecx
        subl      $16224, %ecx
        shrl      $7, %ecx
        andl      $65532, %ecx
        lea       PI_INV_TABLE(%rip), %r11
        addq      %r11, %rcx
        movd      %xmm0, %rax
        movl      20(%rcx), %r10d
        movl      24(%rcx), %r8d
        movl      %eax, %edx
        shrq      $21, %rax
        orl       $-2147483648, %eax
        shrl      $11, %eax
        movl      %r10d, %r9d
        imulq     %rdx, %r10
        imulq     %rax, %r9
        imulq     %rax, %r8
        movl      16(%rcx), %esi
        movl      12(%rcx), %edi
        movl      %r10d, %r11d
        shrq      $32, %r10
        addq      %r10, %r9
        addq      %r8, %r11
        movl      %r11d, %r8d
        shrq      $32, %r11
        addq      %r11, %r9
        movl      %esi, %r10d
        imulq     %rdx, %rsi
        imulq     %rax, %r10
        movl      %edi, %r11d
        imulq     %rdx, %rdi
        movl      %esi, %ebx
        shrq      $32, %rsi
        addq      %rbx, %r9
        movl      %r9d, %ebx
        shrq      $32, %r9
        addq      %rsi, %r10
        addq      %r9, %r10
        shlq      $32, %rbx
        orq       %rbx, %r8
        imulq     %rax, %r11
        movl      8(%rcx), %r9d
        movl      4(%rcx), %esi
        movl      %edi, %ebx
        shrq      $32, %rdi
        addq      %rbx, %r10
        movl      %r10d, %ebx
        shrq      $32, %r10
        addq      %rdi, %r11
        addq      %r10, %r11
        movq      %r9, %rdi
        imulq     %rdx, %r9
        imulq     %rax, %rdi
        movl      %r9d, %r10d
        shrq      $32, %r9
        addq      %r10, %r11
        movl      %r11d, %r10d
        shrq      $32, %r11
        addq      %r9, %rdi
        addq      %r11, %rdi
        movq      %rsi, %r9
        imulq     %rdx, %rsi
        imulq     %rax, %r9
        shlq      $32, %r10
        orq       %rbx, %r10
        movl      (%rcx), %eax
        movl      %esi, %r11d
        shrq      $32, %rsi
        addq      %r11, %rdi
        movl      %edi, %r11d
        shrq      $32, %rdi
        addq      %rsi, %r9
        addq      %rdi, %r9
        imulq     %rax, %rdx
        pextrw    $3, %xmm0, %ebx
        lea       PI_INV_TABLE(%rip), %rdi
        subq      %rdi, %rcx
        addl      %ecx, %ecx
        addl      %ecx, %ecx
        addl      %ecx, %ecx
        addl      $19, %ecx
        movl      $32768, %esi
        andl      %ebx, %esi
        shrl      $4, %ebx
        andl      $2047, %ebx
        subl      $1023, %ebx
        subl      %ebx, %ecx
        addq      %rdx, %r9
        movl      %ecx, %edx
        addl      $32, %edx
        cmpl      $1, %ecx
        jl        .L_2TAG_PACKET_3.0.1
        negl      %ecx
        addl      $29, %ecx
        shll      %cl, %r9d
        movl      %r9d, %edi
        andl      $536870911, %r9d
        testl     $268435456, %r9d
        jne       .L_2TAG_PACKET_4.0.1
        shrl      %cl, %r9d
        movl      $0, %ebx
        shlq      $32, %r9
        orq       %r11, %r9
.L_2TAG_PACKET_5.0.1:
.L_2TAG_PACKET_6.0.1:
        cmpq      $0, %r9
        je        .L_2TAG_PACKET_7.0.1
.L_2TAG_PACKET_8.0.1:
        bsr       %r9, %r11
        movl      $29, %ecx
        subl      %r11d, %ecx
        jle       .L_2TAG_PACKET_9.0.1
        shlq      %cl, %r9
        movq      %r10, %rax
        shlq      %cl, %r10
        addl      %ecx, %edx
        negl      %ecx
        addl      $64, %ecx
        shrq      %cl, %rax
        shrq      %cl, %r8
        orq       %rax, %r9
        orq       %r8, %r10
.L_2TAG_PACKET_10.0.1:
        cvtsi2sdq %r9, %xmm0
        shrq      $1, %r10
        cvtsi2sdq %r10, %xmm3
        xorpd     %xmm4, %xmm4
        shll      $4, %edx
        negl      %edx
        addl      $16368, %edx
        orl       %esi, %edx
        xorl      %ebx, %edx
        pinsrw    $3, %edx, %xmm4
        movq      PI_4(%rip), %xmm2
        movq      8+PI_4(%rip), %xmm6
        xorpd     %xmm5, %xmm5
        subl      $1008, %edx
        pinsrw    $3, %edx, %xmm5
        mulsd     %xmm4, %xmm0
        shll      $16, %esi
        sarl      $31, %esi
        mulsd     %xmm5, %xmm3
        movq      %xmm0, %xmm1
        mulsd     %xmm2, %xmm0
        shrl      $29, %edi
        addsd     %xmm3, %xmm1
        mulsd     %xmm2, %xmm3
        addl      %esi, %edi
        xorl      %esi, %edi
        mulsd     %xmm1, %xmm6
        movl      %edi, %eax
        addsd     %xmm3, %xmm6
        movq      %xmm0, %xmm2
        addsd     %xmm6, %xmm0
        subsd     %xmm0, %xmm2
        addsd     %xmm2, %xmm6
.L_2TAG_PACKET_11.0.1:
        movq      PI32INV(%rip), %xmm1
        mulsd     %xmm0, %xmm1
        movq      ONEHALF(%rip), %xmm5
        movq      SIGN_MASK(%rip), %xmm4
        andpd     %xmm0, %xmm4
        orps      %xmm4, %xmm5
        addpd     %xmm5, %xmm1
        cvttsd2si %xmm1, %rdx
        cvtsi2sdq %rdx, %xmm1
        movq      P_1(%rip), %xmm3
        movapd    P_2(%rip), %xmm2
        mulsd     %xmm1, %xmm3
        unpcklpd  %xmm1, %xmm1
        shll      $3, %eax
        addl      $1865232, %edx
        movq      %xmm0, %xmm4
        addl      %eax, %edx
        andl      $63, %edx
        movapd    SC_4(%rip), %xmm5
        lea       Ctable(%rip), %rax
        shll      $5, %edx
        addq      %rdx, %rax
        mulpd     %xmm1, %xmm2
        subsd     %xmm3, %xmm0
        mulsd     P_3(%rip), %xmm1
        subsd     %xmm3, %xmm4
        movq      8(%rax), %xmm7
        unpcklpd  %xmm0, %xmm0
        movq      %xmm4, %xmm3
        subsd     %xmm2, %xmm4
        mulpd     %xmm0, %xmm5
        subpd     %xmm2, %xmm0
        mulsd     %xmm4, %xmm7
        subsd     %xmm4, %xmm3
        mulpd     %xmm0, %xmm5
        mulpd     %xmm0, %xmm0
        subsd     %xmm2, %xmm3
        movapd    (%rax), %xmm2
        subsd     %xmm3, %xmm1
        movq      24(%rax), %xmm3
        addsd     %xmm3, %xmm2
        subsd     %xmm2, %xmm7
        subsd     %xmm6, %xmm1
        movapd    SC_2(%rip), %xmm6
        mulsd     %xmm4, %xmm2
        mulpd     %xmm0, %xmm6
        mulsd     %xmm4, %xmm3
        mulpd     %xmm0, %xmm2
        mulpd     %xmm0, %xmm0
        addpd     SC_3(%rip), %xmm5
        mulsd     (%rax), %xmm4
        addpd     SC_1(%rip), %xmm6
        mulpd     %xmm0, %xmm5
        movq      %xmm3, %xmm0
        addsd     8(%rax), %xmm3
        mulpd     %xmm7, %xmm1
        movq      %xmm4, %xmm7
        addsd     %xmm3, %xmm4
        addpd     %xmm5, %xmm6
        movq      8(%rax), %xmm5
        subsd     %xmm3, %xmm5
        subsd     %xmm4, %xmm3
        addsd     16(%rax), %xmm1
        mulpd     %xmm2, %xmm6
        addsd     %xmm0, %xmm5
        addsd     %xmm7, %xmm3
        addsd     %xmm5, %xmm1
        addsd     %xmm3, %xmm1
        addsd     %xmm6, %xmm1
        unpckhpd  %xmm6, %xmm6
        movq      %xmm4, %xmm0
        addsd     %xmm6, %xmm1
        addsd     %xmm1, %xmm0
        jmp       ..B1.4
.L_2TAG_PACKET_7.0.1:
        addl      $64, %edx
        movq      %r10, %r9
        movq      %r8, %r10
        movq      $0, %r8
        cmpq      $0, %r9
        jne       .L_2TAG_PACKET_8.0.1
        addl      $64, %edx
        movq      %r10, %r9
        movq      %r8, %r10
        cmpq      $0, %r9
        jne       .L_2TAG_PACKET_8.0.1
        xorpd     %xmm0, %xmm0
        xorpd     %xmm6, %xmm6
        jmp       .L_2TAG_PACKET_11.0.1
.L_2TAG_PACKET_9.0.1:
        je        .L_2TAG_PACKET_10.0.1
        negl      %ecx
        shrq      %cl, %r10
        movq      %r9, %rax
        shrq      %cl, %r9
        subl      %ecx, %edx
        negl      %ecx
        addl      $64, %ecx
        shlq      %cl, %rax
        orq       %rax, %r10
        jmp       .L_2TAG_PACKET_10.0.1
.L_2TAG_PACKET_3.0.1:
        negl      %ecx
        shlq      $32, %r9
        orq       %r11, %r9
        shlq      %cl, %r9
        movq      %r9, %rdi
        testl     $-2147483648, %r9d
        jne       .L_2TAG_PACKET_12.0.1
        shrl      %cl, %r9d
        movl      $0, %ebx
        shrq      $3, %rdi
        jmp       .L_2TAG_PACKET_6.0.1
.L_2TAG_PACKET_4.0.1:
        shrl      %cl, %r9d
        movl      $536870912, %ebx
        shrl      %cl, %ebx
        shlq      $32, %r9
        orq       %r11, %r9
        shlq      $32, %rbx
        addl      $536870912, %edi
        movq      $0, %rcx
        movq      $0, %r11
        subq      %r8, %rcx
        sbbq      %r10, %r11
        sbbq      %r9, %rbx
        movq      %rcx, %r8
        movq      %r11, %r10
        movq      %rbx, %r9
        movl      $32768, %ebx
        jmp       .L_2TAG_PACKET_5.0.1
.L_2TAG_PACKET_12.0.1:
        shrl      %cl, %r9d
        movq      $0x100000000, %rbx
        shrq      %cl, %rbx
        movq      $0, %rcx
        movq      $0, %r11
        subq      %r8, %rcx
        sbbq      %r10, %r11
        sbbq      %r9, %rbx
        movq      %rcx, %r8
        movq      %r11, %r10
        movq      %rbx, %r9
        movl      $32768, %ebx
        shrq      $3, %rdi
        addl      $536870912, %edi
        jmp       .L_2TAG_PACKET_6.0.1
.L_2TAG_PACKET_2.0.1:
        movsd     8(%rsp), %xmm0
        mulsd     NEG_ZERO(%rip), %xmm0
        movq      %xmm0, (%rsp)
.L_2TAG_PACKET_13.0.1:
..B1.4:
        addq      $16, %rsp
..___tag_value_cos.6:
        popq      %rbx
..___tag_value_cos.8:
        ret       
..___tag_value_cos.9:
END(cos)
# -- End  cos
	.section .rodata, "a"
	.align 16
	.align 16
ONEHALF:
	.long	0
	.long	1071644672
	.long	0
	.long	1071644672
	.type	ONEHALF,@object
	.size	ONEHALF,16
	.align 16
P_2:
	.long	442499072
	.long	1032893537
	.long	442499072
	.long	1032893537
	.type	P_2,@object
	.size	P_2,16
	.align 16
SC_4:
	.long	2773927732
	.long	1053236707
	.long	436314138
	.long	1056571808
	.type	SC_4,@object
	.size	SC_4,16
	.align 16
Ctable:
	.long	0
	.long	0
	.long	0
	.long	0
	.long	0
	.long	0
	.long	0
	.long	1072693248
	.long	393047345
	.long	3212032302
	.long	3156849708
	.long	1069094822
	.long	3758096384
	.long	3158189848
	.long	0
	.long	1072693248
	.long	18115067
	.long	3214126342
	.long	1013556747
	.long	1070135480
	.long	3221225472
	.long	3160567065
	.long	0
	.long	1072693248
	.long	2476548698
	.long	3215330282
	.long	785751814
	.long	1070765062
	.long	2684354560
	.long	3161838221
	.long	0
	.long	1072693248
	.long	2255197647
	.long	3216211105
	.long	2796464483
	.long	1071152610
	.long	3758096384
	.long	3160878317
	.long	0
	.long	1072693248
	.long	1945768569
	.long	3216915048
	.long	939980347
	.long	1071524701
	.long	536870912
	.long	1012796809
	.long	0
	.long	1072693248
	.long	1539668340
	.long	3217396327
	.long	967731400
	.long	1071761211
	.long	536870912
	.long	1015752157
	.long	0
	.long	1072693248
	.long	1403757309
	.long	3217886718
	.long	621354454
	.long	1071926515
	.long	536870912
	.long	1013450602
	.long	0
	.long	1072693248
	.long	2583490354
	.long	1070236281
	.long	1719614413
	.long	1072079006
	.long	536870912
	.long	3163282740
	.long	0
	.long	1071644672
	.long	2485417816
	.long	1069626316
	.long	1796544321
	.long	1072217216
	.long	536870912
	.long	3162686945
	.long	0
	.long	1071644672
	.long	2598800519
	.long	1068266419
	.long	688824739
	.long	1072339814
	.long	3758096384
	.long	1010431536
	.long	0
	.long	1071644672
	.long	2140183630
	.long	3214756396
	.long	4051746225
	.long	1072445618
	.long	2147483648
	.long	3161907377
	.long	0
	.long	1071644672
	.long	1699043957
	.long	3216902261
	.long	3476196678
	.long	1072533611
	.long	536870912
	.long	1014257638
	.long	0
	.long	1071644672
	.long	1991047213
	.long	1067753521
	.long	1455828442
	.long	1072602945
	.long	3758096384
	.long	1015505073
	.long	0
	.long	1070596096
	.long	240740309
	.long	3215727903
	.long	3489094832
	.long	1072652951
	.long	536870912
	.long	1014325783
	.long	0
	.long	1070596096
	.long	257503056
	.long	3214647653
	.long	2748392742
	.long	1072683149
	.long	1073741824
	.long	3163061750
	.long	0
	.long	1069547520
	.long	0
	.long	0
	.long	0
	.long	1072693248
	.long	0
	.long	0
	.long	0
	.long	0
	.long	257503056
	.long	1067164005
	.long	2748392742
	.long	1072683149
	.long	1073741824
	.long	3163061750
	.long	0
	.long	3217031168
	.long	240740309
	.long	1068244255
	.long	3489094832
	.long	1072652951
	.long	536870912
	.long	1014325783
	.long	0
	.long	3218079744
	.long	1991047213
	.long	3215237169
	.long	1455828442
	.long	1072602945
	.long	3758096384
	.long	1015505073
	.long	0
	.long	3218079744
	.long	1699043957
	.long	1069418613
	.long	3476196678
	.long	1072533611
	.long	536870912
	.long	1014257638
	.long	0
	.long	3219128320
	.long	2140183630
	.long	1067272748
	.long	4051746225
	.long	1072445618
	.long	2147483648
	.long	3161907377
	.long	0
	.long	3219128320
	.long	2598800519
	.long	3215750067
	.long	688824739
	.long	1072339814
	.long	3758096384
	.long	1010431536
	.long	0
	.long	3219128320
	.long	2485417816
	.long	3217109964
	.long	1796544321
	.long	1072217216
	.long	536870912
	.long	3162686945
	.long	0
	.long	3219128320
	.long	2583490354
	.long	3217719929
	.long	1719614413
	.long	1072079006
	.long	536870912
	.long	3163282740
	.long	0
	.long	3219128320
	.long	1403757309
	.long	1070403070
	.long	621354454
	.long	1071926515
	.long	536870912
	.long	1013450602
	.long	0
	.long	3220176896
	.long	1539668340
	.long	1069912679
	.long	967731400
	.long	1071761211
	.long	536870912
	.long	1015752157
	.long	0
	.long	3220176896
	.long	1945768569
	.long	1069431400
	.long	939980347
	.long	1071524701
	.long	536870912
	.long	1012796809
	.long	0
	.long	3220176896
	.long	2255197647
	.long	1068727457
	.long	2796464483
	.long	1071152610
	.long	3758096384
	.long	3160878317
	.long	0
	.long	3220176896
	.long	2476548698
	.long	1067846634
	.long	785751814
	.long	1070765062
	.long	2684354560
	.long	3161838221
	.long	0
	.long	3220176896
	.long	18115067
	.long	1066642694
	.long	1013556747
	.long	1070135480
	.long	3221225472
	.long	3160567065
	.long	0
	.long	3220176896
	.long	393047345
	.long	1064548654
	.long	3156849708
	.long	1069094822
	.long	3758096384
	.long	3158189848
	.long	0
	.long	3220176896
	.long	0
	.long	0
	.long	0
	.long	0
	.long	0
	.long	0
	.long	0
	.long	3220176896
	.long	393047345
	.long	1064548654
	.long	3156849708
	.long	3216578470
	.long	3758096384
	.long	1010706200
	.long	0
	.long	3220176896
	.long	18115067
	.long	1066642694
	.long	1013556747
	.long	3217619128
	.long	3221225472
	.long	1013083417
	.long	0
	.long	3220176896
	.long	2476548698
	.long	1067846634
	.long	785751814
	.long	3218248710
	.long	2684354560
	.long	1014354573
	.long	0
	.long	3220176896
	.long	2255197647
	.long	1068727457
	.long	2796464483
	.long	3218636258
	.long	3758096384
	.long	1013394669
	.long	0
	.long	3220176896
	.long	1945768569
	.long	1069431400
	.long	939980347
	.long	3219008349
	.long	536870912
	.long	3160280457
	.long	0
	.long	3220176896
	.long	1539668340
	.long	1069912679
	.long	967731400
	.long	3219244859
	.long	536870912
	.long	3163235805
	.long	0
	.long	3220176896
	.long	1403757309
	.long	1070403070
	.long	621354454
	.long	3219410163
	.long	536870912
	.long	3160934250
	.long	0
	.long	3220176896
	.long	2583490354
	.long	3217719929
	.long	1719614413
	.long	3219562654
	.long	536870912
	.long	1015799092
	.long	0
	.long	3219128320
	.long	2485417816
	.long	3217109964
	.long	1796544321
	.long	3219700864
	.long	536870912
	.long	1015203297
	.long	0
	.long	3219128320
	.long	2598800519
	.long	3215750067
	.long	688824739
	.long	3219823462
	.long	3758096384
	.long	3157915184
	.long	0
	.long	3219128320
	.long	2140183630
	.long	1067272748
	.long	4051746225
	.long	3219929266
	.long	2147483648
	.long	1014423729
	.long	0
	.long	3219128320
	.long	1699043957
	.long	1069418613
	.long	3476196678
	.long	3220017259
	.long	536870912
	.long	3161741286
	.long	0
	.long	3219128320
	.long	1991047213
	.long	3215237169
	.long	1455828442
	.long	3220086593
	.long	3758096384
	.long	3162988721
	.long	0
	.long	3218079744
	.long	240740309
	.long	1068244255
	.long	3489094832
	.long	3220136599
	.long	536870912
	.long	3161809431
	.long	0
	.long	3218079744
	.long	257503056
	.long	1067164005
	.long	2748392742
	.long	3220166797
	.long	1073741824
	.long	1015578102
	.long	0
	.long	3217031168
	.long	0
	.long	0
	.long	0
	.long	3220176896
	.long	0
	.long	0
	.long	0
	.long	0
	.long	257503056
	.long	3214647653
	.long	2748392742
	.long	3220166797
	.long	1073741824
	.long	1015578102
	.long	0
	.long	1069547520
	.long	240740309
	.long	3215727903
	.long	3489094832
	.long	3220136599
	.long	536870912
	.long	3161809431
	.long	0
	.long	1070596096
	.long	1991047213
	.long	1067753521
	.long	1455828442
	.long	3220086593
	.long	3758096384
	.long	3162988721
	.long	0
	.long	1070596096
	.long	1699043957
	.long	3216902261
	.long	3476196678
	.long	3220017259
	.long	536870912
	.long	3161741286
	.long	0
	.long	1071644672
	.long	2140183630
	.long	3214756396
	.long	4051746225
	.long	3219929266
	.long	2147483648
	.long	1014423729
	.long	0
	.long	1071644672
	.long	2598800519
	.long	1068266419
	.long	688824739
	.long	3219823462
	.long	3758096384
	.long	3157915184
	.long	0
	.long	1071644672
	.long	2485417816
	.long	1069626316
	.long	1796544321
	.long	3219700864
	.long	536870912
	.long	1015203297
	.long	0
	.long	1071644672
	.long	2583490354
	.long	1070236281
	.long	1719614413
	.long	3219562654
	.long	536870912
	.long	1015799092
	.long	0
	.long	1071644672
	.long	1403757309
	.long	3217886718
	.long	621354454
	.long	3219410163
	.long	536870912
	.long	3160934250
	.long	0
	.long	1072693248
	.long	1539668340
	.long	3217396327
	.long	967731400
	.long	3219244859
	.long	536870912
	.long	3163235805
	.long	0
	.long	1072693248
	.long	1945768569
	.long	3216915048
	.long	939980347
	.long	3219008349
	.long	536870912
	.long	3160280457
	.long	0
	.long	1072693248
	.long	2255197647
	.long	3216211105
	.long	2796464483
	.long	3218636258
	.long	3758096384
	.long	1013394669
	.long	0
	.long	1072693248
	.long	2476548698
	.long	3215330282
	.long	785751814
	.long	3218248710
	.long	2684354560
	.long	1014354573
	.long	0
	.long	1072693248
	.long	18115067
	.long	3214126342
	.long	1013556747
	.long	3217619128
	.long	3221225472
	.long	1013083417
	.long	0
	.long	1072693248
	.long	393047345
	.long	3212032302
	.long	3156849708
	.long	3216578470
	.long	3758096384
	.long	1010706200
	.long	0
	.long	1072693248
	.type	Ctable,@object
	.size	Ctable,2048
	.align 16
SC_2:
	.long	286331153
	.long	1065423121
	.long	1431655765
	.long	1067799893
	.type	SC_2,@object
	.size	SC_2,16
	.align 16
SC_3:
	.long	436314138
	.long	3207201184
	.long	381774871
	.long	3210133868
	.type	SC_3,@object
	.size	SC_3,16
	.align 16
SC_1:
	.long	1431655765
	.long	3217380693
	.long	0
	.long	3219128320
	.type	SC_1,@object
	.size	SC_1,16
	.align 16
PI_INV_TABLE:
	.long	0
	.long	0
	.long	2734261102
	.long	1313084713
	.long	4230436817
	.long	4113882560
	.long	3680671129
	.long	1011060801
	.long	4266746795
	.long	3736847713
	.long	3072618042
	.long	1112396512
	.long	105459434
	.long	164729372
	.long	4263373596
	.long	2972297022
	.long	3900847605
	.long	784024708
	.long	3919343654
	.long	3026157121
	.long	965858873
	.long	2203269620
	.long	2625920907
	.long	3187222587
	.long	536385535
	.long	3724908559
	.long	4012839307
	.long	1510632735
	.long	1832287951
	.long	667617719
	.long	1330003814
	.long	2657085997
	.long	1965537991
	.long	3957715323
	.long	1023883767
	.long	2320667370
	.long	1811636145
	.long	529358088
	.long	1443049542
	.long	4235946923
	.long	4040145953
	.type	PI_INV_TABLE,@object
	.size	PI_INV_TABLE,164
	.space 12, 0x00 	# pad
	.align 16
PI_4:
	.long	1073741824
	.long	1072243195
	.long	407279769
	.long	1046758445
	.type	PI_4,@object
	.size	PI_4,16
	.align 8
PI32INV:
	.long	1841940611
	.long	1076125488
	.type	PI32INV,@object
	.size	PI32INV,8
	.align 8
SIGN_MASK:
	.long	0
	.long	2147483648
	.type	SIGN_MASK,@object
	.size	SIGN_MASK,8
	.align 8
P_1:
	.long	1413480448
	.long	1069097467
	.type	P_1,@object
	.size	P_1,8
	.align 8
P_3:
	.long	771977331
	.long	996350346
	.type	P_3,@object
	.size	P_3,8
	.align 8
ONE:
	.long	0
	.long	1072693248
	.type	ONE,@object
	.size	ONE,8
	.align 8
NEG_ZERO:
	.long	0
	.long	2147483648
	.type	NEG_ZERO,@object
	.size	NEG_ZERO,8
	.data
	.section .note.GNU-stack, ""
// -- Begin DWARF2 SEGMENT .eh_frame
	.section .eh_frame,"a",@progbits
.eh_frame_seg:
	.align 1
	.4byte 0x00000014
	.8byte 0x00527a0100000000
	.8byte 0x08070c1b01107801
	.4byte 0x00000190
	.4byte 0x0000002c
	.4byte 0x0000001c
	.4byte ..___tag_value_cos.1-.
	.4byte ..___tag_value_cos.9-..___tag_value_cos.1
	.2byte 0x0400
	.4byte ..___tag_value_cos.3-..___tag_value_cos.1
	.4byte 0x0283100e
	.byte 0x04
	.4byte ..___tag_value_cos.5-..___tag_value_cos.3
	.2byte 0x200e
	.byte 0x04
	.4byte ..___tag_value_cos.6-..___tag_value_cos.5
	.4byte 0x04c3100e
	.4byte ..___tag_value_cos.8-..___tag_value_cos.6
	.2byte 0x080e
# End