trunc: Remove llvm intrinsic from the header.
authorJan Vesely <jan.vesely@rutgers.edu>
Wed, 13 Mar 2019 07:06:10 +0000 (07:06 +0000)
committerJan Vesely <jan.vesely@rutgers.edu>
Wed, 13 Mar 2019 07:06:10 +0000 (07:06 +0000)
Reviewer: Aaron Watry
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 356018

libclc/generic/include/clc/math/trunc.h
libclc/generic/lib/SOURCES
libclc/generic/lib/math/trunc.cl [new file with mode: 0644]

index d34f661..e8cc1f8 100644 (file)
@@ -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
index a54aa8a..df7f68f 100644 (file)
@@ -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 (file)
index 0000000..930bf78
--- /dev/null
@@ -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"