From fd199f013948d6d9304caefed4cfd35d6f1e18ca Mon Sep 17 00:00:00 2001 From: Jan Vesely Date: Wed, 13 Mar 2019 07:06:03 +0000 Subject: floor: Remove llvm isntrinsic from the header. Reviewer: Aaron Watry Signed-off-by: Jan Vesely llvm-svn: 356015 --- libclc/generic/include/clc/math/floor.h | 11 ++++++----- libclc/generic/lib/SOURCES | 1 + libclc/generic/lib/math/floor.cl | 11 +++++++++++ 3 files changed, 18 insertions(+), 5 deletions(-) create mode 100644 libclc/generic/lib/math/floor.cl diff --git a/libclc/generic/include/clc/math/floor.h b/libclc/generic/include/clc/math/floor.h index 2337d35caae..b4e96444a6a 100644 --- a/libclc/generic/include/clc/math/floor.h +++ b/libclc/generic/include/clc/math/floor.h @@ -1,6 +1,7 @@ -#undef floor -#define floor __clc_floor +#define __CLC_BODY +#define __CLC_FUNCTION floor -#define __CLC_FUNCTION __clc_floor -#define __CLC_INTRINSIC "llvm.floor" -#include +#include + +#undef __CLC_BODY +#undef __CLC_FUNCTION diff --git a/libclc/generic/lib/SOURCES b/libclc/generic/lib/SOURCES index 7b53147d8e9..d2ad43024e5 100644 --- a/libclc/generic/lib/SOURCES +++ b/libclc/generic/lib/SOURCES @@ -105,6 +105,7 @@ math/clc_exp10.cl math/exp10.cl math/fabs.cl math/fdim.cl +math/floor.cl math/clc_fma.cl math/fma.cl math/fmax.cl diff --git a/libclc/generic/lib/math/floor.cl b/libclc/generic/lib/math/floor.cl new file mode 100644 index 00000000000..333707cc10a --- /dev/null +++ b/libclc/generic/lib/math/floor.cl @@ -0,0 +1,11 @@ +#include +#include "../clcmacro.h" + +// Map the llvm intrinsic to an OpenCL function. +#define __CLC_FUNCTION __clc_floor +#define __CLC_INTRINSIC "llvm.floor" +#include + +#undef __CLC_FUNCTION +#define __CLC_FUNCTION floor +#include "unary_builtin.inc" -- cgit v1.2.3