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/add.ll | |
parent | d8d1584c13c554349c235177b2b89cb5117347b2 (diff) | |
download | external_llvm-f71720231f6de9b2b7fe28edd179ae217a105329.zip external_llvm-f71720231f6de9b2b7fe28edd179ae217a105329.tar.gz external_llvm-f71720231f6de9b2b7fe28edd179ae217a105329.tar.bz2 |
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/add.ll')
-rw-r--r-- | test/CodeGen/PTX/add.ll | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/CodeGen/PTX/add.ll b/test/CodeGen/PTX/add.ll index 1259d03..9e777ae 100644 --- a/test/CodeGen/PTX/add.ll +++ b/test/CodeGen/PTX/add.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: add.f32 f0, f1, f2 +; CHECK-NEXT: ret; + %z = fadd float %x, %y + ret float %z +} + +define ptx_device float @t4(float %x) { +; CHECK: add.f32 f0, f1, 0F3F800000; +; CHECK-NEXT: ret; + %z = fadd float %x, 1.0 + ret float %z +} |