llvm.org GIT mirror llvm / testing test / CodeGen / X86 / sse42-schedule.ll
testing

Tree @testing (Download .tar.gz)

sse42-schedule.ll @testingraw · history · blame

  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
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -print-schedule -mcpu=x86-64 -mattr=+sse4.2,+pclmul | FileCheck %s --check-prefix=CHECK --check-prefix=GENERIC
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -print-schedule -mcpu=slm | FileCheck %s --check-prefix=CHECK --check-prefix=SLM
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -print-schedule -mcpu=sandybridge | FileCheck %s --check-prefix=CHECK --check-prefix=SANDY
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -print-schedule -mcpu=ivybridge | FileCheck %s --check-prefix=CHECK --check-prefix=SANDY
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -print-schedule -mcpu=haswell | FileCheck %s --check-prefix=CHECK --check-prefix=HASWELL
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -print-schedule -mcpu=broadwell | FileCheck %s --check-prefix=CHECK --check-prefix=BROADWELL
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -print-schedule -mcpu=skylake | FileCheck %s --check-prefix=CHECK --check-prefix=SKYLAKE
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -print-schedule -mcpu=skx | FileCheck %s --check-prefix=CHECK --check-prefix=SKX
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -print-schedule -mcpu=btver2 | FileCheck %s --check-prefix=CHECK --check-prefix=BTVER2
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -print-schedule -mcpu=znver1 | FileCheck %s --check-prefix=CHECK --check-prefix=ZNVER1

define i32 @crc32_32_8(i32 %a0, i8 %a1, i8 *%a2) {
; GENERIC-LABEL: crc32_32_8:
; GENERIC:       # BB#0:
; GENERIC-NEXT:    crc32b %sil, %edi # sched: [3:1.00]
; GENERIC-NEXT:    crc32b (%rdx), %edi # sched: [8:1.00]
; GENERIC-NEXT:    movl %edi, %eax # sched: [1:0.33]
; GENERIC-NEXT:    retq # sched: [1:1.00]
;
; SLM-LABEL: crc32_32_8:
; SLM:       # BB#0:
; SLM-NEXT:    crc32b %sil, %edi # sched: [3:1.00]
; SLM-NEXT:    crc32b (%rdx), %edi # sched: [6:1.00]
; SLM-NEXT:    movl %edi, %eax # sched: [1:0.50]
; SLM-NEXT:    retq # sched: [4:1.00]
;
; SANDY-LABEL: crc32_32_8:
; SANDY:       # BB#0:
; SANDY-NEXT:    crc32b %sil, %edi # sched: [3:1.00]
; SANDY-NEXT:    crc32b (%rdx), %edi # sched: [8:1.00]
; SANDY-NEXT:    movl %edi, %eax # sched: [1:0.33]
; SANDY-NEXT:    retq # sched: [1:1.00]
;
; HASWELL-LABEL: crc32_32_8:
; HASWELL:       # BB#0:
; HASWELL-NEXT:    crc32b %sil, %edi # sched: [3:1.00]
; HASWELL-NEXT:    crc32b (%rdx), %edi # sched: [7:1.00]
; HASWELL-NEXT:    movl %edi, %eax # sched: [1:0.25]
; HASWELL-NEXT:    retq # sched: [2:1.00]
;
; BROADWELL-LABEL: crc32_32_8:
; BROADWELL:       # BB#0:
; BROADWELL-NEXT:    crc32b %sil, %edi # sched: [3:1.00]
; BROADWELL-NEXT:    crc32b (%rdx), %edi # sched: [8:1.00]
; BROADWELL-NEXT:    movl %edi, %eax # sched: [1:0.25]
; BROADWELL-NEXT:    retq # sched: [7:1.00]
;
; SKYLAKE-LABEL: crc32_32_8:
; SKYLAKE:       # BB#0:
; SKYLAKE-NEXT:    crc32b %sil, %edi # sched: [3:1.00]
; SKYLAKE-NEXT:    crc32b (%rdx), %edi # sched: [8:1.00]
; SKYLAKE-NEXT:    movl %edi, %eax # sched: [1:0.25]
; SKYLAKE-NEXT:    retq # sched: [7:1.00]
;
; SKX-LABEL: crc32_32_8:
; SKX:       # BB#0:
; SKX-NEXT:    crc32b %sil, %edi # sched: [3:1.00]
; SKX-NEXT:    crc32b (%rdx), %edi # sched: [8:1.00]
; SKX-NEXT:    movl %edi, %eax # sched: [1:0.25]
; SKX-NEXT:    retq # sched: [7:1.00]
;
; BTVER2-LABEL: crc32_32_8:
; BTVER2:       # BB#0:
; BTVER2-NEXT:    crc32b %sil, %edi # sched: [3:1.00]
; BTVER2-NEXT:    crc32b (%rdx), %edi # sched: [8:1.00]
; BTVER2-NEXT:    movl %edi, %eax # sched: [1:0.17]
; BTVER2-NEXT:    retq # sched: [4:1.00]
;
; ZNVER1-LABEL: crc32_32_8:
; ZNVER1:       # BB#0:
; ZNVER1-NEXT:    crc32b %sil, %edi # sched: [3:1.00]
; ZNVER1-NEXT:    crc32b (%rdx), %edi # sched: [10:1.00]
; ZNVER1-NEXT:    movl %edi, %eax # sched: [1:0.25]
; ZNVER1-NEXT:    retq # sched: [1:0.50]
  %1 = call i32 @llvm.x86.sse42.crc32.32.8(i32 %a0, i8 %a1)
  %2 = load i8, i8 *%a2
  %3 = call i32 @llvm.x86.sse42.crc32.32.8(i32 %1, i8 %2)
  ret i32 %3
}
declare i32 @llvm.x86.sse42.crc32.32.8(i32, i8) nounwind

define i32 @crc32_32_16(i32 %a0, i16 %a1, i16 *%a2) {
; GENERIC-LABEL: crc32_32_16:
; GENERIC:       # BB#0:
; GENERIC-NEXT:    crc32w %si, %edi # sched: [3:1.00]
; GENERIC-NEXT:    crc32w (%rdx), %edi # sched: [7:1.00]
; GENERIC-NEXT:    movl %edi, %eax # sched: [1:0.33]
; GENERIC-NEXT:    retq # sched: [1:1.00]
;
; SLM-LABEL: crc32_32_16:
; SLM:       # BB#0:
; SLM-NEXT:    crc32w %si, %edi # sched: [3:1.00]
; SLM-NEXT:    crc32w (%rdx), %edi # sched: [6:1.00]
; SLM-NEXT:    movl %edi, %eax # sched: [1:0.50]
; SLM-NEXT:    retq # sched: [4:1.00]
;
; SANDY-LABEL: crc32_32_16:
; SANDY:       # BB#0:
; SANDY-NEXT:    crc32w %si, %edi # sched: [3:1.00]
; SANDY-NEXT:    crc32w (%rdx), %edi # sched: [7:1.00]
; SANDY-NEXT:    movl %edi, %eax # sched: [1:0.33]
; SANDY-NEXT:    retq # sched: [1:1.00]
;
; HASWELL-LABEL: crc32_32_16:
; HASWELL:       # BB#0:
; HASWELL-NEXT:    crc32w %si, %edi # sched: [3:1.00]
; HASWELL-NEXT:    crc32w (%rdx), %edi # sched: [7:1.00]
; HASWELL-NEXT:    movl %edi, %eax # sched: [1:0.25]
; HASWELL-NEXT:    retq # sched: [2:1.00]
;
; BROADWELL-LABEL: crc32_32_16:
; BROADWELL:       # BB#0:
; BROADWELL-NEXT:    crc32w %si, %edi # sched: [3:1.00]
; BROADWELL-NEXT:    crc32w (%rdx), %edi # sched: [8:1.00]
; BROADWELL-NEXT:    movl %edi, %eax # sched: [1:0.25]
; BROADWELL-NEXT:    retq # sched: [7:1.00]
;
; SKYLAKE-LABEL: crc32_32_16:
; SKYLAKE:       # BB#0:
; SKYLAKE-NEXT:    crc32w %si, %edi # sched: [3:1.00]
; SKYLAKE-NEXT:    crc32w (%rdx), %edi # sched: [8:1.00]
; SKYLAKE-NEXT:    movl %edi, %eax # sched: [1:0.25]
; SKYLAKE-NEXT:    retq # sched: [7:1.00]
;
; SKX-LABEL: crc32_32_16:
; SKX:       # BB#0:
; SKX-NEXT:    crc32w %si, %edi # sched: [3:1.00]
; SKX-NEXT:    crc32w (%rdx), %edi # sched: [8:1.00]
; SKX-NEXT:    movl %edi, %eax # sched: [1:0.25]
; SKX-NEXT:    retq # sched: [7:1.00]
;
; BTVER2-LABEL: crc32_32_16:
; BTVER2:       # BB#0:
; BTVER2-NEXT:    crc32w %si, %edi # sched: [3:1.00]
; BTVER2-NEXT:    crc32w (%rdx), %edi # sched: [8:1.00]
; BTVER2-NEXT:    movl %edi, %eax # sched: [1:0.17]
; BTVER2-NEXT:    retq # sched: [4:1.00]
;
; ZNVER1-LABEL: crc32_32_16:
; ZNVER1:       # BB#0:
; ZNVER1-NEXT:    crc32w %si, %edi # sched: [3:1.00]
; ZNVER1-NEXT:    crc32w (%rdx), %edi # sched: [10:1.00]
; ZNVER1-NEXT:    movl %edi, %eax # sched: [1:0.25]
; ZNVER1-NEXT:    retq # sched: [1:0.50]
  %1 = call i32 @llvm.x86.sse42.crc32.32.16(i32 %a0, i16 %a1)
  %2 = load i16, i16 *%a2
  %3 = call i32 @llvm.x86.sse42.crc32.32.16(i32 %1, i16 %2)
  ret i32 %3
}
declare i32 @llvm.x86.sse42.crc32.32.16(i32, i16) nounwind

define i32 @crc32_32_32(i32 %a0, i32 %a1, i32 *%a2) {
; GENERIC-LABEL: crc32_32_32:
; GENERIC:       # BB#0:
; GENERIC-NEXT:    crc32l %esi, %edi # sched: [3:1.00]
; GENERIC-NEXT:    crc32l (%rdx), %edi # sched: [7:1.00]
; GENERIC-NEXT:    movl %edi, %eax # sched: [1:0.33]
; GENERIC-NEXT:    retq # sched: [1:1.00]
;
; SLM-LABEL: crc32_32_32:
; SLM:       # BB#0:
; SLM-NEXT:    crc32l %esi, %edi # sched: [3:1.00]
; SLM-NEXT:    crc32l (%rdx), %edi # sched: [6:1.00]
; SLM-NEXT:    movl %edi, %eax # sched: [1:0.50]
; SLM-NEXT:    retq # sched: [4:1.00]
;
; SANDY-LABEL: crc32_32_32:
; SANDY:       # BB#0:
; SANDY-NEXT:    crc32l %esi, %edi # sched: [3:1.00]
; SANDY-NEXT:    crc32l (%rdx), %edi # sched: [7:1.00]
; SANDY-NEXT:    movl %edi, %eax # sched: [1:0.33]
; SANDY-NEXT:    retq # sched: [1:1.00]
;
; HASWELL-LABEL: crc32_32_32:
; HASWELL:       # BB#0:
; HASWELL-NEXT:    crc32l %esi, %edi # sched: [3:1.00]
; HASWELL-NEXT:    crc32l (%rdx), %edi # sched: [7:1.00]
; HASWELL-NEXT:    movl %edi, %eax # sched: [1:0.25]
; HASWELL-NEXT:    retq # sched: [2:1.00]
;
; BROADWELL-LABEL: crc32_32_32:
; BROADWELL:       # BB#0:
; BROADWELL-NEXT:    crc32l %esi, %edi # sched: [3:1.00]
; BROADWELL-NEXT:    crc32l (%rdx), %edi # sched: [8:1.00]
; BROADWELL-NEXT:    movl %edi, %eax # sched: [1:0.25]
; BROADWELL-NEXT:    retq # sched: [7:1.00]
;
; SKYLAKE-LABEL: crc32_32_32:
; SKYLAKE:       # BB#0:
; SKYLAKE-NEXT:    crc32l %esi, %edi # sched: [3:1.00]
; SKYLAKE-NEXT:    crc32l (%rdx), %edi # sched: [8:1.00]
; SKYLAKE-NEXT:    movl %edi, %eax # sched: [1:0.25]
; SKYLAKE-NEXT:    retq # sched: [7:1.00]
;
; SKX-LABEL: crc32_32_32:
; SKX:       # BB#0:
; SKX-NEXT:    crc32l %esi, %edi # sched: [3:1.00]
; SKX-NEXT:    crc32l (%rdx), %edi # sched: [8:1.00]
; SKX-NEXT:    movl %edi, %eax # sched: [1:0.25]
; SKX-NEXT:    retq # sched: [7:1.00]
;
; BTVER2-LABEL: crc32_32_32:
; BTVER2:       # BB#0:
; BTVER2-NEXT:    crc32l %esi, %edi # sched: [3:1.00]
; BTVER2-NEXT:    crc32l (%rdx), %edi # sched: [8:1.00]
; BTVER2-NEXT:    movl %edi, %eax # sched: [1:0.17]
; BTVER2-NEXT:    retq # sched: [4:1.00]
;
; ZNVER1-LABEL: crc32_32_32:
; ZNVER1:       # BB#0:
; ZNVER1-NEXT:    crc32l %esi, %edi # sched: [3:1.00]
; ZNVER1-NEXT:    crc32l (%rdx), %edi # sched: [10:1.00]
; ZNVER1-NEXT:    movl %edi, %eax # sched: [1:0.25]
; ZNVER1-NEXT:    retq # sched: [1:0.50]
  %1 = call i32 @llvm.x86.sse42.crc32.32.32(i32 %a0, i32 %a1)
  %2 = load i32, i32 *%a2
  %3 = call i32 @llvm.x86.sse42.crc32.32.32(i32 %1, i32 %2)
  ret i32 %3
}
declare i32 @llvm.x86.sse42.crc32.32.32(i32, i32) nounwind

define i64 @crc32_64_8(i64 %a0, i8 %a1, i8 *%a2) nounwind {
; GENERIC-LABEL: crc32_64_8:
; GENERIC:       # BB#0:
; GENERIC-NEXT:    crc32b %sil, %edi # sched: [3:1.00]
; GENERIC-NEXT:    crc32b (%rdx), %edi # sched: [8:1.00]
; GENERIC-NEXT:    movq %rdi, %rax # sched: [1:0.33]
; GENERIC-NEXT:    retq # sched: [1:1.00]
;
; SLM-LABEL: crc32_64_8:
; SLM:       # BB#0:
; SLM-NEXT:    crc32b %sil, %edi # sched: [3:1.00]
; SLM-NEXT:    crc32b (%rdx), %edi # sched: [6:1.00]
; SLM-NEXT:    movq %rdi, %rax # sched: [1:0.50]
; SLM-NEXT:    retq # sched: [4:1.00]
;
; SANDY-LABEL: crc32_64_8:
; SANDY:       # BB#0:
; SANDY-NEXT:    crc32b %sil, %edi # sched: [3:1.00]
; SANDY-NEXT:    crc32b (%rdx), %edi # sched: [8:1.00]
; SANDY-NEXT:    movq %rdi, %rax # sched: [1:0.33]
; SANDY-NEXT:    retq # sched: [1:1.00]
;
; HASWELL-LABEL: crc32_64_8:
; HASWELL:       # BB#0:
; HASWELL-NEXT:    crc32b %sil, %edi # sched: [3:1.00]
; HASWELL-NEXT:    crc32b (%rdx), %edi # sched: [7:1.00]
; HASWELL-NEXT:    movq %rdi, %rax # sched: [1:0.25]
; HASWELL-NEXT:    retq # sched: [2:1.00]
;
; BROADWELL-LABEL: crc32_64_8:
; BROADWELL:       # BB#0:
; BROADWELL-NEXT:    crc32b %sil, %edi # sched: [3:1.00]
; BROADWELL-NEXT:    crc32b (%rdx), %edi # sched: [8:1.00]
; BROADWELL-NEXT:    movq %rdi, %rax # sched: [1:0.25]
; BROADWELL-NEXT:    retq # sched: [7:1.00]
;
; SKYLAKE-LABEL: crc32_64_8:
; SKYLAKE:       # BB#0:
; SKYLAKE-NEXT:    crc32b %sil, %edi # sched: [3:1.00]
; SKYLAKE-NEXT:    crc32b (%rdx), %edi # sched: [8:1.00]
; SKYLAKE-NEXT:    movq %rdi, %rax # sched: [1:0.25]
; SKYLAKE-NEXT:    retq # sched: [7:1.00]
;
; SKX-LABEL: crc32_64_8:
; SKX:       # BB#0:
; SKX-NEXT:    crc32b %sil, %edi # sched: [3:1.00]
; SKX-NEXT:    crc32b (%rdx), %edi # sched: [8:1.00]
; SKX-NEXT:    movq %rdi, %rax # sched: [1:0.25]
; SKX-NEXT:    retq # sched: [7:1.00]
;
; BTVER2-LABEL: crc32_64_8:
; BTVER2:       # BB#0:
; BTVER2-NEXT:    crc32b %sil, %edi # sched: [3:1.00]
; BTVER2-NEXT:    crc32b (%rdx), %edi # sched: [8:1.00]
; BTVER2-NEXT:    movq %rdi, %rax # sched: [1:0.17]
; BTVER2-NEXT:    retq # sched: [4:1.00]
;
; ZNVER1-LABEL: crc32_64_8:
; ZNVER1:       # BB#0:
; ZNVER1-NEXT:    crc32b %sil, %edi # sched: [3:1.00]
; ZNVER1-NEXT:    crc32b (%rdx), %edi # sched: [10:1.00]
; ZNVER1-NEXT:    movq %rdi, %rax # sched: [1:0.25]
; ZNVER1-NEXT:    retq # sched: [1:0.50]
  %1 = call i64 @llvm.x86.sse42.crc32.64.8(i64 %a0, i8 %a1)
  %2 = load i8, i8 *%a2
  %3 = call i64 @llvm.x86.sse42.crc32.64.8(i64 %1, i8 %2)
  ret i64 %3
}
declare i64 @llvm.x86.sse42.crc32.64.8(i64, i8) nounwind

define i64 @crc32_64_64(i64 %a0, i64 %a1, i64 *%a2) {
; GENERIC-LABEL: crc32_64_64:
; GENERIC:       # BB#0:
; GENERIC-NEXT:    crc32q %rsi, %rdi # sched: [3:1.00]
; GENERIC-NEXT:    crc32q (%rdx), %rdi # sched: [8:1.00]
; GENERIC-NEXT:    movq %rdi, %rax # sched: [1:0.33]
; GENERIC-NEXT:    retq # sched: [1:1.00]
;
; SLM-LABEL: crc32_64_64:
; SLM:       # BB#0:
; SLM-NEXT:    crc32q %rsi, %rdi # sched: [3:1.00]
; SLM-NEXT:    crc32q (%rdx), %rdi # sched: [6:1.00]
; SLM-NEXT:    movq %rdi, %rax # sched: [1:0.50]
; SLM-NEXT:    retq # sched: [4:1.00]
;
; SANDY-LABEL: crc32_64_64:
; SANDY:       # BB#0:
; SANDY-NEXT:    crc32q %rsi, %rdi # sched: [3:1.00]
; SANDY-NEXT:    crc32q (%rdx), %rdi # sched: [8:1.00]
; SANDY-NEXT:    movq %rdi, %rax # sched: [1:0.33]
; SANDY-NEXT:    retq # sched: [1:1.00]
;
; HASWELL-LABEL: crc32_64_64:
; HASWELL:       # BB#0:
; HASWELL-NEXT:    crc32q %rsi, %rdi # sched: [3:1.00]
; HASWELL-NEXT:    crc32q (%rdx), %rdi # sched: [7:1.00]
; HASWELL-NEXT:    movq %rdi, %rax # sched: [1:0.25]
; HASWELL-NEXT:    retq # sched: [2:1.00]
;
; BROADWELL-LABEL: crc32_64_64:
; BROADWELL:       # BB#0:
; BROADWELL-NEXT:    crc32q %rsi, %rdi # sched: [3:1.00]
; BROADWELL-NEXT:    crc32q (%rdx), %rdi # sched: [8:1.00]
; BROADWELL-NEXT:    movq %rdi, %rax # sched: [1:0.25]
; BROADWELL-NEXT:    retq # sched: [7:1.00]
;
; SKYLAKE-LABEL: crc32_64_64:
; SKYLAKE:       # BB#0:
; SKYLAKE-NEXT:    crc32q %rsi, %rdi # sched: [3:1.00]
; SKYLAKE-NEXT:    crc32q (%rdx), %rdi # sched: [8:1.00]
; SKYLAKE-NEXT:    movq %rdi, %rax # sched: [1:0.25]
; SKYLAKE-NEXT:    retq # sched: [7:1.00]
;
; SKX-LABEL: crc32_64_64:
; SKX:       # BB#0:
; SKX-NEXT:    crc32q %rsi, %rdi # sched: [3:1.00]
; SKX-NEXT:    crc32q (%rdx), %rdi # sched: [8:1.00]
; SKX-NEXT:    movq %rdi, %rax # sched: [1:0.25]
; SKX-NEXT:    retq # sched: [7:1.00]
;
; BTVER2-LABEL: crc32_64_64:
; BTVER2:       # BB#0:
; BTVER2-NEXT:    crc32q %rsi, %rdi # sched: [3:1.00]
; BTVER2-NEXT:    crc32q (%rdx), %rdi # sched: [8:1.00]
; BTVER2-NEXT:    movq %rdi, %rax # sched: [1:0.17]
; BTVER2-NEXT:    retq # sched: [4:1.00]
;
; ZNVER1-LABEL: crc32_64_64:
; ZNVER1:       # BB#0:
; ZNVER1-NEXT:    crc32q %rsi, %rdi # sched: [3:1.00]
; ZNVER1-NEXT:    crc32q (%rdx), %rdi # sched: [10:1.00]
; ZNVER1-NEXT:    movq %rdi, %rax # sched: [1:0.25]
; ZNVER1-NEXT:    retq # sched: [1:0.50]
  %1 = call i64 @llvm.x86.sse42.crc32.64.64(i64 %a0, i64 %a1)
  %2 = load i64, i64 *%a2
  %3 = call i64 @llvm.x86.sse42.crc32.64.64(i64 %1, i64 %2)
  ret i64 %3
}
declare i64 @llvm.x86.sse42.crc32.64.64(i64, i64) nounwind

define i32 @test_pcmpestri(<16 x i8> %a0, <16 x i8> %a1, <16 x i8> *%a2) {
; GENERIC-LABEL: test_pcmpestri:
; GENERIC:       # BB#0:
; GENERIC-NEXT:    movl $7, %eax # sched: [1:0.33]
; GENERIC-NEXT:    movl $7, %edx # sched: [1:0.33]
; GENERIC-NEXT:    pcmpestri $7, %xmm1, %xmm0 # sched: [4:2.67]
; GENERIC-NEXT:    movl %ecx, %esi # sched: [1:0.33]
; GENERIC-NEXT:    movl $7, %eax # sched: [1:0.33]
; GENERIC-NEXT:    movl $7, %edx # sched: [1:0.33]
; GENERIC-NEXT:    pcmpestri $7, (%rdi), %xmm0 # sched: [4:2.33]
; GENERIC-NEXT:    # kill: %ECX<def> %ECX<kill> %RCX<def>
; GENERIC-NEXT:    leal (%rcx,%rsi), %eax # sched: [1:0.50]
; GENERIC-NEXT:    retq # sched: [1:1.00]
;
; SLM-LABEL: test_pcmpestri:
; SLM:       # BB#0:
; SLM-NEXT:    movl $7, %eax # sched: [1:0.50]
; SLM-NEXT:    movl $7, %edx # sched: [1:0.50]
; SLM-NEXT:    pcmpestri $7, %xmm1, %xmm0 # sched: [21:21.00]
; SLM-NEXT:    movl $7, %eax # sched: [1:0.50]
; SLM-NEXT:    movl $7, %edx # sched: [1:0.50]
; SLM-NEXT:    movl %ecx, %esi # sched: [1:0.50]
; SLM-NEXT:    pcmpestri $7, (%rdi), %xmm0 # sched: [21:21.00]
; SLM-NEXT:    # kill: %ECX<def> %ECX<kill> %RCX<def>
; SLM-NEXT:    leal (%rcx,%rsi), %eax # sched: [1:1.00]
; SLM-NEXT:    retq # sched: [4:1.00]
;
; SANDY-LABEL: test_pcmpestri:
; SANDY:       # BB#0:
; SANDY-NEXT:    movl $7, %eax # sched: [1:0.33]
; SANDY-NEXT:    movl $7, %edx # sched: [1:0.33]
; SANDY-NEXT:    vpcmpestri $7, %xmm1, %xmm0 # sched: [4:2.67]
; SANDY-NEXT:    movl %ecx, %esi # sched: [1:0.33]
; SANDY-NEXT:    movl $7, %eax # sched: [1:0.33]
; SANDY-NEXT:    movl $7, %edx # sched: [1:0.33]
; SANDY-NEXT:    vpcmpestri $7, (%rdi), %xmm0 # sched: [4:2.33]
; SANDY-NEXT:    # kill: %ECX<def> %ECX<kill> %RCX<def>
; SANDY-NEXT:    leal (%rcx,%rsi), %eax # sched: [1:0.50]
; SANDY-NEXT:    retq # sched: [1:1.00]
;
; HASWELL-LABEL: test_pcmpestri:
; HASWELL:       # BB#0:
; HASWELL-NEXT:    movl $7, %eax # sched: [1:0.25]
; HASWELL-NEXT:    movl $7, %edx # sched: [1:0.25]
; HASWELL-NEXT:    vpcmpestri $7, %xmm1, %xmm0 # sched: [18:4.00]
; HASWELL-NEXT:    movl %ecx, %esi # sched: [1:0.25]
; HASWELL-NEXT:    movl $7, %eax # sched: [1:0.25]
; HASWELL-NEXT:    movl $7, %edx # sched: [1:0.25]
; HASWELL-NEXT:    vpcmpestri $7, (%rdi), %xmm0 # sched: [18:4.00]
; HASWELL-NEXT:    # kill: %ECX<def> %ECX<kill> %RCX<def>
; HASWELL-NEXT:    leal (%rcx,%rsi), %eax # sched: [1:0.50]
; HASWELL-NEXT:    retq # sched: [2:1.00]
;
; BROADWELL-LABEL: test_pcmpestri:
; BROADWELL:       # BB#0:
; BROADWELL-NEXT:    movl $7, %eax # sched: [1:0.25]
; BROADWELL-NEXT:    movl $7, %edx # sched: [1:0.25]
; BROADWELL-NEXT:    vpcmpestri $7, %xmm1, %xmm0 # sched: [18:4.00]
; BROADWELL-NEXT:    movl %ecx, %esi # sched: [1:0.25]
; BROADWELL-NEXT:    movl $7, %eax # sched: [1:0.25]
; BROADWELL-NEXT:    movl $7, %edx # sched: [1:0.25]
; BROADWELL-NEXT:    vpcmpestri $7, (%rdi), %xmm0 # sched: [23:4.00]
; BROADWELL-NEXT:    # kill: %ECX<def> %ECX<kill> %RCX<def>
; BROADWELL-NEXT:    leal (%rcx,%rsi), %eax # sched: [1:0.50]
; BROADWELL-NEXT:    retq # sched: [7:1.00]
;
; SKYLAKE-LABEL: test_pcmpestri:
; SKYLAKE:       # BB#0:
; SKYLAKE-NEXT:    movl $7, %eax # sched: [1:0.25]
; SKYLAKE-NEXT:    movl $7, %edx # sched: [1:0.25]
; SKYLAKE-NEXT:    vpcmpestri $7, %xmm1, %xmm0 # sched: [18:4.00]
; SKYLAKE-NEXT:    movl %ecx, %esi # sched: [1:0.25]
; SKYLAKE-NEXT:    movl $7, %eax # sched: [1:0.25]
; SKYLAKE-NEXT:    movl $7, %edx # sched: [1:0.25]
; SKYLAKE-NEXT:    vpcmpestri $7, (%rdi), %xmm0 # sched: [24:4.00]
; SKYLAKE-NEXT:    # kill: %ECX<def> %ECX<kill> %RCX<def>
; SKYLAKE-NEXT:    leal (%rcx,%rsi), %eax # sched: [1:0.50]
; SKYLAKE-NEXT:    retq # sched: [7:1.00]
;
; SKX-LABEL: test_pcmpestri:
; SKX:       # BB#0:
; SKX-NEXT:    movl $7, %eax # sched: [1:0.25]
; SKX-NEXT:    movl $7, %edx # sched: [1:0.25]
; SKX-NEXT:    vpcmpestri $7, %xmm1, %xmm0 # sched: [18:4.00]
; SKX-NEXT:    movl %ecx, %esi # sched: [1:0.25]
; SKX-NEXT:    movl $7, %eax # sched: [1:0.25]
; SKX-NEXT:    movl $7, %edx # sched: [1:0.25]
; SKX-NEXT:    vpcmpestri $7, (%rdi), %xmm0 # sched: [24:4.00]
; SKX-NEXT:    # kill: %ECX<def> %ECX<kill> %RCX<def>
; SKX-NEXT:    leal (%rcx,%rsi), %eax # sched: [1:0.50]
; SKX-NEXT:    retq # sched: [7:1.00]
;
; BTVER2-LABEL: test_pcmpestri:
; BTVER2:       # BB#0:
; BTVER2-NEXT:    movl $7, %eax # sched: [1:0.17]
; BTVER2-NEXT:    movl $7, %edx # sched: [1:0.17]
; BTVER2-NEXT:    vpcmpestri $7, %xmm1, %xmm0 # sched: [13:2.50]
; BTVER2-NEXT:    movl $7, %eax # sched: [1:0.17]
; BTVER2-NEXT:    movl $7, %edx # sched: [1:0.17]
; BTVER2-NEXT:    movl %ecx, %esi # sched: [1:0.17]
; BTVER2-NEXT:    vpcmpestri $7, (%rdi), %xmm0 # sched: [18:2.50]
; BTVER2-NEXT:    # kill: %ECX<def> %ECX<kill> %RCX<def>
; BTVER2-NEXT:    leal (%rcx,%rsi), %eax # sched: [1:0.50]
; BTVER2-NEXT:    retq # sched: [4:1.00]
;
; ZNVER1-LABEL: test_pcmpestri:
; ZNVER1:       # BB#0:
; ZNVER1-NEXT:    movl $7, %eax # sched: [1:0.25]
; ZNVER1-NEXT:    movl $7, %edx # sched: [1:0.25]
; ZNVER1-NEXT:    vpcmpestri $7, %xmm1, %xmm0 # sched: [100:?]
; ZNVER1-NEXT:    movl $7, %eax # sched: [1:0.25]
; ZNVER1-NEXT:    movl $7, %edx # sched: [1:0.25]
; ZNVER1-NEXT:    movl %ecx, %esi # sched: [1:0.25]
; ZNVER1-NEXT:    vpcmpestri $7, (%rdi), %xmm0 # sched: [100:?]
; ZNVER1-NEXT:    # kill: %ECX<def> %ECX<kill> %RCX<def>
; ZNVER1-NEXT:    leal (%rcx,%rsi), %eax # sched: [1:0.25]
; ZNVER1-NEXT:    retq # sched: [1:0.50]
  %1 = call i32 @llvm.x86.sse42.pcmpestri128(<16 x i8> %a0, i32 7, <16 x i8> %a1, i32 7, i8 7)
  %2 = load <16 x i8>, <16 x i8> *%a2, align 16
  %3 = call i32 @llvm.x86.sse42.pcmpestri128(<16 x i8> %a0, i32 7, <16 x i8> %2, i32 7, i8 7)
  %4 = add i32 %1, %3
  ret i32 %4
}
declare i32 @llvm.x86.sse42.pcmpestri128(<16 x i8>, i32, <16 x i8>, i32, i8) nounwind readnone

define <16 x i8> @test_pcmpestrm(<16 x i8> %a0, <16 x i8> %a1, <16 x i8> *%a2) {
; GENERIC-LABEL: test_pcmpestrm:
; GENERIC:       # BB#0:
; GENERIC-NEXT:    movl $7, %eax # sched: [1:0.33]
; GENERIC-NEXT:    movl $7, %edx # sched: [1:0.33]
; GENERIC-NEXT:    pcmpestrm $7, %xmm1, %xmm0 # sched: [11:2.67]
; GENERIC-NEXT:    movl $7, %eax # sched: [1:0.33]
; GENERIC-NEXT:    movl $7, %edx # sched: [1:0.33]
; GENERIC-NEXT:    pcmpestrm $7, (%rdi), %xmm0 # sched: [11:2.33]
; GENERIC-NEXT:    retq # sched: [1:1.00]
;
; SLM-LABEL: test_pcmpestrm:
; SLM:       # BB#0:
; SLM-NEXT:    movl $7, %eax # sched: [1:0.50]
; SLM-NEXT:    movl $7, %edx # sched: [1:0.50]
; SLM-NEXT:    pcmpestrm $7, %xmm1, %xmm0 # sched: [17:17.00]
; SLM-NEXT:    movl $7, %eax # sched: [1:0.50]
; SLM-NEXT:    movl $7, %edx # sched: [1:0.50]
; SLM-NEXT:    pcmpestrm $7, (%rdi), %xmm0 # sched: [17:17.00]
; SLM-NEXT:    retq # sched: [4:1.00]
;
; SANDY-LABEL: test_pcmpestrm:
; SANDY:       # BB#0:
; SANDY-NEXT:    movl $7, %eax # sched: [1:0.33]
; SANDY-NEXT:    movl $7, %edx # sched: [1:0.33]
; SANDY-NEXT:    vpcmpestrm $7, %xmm1, %xmm0 # sched: [11:2.67]
; SANDY-NEXT:    movl $7, %eax # sched: [1:0.33]
; SANDY-NEXT:    movl $7, %edx # sched: [1:0.33]
; SANDY-NEXT:    vpcmpestrm $7, (%rdi), %xmm0 # sched: [11:2.33]
; SANDY-NEXT:    retq # sched: [1:1.00]
;
; HASWELL-LABEL: test_pcmpestrm:
; HASWELL:       # BB#0:
; HASWELL-NEXT:    movl $7, %eax # sched: [1:0.25]
; HASWELL-NEXT:    movl $7, %edx # sched: [1:0.25]
; HASWELL-NEXT:    vpcmpestrm $7, %xmm1, %xmm0 # sched: [19:4.00]
; HASWELL-NEXT:    movl $7, %eax # sched: [1:0.25]
; HASWELL-NEXT:    movl $7, %edx # sched: [1:0.25]
; HASWELL-NEXT:    vpcmpestrm $7, (%rdi), %xmm0 # sched: [19:4.00]
; HASWELL-NEXT:    retq # sched: [2:1.00]
;
; BROADWELL-LABEL: test_pcmpestrm:
; BROADWELL:       # BB#0:
; BROADWELL-NEXT:    movl $7, %eax # sched: [1:0.25]
; BROADWELL-NEXT:    movl $7, %edx # sched: [1:0.25]
; BROADWELL-NEXT:    vpcmpestrm $7, %xmm1, %xmm0 # sched: [19:4.00]
; BROADWELL-NEXT:    movl $7, %eax # sched: [1:0.25]
; BROADWELL-NEXT:    movl $7, %edx # sched: [1:0.25]
; BROADWELL-NEXT:    vpcmpestrm $7, (%rdi), %xmm0 # sched: [24:4.00]
; BROADWELL-NEXT:    retq # sched: [7:1.00]
;
; SKYLAKE-LABEL: test_pcmpestrm:
; SKYLAKE:       # BB#0:
; SKYLAKE-NEXT:    movl $7, %eax # sched: [1:0.25]
; SKYLAKE-NEXT:    movl $7, %edx # sched: [1:0.25]
; SKYLAKE-NEXT:    vpcmpestrm $7, %xmm1, %xmm0 # sched: [19:4.00]
; SKYLAKE-NEXT:    movl $7, %eax # sched: [1:0.25]
; SKYLAKE-NEXT:    movl $7, %edx # sched: [1:0.25]
; SKYLAKE-NEXT:    vpcmpestrm $7, (%rdi), %xmm0 # sched: [25:4.00]
; SKYLAKE-NEXT:    retq # sched: [7:1.00]
;
; SKX-LABEL: test_pcmpestrm:
; SKX:       # BB#0:
; SKX-NEXT:    movl $7, %eax # sched: [1:0.25]
; SKX-NEXT:    movl $7, %edx # sched: [1:0.25]
; SKX-NEXT:    vpcmpestrm $7, %xmm1, %xmm0 # sched: [19:4.00]
; SKX-NEXT:    movl $7, %eax # sched: [1:0.25]
; SKX-NEXT:    movl $7, %edx # sched: [1:0.25]
; SKX-NEXT:    vpcmpestrm $7, (%rdi), %xmm0 # sched: [25:4.00]
; SKX-NEXT:    retq # sched: [7:1.00]
;
; BTVER2-LABEL: test_pcmpestrm:
; BTVER2:       # BB#0:
; BTVER2-NEXT:    movl $7, %eax # sched: [1:0.17]
; BTVER2-NEXT:    movl $7, %edx # sched: [1:0.17]
; BTVER2-NEXT:    vpcmpestrm $7, %xmm1, %xmm0 # sched: [13:2.50]
; BTVER2-NEXT:    movl $7, %eax # sched: [1:0.17]
; BTVER2-NEXT:    movl $7, %edx # sched: [1:0.17]
; BTVER2-NEXT:    vpcmpestrm $7, (%rdi), %xmm0 # sched: [18:2.50]
; BTVER2-NEXT:    retq # sched: [4:1.00]
;
; ZNVER1-LABEL: test_pcmpestrm:
; ZNVER1:       # BB#0:
; ZNVER1-NEXT:    movl $7, %eax # sched: [1:0.25]
; ZNVER1-NEXT:    movl $7, %edx # sched: [1:0.25]
; ZNVER1-NEXT:    vpcmpestrm $7, %xmm1, %xmm0 # sched: [100:?]
; ZNVER1-NEXT:    movl $7, %eax # sched: [1:0.25]
; ZNVER1-NEXT:    movl $7, %edx # sched: [1:0.25]
; ZNVER1-NEXT:    vpcmpestrm $7, (%rdi), %xmm0 # sched: [100:?]
; ZNVER1-NEXT:    retq # sched: [1:0.50]
  %1 = call <16 x i8> @llvm.x86.sse42.pcmpestrm128(<16 x i8> %a0, i32 7, <16 x i8> %a1, i32 7, i8 7)
  %2 = load <16 x i8>, <16 x i8> *%a2, align 16
  %3 = call <16 x i8> @llvm.x86.sse42.pcmpestrm128(<16 x i8> %1, i32 7, <16 x i8> %2, i32 7, i8 7)
  ret <16 x i8> %3
}
declare <16 x i8> @llvm.x86.sse42.pcmpestrm128(<16 x i8>, i32, <16 x i8>, i32, i8) nounwind readnone

define i32 @test_pcmpistri(<16 x i8> %a0, <16 x i8> %a1, <16 x i8> *%a2) {
; GENERIC-LABEL: test_pcmpistri:
; GENERIC:       # BB#0:
; GENERIC-NEXT:    pcmpistri $7, %xmm1, %xmm0 # sched: [11:3.00]
; GENERIC-NEXT:    movl %ecx, %eax # sched: [1:0.33]
; GENERIC-NEXT:    pcmpistri $7, (%rdi), %xmm0 # sched: [17:3.00]
; GENERIC-NEXT:    # kill: %ECX<def> %ECX<kill> %RCX<def>
; GENERIC-NEXT:    leal (%rcx,%rax), %eax # sched: [1:0.50]
; GENERIC-NEXT:    retq # sched: [1:1.00]
;
; SLM-LABEL: test_pcmpistri:
; SLM:       # BB#0:
; SLM-NEXT:    pcmpistri $7, %xmm1, %xmm0 # sched: [17:17.00]
; SLM-NEXT:    movl %ecx, %eax # sched: [1:0.50]
; SLM-NEXT:    pcmpistri $7, (%rdi), %xmm0 # sched: [17:17.00]
; SLM-NEXT:    # kill: %ECX<def> %ECX<kill> %RCX<def>
; SLM-NEXT:    leal (%rcx,%rax), %eax # sched: [1:1.00]
; SLM-NEXT:    retq # sched: [4:1.00]
;
; SANDY-LABEL: test_pcmpistri:
; SANDY:       # BB#0:
; SANDY-NEXT:    vpcmpistri $7, %xmm1, %xmm0 # sched: [11:3.00]
; SANDY-NEXT:    movl %ecx, %eax # sched: [1:0.33]
; SANDY-NEXT:    vpcmpistri $7, (%rdi), %xmm0 # sched: [17:3.00]
; SANDY-NEXT:    # kill: %ECX<def> %ECX<kill> %RCX<def>
; SANDY-NEXT:    leal (%rcx,%rax), %eax # sched: [1:0.50]
; SANDY-NEXT:    retq # sched: [1:1.00]
;
; HASWELL-LABEL: test_pcmpistri:
; HASWELL:       # BB#0:
; HASWELL-NEXT:    vpcmpistri $7, %xmm1, %xmm0 # sched: [11:3.00]
; HASWELL-NEXT:    movl %ecx, %eax # sched: [1:0.25]
; HASWELL-NEXT:    vpcmpistri $7, (%rdi), %xmm0 # sched: [11:3.00]
; HASWELL-NEXT:    # kill: %ECX<def> %ECX<kill> %RCX<def>
; HASWELL-NEXT:    leal (%rcx,%rax), %eax # sched: [1:0.50]
; HASWELL-NEXT:    retq # sched: [2:1.00]
;
; BROADWELL-LABEL: test_pcmpistri:
; BROADWELL:       # BB#0:
; BROADWELL-NEXT:    vpcmpistri $7, %xmm1, %xmm0 # sched: [11:3.00]
; BROADWELL-NEXT:    movl %ecx, %eax # sched: [1:0.25]
; BROADWELL-NEXT:    vpcmpistri $7, (%rdi), %xmm0 # sched: [16:3.00]
; BROADWELL-NEXT:    # kill: %ECX<def> %ECX<kill> %RCX<def>
; BROADWELL-NEXT:    leal (%rcx,%rax), %eax # sched: [1:0.50]
; BROADWELL-NEXT:    retq # sched: [7:1.00]
;
; SKYLAKE-LABEL: test_pcmpistri:
; SKYLAKE:       # BB#0:
; SKYLAKE-NEXT:    vpcmpistri $7, %xmm1, %xmm0 # sched: [10:3.00]
; SKYLAKE-NEXT:    movl %ecx, %eax # sched: [1:0.25]
; SKYLAKE-NEXT:    vpcmpistri $7, (%rdi), %xmm0 # sched: [16:3.00]
; SKYLAKE-NEXT:    # kill: %ECX<def> %ECX<kill> %RCX<def>
; SKYLAKE-NEXT:    leal (%rcx,%rax), %eax # sched: [1:0.50]
; SKYLAKE-NEXT:    retq # sched: [7:1.00]
;
; SKX-LABEL: test_pcmpistri:
; SKX:       # BB#0:
; SKX-NEXT:    vpcmpistri $7, %xmm1, %xmm0 # sched: [10:3.00]
; SKX-NEXT:    movl %ecx, %eax # sched: [1:0.25]
; SKX-NEXT:    vpcmpistri $7, (%rdi), %xmm0 # sched: [16:3.00]
; SKX-NEXT:    # kill: %ECX<def> %ECX<kill> %RCX<def>
; SKX-NEXT:    leal (%rcx,%rax), %eax # sched: [1:0.50]
; SKX-NEXT:    retq # sched: [7:1.00]
;
; BTVER2-LABEL: test_pcmpistri:
; BTVER2:       # BB#0:
; BTVER2-NEXT:    vpcmpistri $7, %xmm1, %xmm0 # sched: [6:1.00]
; BTVER2-NEXT:    movl %ecx, %eax # sched: [1:0.17]
; BTVER2-NEXT:    vpcmpistri $7, (%rdi), %xmm0 # sched: [11:1.00]
; BTVER2-NEXT:    # kill: %ECX<def> %ECX<kill> %RCX<def>
; BTVER2-NEXT:    leal (%rcx,%rax), %eax # sched: [1:0.50]
; BTVER2-NEXT:    retq # sched: [4:1.00]
;
; ZNVER1-LABEL: test_pcmpistri:
; ZNVER1:       # BB#0:
; ZNVER1-NEXT:    vpcmpistri $7, %xmm1, %xmm0 # sched: [100:?]
; ZNVER1-NEXT:    movl %ecx, %eax # sched: [1:0.25]
; ZNVER1-NEXT:    vpcmpistri $7, (%rdi), %xmm0 # sched: [100:?]
; ZNVER1-NEXT:    # kill: %ECX<def> %ECX<kill> %RCX<def>
; ZNVER1-NEXT:    leal (%rcx,%rax), %eax # sched: [1:0.25]
; ZNVER1-NEXT:    retq # sched: [1:0.50]
  %1 = call i32 @llvm.x86.sse42.pcmpistri128(<16 x i8> %a0, <16 x i8> %a1, i8 7)
  %2 = load <16 x i8>, <16 x i8> *%a2, align 16
  %3 = call i32 @llvm.x86.sse42.pcmpistri128(<16 x i8> %a0, <16 x i8> %2, i8 7)
  %4 = add i32 %1, %3
  ret i32 %4
}
declare i32 @llvm.x86.sse42.pcmpistri128(<16 x i8>, <16 x i8>, i8) nounwind readnone

define <16 x i8> @test_pcmpistrm(<16 x i8> %a0, <16 x i8> %a1, <16 x i8> *%a2) {
; GENERIC-LABEL: test_pcmpistrm:
; GENERIC:       # BB#0:
; GENERIC-NEXT:    pcmpistrm $7, %xmm1, %xmm0 # sched: [11:3.00]
; GENERIC-NEXT:    pcmpistrm $7, (%rdi), %xmm0 # sched: [17:3.00]
; GENERIC-NEXT:    retq # sched: [1:1.00]
;
; SLM-LABEL: test_pcmpistrm:
; SLM:       # BB#0:
; SLM-NEXT:    pcmpistrm $7, %xmm1, %xmm0 # sched: [13:13.00]
; SLM-NEXT:    pcmpistrm $7, (%rdi), %xmm0 # sched: [13:13.00]
; SLM-NEXT:    retq # sched: [4:1.00]
;
; SANDY-LABEL: test_pcmpistrm:
; SANDY:       # BB#0:
; SANDY-NEXT:    vpcmpistrm $7, %xmm1, %xmm0 # sched: [11:3.00]
; SANDY-NEXT:    vpcmpistrm $7, (%rdi), %xmm0 # sched: [17:3.00]
; SANDY-NEXT:    retq # sched: [1:1.00]
;
; HASWELL-LABEL: test_pcmpistrm:
; HASWELL:       # BB#0:
; HASWELL-NEXT:    vpcmpistrm $7, %xmm1, %xmm0 # sched: [11:3.00]
; HASWELL-NEXT:    vpcmpistrm $7, (%rdi), %xmm0 # sched: [11:3.00]
; HASWELL-NEXT:    retq # sched: [2:1.00]
;
; BROADWELL-LABEL: test_pcmpistrm:
; BROADWELL:       # BB#0:
; BROADWELL-NEXT:    vpcmpistrm $7, %xmm1, %xmm0 # sched: [11:3.00]
; BROADWELL-NEXT:    vpcmpistrm $7, (%rdi), %xmm0 # sched: [16:3.00]
; BROADWELL-NEXT:    retq # sched: [7:1.00]
;
; SKYLAKE-LABEL: test_pcmpistrm:
; SKYLAKE:       # BB#0:
; SKYLAKE-NEXT:    vpcmpistrm $7, %xmm1, %xmm0 # sched: [10:3.00]
; SKYLAKE-NEXT:    vpcmpistrm $7, (%rdi), %xmm0 # sched: [16:3.00]
; SKYLAKE-NEXT:    retq # sched: [7:1.00]
;
; SKX-LABEL: test_pcmpistrm:
; SKX:       # BB#0:
; SKX-NEXT:    vpcmpistrm $7, %xmm1, %xmm0 # sched: [10:3.00]
; SKX-NEXT:    vpcmpistrm $7, (%rdi), %xmm0 # sched: [16:3.00]
; SKX-NEXT:    retq # sched: [7:1.00]
;
; BTVER2-LABEL: test_pcmpistrm:
; BTVER2:       # BB#0:
; BTVER2-NEXT:    vpcmpistrm $7, %xmm1, %xmm0 # sched: [7:1.00]
; BTVER2-NEXT:    vpcmpistrm $7, (%rdi), %xmm0 # sched: [12:1.00]
; BTVER2-NEXT:    retq # sched: [4:1.00]
;
; ZNVER1-LABEL: test_pcmpistrm:
; ZNVER1:       # BB#0:
; ZNVER1-NEXT:    vpcmpistrm $7, %xmm1, %xmm0 # sched: [100:?]
; ZNVER1-NEXT:    vpcmpistrm $7, (%rdi), %xmm0 # sched: [100:?]
; ZNVER1-NEXT:    retq # sched: [1:0.50]
  %1 = call <16 x i8> @llvm.x86.sse42.pcmpistrm128(<16 x i8> %a0, <16 x i8> %a1, i8 7)
  %2 = load <16 x i8>, <16 x i8> *%a2, align 16
  %3 = call <16 x i8> @llvm.x86.sse42.pcmpistrm128(<16 x i8> %1, <16 x i8> %2, i8 7)
  ret <16 x i8> %3
}
declare <16 x i8> @llvm.x86.sse42.pcmpistrm128(<16 x i8>, <16 x i8>, i8) nounwind readnone

define <2 x i64> @test_pcmpgtq(<2 x i64> %a0, <2 x i64> %a1, <2 x i64> *%a2) {
; GENERIC-LABEL: test_pcmpgtq:
; GENERIC:       # BB#0:
; GENERIC-NEXT:    pcmpgtq %xmm1, %xmm0 # sched: [5:1.00]
; GENERIC-NEXT:    pcmpgtq (%rdi), %xmm0 # sched: [11:1.00]
; GENERIC-NEXT:    retq # sched: [1:1.00]
;
; SLM-LABEL: test_pcmpgtq:
; SLM:       # BB#0:
; SLM-NEXT:    pcmpgtq %xmm1, %xmm0 # sched: [1:0.50]
; SLM-NEXT:    pcmpgtq (%rdi), %xmm0 # sched: [4:1.00]
; SLM-NEXT:    retq # sched: [4:1.00]
;
; SANDY-LABEL: test_pcmpgtq:
; SANDY:       # BB#0:
; SANDY-NEXT:    vpcmpgtq %xmm1, %xmm0, %xmm0 # sched: [5:1.00]
; SANDY-NEXT:    vpcmpgtq (%rdi), %xmm0, %xmm0 # sched: [11:1.00]
; SANDY-NEXT:    retq # sched: [1:1.00]
;
; HASWELL-LABEL: test_pcmpgtq:
; HASWELL:       # BB#0:
; HASWELL-NEXT:    vpcmpgtq %xmm1, %xmm0, %xmm0 # sched: [5:1.00]
; HASWELL-NEXT:    vpcmpgtq (%rdi), %xmm0, %xmm0 # sched: [5:1.00]
; HASWELL-NEXT:    retq # sched: [2:1.00]
;
; BROADWELL-LABEL: test_pcmpgtq:
; BROADWELL:       # BB#0:
; BROADWELL-NEXT:    vpcmpgtq %xmm1, %xmm0, %xmm0 # sched: [5:1.00]
; BROADWELL-NEXT:    vpcmpgtq (%rdi), %xmm0, %xmm0 # sched: [10:1.00]
; BROADWELL-NEXT:    retq # sched: [7:1.00]
;
; SKYLAKE-LABEL: test_pcmpgtq:
; SKYLAKE:       # BB#0:
; SKYLAKE-NEXT:    vpcmpgtq %xmm1, %xmm0, %xmm0 # sched: [3:1.00]
; SKYLAKE-NEXT:    vpcmpgtq (%rdi), %xmm0, %xmm0 # sched: [9:1.00]
; SKYLAKE-NEXT:    retq # sched: [7:1.00]
;
; SKX-LABEL: test_pcmpgtq:
; SKX:       # BB#0:
; SKX-NEXT:    vpcmpgtq %xmm1, %xmm0, %k0 # sched: [3:1.00]
; SKX-NEXT:    vpmovm2q %k0, %xmm0
; SKX-NEXT:    vpcmpgtq (%rdi), %xmm0, %k0 # sched: [9:1.00]
; SKX-NEXT:    vpmovm2q %k0, %xmm0
; SKX-NEXT:    retq # sched: [7:1.00]
;
; BTVER2-LABEL: test_pcmpgtq:
; BTVER2:       # BB#0:
; BTVER2-NEXT:    vpcmpgtq %xmm1, %xmm0, %xmm0 # sched: [1:0.50]
; BTVER2-NEXT:    vpcmpgtq (%rdi), %xmm0, %xmm0 # sched: [6:1.00]
; BTVER2-NEXT:    retq # sched: [4:1.00]
;
; ZNVER1-LABEL: test_pcmpgtq:
; ZNVER1:       # BB#0:
; ZNVER1-NEXT:    vpcmpgtq %xmm1, %xmm0, %xmm0 # sched: [1:0.50]
; ZNVER1-NEXT:    vpcmpgtq (%rdi), %xmm0, %xmm0 # sched: [8:0.50]
; ZNVER1-NEXT:    retq # sched: [1:0.50]
  %1 = icmp sgt <2 x i64> %a0, %a1
  %2 = sext <2 x i1> %1 to <2 x i64>
  %3 = load <2 x i64>, <2 x i64>*%a2, align 16
  %4 = icmp sgt <2 x i64> %2, %3
  %5 = sext <2 x i1> %4 to <2 x i64>
  ret <2 x i64> %5
}

define <2 x i64> @test_pclmulqdq(<2 x i64> %a0, <2 x i64> %a1, <2 x i64> *%a2) {
; GENERIC-LABEL: test_pclmulqdq:
; GENERIC:       # BB#0:
; GENERIC-NEXT:    pclmulqdq $0, %xmm1, %xmm0 # sched: [14:6.00]
; GENERIC-NEXT:    pclmulqdq $0, (%rdi), %xmm0 # sched: [14:5.67]
; GENERIC-NEXT:    retq # sched: [1:1.00]
;
; SLM-LABEL: test_pclmulqdq:
; SLM:       # BB#0:
; SLM-NEXT:    pclmulqdq $0, %xmm1, %xmm0 # sched: [10:10.00]
; SLM-NEXT:    pclmulqdq $0, (%rdi), %xmm0 # sched: [10:10.00]
; SLM-NEXT:    retq # sched: [4:1.00]
;
; SANDY-LABEL: test_pclmulqdq:
; SANDY:       # BB#0:
; SANDY-NEXT:    vpclmulqdq $0, %xmm1, %xmm0, %xmm0 # sched: [14:6.00]
; SANDY-NEXT:    vpclmulqdq $0, (%rdi), %xmm0, %xmm0 # sched: [14:5.67]
; SANDY-NEXT:    retq # sched: [1:1.00]
;
; HASWELL-LABEL: test_pclmulqdq:
; HASWELL:       # BB#0:
; HASWELL-NEXT:    vpclmulqdq $0, %xmm1, %xmm0, %xmm0 # sched: [11:2.00]
; HASWELL-NEXT:    vpclmulqdq $0, (%rdi), %xmm0, %xmm0 # sched: [11:2.00]
; HASWELL-NEXT:    retq # sched: [2:1.00]
;
; BROADWELL-LABEL: test_pclmulqdq:
; BROADWELL:       # BB#0:
; BROADWELL-NEXT:    vpclmulqdq $0, %xmm1, %xmm0, %xmm0 # sched: [5:1.00]
; BROADWELL-NEXT:    vpclmulqdq $0, (%rdi), %xmm0, %xmm0 # sched: [10:1.00]
; BROADWELL-NEXT:    retq # sched: [7:1.00]
;
; SKYLAKE-LABEL: test_pclmulqdq:
; SKYLAKE:       # BB#0:
; SKYLAKE-NEXT:    vpclmulqdq $0, %xmm1, %xmm0, %xmm0 # sched: [6:1.00]
; SKYLAKE-NEXT:    vpclmulqdq $0, (%rdi), %xmm0, %xmm0 # sched: [12:1.00]
; SKYLAKE-NEXT:    retq # sched: [7:1.00]
;
; SKX-LABEL: test_pclmulqdq:
; SKX:       # BB#0:
; SKX-NEXT:    vpclmulqdq $0, %xmm1, %xmm0, %xmm0 # sched: [6:1.00]
; SKX-NEXT:    vpclmulqdq $0, (%rdi), %xmm0, %xmm0 # sched: [12:1.00]
; SKX-NEXT:    retq # sched: [7:1.00]
;
; BTVER2-LABEL: test_pclmulqdq:
; BTVER2:       # BB#0:
; BTVER2-NEXT:    vpclmulqdq $0, %xmm1, %xmm0, %xmm0 # sched: [2:1.00]
; BTVER2-NEXT:    vpclmulqdq $0, (%rdi), %xmm0, %xmm0 # sched: [7:1.00]
; BTVER2-NEXT:    retq # sched: [4:1.00]
;
; ZNVER1-LABEL: test_pclmulqdq:
; ZNVER1:       # BB#0:
; ZNVER1-NEXT:    vpclmulqdq $0, %xmm1, %xmm0, %xmm0 # sched: [100:?]
; ZNVER1-NEXT:    vpclmulqdq $0, (%rdi), %xmm0, %xmm0 # sched: [100:?]
; ZNVER1-NEXT:    retq # sched: [1:0.50]
  %1 = load <2 x i64>, <2 x i64> *%a2, align 16
  %2 = call <2 x i64> @llvm.x86.pclmulqdq(<2 x i64> %a0, <2 x i64> %a1, i8 0)
  %3 = call <2 x i64> @llvm.x86.pclmulqdq(<2 x i64> %1, <2 x i64> %2, i8 0)
  ret <2 x i64> %3
}
declare <2 x i64> @llvm.x86.pclmulqdq(<2 x i64>, <2 x i64>, i8)