summaryrefslogtreecommitdiff
path: root/libclc
diff options
context:
space:
mode:
authorJan Vesely <jan.vesely@rutgers.edu>2019-03-13 07:06:10 +0000
committerJan Vesely <jan.vesely@rutgers.edu>2019-03-13 07:06:10 +0000
commitee555aa9929976a6b178f549ec0bf68069bafa52 (patch)
treefec31cb8273b60670ef2e333d5a55c5587094521 /libclc
parent1c395b74bf6d7328a34ddf7633d647bc705c9e06 (diff)
downloadllvm-ee555aa9929976a6b178f549ec0bf68069bafa52.tar.gz
trunc: Remove llvm intrinsic from the header.
Reviewer: Aaron Watry Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> llvm-svn: 356018
Diffstat (limited to 'libclc')
-rw-r--r--libclc/generic/include/clc/math/trunc.h10
-rw-r--r--libclc/generic/lib/SOURCES1
-rw-r--r--libclc/generic/lib/math/trunc.cl10
3 files changed, 15 insertions, 6 deletions
diff --git a/libclc/generic/include/clc/math/trunc.h b/libclc/generic/include/clc/math/trunc.h
index d34f66190433..e8cc1f812e4a 100644
--- a/libclc/generic/include/clc/math/trunc.h
+++ b/libclc/generic/include/clc/math/trunc.h
@@ -1,9 +1,7 @@
-#undef trunc
-#define trunc __clc_trunc
+#define __CLC_BODY <clc/math/unary_decl.inc>
+#define __CLC_FUNCTION trunc
-#define __CLC_FUNCTION __clc_trunc
-#define __CLC_INTRINSIC "llvm.trunc"
-#include <clc/math/unary_intrin.inc>
+#include <clc/math/gentype.inc>
+#undef __CLC_BODY
#undef __CLC_FUNCTION
-#undef __CLC_INTRINSIC
diff --git a/libclc/generic/lib/SOURCES b/libclc/generic/lib/SOURCES
index a54aa8a02fbb..df7f68f040f3 100644
--- a/libclc/generic/lib/SOURCES
+++ b/libclc/generic/lib/SOURCES
@@ -189,6 +189,7 @@ math/tanh.cl
math/clc_tanpi.cl
math/tanpi.cl
math/tgamma.cl
+math/trunc.cl
misc/shuffle.cl
misc/shuffle2.cl
relational/all.cl
diff --git a/libclc/generic/lib/math/trunc.cl b/libclc/generic/lib/math/trunc.cl
new file mode 100644
index 000000000000..930bf78d234c
--- /dev/null
+++ b/libclc/generic/lib/math/trunc.cl
@@ -0,0 +1,10 @@
+#include <clc/clc.h>
+
+// Map the llvm intrinsic to an OpenCL function.
+#define __CLC_FUNCTION __clc_trunc
+#define __CLC_INTRINSIC "llvm.trunc"
+#include <clc/math/unary_intrin.inc>
+
+#undef __CLC_FUNCTION
+#define __CLC_FUNCTION trunc
+#include "unary_builtin.inc"