diff options
author | Che-Liang Chiou <clchiou@gmail.com> | 2011-03-02 03:20:28 +0000 |
---|---|---|
committer | Che-Liang Chiou <clchiou@gmail.com> | 2011-03-02 03:20:28 +0000 |
commit | fd8978b021dbb0b9b09084dcc707c2054ff76280 (patch) | |
tree | cdbd6a22e3787047cdb1edcaa79065a2231b6a9c /test/CodeGen/PTX/ld_float.ll | |
parent | 9ff5de99df4820a128e525e077333047cfe50661 (diff) | |
download | external_llvm-fd8978b021dbb0b9b09084dcc707c2054ff76280.tar.gz external_llvm-fd8978b021dbb0b9b09084dcc707c2054ff76280.tar.bz2 external_llvm-fd8978b021dbb0b9b09084dcc707c2054ff76280.zip |
Extend initial support for primitive types in PTX backend
- Allow i16, i32, i64, float, and double types, using the native .u16,
.u32, .u64, .f32, and .f64 PTX types.
- Allow loading/storing of all primitive types.
- Allow primitive types to be passed as parameters.
- Allow selection of PTX Version and Shader Model as sub-target attributes.
- Merge integer/floating-point test cases for load/store.
- Use .u32 instead of .s32 to conform to output from NVidia nvcc compiler.
Patch by Justin Holewinski
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126824 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/PTX/ld_float.ll')
-rw-r--r-- | test/CodeGen/PTX/ld_float.ll | 86 |
1 files changed, 0 insertions, 86 deletions
diff --git a/test/CodeGen/PTX/ld_float.ll b/test/CodeGen/PTX/ld_float.ll deleted file mode 100644 index 62d2c36e64..0000000000 --- a/test/CodeGen/PTX/ld_float.ll +++ /dev/null @@ -1,86 +0,0 @@ -; RUN: llc < %s -march=ptx | FileCheck %s - -;CHECK: .extern .global .f32 array[]; -@array = external global [10 x float] - -;CHECK: .extern .const .f32 array_constant[]; -@array_constant = external addrspace(1) constant [10 x float] - -;CHECK: .extern .local .f32 array_local[]; -@array_local = external addrspace(2) global [10 x float] - -;CHECK: .extern .shared .f32 array_shared[]; -@array_shared = external addrspace(4) global [10 x float] - -define ptx_device float @t1(float* %p) { -entry: -;CHECK: ld.global.f32 f0, [r1]; -;CHECK-NEXT: ret; - %x = load float* %p - ret float %x -} - -define ptx_device float @t2(float* %p) { -entry: -;CHECK: ld.global.f32 f0, [r1+4]; -;CHECK-NEXT: ret; - %i = getelementptr float* %p, i32 1 - %x = load float* %i - ret float %x -} - -define ptx_device float @t3(float* %p, i32 %q) { -entry: -;CHECK: shl.b32 r0, r2, 2; -;CHECK-NEXT: add.s32 r0, r1, r0; -;CHECK-NEXT: ld.global.f32 f0, [r0]; -;CHECK-NEXT: ret; - %i = getelementptr float* %p, i32 %q - %x = load float* %i - ret float %x -} - -define ptx_device float @t4_global() { -entry: -;CHECK: ld.global.f32 f0, [array]; -;CHECK-NEXT: ret; - %i = getelementptr [10 x float]* @array, i32 0, i32 0 - %x = load float* %i - ret float %x -} - -define ptx_device float @t4_const() { -entry: -;CHECK: ld.const.f32 f0, [array_constant]; -;CHECK-NEXT: ret; - %i = getelementptr [10 x float] addrspace(1)* @array_constant, i32 0, i32 0 - %x = load float addrspace(1)* %i - ret float %x -} - -define ptx_device float @t4_local() { -entry: -;CHECK: ld.local.f32 f0, [array_local]; -;CHECK-NEXT: ret; - %i = getelementptr [10 x float] addrspace(2)* @array_local, i32 0, i32 0 - %x = load float addrspace(2)* %i - ret float %x -} - -define ptx_device float @t4_shared() { -entry: -;CHECK: ld.shared.f32 f0, [array_shared]; -;CHECK-NEXT: ret; - %i = getelementptr [10 x float] addrspace(4)* @array_shared, i32 0, i32 0 - %x = load float addrspace(4)* %i - ret float %x -} - -define ptx_device float @t5() { -entry: -;CHECK: ld.global.f32 f0, [array+4]; -;CHECK-NEXT: ret; - %i = getelementptr [10 x float]* @array, i32 0, i32 1 - %x = load float* %i - ret float %x -} |