diff options
| author | Aaron Watry <awatry@gmail.com> | 2013-08-12 14:42:49 +0000 |
|---|---|---|
| committer | Aaron Watry <awatry@gmail.com> | 2013-08-12 14:42:49 +0000 |
| commit | 7d525653213542746e4e18589d5c4bf046f614d6 (patch) | |
| tree | 833b8693c3357bbb0603e7f312f26f90362894cd /libclc/generic/lib/shared | |
| parent | 3841fa38da4e4f48ca05098699ced70bbeb2f7de (diff) | |
| download | bcm5719-llvm-7d525653213542746e4e18589d5c4bf046f614d6.tar.gz bcm5719-llvm-7d525653213542746e4e18589d5c4bf046f614d6.zip | |
Add vload* for addrspace(2) and use as constant load for R600
Signed-off-by: Aaron Watry <awatry@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
llvm-svn: 188179
Diffstat (limited to 'libclc/generic/lib/shared')
| -rw-r--r-- | libclc/generic/lib/shared/vload_impl.ll | 33 | ||||
| -rw-r--r-- | libclc/generic/lib/shared/vstore_impl.ll | 3 |
2 files changed, 34 insertions, 2 deletions
diff --git a/libclc/generic/lib/shared/vload_impl.ll b/libclc/generic/lib/shared/vload_impl.ll index 2e70e5f2029..2416aafc8a3 100644 --- a/libclc/generic/lib/shared/vload_impl.ll +++ b/libclc/generic/lib/shared/vload_impl.ll @@ -1,4 +1,5 @@ -; This provides optimized implementations of vload4/8/16 for 32-bit int/uint +; This provides optimized implementations of vload2/3/4/8/16 for 32-bit int/uint +; The address spaces get mapped to data types in target-specific usages define <2 x i32> @__clc_vload2_i32__addr1(i32 addrspace(1)* nocapture %addr) nounwind readonly alwaysinline { %1 = bitcast i32 addrspace(1)* %addr to <2 x i32> addrspace(1)* @@ -30,6 +31,36 @@ define <16 x i32> @__clc_vload16_i32__addr1(i32 addrspace(1)* nocapture %addr) n ret <16 x i32> %2 } +define <2 x i32> @__clc_vload2_i32__addr2(i32 addrspace(2)* nocapture %addr) nounwind readonly alwaysinline { + %1 = bitcast i32 addrspace(2)* %addr to <2 x i32> addrspace(2)* + %2 = load <2 x i32> addrspace(2)* %1, align 4, !tbaa !3 + ret <2 x i32> %2 +} + +define <3 x i32> @__clc_vload3_i32__addr2(i32 addrspace(2)* nocapture %addr) nounwind readonly alwaysinline { + %1 = bitcast i32 addrspace(2)* %addr to <3 x i32> addrspace(2)* + %2 = load <3 x i32> addrspace(2)* %1, align 4, !tbaa !3 + ret <3 x i32> %2 +} + +define <4 x i32> @__clc_vload4_i32__addr2(i32 addrspace(2)* nocapture %addr) nounwind readonly alwaysinline { + %1 = bitcast i32 addrspace(2)* %addr to <4 x i32> addrspace(2)* + %2 = load <4 x i32> addrspace(2)* %1, align 4, !tbaa !3 + ret <4 x i32> %2 +} + +define <8 x i32> @__clc_vload8_i32__addr2(i32 addrspace(2)* nocapture %addr) nounwind readonly alwaysinline { + %1 = bitcast i32 addrspace(2)* %addr to <8 x i32> addrspace(2)* + %2 = load <8 x i32> addrspace(2)* %1, align 4, !tbaa !3 + ret <8 x i32> %2 +} + +define <16 x i32> @__clc_vload16_i32__addr2(i32 addrspace(2)* nocapture %addr) nounwind readonly alwaysinline { + %1 = bitcast i32 addrspace(2)* %addr to <16 x i32> addrspace(2)* + %2 = load <16 x i32> addrspace(2)* %1, align 4, !tbaa !3 + ret <16 x i32> %2 +} + !1 = metadata !{metadata !"char", metadata !5} !2 = metadata !{metadata !"short", metadata !5} !3 = metadata !{metadata !"int", metadata !5} diff --git a/libclc/generic/lib/shared/vstore_impl.ll b/libclc/generic/lib/shared/vstore_impl.ll index 388bce2d097..9e2a37b2970 100644 --- a/libclc/generic/lib/shared/vstore_impl.ll +++ b/libclc/generic/lib/shared/vstore_impl.ll @@ -1,4 +1,5 @@ -; This provides optimized implementations of vstore4/8/16 for 32-bit int/uint +; This provides optimized implementations of vstore2/3/4/8/16 for 32-bit int/uint +; The address spaces get mapped to data types in target-specific usages define void @__clc_vstore2_i32__addr1(<2 x i32> %vec, i32 addrspace(1)* nocapture %addr) nounwind alwaysinline { %1 = bitcast i32 addrspace(1)* %addr to <2 x i32> addrspace(1)* |

