diff options
author | Jan Vesely <jan.vesely@rutgers.edu> | 2017-09-08 23:58:57 +0000 |
---|---|---|
committer | Jan Vesely <jan.vesely@rutgers.edu> | 2017-09-08 23:58:57 +0000 |
commit | 661ac03a1bef271698a92fb39eff369063bfcca0 (patch) | |
tree | 49f1bd1beff826ac5251d3d11a2e53a7bfc0d4ce /libclc/amdgpu | |
parent | b9dbaae3fb167317d75d04d0cef00f9577abd53d (diff) | |
download | llvm-661ac03a1bef271698a92fb39eff369063bfcca0.tar.gz |
vstore: Cleanup and add vstore(half)
Add missing undefs
Make helpers amdgpu specific (NVPTX uses different numbering for private AS)
Use clang builtins on clang >= 6
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-by: Tom Stellard <tstellar@redhat.com>
llvm-svn: 312838
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/vstore_half_helpers.ll | 35 |
3 files changed, 37 insertions, 0 deletions
diff --git a/libclc/amdgpu/lib/SOURCES_4.0 b/libclc/amdgpu/lib/SOURCES_4.0 new file mode 100644 index 000000000000..58517988601c --- /dev/null +++ b/libclc/amdgpu/lib/SOURCES_4.0 @@ -0,0 +1 @@ +shared/vstore_half_helpers.ll diff --git a/libclc/amdgpu/lib/SOURCES_5.0 b/libclc/amdgpu/lib/SOURCES_5.0 new file mode 100644 index 000000000000..58517988601c --- /dev/null +++ b/libclc/amdgpu/lib/SOURCES_5.0 @@ -0,0 +1 @@ +shared/vstore_half_helpers.ll diff --git a/libclc/amdgpu/lib/shared/vstore_half_helpers.ll b/libclc/amdgpu/lib/shared/vstore_half_helpers.ll new file mode 100644 index 000000000000..e958664e5601 --- /dev/null +++ b/libclc/amdgpu/lib/shared/vstore_half_helpers.ll @@ -0,0 +1,35 @@ +define void @__clc_vstore_half_float_helper__private(float %data, half addrspace(0)* nocapture %ptr) nounwind alwaysinline { + %res = fptrunc float %data to half + store half %res, half addrspace(0)* %ptr + ret void +} + +define void @__clc_vstore_half_float_helper__global(float %data, half addrspace(1)* nocapture %ptr) nounwind alwaysinline { + %res = fptrunc float %data to half + store half %res, half addrspace(1)* %ptr + ret void +} + +define void @__clc_vstore_half_float_helper__local(float %data, half addrspace(3)* nocapture %ptr) nounwind alwaysinline { + %res = fptrunc float %data to half + store half %res, half addrspace(3)* %ptr + ret void +} + +define void @__clc_vstore_half_double_helper__private(double %data, half addrspace(0)* nocapture %ptr) nounwind alwaysinline { + %res = fptrunc double %data to half + store half %res, half addrspace(0)* %ptr + ret void +} + +define void @__clc_vstore_half_double_helper__global(double %data, half addrspace(1)* nocapture %ptr) nounwind alwaysinline { + %res = fptrunc double %data to half + store half %res, half addrspace(1)* %ptr + ret void +} + +define void @__clc_vstore_half_double_helper__local(double %data, half addrspace(3)* nocapture %ptr) nounwind alwaysinline { + %res = fptrunc double %data to half + store half %res, half addrspace(3)* %ptr + ret void +} |