@@ -182,8 +182,9 @@ define i37 @fshl_i37(i37 %x, i37 %y, i37 %z) nounwind {
182182; X64-AVX-NEXT: movabsq $498560650640798693, %rdx # imm = 0x6EB3E45306EB3E5
183183; X64-AVX-NEXT: mulq %rdx
184184; X64-AVX-NEXT: leal (%rdx,%rdx,8), %eax
185- ; X64-AVX-NEXT: leal (%rdx,%rax,4), %eax
186- ; X64-AVX-NEXT: subl %eax, %ecx
185+ ; X64-AVX-NEXT: shll $2, %eax
186+ ; X64-AVX-NEXT: addb %dl, %al
187+ ; X64-AVX-NEXT: subb %al, %cl
187188; X64-AVX-NEXT: shlq $27, %rsi
188189; X64-AVX-NEXT: # kill: def $cl killed $cl killed $rcx
189190; X64-AVX-NEXT: shldq %cl, %rsi, %rdi
@@ -349,9 +350,10 @@ define i37 @fshr_i37(i37 %x, i37 %y, i37 %z) nounwind {
349350; X64-AVX-NEXT: movabsq $498560650640798693, %rdx # imm = 0x6EB3E45306EB3E5
350351; X64-AVX-NEXT: mulq %rdx
351352; X64-AVX-NEXT: leal (%rdx,%rdx,8), %eax
352- ; X64-AVX-NEXT: leal (%rdx,%rax,4), %eax
353- ; X64-AVX-NEXT: subl %eax, %ecx
354- ; X64-AVX-NEXT: addl $27, %ecx
353+ ; X64-AVX-NEXT: shll $2, %eax
354+ ; X64-AVX-NEXT: addb %dl, %al
355+ ; X64-AVX-NEXT: subb %al, %cl
356+ ; X64-AVX-NEXT: addb $27, %cl
355357; X64-AVX-NEXT: shlq $27, %rsi
356358; X64-AVX-NEXT: # kill: def $cl killed $cl killed $rcx
357359; X64-AVX-NEXT: shrdq %cl, %rdi, %rsi
@@ -437,16 +439,15 @@ define i32 @fshl_i32_undef0_msk(i32 %a0, i32 %a1) nounwind {
437439; X86-SSE2-LABEL: fshl_i32_undef0_msk:
438440; X86-SSE2: # %bb.0:
439441; X86-SSE2-NEXT: movl {{[0-9]+}}(%esp), %eax
440- ; X86-SSE2-NEXT: movl {{[0-9]+}}(%esp), %ecx
441- ; X86-SSE2-NEXT: andl $7, %ecx
442- ; X86-SSE2-NEXT: # kill: def $cl killed $cl killed $ecx
442+ ; X86-SSE2-NEXT: movzbl {{[0-9]+}}(%esp), %ecx
443+ ; X86-SSE2-NEXT: andb $7, %cl
443444; X86-SSE2-NEXT: shldl %cl, %eax, %eax
444445; X86-SSE2-NEXT: retl
445446;
446447; X64-AVX-LABEL: fshl_i32_undef0_msk:
447448; X64-AVX: # %bb.0:
448449; X64-AVX-NEXT: movl %esi, %ecx
449- ; X64-AVX-NEXT: andl $7, %ecx
450+ ; X64-AVX-NEXT: andb $7, %cl
450451; X64-AVX-NEXT: # kill: def $cl killed $cl killed $ecx
451452; X64-AVX-NEXT: shldl %cl, %edi, %eax
452453; X64-AVX-NEXT: retq
@@ -694,16 +695,15 @@ define i32 @fshr_i32_undef1_msk(i32 %a0, i32 %a1) nounwind {
694695; X86-SSE2-LABEL: fshr_i32_undef1_msk:
695696; X86-SSE2: # %bb.0:
696697; X86-SSE2-NEXT: movl {{[0-9]+}}(%esp), %eax
697- ; X86-SSE2-NEXT: movl {{[0-9]+}}(%esp), %ecx
698- ; X86-SSE2-NEXT: andl $7, %ecx
699- ; X86-SSE2-NEXT: # kill: def $cl killed $cl killed $ecx
698+ ; X86-SSE2-NEXT: movzbl {{[0-9]+}}(%esp), %ecx
699+ ; X86-SSE2-NEXT: andb $7, %cl
700700; X86-SSE2-NEXT: shrdl %cl, %eax, %eax
701701; X86-SSE2-NEXT: retl
702702;
703703; X64-AVX-LABEL: fshr_i32_undef1_msk:
704704; X64-AVX: # %bb.0:
705705; X64-AVX-NEXT: movl %esi, %ecx
706- ; X64-AVX-NEXT: andl $7, %ecx
706+ ; X64-AVX-NEXT: andb $7, %cl
707707; X64-AVX-NEXT: # kill: def $cl killed $cl killed $ecx
708708; X64-AVX-NEXT: shrdl %cl, %edi, %eax
709709; X64-AVX-NEXT: retq
0 commit comments