Skip to content

Commit 25e179d

Browse files
committed
Pre-commit test (NFC)
1 parent e7839ee commit 25e179d

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

llvm/test/CodeGen/X86/sbb.ll

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,3 +365,36 @@ define i32 @uge_sext_add(i32 %0, i32 %1, i32 %2) {
365365
%6 = add nsw i32 %5, %0
366366
ret i32 %6
367367
}
368+
369+
define i32 @sub_sub_ugt(i32 %a, i32 %b) {
370+
; CHECK-LABEL: sub_sub_ugt:
371+
; CHECK: # %bb.0:
372+
; CHECK-NEXT: movl %edi, %eax
373+
; CHECK-NEXT: xorl %ecx, %ecx
374+
; CHECK-NEXT: subl %esi, %eax
375+
; CHECK-NEXT: seta %cl
376+
; CHECK-NEXT: subl %ecx, %eax
377+
; CHECK-NEXT: retq
378+
%cmp = icmp ugt i32 %a, %b
379+
%conv = zext i1 %cmp to i32
380+
%sub = sub i32 %a, %b
381+
%res = sub i32 %sub, %conv
382+
ret i32 %res
383+
}
384+
385+
define i32 @sub_sub_ult(i32 %a, i32 %b) {
386+
; CHECK-LABEL: sub_sub_ult:
387+
; CHECK: # %bb.0:
388+
; CHECK-NEXT: movl %edi, %eax
389+
; CHECK-NEXT: xorl %ecx, %ecx
390+
; CHECK-NEXT: subl %esi, %eax
391+
; CHECK-NEXT: seta %cl
392+
; CHECK-NEXT: subl %ecx, %eax
393+
; CHECK-NEXT: retq
394+
%cmp = icmp ult i32 %b, %a
395+
%conv = zext i1 %cmp to i32
396+
%sub = sub i32 %a, %b
397+
%res = sub i32 %sub, %conv
398+
ret i32 %res
399+
}
400+

0 commit comments

Comments
 (0)