diff options
| author | Che-Liang Chiou <clchiou@gmail.com> | 2010-11-17 08:08:49 +0000 |
|---|---|---|
| committer | Che-Liang Chiou <clchiou@gmail.com> | 2010-11-17 08:08:49 +0000 |
| commit | c03d04ee1f032dafc99e2aebbfde80f68f876797 (patch) | |
| tree | 2aff84b8bca2bdc463890cf62b9359dc39bdf806 /llvm/test/CodeGen | |
| parent | 655364797e0e8234fbf633816308808674cf003c (diff) | |
| download | bcm5719-llvm-c03d04ee1f032dafc99e2aebbfde80f68f876797.tar.gz bcm5719-llvm-c03d04ee1f032dafc99e2aebbfde80f68f876797.zip | |
Add simple arithmetics and %type directive for PTX
llvm-svn: 119485
Diffstat (limited to 'llvm/test/CodeGen')
| -rw-r--r-- | llvm/test/CodeGen/PTX/add.ll | 15 | ||||
| -rw-r--r-- | llvm/test/CodeGen/PTX/exit.ll | 3 | ||||
| -rw-r--r-- | llvm/test/CodeGen/PTX/mov.ll | 8 | ||||
| -rw-r--r-- | llvm/test/CodeGen/PTX/ret.ll | 3 | ||||
| -rw-r--r-- | llvm/test/CodeGen/PTX/sub.ll | 15 |
5 files changed, 38 insertions, 6 deletions
diff --git a/llvm/test/CodeGen/PTX/add.ll b/llvm/test/CodeGen/PTX/add.ll new file mode 100644 index 00000000000..1259d03e96c --- /dev/null +++ b/llvm/test/CodeGen/PTX/add.ll @@ -0,0 +1,15 @@ +; RUN: llc < %s -march=ptx | FileCheck %s + +define ptx_device i32 @t1(i32 %x, i32 %y) { +; CHECK: add.s32 r0, r1, r2; + %z = add i32 %x, %y +; CHECK: ret; + ret i32 %z +} + +define ptx_device i32 @t2(i32 %x) { +; CHECK: add.s32 r0, r1, 1; + %z = add i32 %x, 1 +; CHECK: ret; + ret i32 %z +} diff --git a/llvm/test/CodeGen/PTX/exit.ll b/llvm/test/CodeGen/PTX/exit.ll index 1fb297c7469..396898b623c 100644 --- a/llvm/test/CodeGen/PTX/exit.ll +++ b/llvm/test/CodeGen/PTX/exit.ll @@ -1,6 +1,7 @@ ; RUN: llc < %s -march=ptx | FileCheck %s define ptx_kernel void @t1() { -;CHECK: exit; +; CHECK: exit; +; CHECK-NOT: ret; ret void } diff --git a/llvm/test/CodeGen/PTX/mov.ll b/llvm/test/CodeGen/PTX/mov.ll index 287b846da73..c365e9beb89 100644 --- a/llvm/test/CodeGen/PTX/mov.ll +++ b/llvm/test/CodeGen/PTX/mov.ll @@ -1,13 +1,13 @@ ; RUN: llc < %s -march=ptx | FileCheck %s define ptx_device i32 @t1() { -;CHECK: mov.s32 r0, 0; -;CHECK: ret; +; CHECK: mov.s32 r0, 0; +; CHECK: ret; ret i32 0 } define ptx_device i32 @t2(i32 %x) { -;CHECK: mov.s32 r0, r1; -;CHECK: ret; +; CHECK: mov.s32 r0, r1; +; CHECK: ret; ret i32 %x } diff --git a/llvm/test/CodeGen/PTX/ret.ll b/llvm/test/CodeGen/PTX/ret.ll index c129ffe6ffa..d5037f25fd3 100644 --- a/llvm/test/CodeGen/PTX/ret.ll +++ b/llvm/test/CodeGen/PTX/ret.ll @@ -1,6 +1,7 @@ ; RUN: llc < %s -march=ptx | FileCheck %s define ptx_device void @t1() { -;CHECK: ret; +; CHECK: ret; +; CHECK-NOT: exit; ret void } diff --git a/llvm/test/CodeGen/PTX/sub.ll b/llvm/test/CodeGen/PTX/sub.ll new file mode 100644 index 00000000000..aab3fdadad1 --- /dev/null +++ b/llvm/test/CodeGen/PTX/sub.ll @@ -0,0 +1,15 @@ +; RUN: llc < %s -march=ptx | FileCheck %s + +define ptx_device i32 @t1(i32 %x, i32 %y) { +;CHECK: sub.s32 r0, r1, r2; + %z = sub i32 %x, %y +;CHECK: ret; + ret i32 %z +} + +define ptx_device i32 @t2(i32 %x) { +;CHECK: add.s32 r0, r1, -1; + %z = sub i32 %x, 1 +;CHECK: ret; + ret i32 %z +} |

