diff options
author | Che-Liang Chiou <clchiou@gmail.com> | 2011-02-28 06:34:09 +0000 |
---|---|---|
committer | Che-Liang Chiou <clchiou@gmail.com> | 2011-02-28 06:34:09 +0000 |
commit | f71720231f6de9b2b7fe28edd179ae217a105329 (patch) | |
tree | 7ed3e644aac2d4be87b13f146f0467761e8e7600 /test/CodeGen/PTX/sub.ll | |
parent | d8d1584c13c554349c235177b2b89cb5117347b2 (diff) |
Add preliminary support for .f32 in the PTX backend.
- Add appropriate TableGen patterns for fadd, fsub, fmul.
- Add .f32 as the PTX type for the LLVM float type.
- Allow parameters, return values, and global variable declarations
to accept the float type.
- Add appropriate test cases.
Patch by Justin Holewinski
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126636 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/PTX/sub.ll')
-rw-r--r-- | test/CodeGen/PTX/sub.ll | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/CodeGen/PTX/sub.ll b/test/CodeGen/PTX/sub.ll index aab3fdadad..e11decaf5c 100644 --- a/test/CodeGen/PTX/sub.ll +++ b/test/CodeGen/PTX/sub.ll @@ -13,3 +13,17 @@ define ptx_device i32 @t2(i32 %x) { ;CHECK: ret; ret i32 %z } + +define ptx_device float @t3(float %x, float %y) { +; CHECK: sub.f32 f0, f1, f2 +; CHECK-NEXT: ret; + %z = fsub float %x, %y + ret float %z +} + +define ptx_device float @t4(float %x) { +; CHECK: add.f32 f0, f1, 0FBF800000; +; CHECK-NEXT: ret; + %z = fsub float %x, 1.0 + ret float %z +} |