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
|
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc < %s -mtriple=i686-unknown-unknown -mattr=+sse2 | FileCheck %s --check-prefixes=X86,X86-SSE
; RUN: llc < %s -mtriple=i686-unknown-unknown -mattr=+avx | FileCheck %s --check-prefixes=X86,X86-AVX,X86-AVX1OR2,X86-AVX1
; RUN: llc < %s -mtriple=i686-unknown-unknown -mattr=+avx2 | FileCheck %s --check-prefixes=X86,X86-AVX,X86-AVX1OR2,X86-AVX2
; RUN: llc < %s -mtriple=i686-unknown-unknown -mattr=+avx512vl | FileCheck %s --check-prefixes=X86,X86-AVX,X86-AVX512,X86-AVX512VL
; RUN: llc < %s -mtriple=i686-unknown-unknown -mattr=+avx512fp16,+avx512vl | FileCheck %s --check-prefixes=X86,X86-AVX,X86-AVX512,X86-AVX512FP16
; RUN: llc < %s -mtriple=i686-unknown-unknown -mattr=+avx512dq,+avx512vl | FileCheck %s --check-prefixes=X86,X86-AVX,X86-AVX512,X86-AVX512VLDQ
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+sse2 | FileCheck %s --check-prefixes=X64,X64-SSE
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx | FileCheck %s --check-prefixes=X64,X64-AVX,X64-AVX1OR2,X64-AVX1
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx2 | FileCheck %s --check-prefixes=X64,X64-AVX,X64-AVX1OR2,X64-AVX2
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx512vl | FileCheck %s --check-prefixes=X64,X64-AVX,X64-AVX512,X64-AVX512VL
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx512fp16,+avx512vl | FileCheck %s --check-prefixes=X64,X64-AVX,X64-AVX512,X64-AVX512FP16
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx512dq,+avx512vl | FileCheck %s --check-prefixes=X64,X64-AVX,X64-AVX512,X64-AVX512VLDQ
;
; 128-bit Vectors
;
define <2 x double> @fcopysign_v2f64(<2 x double> %a0, <2 x double> %a1) nounwind {
; X86-SSE-LABEL: fcopysign_v2f64:
; X86-SSE: # %bb.0:
; X86-SSE-NEXT: andps {{\.?LCPI[0-9]+_[0-9]+}}, %xmm1
; X86-SSE-NEXT: andps {{\.?LCPI[0-9]+_[0-9]+}}, %xmm0
; X86-SSE-NEXT: orps %xmm1, %xmm0
; X86-SSE-NEXT: retl
;
; X86-AVX1OR2-LABEL: fcopysign_v2f64:
; X86-AVX1OR2: # %bb.0:
; X86-AVX1OR2-NEXT: vandps {{\.?LCPI[0-9]+_[0-9]+}}, %xmm1, %xmm1
; X86-AVX1OR2-NEXT: vandps {{\.?LCPI[0-9]+_[0-9]+}}, %xmm0, %xmm0
; X86-AVX1OR2-NEXT: vorps %xmm1, %xmm0, %xmm0
; X86-AVX1OR2-NEXT: retl
;
; X86-AVX512-LABEL: fcopysign_v2f64:
; X86-AVX512: # %bb.0:
; X86-AVX512-NEXT: vpternlogq $228, {{\.?LCPI[0-9]+_[0-9]+}}{1to2}, %xmm1, %xmm0
; X86-AVX512-NEXT: retl
;
; X64-SSE-LABEL: fcopysign_v2f64:
; X64-SSE: # %bb.0:
; X64-SSE-NEXT: andps {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1
; X64-SSE-NEXT: andps {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0
; X64-SSE-NEXT: orps %xmm1, %xmm0
; X64-SSE-NEXT: retq
;
; X64-AVX1OR2-LABEL: fcopysign_v2f64:
; X64-AVX1OR2: # %bb.0:
; X64-AVX1OR2-NEXT: vandps {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1, %xmm1
; X64-AVX1OR2-NEXT: vandps {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0, %xmm0
; X64-AVX1OR2-NEXT: vorps %xmm1, %xmm0, %xmm0
; X64-AVX1OR2-NEXT: retq
;
; X64-AVX512-LABEL: fcopysign_v2f64:
; X64-AVX512: # %bb.0:
; X64-AVX512-NEXT: vpternlogq $228, {{\.?LCPI[0-9]+_[0-9]+}}(%rip){1to2}, %xmm1, %xmm0
; X64-AVX512-NEXT: retq
%t = call <2 x double> @llvm.copysign.v2f64(<2 x double> %a0, <2 x double> %a1)
ret <2 x double> %t
}
declare <2 x double> @llvm.copysign.v2f64(<2 x double>, <2 x double>)
define <4 x float> @fcopysign_v4f32(<4 x float> %a0, <4 x float> %a1) nounwind {
; X86-SSE-LABEL: fcopysign_v4f32:
; X86-SSE: # %bb.0:
; X86-SSE-NEXT: andps {{\.?LCPI[0-9]+_[0-9]+}}, %xmm1
; X86-SSE-NEXT: andps {{\.?LCPI[0-9]+_[0-9]+}}, %xmm0
; X86-SSE-NEXT: orps %xmm1, %xmm0
; X86-SSE-NEXT: retl
;
; X86-AVX1-LABEL: fcopysign_v4f32:
; X86-AVX1: # %bb.0:
; X86-AVX1-NEXT: vandps {{\.?LCPI[0-9]+_[0-9]+}}, %xmm1, %xmm1
; X86-AVX1-NEXT: vandps {{\.?LCPI[0-9]+_[0-9]+}}, %xmm0, %xmm0
; X86-AVX1-NEXT: vorps %xmm1, %xmm0, %xmm0
; X86-AVX1-NEXT: retl
;
; X86-AVX2-LABEL: fcopysign_v4f32:
; X86-AVX2: # %bb.0:
; X86-AVX2-NEXT: vbroadcastss {{.*#+}} xmm2 = [-0.0E+0,-0.0E+0,-0.0E+0,-0.0E+0]
; X86-AVX2-NEXT: vandps %xmm2, %xmm1, %xmm1
; X86-AVX2-NEXT: vbroadcastss {{.*#+}} xmm2 = [NaN,NaN,NaN,NaN]
; X86-AVX2-NEXT: vandps %xmm2, %xmm0, %xmm0
; X86-AVX2-NEXT: vorps %xmm1, %xmm0, %xmm0
; X86-AVX2-NEXT: retl
;
; X86-AVX512-LABEL: fcopysign_v4f32:
; X86-AVX512: # %bb.0:
; X86-AVX512-NEXT: vpternlogd $228, {{\.?LCPI[0-9]+_[0-9]+}}{1to4}, %xmm1, %xmm0
; X86-AVX512-NEXT: retl
;
; X64-SSE-LABEL: fcopysign_v4f32:
; X64-SSE: # %bb.0:
; X64-SSE-NEXT: andps {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1
; X64-SSE-NEXT: andps {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0
; X64-SSE-NEXT: orps %xmm1, %xmm0
; X64-SSE-NEXT: retq
;
; X64-AVX1-LABEL: fcopysign_v4f32:
; X64-AVX1: # %bb.0:
; X64-AVX1-NEXT: vandps {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1, %xmm1
; X64-AVX1-NEXT: vandps {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0, %xmm0
; X64-AVX1-NEXT: vorps %xmm1, %xmm0, %xmm0
; X64-AVX1-NEXT: retq
;
; X64-AVX2-LABEL: fcopysign_v4f32:
; X64-AVX2: # %bb.0:
; X64-AVX2-NEXT: vbroadcastss {{.*#+}} xmm2 = [-0.0E+0,-0.0E+0,-0.0E+0,-0.0E+0]
; X64-AVX2-NEXT: vandps %xmm2, %xmm1, %xmm1
; X64-AVX2-NEXT: vbroadcastss {{.*#+}} xmm2 = [NaN,NaN,NaN,NaN]
; X64-AVX2-NEXT: vandps %xmm2, %xmm0, %xmm0
; X64-AVX2-NEXT: vorps %xmm1, %xmm0, %xmm0
; X64-AVX2-NEXT: retq
;
; X64-AVX512-LABEL: fcopysign_v4f32:
; X64-AVX512: # %bb.0:
; X64-AVX512-NEXT: vpternlogd $228, {{\.?LCPI[0-9]+_[0-9]+}}(%rip){1to4}, %xmm1, %xmm0
; X64-AVX512-NEXT: retq
%t = call <4 x float> @llvm.copysign.v4f32(<4 x float> %a0, <4 x float> %a1)
ret <4 x float> %t
}
declare <4 x float> @llvm.copysign.v4f32(<4 x float>, <4 x float>)
define <8 x half> @fcopysign_v8f16(ptr %p0, ptr %p1) nounwind {
; X86-SSE-LABEL: fcopysign_v8f16:
; X86-SSE: # %bb.0:
; X86-SSE-NEXT: movl {{[0-9]+}}(%esp), %eax
; X86-SSE-NEXT: movl {{[0-9]+}}(%esp), %ecx
; X86-SSE-NEXT: movaps (%ecx), %xmm0
; X86-SSE-NEXT: movaps (%eax), %xmm1
; X86-SSE-NEXT: andps {{\.?LCPI[0-9]+_[0-9]+}}, %xmm1
; X86-SSE-NEXT: andps {{\.?LCPI[0-9]+_[0-9]+}}, %xmm0
; X86-SSE-NEXT: orps %xmm1, %xmm0
; X86-SSE-NEXT: retl
;
; X86-AVX1-LABEL: fcopysign_v8f16:
; X86-AVX1: # %bb.0:
; X86-AVX1-NEXT: movl {{[0-9]+}}(%esp), %eax
; X86-AVX1-NEXT: movl {{[0-9]+}}(%esp), %ecx
; X86-AVX1-NEXT: vmovaps (%ecx), %xmm0
; X86-AVX1-NEXT: vmovaps (%eax), %xmm1
; X86-AVX1-NEXT: vandps {{\.?LCPI[0-9]+_[0-9]+}}, %xmm1, %xmm1
; X86-AVX1-NEXT: vandps {{\.?LCPI[0-9]+_[0-9]+}}, %xmm0, %xmm0
; X86-AVX1-NEXT: vorps %xmm1, %xmm0, %xmm0
; X86-AVX1-NEXT: retl
;
; X86-AVX2-LABEL: fcopysign_v8f16:
; X86-AVX2: # %bb.0:
; X86-AVX2-NEXT: movl {{[0-9]+}}(%esp), %eax
; X86-AVX2-NEXT: movl {{[0-9]+}}(%esp), %ecx
; X86-AVX2-NEXT: vpbroadcastw {{.*#+}} xmm0 = [-0.0E+0,-0.0E+0,-0.0E+0,-0.0E+0,-0.0E+0,-0.0E+0,-0.0E+0,-0.0E+0]
; X86-AVX2-NEXT: vpand (%ecx), %xmm0, %xmm0
; X86-AVX2-NEXT: vpbroadcastw {{.*#+}} xmm1 = [NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN]
; X86-AVX2-NEXT: vpand (%eax), %xmm1, %xmm1
; X86-AVX2-NEXT: vpor %xmm0, %xmm1, %xmm0
; X86-AVX2-NEXT: retl
;
; X86-AVX512-LABEL: fcopysign_v8f16:
; X86-AVX512: # %bb.0:
; X86-AVX512-NEXT: movl {{[0-9]+}}(%esp), %eax
; X86-AVX512-NEXT: movl {{[0-9]+}}(%esp), %ecx
; X86-AVX512-NEXT: vmovdqa (%ecx), %xmm1
; X86-AVX512-NEXT: vpbroadcastd {{.*#+}} xmm0 = [2147450879,2147450879,2147450879,2147450879]
; X86-AVX512-NEXT: vpternlogd $202, (%eax), %xmm1, %xmm0
; X86-AVX512-NEXT: retl
;
; X64-SSE-LABEL: fcopysign_v8f16:
; X64-SSE: # %bb.0:
; X64-SSE-NEXT: movaps (%rdi), %xmm0
; X64-SSE-NEXT: movaps (%rsi), %xmm1
; X64-SSE-NEXT: andps {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1
; X64-SSE-NEXT: andps {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0
; X64-SSE-NEXT: orps %xmm1, %xmm0
; X64-SSE-NEXT: retq
;
; X64-AVX1-LABEL: fcopysign_v8f16:
; X64-AVX1: # %bb.0:
; X64-AVX1-NEXT: vmovaps (%rdi), %xmm0
; X64-AVX1-NEXT: vmovaps (%rsi), %xmm1
; X64-AVX1-NEXT: vandps {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1, %xmm1
; X64-AVX1-NEXT: vandps {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0, %xmm0
; X64-AVX1-NEXT: vorps %xmm1, %xmm0, %xmm0
; X64-AVX1-NEXT: retq
;
; X64-AVX2-LABEL: fcopysign_v8f16:
; X64-AVX2: # %bb.0:
; X64-AVX2-NEXT: vpbroadcastw {{.*#+}} xmm0 = [-0.0E+0,-0.0E+0,-0.0E+0,-0.0E+0,-0.0E+0,-0.0E+0,-0.0E+0,-0.0E+0]
; X64-AVX2-NEXT: vpand (%rsi), %xmm0, %xmm0
; X64-AVX2-NEXT: vpbroadcastw {{.*#+}} xmm1 = [NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN]
; X64-AVX2-NEXT: vpand (%rdi), %xmm1, %xmm1
; X64-AVX2-NEXT: vpor %xmm0, %xmm1, %xmm0
; X64-AVX2-NEXT: retq
;
; X64-AVX512-LABEL: fcopysign_v8f16:
; X64-AVX512: # %bb.0:
; X64-AVX512-NEXT: vmovdqa (%rdi), %xmm1
; X64-AVX512-NEXT: vpbroadcastd {{.*#+}} xmm0 = [2147450879,2147450879,2147450879,2147450879]
; X64-AVX512-NEXT: vpternlogd $202, (%rsi), %xmm1, %xmm0
; X64-AVX512-NEXT: retq
%a0 = load <8 x half>, ptr %p0, align 16
%a1 = load <8 x half>, ptr %p1, align 16
%t = call <8 x half> @llvm.copysign.v8f16(<8 x half> %a0, <8 x half> %a1)
ret <8 x half> %t
}
declare <8 x half> @llvm.copysign.v8f16(<8 x half>, <8 x half>)
;
; 256-bit Vectors
;
define <4 x double> @fcopysign_v4f64(<4 x double> %a0, <4 x double> %a1) nounwind {
; X86-SSE-LABEL: fcopysign_v4f64:
; X86-SSE: # %bb.0:
; X86-SSE-NEXT: pushl %ebp
; X86-SSE-NEXT: movl %esp, %ebp
; X86-SSE-NEXT: andl $-16, %esp
; X86-SSE-NEXT: subl $16, %esp
; X86-SSE-NEXT: movaps {{.*#+}} xmm3 = [NaN,NaN]
; X86-SSE-NEXT: movaps %xmm3, %xmm4
; X86-SSE-NEXT: andnps %xmm2, %xmm4
; X86-SSE-NEXT: andps %xmm3, %xmm0
; X86-SSE-NEXT: orps %xmm4, %xmm0
; X86-SSE-NEXT: andps %xmm3, %xmm1
; X86-SSE-NEXT: andnps 8(%ebp), %xmm3
; X86-SSE-NEXT: orps %xmm3, %xmm1
; X86-SSE-NEXT: movl %ebp, %esp
; X86-SSE-NEXT: popl %ebp
; X86-SSE-NEXT: retl
;
; X86-AVX1-LABEL: fcopysign_v4f64:
; X86-AVX1: # %bb.0:
; X86-AVX1-NEXT: vandps {{\.?LCPI[0-9]+_[0-9]+}}, %ymm1, %ymm1
; X86-AVX1-NEXT: vandps {{\.?LCPI[0-9]+_[0-9]+}}, %ymm0, %ymm0
; X86-AVX1-NEXT: vorps %ymm1, %ymm0, %ymm0
; X86-AVX1-NEXT: retl
;
; X86-AVX2-LABEL: fcopysign_v4f64:
; X86-AVX2: # %bb.0:
; X86-AVX2-NEXT: vbroadcastsd {{.*#+}} ymm2 = [-0.0E+0,-0.0E+0,-0.0E+0,-0.0E+0]
; X86-AVX2-NEXT: vandps %ymm2, %ymm1, %ymm1
; X86-AVX2-NEXT: vbroadcastsd {{.*#+}} ymm2 = [NaN,NaN,NaN,NaN]
; X86-AVX2-NEXT: vandps %ymm2, %ymm0, %ymm0
; X86-AVX2-NEXT: vorps %ymm1, %ymm0, %ymm0
; X86-AVX2-NEXT: retl
;
; X86-AVX512-LABEL: fcopysign_v4f64:
; X86-AVX512: # %bb.0:
; X86-AVX512-NEXT: vpternlogq $228, {{\.?LCPI[0-9]+_[0-9]+}}{1to4}, %ymm1, %ymm0
; X86-AVX512-NEXT: retl
;
; X64-SSE-LABEL: fcopysign_v4f64:
; X64-SSE: # %bb.0:
; X64-SSE-NEXT: movaps {{.*#+}} xmm4 = [NaN,NaN]
; X64-SSE-NEXT: movaps %xmm4, %xmm5
; X64-SSE-NEXT: andnps %xmm2, %xmm5
; X64-SSE-NEXT: andps %xmm4, %xmm0
; X64-SSE-NEXT: orps %xmm5, %xmm0
; X64-SSE-NEXT: andps %xmm4, %xmm1
; X64-SSE-NEXT: andnps %xmm3, %xmm4
; X64-SSE-NEXT: orps %xmm4, %xmm1
; X64-SSE-NEXT: retq
;
; X64-AVX1-LABEL: fcopysign_v4f64:
; X64-AVX1: # %bb.0:
; X64-AVX1-NEXT: vandps {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %ymm1, %ymm1
; X64-AVX1-NEXT: vandps {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %ymm0, %ymm0
; X64-AVX1-NEXT: vorps %ymm1, %ymm0, %ymm0
; X64-AVX1-NEXT: retq
;
; X64-AVX2-LABEL: fcopysign_v4f64:
; X64-AVX2: # %bb.0:
; X64-AVX2-NEXT: vbroadcastsd {{.*#+}} ymm2 = [-0.0E+0,-0.0E+0,-0.0E+0,-0.0E+0]
; X64-AVX2-NEXT: vandps %ymm2, %ymm1, %ymm1
; X64-AVX2-NEXT: vbroadcastsd {{.*#+}} ymm2 = [NaN,NaN,NaN,NaN]
; X64-AVX2-NEXT: vandps %ymm2, %ymm0, %ymm0
; X64-AVX2-NEXT: vorps %ymm1, %ymm0, %ymm0
; X64-AVX2-NEXT: retq
;
; X64-AVX512-LABEL: fcopysign_v4f64:
; X64-AVX512: # %bb.0:
; X64-AVX512-NEXT: vpternlogq $228, {{\.?LCPI[0-9]+_[0-9]+}}(%rip){1to4}, %ymm1, %ymm0
; X64-AVX512-NEXT: retq
%t = call <4 x double> @llvm.copysign.v4f64(<4 x double> %a0, <4 x double> %a1)
ret <4 x double> %t
}
declare <4 x double> @llvm.copysign.v4f64(<4 x double>, <4 x double>)
define <8 x float> @fcopysign_v8f32(<8 x float> %a0, <8 x float> %a1) nounwind {
; X86-SSE-LABEL: fcopysign_v8f32:
; X86-SSE: # %bb.0:
; X86-SSE-NEXT: pushl %ebp
; X86-SSE-NEXT: movl %esp, %ebp
; X86-SSE-NEXT: andl $-16, %esp
; X86-SSE-NEXT: subl $16, %esp
; X86-SSE-NEXT: movaps {{.*#+}} xmm3 = [NaN,NaN,NaN,NaN]
; X86-SSE-NEXT: movaps %xmm3, %xmm4
; X86-SSE-NEXT: andnps %xmm2, %xmm4
; X86-SSE-NEXT: andps %xmm3, %xmm0
; X86-SSE-NEXT: orps %xmm4, %xmm0
; X86-SSE-NEXT: andps %xmm3, %xmm1
; X86-SSE-NEXT: andnps 8(%ebp), %xmm3
; X86-SSE-NEXT: orps %xmm3, %xmm1
; X86-SSE-NEXT: movl %ebp, %esp
; X86-SSE-NEXT: popl %ebp
; X86-SSE-NEXT: retl
;
; X86-AVX1-LABEL: fcopysign_v8f32:
; X86-AVX1: # %bb.0:
; X86-AVX1-NEXT: vandps {{\.?LCPI[0-9]+_[0-9]+}}, %ymm1, %ymm1
; X86-AVX1-NEXT: vandps {{\.?LCPI[0-9]+_[0-9]+}}, %ymm0, %ymm0
; X86-AVX1-NEXT: vorps %ymm1, %ymm0, %ymm0
; X86-AVX1-NEXT: retl
;
; X86-AVX2-LABEL: fcopysign_v8f32:
; X86-AVX2: # %bb.0:
; X86-AVX2-NEXT: vbroadcastss {{.*#+}} ymm2 = [-0.0E+0,-0.0E+0,-0.0E+0,-0.0E+0,-0.0E+0,-0.0E+0,-0.0E+0,-0.0E+0]
; X86-AVX2-NEXT: vandps %ymm2, %ymm1, %ymm1
; X86-AVX2-NEXT: vbroadcastss {{.*#+}} ymm2 = [NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN]
; X86-AVX2-NEXT: vandps %ymm2, %ymm0, %ymm0
; X86-AVX2-NEXT: vorps %ymm1, %ymm0, %ymm0
; X86-AVX2-NEXT: retl
;
; X86-AVX512-LABEL: fcopysign_v8f32:
; X86-AVX512: # %bb.0:
; X86-AVX512-NEXT: vpternlogd $228, {{\.?LCPI[0-9]+_[0-9]+}}{1to8}, %ymm1, %ymm0
; X86-AVX512-NEXT: retl
;
; X64-SSE-LABEL: fcopysign_v8f32:
; X64-SSE: # %bb.0:
; X64-SSE-NEXT: movaps {{.*#+}} xmm4 = [NaN,NaN,NaN,NaN]
; X64-SSE-NEXT: movaps %xmm4, %xmm5
; X64-SSE-NEXT: andnps %xmm2, %xmm5
; X64-SSE-NEXT: andps %xmm4, %xmm0
; X64-SSE-NEXT: orps %xmm5, %xmm0
; X64-SSE-NEXT: andps %xmm4, %xmm1
; X64-SSE-NEXT: andnps %xmm3, %xmm4
; X64-SSE-NEXT: orps %xmm4, %xmm1
; X64-SSE-NEXT: retq
;
; X64-AVX1-LABEL: fcopysign_v8f32:
; X64-AVX1: # %bb.0:
; X64-AVX1-NEXT: vandps {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %ymm1, %ymm1
; X64-AVX1-NEXT: vandps {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %ymm0, %ymm0
; X64-AVX1-NEXT: vorps %ymm1, %ymm0, %ymm0
; X64-AVX1-NEXT: retq
;
; X64-AVX2-LABEL: fcopysign_v8f32:
; X64-AVX2: # %bb.0:
; X64-AVX2-NEXT: vbroadcastss {{.*#+}} ymm2 = [-0.0E+0,-0.0E+0,-0.0E+0,-0.0E+0,-0.0E+0,-0.0E+0,-0.0E+0,-0.0E+0]
; X64-AVX2-NEXT: vandps %ymm2, %ymm1, %ymm1
; X64-AVX2-NEXT: vbroadcastss {{.*#+}} ymm2 = [NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN]
; X64-AVX2-NEXT: vandps %ymm2, %ymm0, %ymm0
; X64-AVX2-NEXT: vorps %ymm1, %ymm0, %ymm0
; X64-AVX2-NEXT: retq
;
; X64-AVX512-LABEL: fcopysign_v8f32:
; X64-AVX512: # %bb.0:
; X64-AVX512-NEXT: vpternlogd $228, {{\.?LCPI[0-9]+_[0-9]+}}(%rip){1to8}, %ymm1, %ymm0
; X64-AVX512-NEXT: retq
%t = call <8 x float> @llvm.copysign.v8f32(<8 x float> %a0, <8 x float> %a1)
ret <8 x float> %t
}
declare <8 x float> @llvm.copysign.v8f32(<8 x float>, <8 x float>)
define <16 x half> @fcopysign_v16f16(ptr %p0, ptr %p1) nounwind {
; X86-SSE-LABEL: fcopysign_v16f16:
; X86-SSE: # %bb.0:
; X86-SSE-NEXT: movl {{[0-9]+}}(%esp), %eax
; X86-SSE-NEXT: movl {{[0-9]+}}(%esp), %ecx
; X86-SSE-NEXT: movaps {{.*#+}} xmm1 = [NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN]
; X86-SSE-NEXT: movaps %xmm1, %xmm2
; X86-SSE-NEXT: andnps (%ecx), %xmm2
; X86-SSE-NEXT: movaps (%eax), %xmm0
; X86-SSE-NEXT: andps %xmm1, %xmm0
; X86-SSE-NEXT: orps %xmm2, %xmm0
; X86-SSE-NEXT: movaps %xmm1, %xmm2
; X86-SSE-NEXT: andnps 16(%ecx), %xmm2
; X86-SSE-NEXT: andps 16(%eax), %xmm1
; X86-SSE-NEXT: orps %xmm2, %xmm1
; X86-SSE-NEXT: retl
;
; X86-AVX1-LABEL: fcopysign_v16f16:
; X86-AVX1: # %bb.0:
; X86-AVX1-NEXT: movl {{[0-9]+}}(%esp), %eax
; X86-AVX1-NEXT: movl {{[0-9]+}}(%esp), %ecx
; X86-AVX1-NEXT: vmovups (%ecx), %ymm0
; X86-AVX1-NEXT: vmovups (%eax), %ymm1
; X86-AVX1-NEXT: vandps {{\.?LCPI[0-9]+_[0-9]+}}, %ymm1, %ymm1
; X86-AVX1-NEXT: vandps {{\.?LCPI[0-9]+_[0-9]+}}, %ymm0, %ymm0
; X86-AVX1-NEXT: vorps %ymm1, %ymm0, %ymm0
; X86-AVX1-NEXT: retl
;
; X86-AVX2-LABEL: fcopysign_v16f16:
; X86-AVX2: # %bb.0:
; X86-AVX2-NEXT: movl {{[0-9]+}}(%esp), %eax
; X86-AVX2-NEXT: movl {{[0-9]+}}(%esp), %ecx
; X86-AVX2-NEXT: vpbroadcastw {{.*#+}} ymm0 = [-0.0E+0,-0.0E+0,-0.0E+0,-0.0E+0,-0.0E+0,-0.0E+0,-0.0E+0,-0.0E+0,-0.0E+0,-0.0E+0,-0.0E+0,-0.0E+0,-0.0E+0,-0.0E+0,-0.0E+0,-0.0E+0]
; X86-AVX2-NEXT: vpand (%ecx), %ymm0, %ymm0
; X86-AVX2-NEXT: vpbroadcastw {{.*#+}} ymm1 = [NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN]
; X86-AVX2-NEXT: vpand (%eax), %ymm1, %ymm1
; X86-AVX2-NEXT: vpor %ymm0, %ymm1, %ymm0
; X86-AVX2-NEXT: retl
;
; X86-AVX512-LABEL: fcopysign_v16f16:
; X86-AVX512: # %bb.0:
; X86-AVX512-NEXT: movl {{[0-9]+}}(%esp), %eax
; X86-AVX512-NEXT: movl {{[0-9]+}}(%esp), %ecx
; X86-AVX512-NEXT: vmovdqu (%ecx), %ymm1
; X86-AVX512-NEXT: vpbroadcastd {{.*#+}} ymm0 = [2147450879,2147450879,2147450879,2147450879,2147450879,2147450879,2147450879,2147450879]
; X86-AVX512-NEXT: vpternlogd $202, (%eax), %ymm1, %ymm0
; X86-AVX512-NEXT: retl
;
; X64-SSE-LABEL: fcopysign_v16f16:
; X64-SSE: # %bb.0:
; X64-SSE-NEXT: movaps {{.*#+}} xmm1 = [NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN]
; X64-SSE-NEXT: movaps %xmm1, %xmm2
; X64-SSE-NEXT: andnps (%rsi), %xmm2
; X64-SSE-NEXT: movaps (%rdi), %xmm0
; X64-SSE-NEXT: andps %xmm1, %xmm0
; X64-SSE-NEXT: orps %xmm2, %xmm0
; X64-SSE-NEXT: movaps %xmm1, %xmm2
; X64-SSE-NEXT: andnps 16(%rsi), %xmm2
; X64-SSE-NEXT: andps 16(%rdi), %xmm1
; X64-SSE-NEXT: orps %xmm2, %xmm1
; X64-SSE-NEXT: retq
;
; X64-AVX1-LABEL: fcopysign_v16f16:
; X64-AVX1: # %bb.0:
; X64-AVX1-NEXT: vmovups (%rdi), %ymm0
; X64-AVX1-NEXT: vmovups (%rsi), %ymm1
; X64-AVX1-NEXT: vandps {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %ymm1, %ymm1
; X64-AVX1-NEXT: vandps {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %ymm0, %ymm0
; X64-AVX1-NEXT: vorps %ymm1, %ymm0, %ymm0
; X64-AVX1-NEXT: retq
;
; X64-AVX2-LABEL: fcopysign_v16f16:
; X64-AVX2: # %bb.0:
; X64-AVX2-NEXT: vpbroadcastw {{.*#+}} ymm0 = [-0.0E+0,-0.0E+0,-0.0E+0,-0.0E+0,-0.0E+0,-0.0E+0,-0.0E+0,-0.0E+0,-0.0E+0,-0.0E+0,-0.0E+0,-0.0E+0,-0.0E+0,-0.0E+0,-0.0E+0,-0.0E+0]
; X64-AVX2-NEXT: vpand (%rsi), %ymm0, %ymm0
; X64-AVX2-NEXT: vpbroadcastw {{.*#+}} ymm1 = [NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN]
; X64-AVX2-NEXT: vpand (%rdi), %ymm1, %ymm1
; X64-AVX2-NEXT: vpor %ymm0, %ymm1, %ymm0
; X64-AVX2-NEXT: retq
;
; X64-AVX512-LABEL: fcopysign_v16f16:
; X64-AVX512: # %bb.0:
; X64-AVX512-NEXT: vmovdqu (%rdi), %ymm1
; X64-AVX512-NEXT: vpbroadcastd {{.*#+}} ymm0 = [2147450879,2147450879,2147450879,2147450879,2147450879,2147450879,2147450879,2147450879]
; X64-AVX512-NEXT: vpternlogd $202, (%rsi), %ymm1, %ymm0
; X64-AVX512-NEXT: retq
%a0 = load <16 x half>, ptr %p0, align 16
%a1 = load <16 x half>, ptr %p1, align 16
%t = call <16 x half> @llvm.copysign.v16f16(<16 x half> %a0, <16 x half> %a1)
ret <16 x half> %t
}
declare <16 x half> @llvm.copysign.v16f16(<16 x half>, <16 x half>)
;
; 512-bit Vectors
;
define <8 x double> @fcopysign_v8f64(<8 x double> %a0, <8 x double> %a1) nounwind {
; X86-SSE-LABEL: fcopysign_v8f64:
; X86-SSE: # %bb.0:
; X86-SSE-NEXT: pushl %ebp
; X86-SSE-NEXT: movl %esp, %ebp
; X86-SSE-NEXT: andl $-16, %esp
; X86-SSE-NEXT: subl $16, %esp
; X86-SSE-NEXT: movaps {{.*#+}} xmm3 = [NaN,NaN]
; X86-SSE-NEXT: andps %xmm3, %xmm0
; X86-SSE-NEXT: movaps %xmm3, %xmm4
; X86-SSE-NEXT: andnps 24(%ebp), %xmm4
; X86-SSE-NEXT: orps %xmm4, %xmm0
; X86-SSE-NEXT: andps %xmm3, %xmm1
; X86-SSE-NEXT: movaps %xmm3, %xmm4
; X86-SSE-NEXT: andnps 40(%ebp), %xmm4
; X86-SSE-NEXT: orps %xmm4, %xmm1
; X86-SSE-NEXT: andps %xmm3, %xmm2
; X86-SSE-NEXT: movaps %xmm3, %xmm4
; X86-SSE-NEXT: andnps 56(%ebp), %xmm4
; X86-SSE-NEXT: orps %xmm4, %xmm2
; X86-SSE-NEXT: movaps %xmm3, %xmm4
; X86-SSE-NEXT: andnps 72(%ebp), %xmm4
; X86-SSE-NEXT: andps 8(%ebp), %xmm3
; X86-SSE-NEXT: orps %xmm4, %xmm3
; X86-SSE-NEXT: movl %ebp, %esp
; X86-SSE-NEXT: popl %ebp
; X86-SSE-NEXT: retl
;
; X86-AVX1OR2-LABEL: fcopysign_v8f64:
; X86-AVX1OR2: # %bb.0:
; X86-AVX1OR2-NEXT: pushl %ebp
; X86-AVX1OR2-NEXT: movl %esp, %ebp
; X86-AVX1OR2-NEXT: andl $-32, %esp
; X86-AVX1OR2-NEXT: subl $32, %esp
; X86-AVX1OR2-NEXT: vbroadcastsd {{.*#+}} ymm3 = [NaN,NaN,NaN,NaN]
; X86-AVX1OR2-NEXT: vandnps %ymm2, %ymm3, %ymm2
; X86-AVX1OR2-NEXT: vandps %ymm3, %ymm0, %ymm0
; X86-AVX1OR2-NEXT: vorps %ymm2, %ymm0, %ymm0
; X86-AVX1OR2-NEXT: vandps %ymm3, %ymm1, %ymm1
; X86-AVX1OR2-NEXT: vandnps 8(%ebp), %ymm3, %ymm2
; X86-AVX1OR2-NEXT: vorps %ymm2, %ymm1, %ymm1
; X86-AVX1OR2-NEXT: movl %ebp, %esp
; X86-AVX1OR2-NEXT: popl %ebp
; X86-AVX1OR2-NEXT: retl
;
; X86-AVX512-LABEL: fcopysign_v8f64:
; X86-AVX512: # %bb.0:
; X86-AVX512-NEXT: vpternlogq $228, {{\.?LCPI[0-9]+_[0-9]+}}{1to8}, %zmm1, %zmm0
; X86-AVX512-NEXT: retl
;
; X64-SSE-LABEL: fcopysign_v8f64:
; X64-SSE: # %bb.0:
; X64-SSE-NEXT: movaps {{.*#+}} xmm8 = [NaN,NaN]
; X64-SSE-NEXT: movaps %xmm8, %xmm9
; X64-SSE-NEXT: andnps %xmm4, %xmm9
; X64-SSE-NEXT: andps %xmm8, %xmm0
; X64-SSE-NEXT: orps %xmm9, %xmm0
; X64-SSE-NEXT: movaps %xmm8, %xmm4
; X64-SSE-NEXT: andnps %xmm5, %xmm4
; X64-SSE-NEXT: andps %xmm8, %xmm1
; X64-SSE-NEXT: orps %xmm4, %xmm1
; X64-SSE-NEXT: movaps %xmm8, %xmm4
; X64-SSE-NEXT: andnps %xmm6, %xmm4
; X64-SSE-NEXT: andps %xmm8, %xmm2
; X64-SSE-NEXT: orps %xmm4, %xmm2
; X64-SSE-NEXT: andps %xmm8, %xmm3
; X64-SSE-NEXT: andnps %xmm7, %xmm8
; X64-SSE-NEXT: orps %xmm8, %xmm3
; X64-SSE-NEXT: retq
;
; X64-AVX1OR2-LABEL: fcopysign_v8f64:
; X64-AVX1OR2: # %bb.0:
; X64-AVX1OR2-NEXT: vbroadcastsd {{.*#+}} ymm4 = [NaN,NaN,NaN,NaN]
; X64-AVX1OR2-NEXT: vandnps %ymm2, %ymm4, %ymm2
; X64-AVX1OR2-NEXT: vandps %ymm4, %ymm0, %ymm0
; X64-AVX1OR2-NEXT: vorps %ymm2, %ymm0, %ymm0
; X64-AVX1OR2-NEXT: vandnps %ymm3, %ymm4, %ymm2
; X64-AVX1OR2-NEXT: vandps %ymm4, %ymm1, %ymm1
; X64-AVX1OR2-NEXT: vorps %ymm2, %ymm1, %ymm1
; X64-AVX1OR2-NEXT: retq
;
; X64-AVX512-LABEL: fcopysign_v8f64:
; X64-AVX512: # %bb.0:
; X64-AVX512-NEXT: vpternlogq $228, {{\.?LCPI[0-9]+_[0-9]+}}(%rip){1to8}, %zmm1, %zmm0
; X64-AVX512-NEXT: retq
%t = call <8 x double> @llvm.copysign.v8f64(<8 x double> %a0, <8 x double> %a1)
ret <8 x double> %t
}
declare <8 x double> @llvm.copysign.v8f64(<8 x double>, <8 x double>)
define <16 x float> @fcopysign_v16f32(<16 x float> %a0, <16 x float> %a1) nounwind {
; X86-SSE-LABEL: fcopysign_v16f32:
; X86-SSE: # %bb.0:
; X86-SSE-NEXT: pushl %ebp
; X86-SSE-NEXT: movl %esp, %ebp
; X86-SSE-NEXT: andl $-16, %esp
; X86-SSE-NEXT: subl $16, %esp
; X86-SSE-NEXT: movaps {{.*#+}} xmm3 = [NaN,NaN,NaN,NaN]
; X86-SSE-NEXT: andps %xmm3, %xmm0
; X86-SSE-NEXT: movaps %xmm3, %xmm4
; X86-SSE-NEXT: andnps 24(%ebp), %xmm4
; X86-SSE-NEXT: orps %xmm4, %xmm0
; X86-SSE-NEXT: andps %xmm3, %xmm1
; X86-SSE-NEXT: movaps %xmm3, %xmm4
; X86-SSE-NEXT: andnps 40(%ebp), %xmm4
; X86-SSE-NEXT: orps %xmm4, %xmm1
; X86-SSE-NEXT: andps %xmm3, %xmm2
; X86-SSE-NEXT: movaps %xmm3, %xmm4
; X86-SSE-NEXT: andnps 56(%ebp), %xmm4
; X86-SSE-NEXT: orps %xmm4, %xmm2
; X86-SSE-NEXT: movaps %xmm3, %xmm4
; X86-SSE-NEXT: andnps 72(%ebp), %xmm4
; X86-SSE-NEXT: andps 8(%ebp), %xmm3
; X86-SSE-NEXT: orps %xmm4, %xmm3
; X86-SSE-NEXT: movl %ebp, %esp
; X86-SSE-NEXT: popl %ebp
; X86-SSE-NEXT: retl
;
; X86-AVX1OR2-LABEL: fcopysign_v16f32:
; X86-AVX1OR2: # %bb.0:
; X86-AVX1OR2-NEXT: pushl %ebp
; X86-AVX1OR2-NEXT: movl %esp, %ebp
; X86-AVX1OR2-NEXT: andl $-32, %esp
; X86-AVX1OR2-NEXT: subl $32, %esp
; X86-AVX1OR2-NEXT: vbroadcastss {{.*#+}} ymm3 = [NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN]
; X86-AVX1OR2-NEXT: vandnps %ymm2, %ymm3, %ymm2
; X86-AVX1OR2-NEXT: vandps %ymm3, %ymm0, %ymm0
; X86-AVX1OR2-NEXT: vorps %ymm2, %ymm0, %ymm0
; X86-AVX1OR2-NEXT: vandps %ymm3, %ymm1, %ymm1
; X86-AVX1OR2-NEXT: vandnps 8(%ebp), %ymm3, %ymm2
; X86-AVX1OR2-NEXT: vorps %ymm2, %ymm1, %ymm1
; X86-AVX1OR2-NEXT: movl %ebp, %esp
; X86-AVX1OR2-NEXT: popl %ebp
; X86-AVX1OR2-NEXT: retl
;
; X86-AVX512-LABEL: fcopysign_v16f32:
; X86-AVX512: # %bb.0:
; X86-AVX512-NEXT: vpternlogd $228, {{\.?LCPI[0-9]+_[0-9]+}}{1to16}, %zmm1, %zmm0
; X86-AVX512-NEXT: retl
;
; X64-SSE-LABEL: fcopysign_v16f32:
; X64-SSE: # %bb.0:
; X64-SSE-NEXT: movaps {{.*#+}} xmm8 = [NaN,NaN,NaN,NaN]
; X64-SSE-NEXT: movaps %xmm8, %xmm9
; X64-SSE-NEXT: andnps %xmm4, %xmm9
; X64-SSE-NEXT: andps %xmm8, %xmm0
; X64-SSE-NEXT: orps %xmm9, %xmm0
; X64-SSE-NEXT: movaps %xmm8, %xmm4
; X64-SSE-NEXT: andnps %xmm5, %xmm4
; X64-SSE-NEXT: andps %xmm8, %xmm1
; X64-SSE-NEXT: orps %xmm4, %xmm1
; X64-SSE-NEXT: movaps %xmm8, %xmm4
; X64-SSE-NEXT: andnps %xmm6, %xmm4
; X64-SSE-NEXT: andps %xmm8, %xmm2
; X64-SSE-NEXT: orps %xmm4, %xmm2
; X64-SSE-NEXT: andps %xmm8, %xmm3
; X64-SSE-NEXT: andnps %xmm7, %xmm8
; X64-SSE-NEXT: orps %xmm8, %xmm3
; X64-SSE-NEXT: retq
;
; X64-AVX1OR2-LABEL: fcopysign_v16f32:
; X64-AVX1OR2: # %bb.0:
; X64-AVX1OR2-NEXT: vbroadcastss {{.*#+}} ymm4 = [NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN]
; X64-AVX1OR2-NEXT: vandnps %ymm2, %ymm4, %ymm2
; X64-AVX1OR2-NEXT: vandps %ymm4, %ymm0, %ymm0
; X64-AVX1OR2-NEXT: vorps %ymm2, %ymm0, %ymm0
; X64-AVX1OR2-NEXT: vandnps %ymm3, %ymm4, %ymm2
; X64-AVX1OR2-NEXT: vandps %ymm4, %ymm1, %ymm1
; X64-AVX1OR2-NEXT: vorps %ymm2, %ymm1, %ymm1
; X64-AVX1OR2-NEXT: retq
;
; X64-AVX512-LABEL: fcopysign_v16f32:
; X64-AVX512: # %bb.0:
; X64-AVX512-NEXT: vpternlogd $228, {{\.?LCPI[0-9]+_[0-9]+}}(%rip){1to16}, %zmm1, %zmm0
; X64-AVX512-NEXT: retq
%t = call <16 x float> @llvm.copysign.v16f32(<16 x float> %a0, <16 x float> %a1)
ret <16 x float> %t
}
declare <16 x float> @llvm.copysign.v16f32(<16 x float>, <16 x float>)
define <32 x half> @fcopysign_v32f16(ptr %p0, ptr %p1) nounwind {
; X86-SSE-LABEL: fcopysign_v32f16:
; X86-SSE: # %bb.0:
; X86-SSE-NEXT: movl {{[0-9]+}}(%esp), %eax
; X86-SSE-NEXT: movl {{[0-9]+}}(%esp), %ecx
; X86-SSE-NEXT: movaps {{.*#+}} xmm3 = [NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN]
; X86-SSE-NEXT: movaps %xmm3, %xmm1
; X86-SSE-NEXT: andnps (%ecx), %xmm1
; X86-SSE-NEXT: movaps (%eax), %xmm0
; X86-SSE-NEXT: andps %xmm3, %xmm0
; X86-SSE-NEXT: orps %xmm1, %xmm0
; X86-SSE-NEXT: movaps %xmm3, %xmm2
; X86-SSE-NEXT: andnps 16(%ecx), %xmm2
; X86-SSE-NEXT: movaps 16(%eax), %xmm1
; X86-SSE-NEXT: andps %xmm3, %xmm1
; X86-SSE-NEXT: orps %xmm2, %xmm1
; X86-SSE-NEXT: movaps %xmm3, %xmm4
; X86-SSE-NEXT: andnps 32(%ecx), %xmm4
; X86-SSE-NEXT: movaps 32(%eax), %xmm2
; X86-SSE-NEXT: andps %xmm3, %xmm2
; X86-SSE-NEXT: orps %xmm4, %xmm2
; X86-SSE-NEXT: movaps %xmm3, %xmm4
; X86-SSE-NEXT: andnps 48(%ecx), %xmm4
; X86-SSE-NEXT: andps 48(%eax), %xmm3
; X86-SSE-NEXT: orps %xmm4, %xmm3
; X86-SSE-NEXT: retl
;
; X86-AVX1-LABEL: fcopysign_v32f16:
; X86-AVX1: # %bb.0:
; X86-AVX1-NEXT: movl {{[0-9]+}}(%esp), %eax
; X86-AVX1-NEXT: movl {{[0-9]+}}(%esp), %ecx
; X86-AVX1-NEXT: vbroadcastss {{.*#+}} ymm1 = [NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN]
; X86-AVX1-NEXT: vandnps (%ecx), %ymm1, %ymm0
; X86-AVX1-NEXT: vandps (%eax), %ymm1, %ymm2
; X86-AVX1-NEXT: vorps %ymm0, %ymm2, %ymm0
; X86-AVX1-NEXT: vandnps 32(%ecx), %ymm1, %ymm2
; X86-AVX1-NEXT: vandps 32(%eax), %ymm1, %ymm1
; X86-AVX1-NEXT: vorps %ymm2, %ymm1, %ymm1
; X86-AVX1-NEXT: retl
;
; X86-AVX2-LABEL: fcopysign_v32f16:
; X86-AVX2: # %bb.0:
; X86-AVX2-NEXT: movl {{[0-9]+}}(%esp), %eax
; X86-AVX2-NEXT: movl {{[0-9]+}}(%esp), %ecx
; X86-AVX2-NEXT: vpbroadcastw {{.*#+}} ymm1 = [NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN]
; X86-AVX2-NEXT: vpandn (%ecx), %ymm1, %ymm0
; X86-AVX2-NEXT: vpand (%eax), %ymm1, %ymm2
; X86-AVX2-NEXT: vpor %ymm0, %ymm2, %ymm0
; X86-AVX2-NEXT: vpandn 32(%ecx), %ymm1, %ymm2
; X86-AVX2-NEXT: vpand 32(%eax), %ymm1, %ymm1
; X86-AVX2-NEXT: vpor %ymm2, %ymm1, %ymm1
; X86-AVX2-NEXT: retl
;
; X86-AVX512-LABEL: fcopysign_v32f16:
; X86-AVX512: # %bb.0:
; X86-AVX512-NEXT: movl {{[0-9]+}}(%esp), %eax
; X86-AVX512-NEXT: movl {{[0-9]+}}(%esp), %ecx
; X86-AVX512-NEXT: vmovdqu64 (%ecx), %zmm1
; X86-AVX512-NEXT: vpbroadcastd {{.*#+}} zmm0 = [2147450879,2147450879,2147450879,2147450879,2147450879,2147450879,2147450879,2147450879,2147450879,2147450879,2147450879,2147450879,2147450879,2147450879,2147450879,2147450879]
; X86-AVX512-NEXT: vpternlogd $202, (%eax), %zmm1, %zmm0
; X86-AVX512-NEXT: retl
;
; X64-SSE-LABEL: fcopysign_v32f16:
; X64-SSE: # %bb.0:
; X64-SSE-NEXT: movaps {{.*#+}} xmm3 = [NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN]
; X64-SSE-NEXT: movaps %xmm3, %xmm1
; X64-SSE-NEXT: andnps (%rsi), %xmm1
; X64-SSE-NEXT: movaps (%rdi), %xmm0
; X64-SSE-NEXT: andps %xmm3, %xmm0
; X64-SSE-NEXT: orps %xmm1, %xmm0
; X64-SSE-NEXT: movaps %xmm3, %xmm2
; X64-SSE-NEXT: andnps 16(%rsi), %xmm2
; X64-SSE-NEXT: movaps 16(%rdi), %xmm1
; X64-SSE-NEXT: andps %xmm3, %xmm1
; X64-SSE-NEXT: orps %xmm2, %xmm1
; X64-SSE-NEXT: movaps %xmm3, %xmm4
; X64-SSE-NEXT: andnps 32(%rsi), %xmm4
; X64-SSE-NEXT: movaps 32(%rdi), %xmm2
; X64-SSE-NEXT: andps %xmm3, %xmm2
; X64-SSE-NEXT: orps %xmm4, %xmm2
; X64-SSE-NEXT: movaps %xmm3, %xmm4
; X64-SSE-NEXT: andnps 48(%rsi), %xmm4
; X64-SSE-NEXT: andps 48(%rdi), %xmm3
; X64-SSE-NEXT: orps %xmm4, %xmm3
; X64-SSE-NEXT: retq
;
; X64-AVX1-LABEL: fcopysign_v32f16:
; X64-AVX1: # %bb.0:
; X64-AVX1-NEXT: vbroadcastss {{.*#+}} ymm1 = [NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN]
; X64-AVX1-NEXT: vandnps (%rsi), %ymm1, %ymm0
; X64-AVX1-NEXT: vandps (%rdi), %ymm1, %ymm2
; X64-AVX1-NEXT: vorps %ymm0, %ymm2, %ymm0
; X64-AVX1-NEXT: vandnps 32(%rsi), %ymm1, %ymm2
; X64-AVX1-NEXT: vandps 32(%rdi), %ymm1, %ymm1
; X64-AVX1-NEXT: vorps %ymm2, %ymm1, %ymm1
; X64-AVX1-NEXT: retq
;
; X64-AVX2-LABEL: fcopysign_v32f16:
; X64-AVX2: # %bb.0:
; X64-AVX2-NEXT: vpbroadcastw {{.*#+}} ymm1 = [NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN]
; X64-AVX2-NEXT: vpandn (%rsi), %ymm1, %ymm0
; X64-AVX2-NEXT: vpand (%rdi), %ymm1, %ymm2
; X64-AVX2-NEXT: vpor %ymm0, %ymm2, %ymm0
; X64-AVX2-NEXT: vpandn 32(%rsi), %ymm1, %ymm2
; X64-AVX2-NEXT: vpand 32(%rdi), %ymm1, %ymm1
; X64-AVX2-NEXT: vpor %ymm2, %ymm1, %ymm1
; X64-AVX2-NEXT: retq
;
; X64-AVX512-LABEL: fcopysign_v32f16:
; X64-AVX512: # %bb.0:
; X64-AVX512-NEXT: vmovdqu64 (%rdi), %zmm1
; X64-AVX512-NEXT: vpbroadcastd {{.*#+}} zmm0 = [2147450879,2147450879,2147450879,2147450879,2147450879,2147450879,2147450879,2147450879,2147450879,2147450879,2147450879,2147450879,2147450879,2147450879,2147450879,2147450879]
; X64-AVX512-NEXT: vpternlogd $202, (%rsi), %zmm1, %zmm0
; X64-AVX512-NEXT: retq
%a0 = load <32 x half>, ptr %p0, align 16
%a1 = load <32 x half>, ptr %p1, align 16
%t = call <32 x half> @llvm.copysign.v32f16(<32 x half> %a0, <32 x half> %a1)
ret <32 x half> %t
}
declare <32 x half> @llvm.copysign.v32f16(<32 x half>, <32 x half>)
;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line:
; X64: {{.*}}
; X64-AVX: {{.*}}
; X64-AVX512FP16: {{.*}}
; X64-AVX512VL: {{.*}}
; X64-AVX512VLDQ: {{.*}}
; X86: {{.*}}
; X86-AVX: {{.*}}
; X86-AVX512FP16: {{.*}}
; X86-AVX512VL: {{.*}}
; X86-AVX512VLDQ: {{.*}}
|