@@ -718,17 +718,18 @@ define i8 @test_minsigned_i8(i8 %a0, i8 %a1) nounwind {
718
718
; X64-NEXT: movl %edi, %ecx
719
719
; X64-NEXT: xorb %al, %cl
720
720
; X64-NEXT: subb %al, %cl
721
- ; X64-NEXT: cmpb $-128, %dil
721
+ ; X64-NEXT: negb %dil
722
722
; X64-NEXT: movzbl %cl, %eax
723
- ; X64-NEXT: cmovel %esi, %eax
723
+ ; X64-NEXT: cmovol %esi, %eax
724
724
; X64-NEXT: # kill: def $al killed $al killed $eax
725
725
; X64-NEXT: retq
726
726
;
727
727
; X86-LABEL: test_minsigned_i8:
728
728
; X86: # %bb.0:
729
729
; 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
732
733
; X86-NEXT: # %bb.2:
733
734
; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
734
735
; X86-NEXT: # kill: def $al killed $al killed $eax
@@ -750,12 +751,10 @@ define i8 @test_minsigned_i8(i8 %a0, i8 %a1) nounwind {
750
751
define i16 @test_minsigned_i16 (i16 %a0 , i16 %a1 ) nounwind {
751
752
; X64-LABEL: test_minsigned_i16:
752
753
; X64: # %bb.0:
753
- ; X64-NEXT: movzwl %di, %ecx
754
- ; X64-NEXT: movl %ecx, %eax
754
+ ; X64-NEXT: movl %edi, %eax
755
755
; 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
759
758
; X64-NEXT: # kill: def $ax killed $ax killed $eax
760
759
; X64-NEXT: retq
761
760
;
@@ -765,11 +764,7 @@ define i16 @test_minsigned_i16(i16 %a0, i16 %a1) nounwind {
765
764
; X86-NEXT: movl %ecx, %eax
766
765
; X86-NEXT: negw %ax
767
766
; 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
773
768
; X86-NEXT: retl
774
769
%lim = icmp eq i16 %a0 , -32768
775
770
%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 {
783
778
; X64-NEXT: movl %edi, %eax
784
779
; X64-NEXT: negl %eax
785
780
; 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
788
782
; X64-NEXT: retq
789
783
;
790
784
; X86-LABEL: test_minsigned_i32:
@@ -793,11 +787,7 @@ define i32 @test_minsigned_i32(i32 %a0, i32 %a1) nounwind {
793
787
; X86-NEXT: movl %ecx, %eax
794
788
; X86-NEXT: negl %eax
795
789
; 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
801
791
; X86-NEXT: retl
802
792
%lim = icmp eq i32 %a0 , -2147483648
803
793
%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 {
811
801
; X64-NEXT: movq %rdi, %rax
812
802
; X64-NEXT: negq %rax
813
803
; 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
817
805
; X64-NEXT: retq
818
806
;
819
807
; X86-LABEL: test_minsigned_i64:
0 commit comments