From 1c395b74bf6d7328a34ddf7633d647bc705c9e06 Mon Sep 17 00:00:00 2001 From: Jan Vesely Date: Wed, 13 Mar 2019 07:06:08 +0000 Subject: [PATCH] round: Remove llvm intrinsic from the header Reviewer: Aaron Watry Signed-off-by: Jan Vesely llvm-svn: 356017 --- libclc/generic/include/clc/math/round.h | 10 ++++------ libclc/generic/lib/SOURCES | 1 + libclc/generic/lib/math/round.cl | 10 ++++++++++ 3 files changed, 15 insertions(+), 6 deletions(-) create mode 100644 libclc/generic/lib/math/round.cl diff --git a/libclc/generic/include/clc/math/round.h b/libclc/generic/include/clc/math/round.h index 43e16ae..cd76e34 100644 --- a/libclc/generic/include/clc/math/round.h +++ b/libclc/generic/include/clc/math/round.h @@ -1,9 +1,7 @@ -#undef round -#define round __clc_round +#define __CLC_BODY +#define __CLC_FUNCTION round -#define __CLC_FUNCTION __clc_round -#define __CLC_INTRINSIC "llvm.round" -#include +#include +#undef __CLC_BODY #undef __CLC_FUNCTION -#undef __CLC_INTRINSIC diff --git a/libclc/generic/lib/SOURCES b/libclc/generic/lib/SOURCES index fa50f10..a54aa8a 100644 --- a/libclc/generic/lib/SOURCES +++ b/libclc/generic/lib/SOURCES @@ -175,6 +175,7 @@ math/remquo.cl math/rint.cl math/clc_rootn.cl math/rootn.cl +math/round.cl math/sin.cl math/sincos.cl math/sincos_helpers.cl diff --git a/libclc/generic/lib/math/round.cl b/libclc/generic/lib/math/round.cl new file mode 100644 index 0000000..285328a --- /dev/null +++ b/libclc/generic/lib/math/round.cl @@ -0,0 +1,10 @@ +#include + +// Map the llvm intrinsic to an OpenCL function. +#define __CLC_FUNCTION __clc_round +#define __CLC_INTRINSIC "llvm.round" +#include + +#undef __CLC_FUNCTION +#define __CLC_FUNCTION round +#include "unary_builtin.inc" -- 2.7.4