summaryrefslogtreecommitdiffstats
path: root/libclc/amdgpu/lib/shared
diff options
context:
space:
mode:
authorJan Vesely <jan.vesely@rutgers.edu>2017-09-08 23:58:57 +0000
committerJan Vesely <jan.vesely@rutgers.edu>2017-09-08 23:58:57 +0000
commit661ac03a1bef271698a92fb39eff369063bfcca0 (patch)
tree49f1bd1beff826ac5251d3d11a2e53a7bfc0d4ce /libclc/amdgpu/lib/shared
parentb9dbaae3fb167317d75d04d0cef00f9577abd53d (diff)
downloadbcm5719-llvm-661ac03a1bef271698a92fb39eff369063bfcca0.tar.gz
bcm5719-llvm-661ac03a1bef271698a92fb39eff369063bfcca0.zip
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/lib/shared')
-rw-r--r--libclc/amdgpu/lib/shared/vstore_half_helpers.ll35
1 files changed, 35 insertions, 0 deletions
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 00000000000..e958664e560
--- /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
+}
OpenPOWER on IntegriCloud