; X86-BMI1NOTBM-LABEL: bextr32_a0:
; X86-BMI1NOTBM: # %bb.0:
; X86-BMI1NOTBM-NEXT: movb {{[0-9]+}}(%esp), %al
-; X86-BMI1NOTBM-NEXT: movb {{[0-9]+}}(%esp), %cl
-; X86-BMI1NOTBM-NEXT: movl {{[0-9]+}}(%esp), %edx
-; X86-BMI1NOTBM-NEXT: shrl %cl, %edx
; X86-BMI1NOTBM-NEXT: shll $8, %eax
-; X86-BMI1NOTBM-NEXT: bextrl %eax, %edx, %eax
+; X86-BMI1NOTBM-NEXT: movzbl {{[0-9]+}}(%esp), %ecx
+; X86-BMI1NOTBM-NEXT: orl %eax, %ecx
+; X86-BMI1NOTBM-NEXT: bextrl %ecx, {{[0-9]+}}(%esp), %eax
; X86-BMI1NOTBM-NEXT: retl
;
; X86-BMI1BMI2-LABEL: bextr32_a0:
;
; X64-BMI1NOTBM-LABEL: bextr32_a0:
; X64-BMI1NOTBM: # %bb.0:
-; X64-BMI1NOTBM-NEXT: movl %esi, %ecx
-; X64-BMI1NOTBM-NEXT: # kill: def $cl killed $cl killed $ecx
-; X64-BMI1NOTBM-NEXT: shrl %cl, %edi
; X64-BMI1NOTBM-NEXT: shll $8, %edx
-; X64-BMI1NOTBM-NEXT: bextrl %edx, %edi, %eax
+; X64-BMI1NOTBM-NEXT: movzbl %sil, %eax
+; X64-BMI1NOTBM-NEXT: orl %edx, %eax
+; X64-BMI1NOTBM-NEXT: bextrl %eax, %edi, %eax
; X64-BMI1NOTBM-NEXT: retq
;
; X64-BMI1BMI2-LABEL: bextr32_a0:
; X86-BMI1NOTBM-LABEL: bextr32_a1_indexzext:
; X86-BMI1NOTBM: # %bb.0:
; X86-BMI1NOTBM-NEXT: movb {{[0-9]+}}(%esp), %al
-; X86-BMI1NOTBM-NEXT: movb {{[0-9]+}}(%esp), %cl
-; X86-BMI1NOTBM-NEXT: movl {{[0-9]+}}(%esp), %edx
-; X86-BMI1NOTBM-NEXT: shrl %cl, %edx
; X86-BMI1NOTBM-NEXT: shll $8, %eax
-; X86-BMI1NOTBM-NEXT: bextrl %eax, %edx, %eax
+; X86-BMI1NOTBM-NEXT: movzbl {{[0-9]+}}(%esp), %ecx
+; X86-BMI1NOTBM-NEXT: orl %eax, %ecx
+; X86-BMI1NOTBM-NEXT: bextrl %ecx, {{[0-9]+}}(%esp), %eax
; X86-BMI1NOTBM-NEXT: retl
;
; X86-BMI1BMI2-LABEL: bextr32_a1_indexzext:
;
; X64-BMI1NOTBM-LABEL: bextr32_a1_indexzext:
; X64-BMI1NOTBM: # %bb.0:
-; X64-BMI1NOTBM-NEXT: movl %esi, %ecx
-; X64-BMI1NOTBM-NEXT: # kill: def $cl killed $cl killed $ecx
-; X64-BMI1NOTBM-NEXT: shrl %cl, %edi
; X64-BMI1NOTBM-NEXT: shll $8, %edx
-; X64-BMI1NOTBM-NEXT: bextrl %edx, %edi, %eax
+; X64-BMI1NOTBM-NEXT: movzbl %sil, %eax
+; X64-BMI1NOTBM-NEXT: orl %edx, %eax
+; X64-BMI1NOTBM-NEXT: bextrl %eax, %edi, %eax
; X64-BMI1NOTBM-NEXT: retq
;
; X64-BMI1BMI2-LABEL: bextr32_a1_indexzext:
;
; X86-BMI1NOTBM-LABEL: bextr32_a2_load:
; X86-BMI1NOTBM: # %bb.0:
-; X86-BMI1NOTBM-NEXT: movb {{[0-9]+}}(%esp), %al
+; X86-BMI1NOTBM-NEXT: movl {{[0-9]+}}(%esp), %eax
; X86-BMI1NOTBM-NEXT: movb {{[0-9]+}}(%esp), %cl
-; X86-BMI1NOTBM-NEXT: movl {{[0-9]+}}(%esp), %edx
-; X86-BMI1NOTBM-NEXT: movl (%edx), %edx
-; X86-BMI1NOTBM-NEXT: shrl %cl, %edx
-; X86-BMI1NOTBM-NEXT: shll $8, %eax
-; X86-BMI1NOTBM-NEXT: bextrl %eax, %edx, %eax
+; X86-BMI1NOTBM-NEXT: shll $8, %ecx
+; X86-BMI1NOTBM-NEXT: movzbl {{[0-9]+}}(%esp), %edx
+; X86-BMI1NOTBM-NEXT: orl %ecx, %edx
+; X86-BMI1NOTBM-NEXT: bextrl %edx, (%eax), %eax
; X86-BMI1NOTBM-NEXT: retl
;
; X86-BMI1BMI2-LABEL: bextr32_a2_load:
;
; X64-BMI1NOTBM-LABEL: bextr32_a2_load:
; X64-BMI1NOTBM: # %bb.0:
-; X64-BMI1NOTBM-NEXT: movl %esi, %ecx
-; X64-BMI1NOTBM-NEXT: movl (%rdi), %eax
-; X64-BMI1NOTBM-NEXT: # kill: def $cl killed $cl killed $ecx
-; X64-BMI1NOTBM-NEXT: shrl %cl, %eax
; X64-BMI1NOTBM-NEXT: shll $8, %edx
-; X64-BMI1NOTBM-NEXT: bextrl %edx, %eax, %eax
+; X64-BMI1NOTBM-NEXT: movzbl %sil, %eax
+; X64-BMI1NOTBM-NEXT: orl %edx, %eax
+; X64-BMI1NOTBM-NEXT: bextrl %eax, (%rdi), %eax
; X64-BMI1NOTBM-NEXT: retq
;
; X64-BMI1BMI2-LABEL: bextr32_a2_load:
;
; X86-BMI1NOTBM-LABEL: bextr32_a3_load_indexzext:
; X86-BMI1NOTBM: # %bb.0:
-; X86-BMI1NOTBM-NEXT: movb {{[0-9]+}}(%esp), %al
+; X86-BMI1NOTBM-NEXT: movl {{[0-9]+}}(%esp), %eax
; X86-BMI1NOTBM-NEXT: movb {{[0-9]+}}(%esp), %cl
-; X86-BMI1NOTBM-NEXT: movl {{[0-9]+}}(%esp), %edx
-; X86-BMI1NOTBM-NEXT: movl (%edx), %edx
-; X86-BMI1NOTBM-NEXT: shrl %cl, %edx
-; X86-BMI1NOTBM-NEXT: shll $8, %eax
-; X86-BMI1NOTBM-NEXT: bextrl %eax, %edx, %eax
+; X86-BMI1NOTBM-NEXT: shll $8, %ecx
+; X86-BMI1NOTBM-NEXT: movzbl {{[0-9]+}}(%esp), %edx
+; X86-BMI1NOTBM-NEXT: orl %ecx, %edx
+; X86-BMI1NOTBM-NEXT: bextrl %edx, (%eax), %eax
; X86-BMI1NOTBM-NEXT: retl
;
; X86-BMI1BMI2-LABEL: bextr32_a3_load_indexzext:
;
; X64-BMI1NOTBM-LABEL: bextr32_a3_load_indexzext:
; X64-BMI1NOTBM: # %bb.0:
-; X64-BMI1NOTBM-NEXT: movl %esi, %ecx
-; X64-BMI1NOTBM-NEXT: movl (%rdi), %eax
-; X64-BMI1NOTBM-NEXT: # kill: def $cl killed $cl killed $ecx
-; X64-BMI1NOTBM-NEXT: shrl %cl, %eax
; X64-BMI1NOTBM-NEXT: shll $8, %edx
-; X64-BMI1NOTBM-NEXT: bextrl %edx, %eax, %eax
+; X64-BMI1NOTBM-NEXT: movzbl %sil, %eax
+; X64-BMI1NOTBM-NEXT: orl %edx, %eax
+; X64-BMI1NOTBM-NEXT: bextrl %eax, (%rdi), %eax
; X64-BMI1NOTBM-NEXT: retq
;
; X64-BMI1BMI2-LABEL: bextr32_a3_load_indexzext:
; X86-BMI1NOTBM-LABEL: bextr32_a4_commutative:
; X86-BMI1NOTBM: # %bb.0:
; X86-BMI1NOTBM-NEXT: movb {{[0-9]+}}(%esp), %al
-; X86-BMI1NOTBM-NEXT: movb {{[0-9]+}}(%esp), %cl
-; X86-BMI1NOTBM-NEXT: movl {{[0-9]+}}(%esp), %edx
-; X86-BMI1NOTBM-NEXT: shrl %cl, %edx
; X86-BMI1NOTBM-NEXT: shll $8, %eax
-; X86-BMI1NOTBM-NEXT: bextrl %eax, %edx, %eax
+; X86-BMI1NOTBM-NEXT: movzbl {{[0-9]+}}(%esp), %ecx
+; X86-BMI1NOTBM-NEXT: orl %eax, %ecx
+; X86-BMI1NOTBM-NEXT: bextrl %ecx, {{[0-9]+}}(%esp), %eax
; X86-BMI1NOTBM-NEXT: retl
;
; X86-BMI1BMI2-LABEL: bextr32_a4_commutative:
;
; X64-BMI1NOTBM-LABEL: bextr32_a4_commutative:
; X64-BMI1NOTBM: # %bb.0:
-; X64-BMI1NOTBM-NEXT: movl %esi, %ecx
-; X64-BMI1NOTBM-NEXT: # kill: def $cl killed $cl killed $ecx
-; X64-BMI1NOTBM-NEXT: shrl %cl, %edi
; X64-BMI1NOTBM-NEXT: shll $8, %edx
-; X64-BMI1NOTBM-NEXT: bextrl %edx, %edi, %eax
+; X64-BMI1NOTBM-NEXT: movzbl %sil, %eax
+; X64-BMI1NOTBM-NEXT: orl %edx, %eax
+; X64-BMI1NOTBM-NEXT: bextrl %eax, %edi, %eax
; X64-BMI1NOTBM-NEXT: retq
;
; X64-BMI1BMI2-LABEL: bextr32_a4_commutative:
; X86-BMI1NOTBM: # %bb.0:
; X86-BMI1NOTBM-NEXT: pushl %esi
; X86-BMI1NOTBM-NEXT: subl $8, %esp
-; X86-BMI1NOTBM-NEXT: movb {{[0-9]+}}(%esp), %al
-; X86-BMI1NOTBM-NEXT: movl {{[0-9]+}}(%esp), %edx
-; X86-BMI1NOTBM-NEXT: movl {{[0-9]+}}(%esp), %ecx
-; X86-BMI1NOTBM-NEXT: shrl %cl, %edx
-; X86-BMI1NOTBM-NEXT: shll $8, %eax
-; X86-BMI1NOTBM-NEXT: bextrl %eax, %edx, %esi
-; X86-BMI1NOTBM-NEXT: movl %ecx, (%esp)
+; X86-BMI1NOTBM-NEXT: movb {{[0-9]+}}(%esp), %cl
+; X86-BMI1NOTBM-NEXT: movl {{[0-9]+}}(%esp), %eax
+; X86-BMI1NOTBM-NEXT: shll $8, %ecx
+; X86-BMI1NOTBM-NEXT: movzbl %al, %edx
+; X86-BMI1NOTBM-NEXT: orl %ecx, %edx
+; X86-BMI1NOTBM-NEXT: bextrl %edx, {{[0-9]+}}(%esp), %esi
+; X86-BMI1NOTBM-NEXT: movl %eax, (%esp)
; X86-BMI1NOTBM-NEXT: calll use32
; X86-BMI1NOTBM-NEXT: movl %esi, %eax
; X86-BMI1NOTBM-NEXT: addl $8, %esp
; X64-BMI1NOTBM-LABEL: bextr32_a5_skipextrauses:
; X64-BMI1NOTBM: # %bb.0:
; X64-BMI1NOTBM-NEXT: pushq %rbx
-; X64-BMI1NOTBM-NEXT: movl %esi, %ecx
-; X64-BMI1NOTBM-NEXT: shrl %cl, %edi
; X64-BMI1NOTBM-NEXT: shll $8, %edx
-; X64-BMI1NOTBM-NEXT: bextrl %edx, %edi, %ebx
+; X64-BMI1NOTBM-NEXT: movzbl %sil, %eax
+; X64-BMI1NOTBM-NEXT: orl %edx, %eax
+; X64-BMI1NOTBM-NEXT: bextrl %eax, %edi, %ebx
; X64-BMI1NOTBM-NEXT: movl %esi, %edi
; X64-BMI1NOTBM-NEXT: callq use32
; X64-BMI1NOTBM-NEXT: movl %ebx, %eax
;
; X64-BMI1NOTBM-LABEL: bextr64_a0:
; X64-BMI1NOTBM: # %bb.0:
-; X64-BMI1NOTBM-NEXT: movq %rsi, %rcx
-; X64-BMI1NOTBM-NEXT: # kill: def $cl killed $cl killed $rcx
-; X64-BMI1NOTBM-NEXT: shrq %cl, %rdi
; X64-BMI1NOTBM-NEXT: shlq $8, %rdx
-; X64-BMI1NOTBM-NEXT: bextrq %rdx, %rdi, %rax
+; X64-BMI1NOTBM-NEXT: movzbl %sil, %eax
+; X64-BMI1NOTBM-NEXT: orq %rdx, %rax
+; X64-BMI1NOTBM-NEXT: bextrq %rax, %rdi, %rax
; X64-BMI1NOTBM-NEXT: retq
;
; X64-BMI1BMI2-LABEL: bextr64_a0:
; X64-BMI1NOTBM-LABEL: bextr64_a1_indexzext:
; X64-BMI1NOTBM: # %bb.0:
; X64-BMI1NOTBM-NEXT: # kill: def $edx killed $edx def $rdx
-; X64-BMI1NOTBM-NEXT: movl %esi, %ecx
-; X64-BMI1NOTBM-NEXT: # kill: def $cl killed $cl killed $ecx
-; X64-BMI1NOTBM-NEXT: shrq %cl, %rdi
; X64-BMI1NOTBM-NEXT: shlq $8, %rdx
-; X64-BMI1NOTBM-NEXT: bextrq %rdx, %rdi, %rax
+; X64-BMI1NOTBM-NEXT: movzbl %sil, %eax
+; X64-BMI1NOTBM-NEXT: orq %rdx, %rax
+; X64-BMI1NOTBM-NEXT: bextrq %rax, %rdi, %rax
; X64-BMI1NOTBM-NEXT: retq
;
; X64-BMI1BMI2-LABEL: bextr64_a1_indexzext:
;
; X64-BMI1NOTBM-LABEL: bextr64_a2_load:
; X64-BMI1NOTBM: # %bb.0:
-; X64-BMI1NOTBM-NEXT: movq %rsi, %rcx
-; X64-BMI1NOTBM-NEXT: movq (%rdi), %rax
-; X64-BMI1NOTBM-NEXT: # kill: def $cl killed $cl killed $rcx
-; X64-BMI1NOTBM-NEXT: shrq %cl, %rax
; X64-BMI1NOTBM-NEXT: shlq $8, %rdx
-; X64-BMI1NOTBM-NEXT: bextrq %rdx, %rax, %rax
+; X64-BMI1NOTBM-NEXT: movzbl %sil, %eax
+; X64-BMI1NOTBM-NEXT: orq %rdx, %rax
+; X64-BMI1NOTBM-NEXT: bextrq %rax, (%rdi), %rax
; X64-BMI1NOTBM-NEXT: retq
;
; X64-BMI1BMI2-LABEL: bextr64_a2_load:
; X64-BMI1NOTBM-LABEL: bextr64_a3_load_indexzext:
; X64-BMI1NOTBM: # %bb.0:
; X64-BMI1NOTBM-NEXT: # kill: def $edx killed $edx def $rdx
-; X64-BMI1NOTBM-NEXT: movl %esi, %ecx
-; X64-BMI1NOTBM-NEXT: movq (%rdi), %rax
-; X64-BMI1NOTBM-NEXT: # kill: def $cl killed $cl killed $ecx
-; X64-BMI1NOTBM-NEXT: shrq %cl, %rax
; X64-BMI1NOTBM-NEXT: shlq $8, %rdx
-; X64-BMI1NOTBM-NEXT: bextrq %rdx, %rax, %rax
+; X64-BMI1NOTBM-NEXT: movzbl %sil, %eax
+; X64-BMI1NOTBM-NEXT: orq %rdx, %rax
+; X64-BMI1NOTBM-NEXT: bextrq %rax, (%rdi), %rax
; X64-BMI1NOTBM-NEXT: retq
;
; X64-BMI1BMI2-LABEL: bextr64_a3_load_indexzext:
;
; X64-BMI1NOTBM-LABEL: bextr64_a4_commutative:
; X64-BMI1NOTBM: # %bb.0:
-; X64-BMI1NOTBM-NEXT: movq %rsi, %rcx
-; X64-BMI1NOTBM-NEXT: # kill: def $cl killed $cl killed $rcx
-; X64-BMI1NOTBM-NEXT: shrq %cl, %rdi
; X64-BMI1NOTBM-NEXT: shlq $8, %rdx
-; X64-BMI1NOTBM-NEXT: bextrq %rdx, %rdi, %rax
+; X64-BMI1NOTBM-NEXT: movzbl %sil, %eax
+; X64-BMI1NOTBM-NEXT: orq %rdx, %rax
+; X64-BMI1NOTBM-NEXT: bextrq %rax, %rdi, %rax
; X64-BMI1NOTBM-NEXT: retq
;
; X64-BMI1BMI2-LABEL: bextr64_a4_commutative:
; X64-BMI1NOTBM-LABEL: bextr64_a5_skipextrauses:
; X64-BMI1NOTBM: # %bb.0:
; X64-BMI1NOTBM-NEXT: pushq %rbx
-; X64-BMI1NOTBM-NEXT: movq %rsi, %rcx
-; X64-BMI1NOTBM-NEXT: shrq %cl, %rdi
; X64-BMI1NOTBM-NEXT: shlq $8, %rdx
-; X64-BMI1NOTBM-NEXT: bextrq %rdx, %rdi, %rbx
+; X64-BMI1NOTBM-NEXT: movzbl %sil, %eax
+; X64-BMI1NOTBM-NEXT: orq %rdx, %rax
+; X64-BMI1NOTBM-NEXT: bextrq %rax, %rdi, %rbx
; X64-BMI1NOTBM-NEXT: movq %rsi, %rdi
; X64-BMI1NOTBM-NEXT: callq use64
; X64-BMI1NOTBM-NEXT: movq %rbx, %rax
; X86-BMI1NOTBM-LABEL: bextr32_b0:
; X86-BMI1NOTBM: # %bb.0:
; X86-BMI1NOTBM-NEXT: movb {{[0-9]+}}(%esp), %al
-; X86-BMI1NOTBM-NEXT: movb {{[0-9]+}}(%esp), %cl
-; X86-BMI1NOTBM-NEXT: movl {{[0-9]+}}(%esp), %edx
-; X86-BMI1NOTBM-NEXT: shrl %cl, %edx
; X86-BMI1NOTBM-NEXT: shll $8, %eax
-; X86-BMI1NOTBM-NEXT: bextrl %eax, %edx, %eax
+; X86-BMI1NOTBM-NEXT: movzbl {{[0-9]+}}(%esp), %ecx
+; X86-BMI1NOTBM-NEXT: orl %eax, %ecx
+; X86-BMI1NOTBM-NEXT: bextrl %ecx, {{[0-9]+}}(%esp), %eax
; X86-BMI1NOTBM-NEXT: retl
;
; X86-BMI1BMI2-LABEL: bextr32_b0:
;
; X64-BMI1NOTBM-LABEL: bextr32_b0:
; X64-BMI1NOTBM: # %bb.0:
-; X64-BMI1NOTBM-NEXT: movl %esi, %ecx
-; X64-BMI1NOTBM-NEXT: # kill: def $cl killed $cl killed $ecx
-; X64-BMI1NOTBM-NEXT: shrl %cl, %edi
; X64-BMI1NOTBM-NEXT: shll $8, %edx
-; X64-BMI1NOTBM-NEXT: bextrl %edx, %edi, %eax
+; X64-BMI1NOTBM-NEXT: movzbl %sil, %eax
+; X64-BMI1NOTBM-NEXT: orl %edx, %eax
+; X64-BMI1NOTBM-NEXT: bextrl %eax, %edi, %eax
; X64-BMI1NOTBM-NEXT: retq
;
; X64-BMI1BMI2-LABEL: bextr32_b0:
; X86-BMI1NOTBM-LABEL: bextr32_b1_indexzext:
; X86-BMI1NOTBM: # %bb.0:
; X86-BMI1NOTBM-NEXT: movb {{[0-9]+}}(%esp), %al
-; X86-BMI1NOTBM-NEXT: movb {{[0-9]+}}(%esp), %cl
-; X86-BMI1NOTBM-NEXT: movl {{[0-9]+}}(%esp), %edx
-; X86-BMI1NOTBM-NEXT: shrl %cl, %edx
; X86-BMI1NOTBM-NEXT: shll $8, %eax
-; X86-BMI1NOTBM-NEXT: bextrl %eax, %edx, %eax
+; X86-BMI1NOTBM-NEXT: movzbl {{[0-9]+}}(%esp), %ecx
+; X86-BMI1NOTBM-NEXT: orl %eax, %ecx
+; X86-BMI1NOTBM-NEXT: bextrl %ecx, {{[0-9]+}}(%esp), %eax
; X86-BMI1NOTBM-NEXT: retl
;
; X86-BMI1BMI2-LABEL: bextr32_b1_indexzext:
;
; X64-BMI1NOTBM-LABEL: bextr32_b1_indexzext:
; X64-BMI1NOTBM: # %bb.0:
-; X64-BMI1NOTBM-NEXT: movl %esi, %ecx
-; X64-BMI1NOTBM-NEXT: # kill: def $cl killed $cl killed $ecx
-; X64-BMI1NOTBM-NEXT: shrl %cl, %edi
; X64-BMI1NOTBM-NEXT: shll $8, %edx
-; X64-BMI1NOTBM-NEXT: bextrl %edx, %edi, %eax
+; X64-BMI1NOTBM-NEXT: movzbl %sil, %eax
+; X64-BMI1NOTBM-NEXT: orl %edx, %eax
+; X64-BMI1NOTBM-NEXT: bextrl %eax, %edi, %eax
; X64-BMI1NOTBM-NEXT: retq
;
; X64-BMI1BMI2-LABEL: bextr32_b1_indexzext:
;
; X86-BMI1NOTBM-LABEL: bextr32_b2_load:
; X86-BMI1NOTBM: # %bb.0:
-; X86-BMI1NOTBM-NEXT: movb {{[0-9]+}}(%esp), %al
+; X86-BMI1NOTBM-NEXT: movl {{[0-9]+}}(%esp), %eax
; X86-BMI1NOTBM-NEXT: movb {{[0-9]+}}(%esp), %cl
-; X86-BMI1NOTBM-NEXT: movl {{[0-9]+}}(%esp), %edx
-; X86-BMI1NOTBM-NEXT: movl (%edx), %edx
-; X86-BMI1NOTBM-NEXT: shrl %cl, %edx
-; X86-BMI1NOTBM-NEXT: shll $8, %eax
-; X86-BMI1NOTBM-NEXT: bextrl %eax, %edx, %eax
+; X86-BMI1NOTBM-NEXT: shll $8, %ecx
+; X86-BMI1NOTBM-NEXT: movzbl {{[0-9]+}}(%esp), %edx
+; X86-BMI1NOTBM-NEXT: orl %ecx, %edx
+; X86-BMI1NOTBM-NEXT: bextrl %edx, (%eax), %eax
; X86-BMI1NOTBM-NEXT: retl
;
; X86-BMI1BMI2-LABEL: bextr32_b2_load:
;
; X64-BMI1NOTBM-LABEL: bextr32_b2_load:
; X64-BMI1NOTBM: # %bb.0:
-; X64-BMI1NOTBM-NEXT: movl %esi, %ecx
-; X64-BMI1NOTBM-NEXT: movl (%rdi), %eax
-; X64-BMI1NOTBM-NEXT: # kill: def $cl killed $cl killed $ecx
-; X64-BMI1NOTBM-NEXT: shrl %cl, %eax
; X64-BMI1NOTBM-NEXT: shll $8, %edx
-; X64-BMI1NOTBM-NEXT: bextrl %edx, %eax, %eax
+; X64-BMI1NOTBM-NEXT: movzbl %sil, %eax
+; X64-BMI1NOTBM-NEXT: orl %edx, %eax
+; X64-BMI1NOTBM-NEXT: bextrl %eax, (%rdi), %eax
; X64-BMI1NOTBM-NEXT: retq
;
; X64-BMI1BMI2-LABEL: bextr32_b2_load:
;
; X86-BMI1NOTBM-LABEL: bextr32_b3_load_indexzext:
; X86-BMI1NOTBM: # %bb.0:
-; X86-BMI1NOTBM-NEXT: movb {{[0-9]+}}(%esp), %al
+; X86-BMI1NOTBM-NEXT: movl {{[0-9]+}}(%esp), %eax
; X86-BMI1NOTBM-NEXT: movb {{[0-9]+}}(%esp), %cl
-; X86-BMI1NOTBM-NEXT: movl {{[0-9]+}}(%esp), %edx
-; X86-BMI1NOTBM-NEXT: movl (%edx), %edx
-; X86-BMI1NOTBM-NEXT: shrl %cl, %edx
-; X86-BMI1NOTBM-NEXT: shll $8, %eax
-; X86-BMI1NOTBM-NEXT: bextrl %eax, %edx, %eax
+; X86-BMI1NOTBM-NEXT: shll $8, %ecx
+; X86-BMI1NOTBM-NEXT: movzbl {{[0-9]+}}(%esp), %edx
+; X86-BMI1NOTBM-NEXT: orl %ecx, %edx
+; X86-BMI1NOTBM-NEXT: bextrl %edx, (%eax), %eax
; X86-BMI1NOTBM-NEXT: retl
;
; X86-BMI1BMI2-LABEL: bextr32_b3_load_indexzext:
;
; X64-BMI1NOTBM-LABEL: bextr32_b3_load_indexzext:
; X64-BMI1NOTBM: # %bb.0:
-; X64-BMI1NOTBM-NEXT: movl %esi, %ecx
-; X64-BMI1NOTBM-NEXT: movl (%rdi), %eax
-; X64-BMI1NOTBM-NEXT: # kill: def $cl killed $cl killed $ecx
-; X64-BMI1NOTBM-NEXT: shrl %cl, %eax
; X64-BMI1NOTBM-NEXT: shll $8, %edx
-; X64-BMI1NOTBM-NEXT: bextrl %edx, %eax, %eax
+; X64-BMI1NOTBM-NEXT: movzbl %sil, %eax
+; X64-BMI1NOTBM-NEXT: orl %edx, %eax
+; X64-BMI1NOTBM-NEXT: bextrl %eax, (%rdi), %eax
; X64-BMI1NOTBM-NEXT: retq
;
; X64-BMI1BMI2-LABEL: bextr32_b3_load_indexzext:
; X86-BMI1NOTBM-LABEL: bextr32_b4_commutative:
; X86-BMI1NOTBM: # %bb.0:
; X86-BMI1NOTBM-NEXT: movb {{[0-9]+}}(%esp), %al
-; X86-BMI1NOTBM-NEXT: movb {{[0-9]+}}(%esp), %cl
-; X86-BMI1NOTBM-NEXT: movl {{[0-9]+}}(%esp), %edx
-; X86-BMI1NOTBM-NEXT: shrl %cl, %edx
; X86-BMI1NOTBM-NEXT: shll $8, %eax
-; X86-BMI1NOTBM-NEXT: bextrl %eax, %edx, %eax
+; X86-BMI1NOTBM-NEXT: movzbl {{[0-9]+}}(%esp), %ecx
+; X86-BMI1NOTBM-NEXT: orl %eax, %ecx
+; X86-BMI1NOTBM-NEXT: bextrl %ecx, {{[0-9]+}}(%esp), %eax
; X86-BMI1NOTBM-NEXT: retl
;
; X86-BMI1BMI2-LABEL: bextr32_b4_commutative:
;
; X64-BMI1NOTBM-LABEL: bextr32_b4_commutative:
; X64-BMI1NOTBM: # %bb.0:
-; X64-BMI1NOTBM-NEXT: movl %esi, %ecx
-; X64-BMI1NOTBM-NEXT: # kill: def $cl killed $cl killed $ecx
-; X64-BMI1NOTBM-NEXT: shrl %cl, %edi
; X64-BMI1NOTBM-NEXT: shll $8, %edx
-; X64-BMI1NOTBM-NEXT: bextrl %edx, %edi, %eax
+; X64-BMI1NOTBM-NEXT: movzbl %sil, %eax
+; X64-BMI1NOTBM-NEXT: orl %edx, %eax
+; X64-BMI1NOTBM-NEXT: bextrl %eax, %edi, %eax
; X64-BMI1NOTBM-NEXT: retq
;
; X64-BMI1BMI2-LABEL: bextr32_b4_commutative:
; X86-BMI1NOTBM: # %bb.0:
; X86-BMI1NOTBM-NEXT: pushl %esi
; X86-BMI1NOTBM-NEXT: subl $8, %esp
-; X86-BMI1NOTBM-NEXT: movb {{[0-9]+}}(%esp), %al
-; X86-BMI1NOTBM-NEXT: movl {{[0-9]+}}(%esp), %edx
-; X86-BMI1NOTBM-NEXT: movl {{[0-9]+}}(%esp), %ecx
-; X86-BMI1NOTBM-NEXT: shrl %cl, %edx
-; X86-BMI1NOTBM-NEXT: shll $8, %eax
-; X86-BMI1NOTBM-NEXT: bextrl %eax, %edx, %esi
-; X86-BMI1NOTBM-NEXT: movl %ecx, (%esp)
+; X86-BMI1NOTBM-NEXT: movb {{[0-9]+}}(%esp), %cl
+; X86-BMI1NOTBM-NEXT: movl {{[0-9]+}}(%esp), %eax
+; X86-BMI1NOTBM-NEXT: shll $8, %ecx
+; X86-BMI1NOTBM-NEXT: movzbl %al, %edx
+; X86-BMI1NOTBM-NEXT: orl %ecx, %edx
+; X86-BMI1NOTBM-NEXT: bextrl %edx, {{[0-9]+}}(%esp), %esi
+; X86-BMI1NOTBM-NEXT: movl %eax, (%esp)
; X86-BMI1NOTBM-NEXT: calll use32
; X86-BMI1NOTBM-NEXT: movl %esi, %eax
; X86-BMI1NOTBM-NEXT: addl $8, %esp
; X64-BMI1NOTBM-LABEL: bextr32_b5_skipextrauses:
; X64-BMI1NOTBM: # %bb.0:
; X64-BMI1NOTBM-NEXT: pushq %rbx
-; X64-BMI1NOTBM-NEXT: movl %esi, %ecx
-; X64-BMI1NOTBM-NEXT: shrl %cl, %edi
; X64-BMI1NOTBM-NEXT: shll $8, %edx
-; X64-BMI1NOTBM-NEXT: bextrl %edx, %edi, %ebx
+; X64-BMI1NOTBM-NEXT: movzbl %sil, %eax
+; X64-BMI1NOTBM-NEXT: orl %edx, %eax
+; X64-BMI1NOTBM-NEXT: bextrl %eax, %edi, %ebx
; X64-BMI1NOTBM-NEXT: movl %esi, %edi
; X64-BMI1NOTBM-NEXT: callq use32
; X64-BMI1NOTBM-NEXT: movl %ebx, %eax
;
; X64-BMI1NOTBM-LABEL: bextr64_b0:
; X64-BMI1NOTBM: # %bb.0:
-; X64-BMI1NOTBM-NEXT: movq %rsi, %rcx
-; X64-BMI1NOTBM-NEXT: # kill: def $cl killed $cl killed $rcx
-; X64-BMI1NOTBM-NEXT: shrq %cl, %rdi
; X64-BMI1NOTBM-NEXT: shlq $8, %rdx
-; X64-BMI1NOTBM-NEXT: bextrq %rdx, %rdi, %rax
+; X64-BMI1NOTBM-NEXT: movzbl %sil, %eax
+; X64-BMI1NOTBM-NEXT: orq %rdx, %rax
+; X64-BMI1NOTBM-NEXT: bextrq %rax, %rdi, %rax
; X64-BMI1NOTBM-NEXT: retq
;
; X64-BMI1BMI2-LABEL: bextr64_b0:
; X64-BMI1NOTBM-LABEL: bextr64_b1_indexzext:
; X64-BMI1NOTBM: # %bb.0:
; X64-BMI1NOTBM-NEXT: # kill: def $edx killed $edx def $rdx
-; X64-BMI1NOTBM-NEXT: movl %esi, %ecx
-; X64-BMI1NOTBM-NEXT: # kill: def $cl killed $cl killed $ecx
-; X64-BMI1NOTBM-NEXT: shrq %cl, %rdi
; X64-BMI1NOTBM-NEXT: shlq $8, %rdx
-; X64-BMI1NOTBM-NEXT: bextrq %rdx, %rdi, %rax
+; X64-BMI1NOTBM-NEXT: movzbl %sil, %eax
+; X64-BMI1NOTBM-NEXT: orq %rdx, %rax
+; X64-BMI1NOTBM-NEXT: bextrq %rax, %rdi, %rax
; X64-BMI1NOTBM-NEXT: retq
;
; X64-BMI1BMI2-LABEL: bextr64_b1_indexzext:
;
; X64-BMI1NOTBM-LABEL: bextr64_b2_load:
; X64-BMI1NOTBM: # %bb.0:
-; X64-BMI1NOTBM-NEXT: movq %rsi, %rcx
-; X64-BMI1NOTBM-NEXT: movq (%rdi), %rax
-; X64-BMI1NOTBM-NEXT: # kill: def $cl killed $cl killed $rcx
-; X64-BMI1NOTBM-NEXT: shrq %cl, %rax
; X64-BMI1NOTBM-NEXT: shlq $8, %rdx
-; X64-BMI1NOTBM-NEXT: bextrq %rdx, %rax, %rax
+; X64-BMI1NOTBM-NEXT: movzbl %sil, %eax
+; X64-BMI1NOTBM-NEXT: orq %rdx, %rax
+; X64-BMI1NOTBM-NEXT: bextrq %rax, (%rdi), %rax
; X64-BMI1NOTBM-NEXT: retq
;
; X64-BMI1BMI2-LABEL: bextr64_b2_load:
; X64-BMI1NOTBM-LABEL: bextr64_b3_load_indexzext:
; X64-BMI1NOTBM: # %bb.0:
; X64-BMI1NOTBM-NEXT: # kill: def $edx killed $edx def $rdx
-; X64-BMI1NOTBM-NEXT: movl %esi, %ecx
-; X64-BMI1NOTBM-NEXT: movq (%rdi), %rax
-; X64-BMI1NOTBM-NEXT: # kill: def $cl killed $cl killed $ecx
-; X64-BMI1NOTBM-NEXT: shrq %cl, %rax
; X64-BMI1NOTBM-NEXT: shlq $8, %rdx
-; X64-BMI1NOTBM-NEXT: bextrq %rdx, %rax, %rax
+; X64-BMI1NOTBM-NEXT: movzbl %sil, %eax
+; X64-BMI1NOTBM-NEXT: orq %rdx, %rax
+; X64-BMI1NOTBM-NEXT: bextrq %rax, (%rdi), %rax
; X64-BMI1NOTBM-NEXT: retq
;
; X64-BMI1BMI2-LABEL: bextr64_b3_load_indexzext:
;
; X64-BMI1NOTBM-LABEL: bextr64_b4_commutative:
; X64-BMI1NOTBM: # %bb.0:
-; X64-BMI1NOTBM-NEXT: movq %rsi, %rcx
-; X64-BMI1NOTBM-NEXT: # kill: def $cl killed $cl killed $rcx
-; X64-BMI1NOTBM-NEXT: shrq %cl, %rdi
; X64-BMI1NOTBM-NEXT: shlq $8, %rdx
-; X64-BMI1NOTBM-NEXT: bextrq %rdx, %rdi, %rax
+; X64-BMI1NOTBM-NEXT: movzbl %sil, %eax
+; X64-BMI1NOTBM-NEXT: orq %rdx, %rax
+; X64-BMI1NOTBM-NEXT: bextrq %rax, %rdi, %rax
; X64-BMI1NOTBM-NEXT: retq
;
; X64-BMI1BMI2-LABEL: bextr64_b4_commutative:
; X64-BMI1NOTBM-LABEL: bextr64_b5_skipextrauses:
; X64-BMI1NOTBM: # %bb.0:
; X64-BMI1NOTBM-NEXT: pushq %rbx
-; X64-BMI1NOTBM-NEXT: movq %rsi, %rcx
-; X64-BMI1NOTBM-NEXT: shrq %cl, %rdi
; X64-BMI1NOTBM-NEXT: shlq $8, %rdx
-; X64-BMI1NOTBM-NEXT: bextrq %rdx, %rdi, %rbx
+; X64-BMI1NOTBM-NEXT: movzbl %sil, %eax
+; X64-BMI1NOTBM-NEXT: orq %rdx, %rax
+; X64-BMI1NOTBM-NEXT: bextrq %rax, %rdi, %rbx
; X64-BMI1NOTBM-NEXT: movq %rsi, %rdi
; X64-BMI1NOTBM-NEXT: callq use64
; X64-BMI1NOTBM-NEXT: movq %rbx, %rax
; X86-BMI1NOTBM-LABEL: bextr32_d0:
; X86-BMI1NOTBM: # %bb.0:
; X86-BMI1NOTBM-NEXT: movl {{[0-9]+}}(%esp), %eax
-; X86-BMI1NOTBM-NEXT: movb {{[0-9]+}}(%esp), %cl
-; X86-BMI1NOTBM-NEXT: movl {{[0-9]+}}(%esp), %edx
-; X86-BMI1NOTBM-NEXT: shrl %cl, %edx
+; X86-BMI1NOTBM-NEXT: movzbl {{[0-9]+}}(%esp), %ecx
; X86-BMI1NOTBM-NEXT: shll $8, %eax
-; X86-BMI1NOTBM-NEXT: bextrl %eax, %edx, %eax
+; X86-BMI1NOTBM-NEXT: orl %ecx, %eax
+; X86-BMI1NOTBM-NEXT: bextrl %eax, {{[0-9]+}}(%esp), %eax
; X86-BMI1NOTBM-NEXT: retl
;
; X86-BMI1BMI2-LABEL: bextr32_d0:
;
; X64-BMI1NOTBM-LABEL: bextr32_d0:
; X64-BMI1NOTBM: # %bb.0:
-; X64-BMI1NOTBM-NEXT: movl %esi, %ecx
-; X64-BMI1NOTBM-NEXT: # kill: def $cl killed $cl killed $ecx
-; X64-BMI1NOTBM-NEXT: shrl %cl, %edi
; X64-BMI1NOTBM-NEXT: shll $8, %edx
-; X64-BMI1NOTBM-NEXT: bextrl %edx, %edi, %eax
+; X64-BMI1NOTBM-NEXT: movzbl %sil, %eax
+; X64-BMI1NOTBM-NEXT: orl %edx, %eax
+; X64-BMI1NOTBM-NEXT: bextrl %eax, %edi, %eax
; X64-BMI1NOTBM-NEXT: retq
;
; X64-BMI1BMI2-LABEL: bextr32_d0:
; X86-BMI1NOTBM-LABEL: bextr32_d1_indexzext:
; X86-BMI1NOTBM: # %bb.0:
; X86-BMI1NOTBM-NEXT: movb {{[0-9]+}}(%esp), %al
-; X86-BMI1NOTBM-NEXT: movb {{[0-9]+}}(%esp), %cl
-; X86-BMI1NOTBM-NEXT: movl {{[0-9]+}}(%esp), %edx
-; X86-BMI1NOTBM-NEXT: shrl %cl, %edx
; X86-BMI1NOTBM-NEXT: shll $8, %eax
-; X86-BMI1NOTBM-NEXT: bextrl %eax, %edx, %eax
+; X86-BMI1NOTBM-NEXT: movzbl {{[0-9]+}}(%esp), %ecx
+; X86-BMI1NOTBM-NEXT: orl %eax, %ecx
+; X86-BMI1NOTBM-NEXT: bextrl %ecx, {{[0-9]+}}(%esp), %eax
; X86-BMI1NOTBM-NEXT: retl
;
; X86-BMI1BMI2-LABEL: bextr32_d1_indexzext:
;
; X64-BMI1NOTBM-LABEL: bextr32_d1_indexzext:
; X64-BMI1NOTBM: # %bb.0:
-; X64-BMI1NOTBM-NEXT: movl %esi, %ecx
-; X64-BMI1NOTBM-NEXT: # kill: def $cl killed $cl killed $ecx
-; X64-BMI1NOTBM-NEXT: shrl %cl, %edi
; X64-BMI1NOTBM-NEXT: shll $8, %edx
-; X64-BMI1NOTBM-NEXT: bextrl %edx, %edi, %eax
+; X64-BMI1NOTBM-NEXT: movzbl %sil, %eax
+; X64-BMI1NOTBM-NEXT: orl %edx, %eax
+; X64-BMI1NOTBM-NEXT: bextrl %eax, %edi, %eax
; X64-BMI1NOTBM-NEXT: retq
;
; X64-BMI1BMI2-LABEL: bextr32_d1_indexzext:
; X86-BMI1NOTBM-LABEL: bextr32_d2_load:
; X86-BMI1NOTBM: # %bb.0:
; X86-BMI1NOTBM-NEXT: movl {{[0-9]+}}(%esp), %eax
-; X86-BMI1NOTBM-NEXT: movb {{[0-9]+}}(%esp), %cl
-; X86-BMI1NOTBM-NEXT: movl {{[0-9]+}}(%esp), %edx
-; X86-BMI1NOTBM-NEXT: movl (%edx), %edx
-; X86-BMI1NOTBM-NEXT: shrl %cl, %edx
-; X86-BMI1NOTBM-NEXT: shll $8, %eax
-; X86-BMI1NOTBM-NEXT: bextrl %eax, %edx, %eax
+; X86-BMI1NOTBM-NEXT: movl {{[0-9]+}}(%esp), %ecx
+; X86-BMI1NOTBM-NEXT: movzbl {{[0-9]+}}(%esp), %edx
+; X86-BMI1NOTBM-NEXT: shll $8, %ecx
+; X86-BMI1NOTBM-NEXT: orl %edx, %ecx
+; X86-BMI1NOTBM-NEXT: bextrl %ecx, (%eax), %eax
; X86-BMI1NOTBM-NEXT: retl
;
; X86-BMI1BMI2-LABEL: bextr32_d2_load:
;
; X64-BMI1NOTBM-LABEL: bextr32_d2_load:
; X64-BMI1NOTBM: # %bb.0:
-; X64-BMI1NOTBM-NEXT: movl %esi, %ecx
-; X64-BMI1NOTBM-NEXT: movl (%rdi), %eax
-; X64-BMI1NOTBM-NEXT: # kill: def $cl killed $cl killed $ecx
-; X64-BMI1NOTBM-NEXT: shrl %cl, %eax
; X64-BMI1NOTBM-NEXT: shll $8, %edx
-; X64-BMI1NOTBM-NEXT: bextrl %edx, %eax, %eax
+; X64-BMI1NOTBM-NEXT: movzbl %sil, %eax
+; X64-BMI1NOTBM-NEXT: orl %edx, %eax
+; X64-BMI1NOTBM-NEXT: bextrl %eax, (%rdi), %eax
; X64-BMI1NOTBM-NEXT: retq
;
; X64-BMI1BMI2-LABEL: bextr32_d2_load:
;
; X86-BMI1NOTBM-LABEL: bextr32_d3_load_indexzext:
; X86-BMI1NOTBM: # %bb.0:
-; X86-BMI1NOTBM-NEXT: movb {{[0-9]+}}(%esp), %al
+; X86-BMI1NOTBM-NEXT: movl {{[0-9]+}}(%esp), %eax
; X86-BMI1NOTBM-NEXT: movb {{[0-9]+}}(%esp), %cl
-; X86-BMI1NOTBM-NEXT: movl {{[0-9]+}}(%esp), %edx
-; X86-BMI1NOTBM-NEXT: movl (%edx), %edx
-; X86-BMI1NOTBM-NEXT: shrl %cl, %edx
-; X86-BMI1NOTBM-NEXT: shll $8, %eax
-; X86-BMI1NOTBM-NEXT: bextrl %eax, %edx, %eax
+; X86-BMI1NOTBM-NEXT: shll $8, %ecx
+; X86-BMI1NOTBM-NEXT: movzbl {{[0-9]+}}(%esp), %edx
+; X86-BMI1NOTBM-NEXT: orl %ecx, %edx
+; X86-BMI1NOTBM-NEXT: bextrl %edx, (%eax), %eax
; X86-BMI1NOTBM-NEXT: retl
;
; X86-BMI1BMI2-LABEL: bextr32_d3_load_indexzext:
;
; X64-BMI1NOTBM-LABEL: bextr32_d3_load_indexzext:
; X64-BMI1NOTBM: # %bb.0:
-; X64-BMI1NOTBM-NEXT: movl %esi, %ecx
-; X64-BMI1NOTBM-NEXT: movl (%rdi), %eax
-; X64-BMI1NOTBM-NEXT: # kill: def $cl killed $cl killed $ecx
-; X64-BMI1NOTBM-NEXT: shrl %cl, %eax
; X64-BMI1NOTBM-NEXT: shll $8, %edx
-; X64-BMI1NOTBM-NEXT: bextrl %edx, %eax, %eax
+; X64-BMI1NOTBM-NEXT: movzbl %sil, %eax
+; X64-BMI1NOTBM-NEXT: orl %edx, %eax
+; X64-BMI1NOTBM-NEXT: bextrl %eax, (%rdi), %eax
; X64-BMI1NOTBM-NEXT: retq
;
; X64-BMI1BMI2-LABEL: bextr32_d3_load_indexzext:
; X86-BMI1NOTBM: # %bb.0:
; X86-BMI1NOTBM-NEXT: pushl %esi
; X86-BMI1NOTBM-NEXT: subl $8, %esp
-; X86-BMI1NOTBM-NEXT: movl {{[0-9]+}}(%esp), %eax
-; X86-BMI1NOTBM-NEXT: movl {{[0-9]+}}(%esp), %edx
; X86-BMI1NOTBM-NEXT: movl {{[0-9]+}}(%esp), %ecx
-; X86-BMI1NOTBM-NEXT: shrl %cl, %edx
-; X86-BMI1NOTBM-NEXT: shll $8, %eax
-; X86-BMI1NOTBM-NEXT: bextrl %eax, %edx, %esi
-; X86-BMI1NOTBM-NEXT: movl %ecx, (%esp)
+; X86-BMI1NOTBM-NEXT: movl {{[0-9]+}}(%esp), %eax
+; X86-BMI1NOTBM-NEXT: shll $8, %ecx
+; X86-BMI1NOTBM-NEXT: movzbl %al, %edx
+; X86-BMI1NOTBM-NEXT: orl %ecx, %edx
+; X86-BMI1NOTBM-NEXT: bextrl %edx, {{[0-9]+}}(%esp), %esi
+; X86-BMI1NOTBM-NEXT: movl %eax, (%esp)
; X86-BMI1NOTBM-NEXT: calll use32
; X86-BMI1NOTBM-NEXT: movl %esi, %eax
; X86-BMI1NOTBM-NEXT: addl $8, %esp
; X64-BMI1NOTBM-LABEL: bextr32_d5_skipextrauses:
; X64-BMI1NOTBM: # %bb.0:
; X64-BMI1NOTBM-NEXT: pushq %rbx
-; X64-BMI1NOTBM-NEXT: movl %esi, %ecx
-; X64-BMI1NOTBM-NEXT: shrl %cl, %edi
; X64-BMI1NOTBM-NEXT: shll $8, %edx
-; X64-BMI1NOTBM-NEXT: bextrl %edx, %edi, %ebx
+; X64-BMI1NOTBM-NEXT: movzbl %sil, %eax
+; X64-BMI1NOTBM-NEXT: orl %edx, %eax
+; X64-BMI1NOTBM-NEXT: bextrl %eax, %edi, %ebx
; X64-BMI1NOTBM-NEXT: movl %esi, %edi
; X64-BMI1NOTBM-NEXT: callq use32
; X64-BMI1NOTBM-NEXT: movl %ebx, %eax
;
; X64-BMI1NOTBM-LABEL: bextr64_d0:
; X64-BMI1NOTBM: # %bb.0:
-; X64-BMI1NOTBM-NEXT: movq %rsi, %rcx
-; X64-BMI1NOTBM-NEXT: # kill: def $cl killed $cl killed $rcx
-; X64-BMI1NOTBM-NEXT: shrq %cl, %rdi
; X64-BMI1NOTBM-NEXT: shlq $8, %rdx
-; X64-BMI1NOTBM-NEXT: bextrq %rdx, %rdi, %rax
+; X64-BMI1NOTBM-NEXT: movzbl %sil, %eax
+; X64-BMI1NOTBM-NEXT: orq %rdx, %rax
+; X64-BMI1NOTBM-NEXT: bextrq %rax, %rdi, %rax
; X64-BMI1NOTBM-NEXT: retq
;
; X64-BMI1BMI2-LABEL: bextr64_d0:
; X64-BMI1NOTBM-LABEL: bextr64_d1_indexzext:
; X64-BMI1NOTBM: # %bb.0:
; X64-BMI1NOTBM-NEXT: # kill: def $edx killed $edx def $rdx
-; X64-BMI1NOTBM-NEXT: movl %esi, %ecx
-; X64-BMI1NOTBM-NEXT: # kill: def $cl killed $cl killed $ecx
-; X64-BMI1NOTBM-NEXT: shrq %cl, %rdi
; X64-BMI1NOTBM-NEXT: shlq $8, %rdx
-; X64-BMI1NOTBM-NEXT: bextrq %rdx, %rdi, %rax
+; X64-BMI1NOTBM-NEXT: movzbl %sil, %eax
+; X64-BMI1NOTBM-NEXT: orq %rdx, %rax
+; X64-BMI1NOTBM-NEXT: bextrq %rax, %rdi, %rax
; X64-BMI1NOTBM-NEXT: retq
;
; X64-BMI1BMI2-LABEL: bextr64_d1_indexzext:
;
; X64-BMI1NOTBM-LABEL: bextr64_d2_load:
; X64-BMI1NOTBM: # %bb.0:
-; X64-BMI1NOTBM-NEXT: movq %rsi, %rcx
-; X64-BMI1NOTBM-NEXT: movq (%rdi), %rax
-; X64-BMI1NOTBM-NEXT: # kill: def $cl killed $cl killed $rcx
-; X64-BMI1NOTBM-NEXT: shrq %cl, %rax
; X64-BMI1NOTBM-NEXT: shlq $8, %rdx
-; X64-BMI1NOTBM-NEXT: bextrq %rdx, %rax, %rax
+; X64-BMI1NOTBM-NEXT: movzbl %sil, %eax
+; X64-BMI1NOTBM-NEXT: orq %rdx, %rax
+; X64-BMI1NOTBM-NEXT: bextrq %rax, (%rdi), %rax
; X64-BMI1NOTBM-NEXT: retq
;
; X64-BMI1BMI2-LABEL: bextr64_d2_load:
; X64-BMI1NOTBM-LABEL: bextr64_d3_load_indexzext:
; X64-BMI1NOTBM: # %bb.0:
; X64-BMI1NOTBM-NEXT: # kill: def $edx killed $edx def $rdx
-; X64-BMI1NOTBM-NEXT: movl %esi, %ecx
-; X64-BMI1NOTBM-NEXT: movq (%rdi), %rax
-; X64-BMI1NOTBM-NEXT: # kill: def $cl killed $cl killed $ecx
-; X64-BMI1NOTBM-NEXT: shrq %cl, %rax
; X64-BMI1NOTBM-NEXT: shlq $8, %rdx
-; X64-BMI1NOTBM-NEXT: bextrq %rdx, %rax, %rax
+; X64-BMI1NOTBM-NEXT: movzbl %sil, %eax
+; X64-BMI1NOTBM-NEXT: orq %rdx, %rax
+; X64-BMI1NOTBM-NEXT: bextrq %rax, (%rdi), %rax
; X64-BMI1NOTBM-NEXT: retq
;
; X64-BMI1BMI2-LABEL: bextr64_d3_load_indexzext:
; X64-BMI1NOTBM-LABEL: bextr64_d5_skipextrauses:
; X64-BMI1NOTBM: # %bb.0:
; X64-BMI1NOTBM-NEXT: pushq %rbx
-; X64-BMI1NOTBM-NEXT: movq %rsi, %rcx
-; X64-BMI1NOTBM-NEXT: shrq %cl, %rdi
; X64-BMI1NOTBM-NEXT: shlq $8, %rdx
-; X64-BMI1NOTBM-NEXT: bextrq %rdx, %rdi, %rbx
+; X64-BMI1NOTBM-NEXT: movzbl %sil, %eax
+; X64-BMI1NOTBM-NEXT: orq %rdx, %rax
+; X64-BMI1NOTBM-NEXT: bextrq %rax, %rdi, %rbx
; X64-BMI1NOTBM-NEXT: movq %rsi, %rdi
; X64-BMI1NOTBM-NEXT: callq use64
; X64-BMI1NOTBM-NEXT: movq %rbx, %rax