diff options
author | Jan Vesely <jan.vesely@rutgers.edu> | 2017-09-08 23:59:00 +0000 |
---|---|---|
committer | Jan Vesely <jan.vesely@rutgers.edu> | 2017-09-08 23:59:00 +0000 |
commit | 285d2fb85c89a42dca49ea66af425f4deba352c2 (patch) | |
tree | 0f805fbba8e62c67a5cbdf130f1361271b6f3c41 /libclc/amdgpu | |
parent | 661ac03a1bef271698a92fb39eff369063bfcca0 (diff) | |
download | llvm-285d2fb85c89a42dca49ea66af425f4deba352c2.tar.gz |
Implement vload_half{,n} and vload(half)
v2: add vload(half) as well
make helpers amdgpu specific (NVPTX uses different private AS numbering)
use clang builtin on clang >= 6
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-by: Tom Stellard <tstellar@redhat.com>
llvm-svn: 312839
Diffstat (limited to 'libclc/amdgpu')
-rw-r--r-- | libclc/amdgpu/lib/SOURCES_4.0 | 1 | ||||
-rw-r--r-- | libclc/amdgpu/lib/SOURCES_5.0 | 1 | ||||
-rw-r--r-- | libclc/amdgpu/lib/shared/vload_half_helpers.ll | 23 |
3 files changed, 25 insertions, 0 deletions
diff --git a/libclc/amdgpu/lib/SOURCES_4.0 b/libclc/amdgpu/lib/SOURCES_4.0 index 58517988601c..69c5e5ce9fba 100644 --- a/libclc/amdgpu/lib/SOURCES_4.0 +++ b/libclc/amdgpu/lib/SOURCES_4.0 @@ -1 +1,2 @@ +shared/vload_half_helpers.ll shared/vstore_half_helpers.ll diff --git a/libclc/amdgpu/lib/SOURCES_5.0 b/libclc/amdgpu/lib/SOURCES_5.0 index 58517988601c..69c5e5ce9fba 100644 --- a/libclc/amdgpu/lib/SOURCES_5.0 +++ b/libclc/amdgpu/lib/SOURCES_5.0 @@ -1 +1,2 @@ +shared/vload_half_helpers.ll shared/vstore_half_helpers.ll diff --git a/libclc/amdgpu/lib/shared/vload_half_helpers.ll b/libclc/amdgpu/lib/shared/vload_half_helpers.ll new file mode 100644 index 000000000000..b8c905af6fc8 --- /dev/null +++ b/libclc/amdgpu/lib/shared/vload_half_helpers.ll @@ -0,0 +1,23 @@ +define float @__clc_vload_half_float_helper__private(half addrspace(0)* nocapture %ptr) nounwind alwaysinline { + %data = load half, half addrspace(0)* %ptr + %res = fpext half %data to float + ret float %res +} + +define float @__clc_vload_half_float_helper__global(half addrspace(1)* nocapture %ptr) nounwind alwaysinline { + %data = load half, half addrspace(1)* %ptr + %res = fpext half %data to float + ret float %res +} + +define float @__clc_vload_half_float_helper__local(half addrspace(3)* nocapture %ptr) nounwind alwaysinline { + %data = load half, half addrspace(3)* %ptr + %res = fpext half %data to float + ret float %res +} + +define float @__clc_vload_half_float_helper__constant(half addrspace(2)* nocapture %ptr) nounwind alwaysinline { + %data = load half, half addrspace(2)* %ptr + %res = fpext half %data to float + ret float %res +} |