[llvm] r333341 - Add test case for D46505 . NFC
Amaury Sechet via llvm-commits
llvm-commits at lists.llvm.org
Sat May 26 05:28:24 PDT 2018
Author: deadalnix
Date: Sat May 26 05:28:23 2018
New Revision: 333341
URL: http://llvm.org/viewvc/llvm-project?rev=333341&view=rev
Log:
Add test case for D46505 . NFC
Modified:
llvm/trunk/test/CodeGen/X86/add.ll
llvm/trunk/test/CodeGen/X86/addcarry.ll
Modified: llvm/trunk/test/CodeGen/X86/add.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/add.ll?rev=333341&r1=333340&r2=333341&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/add.ll (original)
+++ llvm/trunk/test/CodeGen/X86/add.ll Sat May 26 05:28:23 2018
@@ -382,3 +382,65 @@ entry:
store i64 %b, i64* %a
ret void
}
+
+define i32 @inc_not(i32 %a) {
+; X32-LABEL: inc_not:
+; X32: # %bb.0:
+; X32-NEXT: movl {{[0-9]+}}(%esp), %eax
+; X32-NEXT: notl %eax
+; X32-NEXT: incl %eax
+; X32-NEXT: retl
+;
+; X64-LINUX-LABEL: inc_not:
+; X64-LINUX: # %bb.0:
+; X64-LINUX-NEXT: # kill: def $edi killed $edi def $rdi
+; X64-LINUX-NEXT: notl %edi
+; X64-LINUX-NEXT: leal 1(%rdi), %eax
+; X64-LINUX-NEXT: retq
+;
+; X64-WIN32-LABEL: inc_not:
+; X64-WIN32: # %bb.0:
+; X64-WIN32-NEXT: # kill: def $ecx killed $ecx def $rcx
+; X64-WIN32-NEXT: notl %ecx
+; X64-WIN32-NEXT: leal 1(%rcx), %eax
+; X64-WIN32-NEXT: retq
+ %nota = xor i32 %a, -1
+ %r = add i32 %nota, 1
+ ret i32 %r
+}
+
+define void @uaddo1_not(i32 %a, i32* %p0, i1* %p1) {
+; X32-LABEL: uaddo1_not:
+; X32: # %bb.0:
+; X32-NEXT: movl {{[0-9]+}}(%esp), %eax
+; X32-NEXT: movl {{[0-9]+}}(%esp), %ecx
+; X32-NEXT: movl {{[0-9]+}}(%esp), %edx
+; X32-NEXT: notl %edx
+; X32-NEXT: addl $1, %edx
+; X32-NEXT: movl %edx, (%ecx)
+; X32-NEXT: setb (%eax)
+; X32-NEXT: retl
+;
+; X64-LINUX-LABEL: uaddo1_not:
+; X64-LINUX: # %bb.0:
+; X64-LINUX-NEXT: notl %edi
+; X64-LINUX-NEXT: addl $1, %edi
+; X64-LINUX-NEXT: movl %edi, (%rsi)
+; X64-LINUX-NEXT: setb (%rdx)
+; X64-LINUX-NEXT: retq
+;
+; X64-WIN32-LABEL: uaddo1_not:
+; X64-WIN32: # %bb.0:
+; X64-WIN32-NEXT: notl %ecx
+; X64-WIN32-NEXT: addl $1, %ecx
+; X64-WIN32-NEXT: movl %ecx, (%rdx)
+; X64-WIN32-NEXT: setb (%r8)
+; X64-WIN32-NEXT: retq
+ %nota = xor i32 %a, -1
+ %uaddo = call {i32, i1} @llvm.uadd.with.overflow.i32(i32 %nota, i32 1)
+ %r0 = extractvalue {i32, i1} %uaddo, 0
+ %r1 = extractvalue {i32, i1} %uaddo, 1
+ store i32 %r0, i32* %p0
+ store i1 %r1, i1* %p1
+ ret void
+}
Modified: llvm/trunk/test/CodeGen/X86/addcarry.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/addcarry.ll?rev=333341&r1=333340&r2=333341&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/addcarry.ll (original)
+++ llvm/trunk/test/CodeGen/X86/addcarry.ll Sat May 26 05:28:23 2018
@@ -317,3 +317,18 @@ entry:
%35 = insertvalue %S undef, [4 x i64] %34, 0
ret %S %35
}
+
+define i128 @addcarry1_not(i128 %n) {
+; CHECK-LABEL: addcarry1_not:
+; CHECK: # %bb.0:
+; CHECK-NEXT: notq %rsi
+; CHECK-NEXT: notq %rdi
+; CHECK-NEXT: addq $1, %rdi
+; CHECK-NEXT: adcq $0, %rsi
+; CHECK-NEXT: movq %rdi, %rax
+; CHECK-NEXT: movq %rsi, %rdx
+; CHECK-NEXT: retq
+ %1 = xor i128 %n, -1
+ %2 = add i128 %1, 1
+ ret i128 %2
+}
More information about the llvm-commits
mailing list