@@ -537,9 +537,7 @@ define i32 @bzhi32_b0(i32 %val, i32 %numlowbits) nounwind {
537
537
; X86-BMI1BMI2-LABEL: bzhi32_b0:
538
538
; X86-BMI1BMI2: # %bb.0:
539
539
; X86-BMI1BMI2-NEXT: movb {{[0-9]+}}(%esp), %al
540
- ; X86-BMI1BMI2-NEXT: movl $-1, %ecx
541
- ; X86-BMI1BMI2-NEXT: shlxl %eax, %ecx, %eax
542
- ; X86-BMI1BMI2-NEXT: andnl {{[0-9]+}}(%esp), %eax, %eax
540
+ ; X86-BMI1BMI2-NEXT: bzhil %eax, {{[0-9]+}}(%esp), %eax
543
541
; X86-BMI1BMI2-NEXT: retl
544
542
;
545
543
; X64-NOBMI-LABEL: bzhi32_b0:
@@ -553,9 +551,7 @@ define i32 @bzhi32_b0(i32 %val, i32 %numlowbits) nounwind {
553
551
;
554
552
; X64-BMI1BMI2-LABEL: bzhi32_b0:
555
553
; X64-BMI1BMI2: # %bb.0:
556
- ; X64-BMI1BMI2-NEXT: movl $-1, %eax
557
- ; X64-BMI1BMI2-NEXT: shlxl %esi, %eax, %eax
558
- ; X64-BMI1BMI2-NEXT: andnl %edi, %eax, %eax
554
+ ; X64-BMI1BMI2-NEXT: bzhil %esi, %edi, %eax
559
555
; X64-BMI1BMI2-NEXT: retq
560
556
%notmask = shl i32 -1 , %numlowbits
561
557
%mask = xor i32 %notmask , -1
@@ -576,9 +572,7 @@ define i32 @bzhi32_b1_indexzext(i32 %val, i8 zeroext %numlowbits) nounwind {
576
572
; X86-BMI1BMI2-LABEL: bzhi32_b1_indexzext:
577
573
; X86-BMI1BMI2: # %bb.0:
578
574
; X86-BMI1BMI2-NEXT: movb {{[0-9]+}}(%esp), %al
579
- ; X86-BMI1BMI2-NEXT: movl $-1, %ecx
580
- ; X86-BMI1BMI2-NEXT: shlxl %eax, %ecx, %eax
581
- ; X86-BMI1BMI2-NEXT: andnl {{[0-9]+}}(%esp), %eax, %eax
575
+ ; X86-BMI1BMI2-NEXT: bzhil %eax, {{[0-9]+}}(%esp), %eax
582
576
; X86-BMI1BMI2-NEXT: retl
583
577
;
584
578
; X64-NOBMI-LABEL: bzhi32_b1_indexzext:
@@ -592,9 +586,7 @@ define i32 @bzhi32_b1_indexzext(i32 %val, i8 zeroext %numlowbits) nounwind {
592
586
;
593
587
; X64-BMI1BMI2-LABEL: bzhi32_b1_indexzext:
594
588
; X64-BMI1BMI2: # %bb.0:
595
- ; X64-BMI1BMI2-NEXT: movl $-1, %eax
596
- ; X64-BMI1BMI2-NEXT: shlxl %esi, %eax, %eax
597
- ; X64-BMI1BMI2-NEXT: andnl %edi, %eax, %eax
589
+ ; X64-BMI1BMI2-NEXT: bzhil %esi, %edi, %eax
598
590
; X64-BMI1BMI2-NEXT: retq
599
591
%conv = zext i8 %numlowbits to i32
600
592
%notmask = shl i32 -1 , %conv
@@ -618,9 +610,7 @@ define i32 @bzhi32_b2_load(i32* %w, i32 %numlowbits) nounwind {
618
610
; X86-BMI1BMI2: # %bb.0:
619
611
; X86-BMI1BMI2-NEXT: movl {{[0-9]+}}(%esp), %eax
620
612
; X86-BMI1BMI2-NEXT: movb {{[0-9]+}}(%esp), %cl
621
- ; X86-BMI1BMI2-NEXT: movl $-1, %edx
622
- ; X86-BMI1BMI2-NEXT: shlxl %ecx, %edx, %ecx
623
- ; X86-BMI1BMI2-NEXT: andnl (%eax), %ecx, %eax
613
+ ; X86-BMI1BMI2-NEXT: bzhil %ecx, (%eax), %eax
624
614
; X86-BMI1BMI2-NEXT: retl
625
615
;
626
616
; X64-NOBMI-LABEL: bzhi32_b2_load:
@@ -634,9 +624,7 @@ define i32 @bzhi32_b2_load(i32* %w, i32 %numlowbits) nounwind {
634
624
;
635
625
; X64-BMI1BMI2-LABEL: bzhi32_b2_load:
636
626
; X64-BMI1BMI2: # %bb.0:
637
- ; X64-BMI1BMI2-NEXT: movl $-1, %eax
638
- ; X64-BMI1BMI2-NEXT: shlxl %esi, %eax, %eax
639
- ; X64-BMI1BMI2-NEXT: andnl (%rdi), %eax, %eax
627
+ ; X64-BMI1BMI2-NEXT: bzhil %esi, (%rdi), %eax
640
628
; X64-BMI1BMI2-NEXT: retq
641
629
%val = load i32 , i32* %w
642
630
%notmask = shl i32 -1 , %numlowbits
@@ -660,9 +648,7 @@ define i32 @bzhi32_b3_load_indexzext(i32* %w, i8 zeroext %numlowbits) nounwind {
660
648
; X86-BMI1BMI2: # %bb.0:
661
649
; X86-BMI1BMI2-NEXT: movl {{[0-9]+}}(%esp), %eax
662
650
; X86-BMI1BMI2-NEXT: movb {{[0-9]+}}(%esp), %cl
663
- ; X86-BMI1BMI2-NEXT: movl $-1, %edx
664
- ; X86-BMI1BMI2-NEXT: shlxl %ecx, %edx, %ecx
665
- ; X86-BMI1BMI2-NEXT: andnl (%eax), %ecx, %eax
651
+ ; X86-BMI1BMI2-NEXT: bzhil %ecx, (%eax), %eax
666
652
; X86-BMI1BMI2-NEXT: retl
667
653
;
668
654
; X64-NOBMI-LABEL: bzhi32_b3_load_indexzext:
@@ -676,9 +662,7 @@ define i32 @bzhi32_b3_load_indexzext(i32* %w, i8 zeroext %numlowbits) nounwind {
676
662
;
677
663
; X64-BMI1BMI2-LABEL: bzhi32_b3_load_indexzext:
678
664
; X64-BMI1BMI2: # %bb.0:
679
- ; X64-BMI1BMI2-NEXT: movl $-1, %eax
680
- ; X64-BMI1BMI2-NEXT: shlxl %esi, %eax, %eax
681
- ; X64-BMI1BMI2-NEXT: andnl (%rdi), %eax, %eax
665
+ ; X64-BMI1BMI2-NEXT: bzhil %esi, (%rdi), %eax
682
666
; X64-BMI1BMI2-NEXT: retq
683
667
%val = load i32 , i32* %w
684
668
%conv = zext i8 %numlowbits to i32
@@ -701,9 +685,7 @@ define i32 @bzhi32_b4_commutative(i32 %val, i32 %numlowbits) nounwind {
701
685
; X86-BMI1BMI2-LABEL: bzhi32_b4_commutative:
702
686
; X86-BMI1BMI2: # %bb.0:
703
687
; X86-BMI1BMI2-NEXT: movb {{[0-9]+}}(%esp), %al
704
- ; X86-BMI1BMI2-NEXT: movl $-1, %ecx
705
- ; X86-BMI1BMI2-NEXT: shlxl %eax, %ecx, %eax
706
- ; X86-BMI1BMI2-NEXT: andnl {{[0-9]+}}(%esp), %eax, %eax
688
+ ; X86-BMI1BMI2-NEXT: bzhil %eax, {{[0-9]+}}(%esp), %eax
707
689
; X86-BMI1BMI2-NEXT: retl
708
690
;
709
691
; X64-NOBMI-LABEL: bzhi32_b4_commutative:
@@ -717,9 +699,7 @@ define i32 @bzhi32_b4_commutative(i32 %val, i32 %numlowbits) nounwind {
717
699
;
718
700
; X64-BMI1BMI2-LABEL: bzhi32_b4_commutative:
719
701
; X64-BMI1BMI2: # %bb.0:
720
- ; X64-BMI1BMI2-NEXT: movl $-1, %eax
721
- ; X64-BMI1BMI2-NEXT: shlxl %esi, %eax, %eax
722
- ; X64-BMI1BMI2-NEXT: andnl %edi, %eax, %eax
702
+ ; X64-BMI1BMI2-NEXT: bzhil %esi, %edi, %eax
723
703
; X64-BMI1BMI2-NEXT: retq
724
704
%notmask = shl i32 -1 , %numlowbits
725
705
%mask = xor i32 %notmask , -1
@@ -778,9 +758,7 @@ define i64 @bzhi64_b0(i64 %val, i64 %numlowbits) nounwind {
778
758
;
779
759
; X64-BMI1BMI2-LABEL: bzhi64_b0:
780
760
; X64-BMI1BMI2: # %bb.0:
781
- ; X64-BMI1BMI2-NEXT: movq $-1, %rax
782
- ; X64-BMI1BMI2-NEXT: shlxq %rsi, %rax, %rax
783
- ; X64-BMI1BMI2-NEXT: andnq %rdi, %rax, %rax
761
+ ; X64-BMI1BMI2-NEXT: bzhiq %rsi, %rdi, %rax
784
762
; X64-BMI1BMI2-NEXT: retq
785
763
%notmask = shl i64 -1 , %numlowbits
786
764
%mask = xor i64 %notmask , -1
@@ -838,9 +816,7 @@ define i64 @bzhi64_b1_indexzext(i64 %val, i8 zeroext %numlowbits) nounwind {
838
816
; X64-BMI1BMI2-LABEL: bzhi64_b1_indexzext:
839
817
; X64-BMI1BMI2: # %bb.0:
840
818
; X64-BMI1BMI2-NEXT: # kill: def $esi killed $esi def $rsi
841
- ; X64-BMI1BMI2-NEXT: movq $-1, %rax
842
- ; X64-BMI1BMI2-NEXT: shlxq %rsi, %rax, %rax
843
- ; X64-BMI1BMI2-NEXT: andnq %rdi, %rax, %rax
819
+ ; X64-BMI1BMI2-NEXT: bzhiq %rsi, %rdi, %rax
844
820
; X64-BMI1BMI2-NEXT: retq
845
821
%conv = zext i8 %numlowbits to i64
846
822
%notmask = shl i64 -1 , %conv
@@ -902,9 +878,7 @@ define i64 @bzhi64_b2_load(i64* %w, i64 %numlowbits) nounwind {
902
878
;
903
879
; X64-BMI1BMI2-LABEL: bzhi64_b2_load:
904
880
; X64-BMI1BMI2: # %bb.0:
905
- ; X64-BMI1BMI2-NEXT: movq $-1, %rax
906
- ; X64-BMI1BMI2-NEXT: shlxq %rsi, %rax, %rax
907
- ; X64-BMI1BMI2-NEXT: andnq (%rdi), %rax, %rax
881
+ ; X64-BMI1BMI2-NEXT: bzhiq %rsi, (%rdi), %rax
908
882
; X64-BMI1BMI2-NEXT: retq
909
883
%val = load i64 , i64* %w
910
884
%notmask = shl i64 -1 , %numlowbits
@@ -967,9 +941,7 @@ define i64 @bzhi64_b3_load_indexzext(i64* %w, i8 zeroext %numlowbits) nounwind {
967
941
; X64-BMI1BMI2-LABEL: bzhi64_b3_load_indexzext:
968
942
; X64-BMI1BMI2: # %bb.0:
969
943
; X64-BMI1BMI2-NEXT: # kill: def $esi killed $esi def $rsi
970
- ; X64-BMI1BMI2-NEXT: movq $-1, %rax
971
- ; X64-BMI1BMI2-NEXT: shlxq %rsi, %rax, %rax
972
- ; X64-BMI1BMI2-NEXT: andnq (%rdi), %rax, %rax
944
+ ; X64-BMI1BMI2-NEXT: bzhiq %rsi, (%rdi), %rax
973
945
; X64-BMI1BMI2-NEXT: retq
974
946
%val = load i64 , i64* %w
975
947
%conv = zext i8 %numlowbits to i64
@@ -1028,9 +1000,7 @@ define i64 @bzhi64_b4_commutative(i64 %val, i64 %numlowbits) nounwind {
1028
1000
;
1029
1001
; X64-BMI1BMI2-LABEL: bzhi64_b4_commutative:
1030
1002
; X64-BMI1BMI2: # %bb.0:
1031
- ; X64-BMI1BMI2-NEXT: movq $-1, %rax
1032
- ; X64-BMI1BMI2-NEXT: shlxq %rsi, %rax, %rax
1033
- ; X64-BMI1BMI2-NEXT: andnq %rdi, %rax, %rax
1003
+ ; X64-BMI1BMI2-NEXT: bzhiq %rsi, %rdi, %rax
1034
1004
; X64-BMI1BMI2-NEXT: retq
1035
1005
%notmask = shl i64 -1 , %numlowbits
1036
1006
%mask = xor i64 %notmask , -1
@@ -1091,11 +1061,8 @@ define i32 @bzhi32_c1_indexzext(i32 %val, i8 %numlowbits) nounwind {
1091
1061
;
1092
1062
; X86-BMI1BMI2-LABEL: bzhi32_c1_indexzext:
1093
1063
; X86-BMI1BMI2: # %bb.0:
1094
- ; X86-BMI1BMI2-NEXT: movb $32, %al
1095
- ; X86-BMI1BMI2-NEXT: subb {{[0-9]+}}(%esp), %al
1096
- ; X86-BMI1BMI2-NEXT: movl $-1, %ecx
1097
- ; X86-BMI1BMI2-NEXT: shrxl %eax, %ecx, %eax
1098
- ; X86-BMI1BMI2-NEXT: andl {{[0-9]+}}(%esp), %eax
1064
+ ; X86-BMI1BMI2-NEXT: movb {{[0-9]+}}(%esp), %al
1065
+ ; X86-BMI1BMI2-NEXT: bzhil %eax, {{[0-9]+}}(%esp), %eax
1099
1066
; X86-BMI1BMI2-NEXT: retl
1100
1067
;
1101
1068
; X64-NOBMI-LABEL: bzhi32_c1_indexzext:
@@ -1109,11 +1076,7 @@ define i32 @bzhi32_c1_indexzext(i32 %val, i8 %numlowbits) nounwind {
1109
1076
;
1110
1077
; X64-BMI1BMI2-LABEL: bzhi32_c1_indexzext:
1111
1078
; X64-BMI1BMI2: # %bb.0:
1112
- ; X64-BMI1BMI2-NEXT: movb $32, %al
1113
- ; X64-BMI1BMI2-NEXT: subb %sil, %al
1114
- ; X64-BMI1BMI2-NEXT: movl $-1, %ecx
1115
- ; X64-BMI1BMI2-NEXT: shrxl %eax, %ecx, %eax
1116
- ; X64-BMI1BMI2-NEXT: andl %edi, %eax
1079
+ ; X64-BMI1BMI2-NEXT: bzhil %esi, %edi, %eax
1117
1080
; X64-BMI1BMI2-NEXT: retq
1118
1081
%numhighbits = sub i8 32 , %numlowbits
1119
1082
%sh_prom = zext i8 %numhighbits to i32
@@ -1175,12 +1138,9 @@ define i32 @bzhi32_c3_load_indexzext(i32* %w, i8 %numlowbits) nounwind {
1175
1138
;
1176
1139
; X86-BMI1BMI2-LABEL: bzhi32_c3_load_indexzext:
1177
1140
; X86-BMI1BMI2: # %bb.0:
1178
- ; X86-BMI1BMI2-NEXT: movl {{[0-9]+}}(%esp), %ecx
1179
- ; X86-BMI1BMI2-NEXT: movb $32, %al
1180
- ; X86-BMI1BMI2-NEXT: subb {{[0-9]+}}(%esp), %al
1181
- ; X86-BMI1BMI2-NEXT: movl $-1, %edx
1182
- ; X86-BMI1BMI2-NEXT: shrxl %eax, %edx, %eax
1183
- ; X86-BMI1BMI2-NEXT: andl (%ecx), %eax
1141
+ ; X86-BMI1BMI2-NEXT: movl {{[0-9]+}}(%esp), %eax
1142
+ ; X86-BMI1BMI2-NEXT: movb {{[0-9]+}}(%esp), %cl
1143
+ ; X86-BMI1BMI2-NEXT: bzhil %ecx, (%eax), %eax
1184
1144
; X86-BMI1BMI2-NEXT: retl
1185
1145
;
1186
1146
; X64-NOBMI-LABEL: bzhi32_c3_load_indexzext:
@@ -1194,11 +1154,7 @@ define i32 @bzhi32_c3_load_indexzext(i32* %w, i8 %numlowbits) nounwind {
1194
1154
;
1195
1155
; X64-BMI1BMI2-LABEL: bzhi32_c3_load_indexzext:
1196
1156
; X64-BMI1BMI2: # %bb.0:
1197
- ; X64-BMI1BMI2-NEXT: movb $32, %al
1198
- ; X64-BMI1BMI2-NEXT: subb %sil, %al
1199
- ; X64-BMI1BMI2-NEXT: movl $-1, %ecx
1200
- ; X64-BMI1BMI2-NEXT: shrxl %eax, %ecx, %eax
1201
- ; X64-BMI1BMI2-NEXT: andl (%rdi), %eax
1157
+ ; X64-BMI1BMI2-NEXT: bzhil %esi, (%rdi), %eax
1202
1158
; X64-BMI1BMI2-NEXT: retq
1203
1159
%val = load i32 , i32* %w
1204
1160
%numhighbits = sub i8 32 , %numlowbits
@@ -1350,11 +1306,8 @@ define i64 @bzhi64_c1_indexzext(i64 %val, i8 %numlowbits) nounwind {
1350
1306
;
1351
1307
; X64-BMI1BMI2-LABEL: bzhi64_c1_indexzext:
1352
1308
; X64-BMI1BMI2: # %bb.0:
1353
- ; X64-BMI1BMI2-NEXT: movb $64, %al
1354
- ; X64-BMI1BMI2-NEXT: subb %sil, %al
1355
- ; X64-BMI1BMI2-NEXT: movq $-1, %rcx
1356
- ; X64-BMI1BMI2-NEXT: shrxq %rax, %rcx, %rax
1357
- ; X64-BMI1BMI2-NEXT: andq %rdi, %rax
1309
+ ; X64-BMI1BMI2-NEXT: # kill: def $esi killed $esi def $rsi
1310
+ ; X64-BMI1BMI2-NEXT: bzhiq %rsi, %rdi, %rax
1358
1311
; X64-BMI1BMI2-NEXT: retq
1359
1312
%numhighbits = sub i8 64 , %numlowbits
1360
1313
%sh_prom = zext i8 %numhighbits to i64
@@ -1479,11 +1432,8 @@ define i64 @bzhi64_c3_load_indexzext(i64* %w, i8 %numlowbits) nounwind {
1479
1432
;
1480
1433
; X64-BMI1BMI2-LABEL: bzhi64_c3_load_indexzext:
1481
1434
; X64-BMI1BMI2: # %bb.0:
1482
- ; X64-BMI1BMI2-NEXT: movb $64, %al
1483
- ; X64-BMI1BMI2-NEXT: subb %sil, %al
1484
- ; X64-BMI1BMI2-NEXT: movq $-1, %rcx
1485
- ; X64-BMI1BMI2-NEXT: shrxq %rax, %rcx, %rax
1486
- ; X64-BMI1BMI2-NEXT: andq (%rdi), %rax
1435
+ ; X64-BMI1BMI2-NEXT: # kill: def $esi killed $esi def $rsi
1436
+ ; X64-BMI1BMI2-NEXT: bzhiq %rsi, (%rdi), %rax
1487
1437
; X64-BMI1BMI2-NEXT: retq
1488
1438
%val = load i64 , i64* %w
1489
1439
%numhighbits = sub i8 64 , %numlowbits
@@ -1602,10 +1552,8 @@ define i32 @bzhi32_d1_indexzext(i32 %val, i8 %numlowbits) nounwind {
1602
1552
;
1603
1553
; X86-BMI1BMI2-LABEL: bzhi32_d1_indexzext:
1604
1554
; X86-BMI1BMI2: # %bb.0:
1605
- ; X86-BMI1BMI2-NEXT: movb $32, %al
1606
- ; X86-BMI1BMI2-NEXT: subb {{[0-9]+}}(%esp), %al
1607
- ; X86-BMI1BMI2-NEXT: shlxl %eax, {{[0-9]+}}(%esp), %ecx
1608
- ; X86-BMI1BMI2-NEXT: shrxl %eax, %ecx, %eax
1555
+ ; X86-BMI1BMI2-NEXT: movb {{[0-9]+}}(%esp), %al
1556
+ ; X86-BMI1BMI2-NEXT: bzhil %eax, {{[0-9]+}}(%esp), %eax
1609
1557
; X86-BMI1BMI2-NEXT: retl
1610
1558
;
1611
1559
; X64-NOBMI-LABEL: bzhi32_d1_indexzext:
@@ -1619,10 +1567,7 @@ define i32 @bzhi32_d1_indexzext(i32 %val, i8 %numlowbits) nounwind {
1619
1567
;
1620
1568
; X64-BMI1BMI2-LABEL: bzhi32_d1_indexzext:
1621
1569
; X64-BMI1BMI2: # %bb.0:
1622
- ; X64-BMI1BMI2-NEXT: movb $32, %al
1623
- ; X64-BMI1BMI2-NEXT: subb %sil, %al
1624
- ; X64-BMI1BMI2-NEXT: shlxl %eax, %edi, %ecx
1625
- ; X64-BMI1BMI2-NEXT: shrxl %eax, %ecx, %eax
1570
+ ; X64-BMI1BMI2-NEXT: bzhil %esi, %edi, %eax
1626
1571
; X64-BMI1BMI2-NEXT: retq
1627
1572
%numhighbits = sub i8 32 , %numlowbits
1628
1573
%sh_prom = zext i8 %numhighbits to i32
@@ -1685,10 +1630,8 @@ define i32 @bzhi32_d3_load_indexzext(i32* %w, i8 %numlowbits) nounwind {
1685
1630
; X86-BMI1BMI2-LABEL: bzhi32_d3_load_indexzext:
1686
1631
; X86-BMI1BMI2: # %bb.0:
1687
1632
; X86-BMI1BMI2-NEXT: movl {{[0-9]+}}(%esp), %eax
1688
- ; X86-BMI1BMI2-NEXT: movb $32, %cl
1689
- ; X86-BMI1BMI2-NEXT: subb {{[0-9]+}}(%esp), %cl
1690
- ; X86-BMI1BMI2-NEXT: shlxl %ecx, (%eax), %eax
1691
- ; X86-BMI1BMI2-NEXT: shrxl %ecx, %eax, %eax
1633
+ ; X86-BMI1BMI2-NEXT: movb {{[0-9]+}}(%esp), %cl
1634
+ ; X86-BMI1BMI2-NEXT: bzhil %ecx, (%eax), %eax
1692
1635
; X86-BMI1BMI2-NEXT: retl
1693
1636
;
1694
1637
; X64-NOBMI-LABEL: bzhi32_d3_load_indexzext:
@@ -1702,10 +1645,7 @@ define i32 @bzhi32_d3_load_indexzext(i32* %w, i8 %numlowbits) nounwind {
1702
1645
;
1703
1646
; X64-BMI1BMI2-LABEL: bzhi32_d3_load_indexzext:
1704
1647
; X64-BMI1BMI2: # %bb.0:
1705
- ; X64-BMI1BMI2-NEXT: movb $32, %al
1706
- ; X64-BMI1BMI2-NEXT: subb %sil, %al
1707
- ; X64-BMI1BMI2-NEXT: shlxl %eax, (%rdi), %ecx
1708
- ; X64-BMI1BMI2-NEXT: shrxl %eax, %ecx, %eax
1648
+ ; X64-BMI1BMI2-NEXT: bzhil %esi, (%rdi), %eax
1709
1649
; X64-BMI1BMI2-NEXT: retq
1710
1650
%val = load i32 , i32* %w
1711
1651
%numhighbits = sub i8 32 , %numlowbits
@@ -1892,10 +1832,8 @@ define i64 @bzhi64_d1_indexzext(i64 %val, i8 %numlowbits) nounwind {
1892
1832
;
1893
1833
; X64-BMI1BMI2-LABEL: bzhi64_d1_indexzext:
1894
1834
; X64-BMI1BMI2: # %bb.0:
1895
- ; X64-BMI1BMI2-NEXT: movb $64, %al
1896
- ; X64-BMI1BMI2-NEXT: subb %sil, %al
1897
- ; X64-BMI1BMI2-NEXT: shlxq %rax, %rdi, %rcx
1898
- ; X64-BMI1BMI2-NEXT: shrxq %rax, %rcx, %rax
1835
+ ; X64-BMI1BMI2-NEXT: # kill: def $esi killed $esi def $rsi
1836
+ ; X64-BMI1BMI2-NEXT: bzhiq %rsi, %rdi, %rax
1899
1837
; X64-BMI1BMI2-NEXT: retq
1900
1838
%numhighbits = sub i8 64 , %numlowbits
1901
1839
%sh_prom = zext i8 %numhighbits to i64
@@ -2084,10 +2022,8 @@ define i64 @bzhi64_d3_load_indexzext(i64* %w, i8 %numlowbits) nounwind {
2084
2022
;
2085
2023
; X64-BMI1BMI2-LABEL: bzhi64_d3_load_indexzext:
2086
2024
; X64-BMI1BMI2: # %bb.0:
2087
- ; X64-BMI1BMI2-NEXT: movb $64, %al
2088
- ; X64-BMI1BMI2-NEXT: subb %sil, %al
2089
- ; X64-BMI1BMI2-NEXT: shlxq %rax, (%rdi), %rcx
2090
- ; X64-BMI1BMI2-NEXT: shrxq %rax, %rcx, %rax
2025
+ ; X64-BMI1BMI2-NEXT: # kill: def $esi killed $esi def $rsi
2026
+ ; X64-BMI1BMI2-NEXT: bzhiq %rsi, (%rdi), %rax
2091
2027
; X64-BMI1BMI2-NEXT: retq
2092
2028
%val = load i64 , i64* %w
2093
2029
%numhighbits = sub i8 64 , %numlowbits
0 commit comments