Add vload_half helpers for ptx
authorJeroen Ketema <j.ketema@imperial.ac.uk>
Thu, 5 Oct 2017 18:17:40 +0000 (18:17 +0000)
committerJeroen Ketema <j.ketema@imperial.ac.uk>
Thu, 5 Oct 2017 18:17:40 +0000 (18:17 +0000)
The removes the vload_half unresolved calls from the nvptx libraries.

Reviewed-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 314998

libclc/ptx/lib/SOURCES_3.9
libclc/ptx/lib/SOURCES_4.0
libclc/ptx/lib/SOURCES_5.0
libclc/ptx/lib/shared/vload_half_helpers.ll [new file with mode: 0644]

index 5851798..69c5e5c 100644 (file)
@@ -1 +1,2 @@
+shared/vload_half_helpers.ll
 shared/vstore_half_helpers.ll
index 5851798..69c5e5c 100644 (file)
@@ -1 +1,2 @@
+shared/vload_half_helpers.ll
 shared/vstore_half_helpers.ll
index 5851798..69c5e5c 100644 (file)
@@ -1 +1,2 @@
+shared/vload_half_helpers.ll
 shared/vstore_half_helpers.ll
diff --git a/libclc/ptx/lib/shared/vload_half_helpers.ll b/libclc/ptx/lib/shared/vload_half_helpers.ll
new file mode 100644 (file)
index 0000000..f79d104
--- /dev/null
@@ -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(4)* nocapture %ptr) nounwind alwaysinline {
+  %data = load half, half addrspace(4)* %ptr
+  %res = fpext half %data to float
+  ret float %res
+}