@@ -718,18 +718,17 @@ define i8 @test_minsigned_i8(i8 %a0, i8 %a1) nounwind {
718718; X64-NEXT: movl %edi, %ecx
719719; X64-NEXT: xorb %al, %cl
720720; X64-NEXT: subb %al, %cl
721- ; X64-NEXT: negb %dil
721+ ; X64-NEXT: cmpb $-128, %dil
722722; X64-NEXT: movzbl %cl, %eax
723- ; X64-NEXT: cmovol %esi, %eax
723+ ; X64-NEXT: cmovel %esi, %eax
724724; X64-NEXT: # kill: def $al killed $al killed $eax
725725; X64-NEXT: retq
726726;
727727; X86-LABEL: test_minsigned_i8:
728728; X86: # %bb.0:
729729; X86-NEXT: movzbl {{[0-9]+}}(%esp), %eax
730- ; X86-NEXT: movl %eax, %ecx
731- ; X86-NEXT: negb %cl
732- ; X86-NEXT: jno .LBB17_1
730+ ; X86-NEXT: cmpb $-128, %al
731+ ; X86-NEXT: jne .LBB17_1
733732; X86-NEXT: # %bb.2:
734733; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
735734; X86-NEXT: # kill: def $al killed $al killed $eax
@@ -751,10 +750,12 @@ define i8 @test_minsigned_i8(i8 %a0, i8 %a1) nounwind {
751750define i16 @test_minsigned_i16 (i16 %a0 , i16 %a1 ) nounwind {
752751; X64-LABEL: test_minsigned_i16:
753752; X64: # %bb.0:
754- ; X64-NEXT: movl %edi, %eax
753+ ; X64-NEXT: movzwl %di, %ecx
754+ ; X64-NEXT: movl %ecx, %eax
755755; X64-NEXT: negw %ax
756- ; X64-NEXT: cmovsw %di, %ax
757- ; X64-NEXT: cmovol %esi, %eax
756+ ; X64-NEXT: cmovsw %cx, %ax
757+ ; X64-NEXT: cmpl $32768, %ecx # imm = 0x8000
758+ ; X64-NEXT: cmovel %esi, %eax
758759; X64-NEXT: # kill: def $ax killed $ax killed $eax
759760; X64-NEXT: retq
760761;
@@ -764,7 +765,11 @@ define i16 @test_minsigned_i16(i16 %a0, i16 %a1) nounwind {
764765; X86-NEXT: movl %ecx, %eax
765766; X86-NEXT: negw %ax
766767; X86-NEXT: cmovsw %cx, %ax
767- ; X86-NEXT: cmovow {{[0-9]+}}(%esp), %ax
768+ ; X86-NEXT: cmpl $32768, %ecx # imm = 0x8000
769+ ; X86-NEXT: jne .LBB18_2
770+ ; X86-NEXT: # %bb.1:
771+ ; X86-NEXT: movzwl {{[0-9]+}}(%esp), %eax
772+ ; X86-NEXT: .LBB18_2:
768773; X86-NEXT: retl
769774 %lim = icmp eq i16 %a0 , -32768
770775 %abs = tail call i16 @llvm.abs.i16 (i16 %a0 , i1 false )
0 commit comments