aboutsummaryrefslogtreecommitdiff
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.zip
llvm-ee555aa9929976a6b178f549ec0bf68069bafa52.tar.gz
llvm-ee555aa9929976a6b178f549ec0bf68069bafa52.tar.bz2
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 d34f661..e8cc1f8 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 a54aa8a..df7f68f 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 0000000..930bf78
--- /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"