@@ -718,17 +718,18 @@ 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: cmpb $-128, %dil
721+ ; X64-NEXT: negb %dil
722722; X64-NEXT: movzbl %cl, %eax
723- ; X64-NEXT: cmovel %esi, %eax
723+ ; X64-NEXT: cmovol %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: cmpb $-128, %al
731- ; X86-NEXT: jne .LBB17_1
730+ ; X86-NEXT: movl %eax, %ecx
731+ ; X86-NEXT: negb %cl
732+ ; X86-NEXT: jno .LBB17_1
732733; X86-NEXT: # %bb.2:
733734; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
734735; X86-NEXT: # kill: def $al killed $al killed $eax
@@ -750,12 +751,10 @@ define i8 @test_minsigned_i8(i8 %a0, i8 %a1) nounwind {
750751define i16 @test_minsigned_i16 (i16 %a0 , i16 %a1 ) nounwind {
751752; X64-LABEL: test_minsigned_i16:
752753; X64: # %bb.0:
753- ; X64-NEXT: movzwl %di, %ecx
754- ; X64-NEXT: movl %ecx, %eax
754+ ; X64-NEXT: movl %edi, %eax
755755; X64-NEXT: negw %ax
756- ; X64-NEXT: cmovsw %cx, %ax
757- ; X64-NEXT: cmpl $32768, %ecx # imm = 0x8000
758- ; X64-NEXT: cmovel %esi, %eax
756+ ; X64-NEXT: cmovsw %di, %ax
757+ ; X64-NEXT: cmovol %esi, %eax
759758; X64-NEXT: # kill: def $ax killed $ax killed $eax
760759; X64-NEXT: retq
761760;
@@ -765,11 +764,7 @@ define i16 @test_minsigned_i16(i16 %a0, i16 %a1) nounwind {
765764; X86-NEXT: movl %ecx, %eax
766765; X86-NEXT: negw %ax
767766; X86-NEXT: cmovsw %cx, %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:
767+ ; X86-NEXT: cmovow {{[0-9]+}}(%esp), %ax
773768; X86-NEXT: retl
774769 %lim = icmp eq i16 %a0 , -32768
775770 %abs = tail call i16 @llvm.abs.i16 (i16 %a0 , i1 false )
@@ -783,8 +778,7 @@ define i32 @test_minsigned_i32(i32 %a0, i32 %a1) nounwind {
783778; X64-NEXT: movl %edi, %eax
784779; X64-NEXT: negl %eax
785780; X64-NEXT: cmovsl %edi, %eax
786- ; X64-NEXT: cmpl $-2147483648, %edi # imm = 0x80000000
787- ; X64-NEXT: cmovel %esi, %eax
781+ ; X64-NEXT: cmovol %esi, %eax
788782; X64-NEXT: retq
789783;
790784; X86-LABEL: test_minsigned_i32:
@@ -793,11 +787,7 @@ define i32 @test_minsigned_i32(i32 %a0, i32 %a1) nounwind {
793787; X86-NEXT: movl %ecx, %eax
794788; X86-NEXT: negl %eax
795789; X86-NEXT: cmovsl %ecx, %eax
796- ; X86-NEXT: cmpl $-2147483648, %ecx # imm = 0x80000000
797- ; X86-NEXT: jne .LBB19_2
798- ; X86-NEXT: # %bb.1:
799- ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
800- ; X86-NEXT: .LBB19_2:
790+ ; X86-NEXT: cmovol {{[0-9]+}}(%esp), %eax
801791; X86-NEXT: retl
802792 %lim = icmp eq i32 %a0 , -2147483648
803793 %abs = tail call i32 @llvm.abs.i32 (i32 %a0 , i1 false )
@@ -811,9 +801,7 @@ define i64 @test_minsigned_i64(i64 %a0, i64 %a1) nounwind {
811801; X64-NEXT: movq %rdi, %rax
812802; X64-NEXT: negq %rax
813803; X64-NEXT: cmovsq %rdi, %rax
814- ; X64-NEXT: movabsq $-9223372036854775808, %rcx # imm = 0x8000000000000000
815- ; X64-NEXT: cmpq %rcx, %rdi
816- ; X64-NEXT: cmoveq %rsi, %rax
804+ ; X64-NEXT: cmovoq %rsi, %rax
817805; X64-NEXT: retq
818806;
819807; X86-LABEL: test_minsigned_i64:
0 commit comments