@@ -718,18 +718,17 @@ 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: negb %dil
721
+ ; X64-NEXT: cmpb $-128, %dil
722
722
; X64-NEXT: movzbl %cl, %eax
723
- ; X64-NEXT: cmovol %esi, %eax
723
+ ; X64-NEXT: cmovel %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: 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
733
732
; X86-NEXT: # %bb.2:
734
733
; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
735
734
; X86-NEXT: # kill: def $al killed $al killed $eax
@@ -751,10 +750,12 @@ define i8 @test_minsigned_i8(i8 %a0, i8 %a1) nounwind {
751
750
define i16 @test_minsigned_i16 (i16 %a0 , i16 %a1 ) nounwind {
752
751
; X64-LABEL: test_minsigned_i16:
753
752
; X64: # %bb.0:
754
- ; X64-NEXT: movl %edi, %eax
753
+ ; X64-NEXT: movzwl %di, %ecx
754
+ ; X64-NEXT: movl %ecx, %eax
755
755
; 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
758
759
; X64-NEXT: # kill: def $ax killed $ax killed $eax
759
760
; X64-NEXT: retq
760
761
;
@@ -764,7 +765,11 @@ define i16 @test_minsigned_i16(i16 %a0, i16 %a1) nounwind {
764
765
; X86-NEXT: movl %ecx, %eax
765
766
; X86-NEXT: negw %ax
766
767
; 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:
768
773
; X86-NEXT: retl
769
774
%lim = icmp eq i16 %a0 , -32768
770
775
%abs = tail call i16 @llvm.abs.i16 (i16 %a0 , i1 false )
0 commit comments