From ee555aa9929976a6b178f549ec0bf68069bafa52 Mon Sep 17 00:00:00 2001 From: Jan Vesely Date: Wed, 13 Mar 2019 07:06:10 +0000 Subject: trunc: Remove llvm intrinsic from the header. Reviewer: Aaron Watry Signed-off-by: Jan Vesely llvm-svn: 356018 --- libclc/generic/include/clc/math/trunc.h | 10 ++++------ libclc/generic/lib/SOURCES | 1 + libclc/generic/lib/math/trunc.cl | 10 ++++++++++ 3 files changed, 15 insertions(+), 6 deletions(-) create mode 100644 libclc/generic/lib/math/trunc.cl (limited to 'libclc') diff --git a/libclc/generic/include/clc/math/trunc.h b/libclc/generic/include/clc/math/trunc.h index d34f6619043..e8cc1f812e4 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 +#define __CLC_FUNCTION trunc -#define __CLC_FUNCTION __clc_trunc -#define __CLC_INTRINSIC "llvm.trunc" -#include +#include +#undef __CLC_BODY #undef __CLC_FUNCTION -#undef __CLC_INTRINSIC diff --git a/libclc/generic/lib/SOURCES b/libclc/generic/lib/SOURCES index a54aa8a02fb..df7f68f040f 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 00000000000..930bf78d234 --- /dev/null +++ b/libclc/generic/lib/math/trunc.cl @@ -0,0 +1,10 @@ +#include + +// Map the llvm intrinsic to an OpenCL function. +#define __CLC_FUNCTION __clc_trunc +#define __CLC_INTRINSIC "llvm.trunc" +#include + +#undef __CLC_FUNCTION +#define __CLC_FUNCTION trunc +#include "unary_builtin.inc" -- cgit v1.2.3