diff --git a/libclc/generic/include/clc/math/fabs.h b/libclc/generic/include/clc/math/fabs.h index ee2f8932a94d2..0afde5f75774c 100644 --- a/libclc/generic/include/clc/math/fabs.h +++ b/libclc/generic/include/clc/math/fabs.h @@ -1,6 +1,7 @@ -#undef fabs -#define fabs __clc_fabs +#define __CLC_BODY +#define __CLC_FUNCTION fabs -#define __CLC_FUNCTION __clc_fabs -#define __CLC_INTRINSIC "llvm.fabs" -#include +#include + +#undef __CLC_BODY +#undef __CLC_FUNCTION diff --git a/libclc/generic/lib/SOURCES b/libclc/generic/lib/SOURCES index 03a047972ac78..7b53147d8e990 100644 --- a/libclc/generic/lib/SOURCES +++ b/libclc/generic/lib/SOURCES @@ -103,6 +103,7 @@ math/expm1.cl math/exp2.cl math/clc_exp10.cl math/exp10.cl +math/fabs.cl math/fdim.cl math/clc_fma.cl math/fma.cl diff --git a/libclc/generic/lib/math/fabs.cl b/libclc/generic/lib/math/fabs.cl new file mode 100644 index 0000000000000..9f740c7d7501e --- /dev/null +++ b/libclc/generic/lib/math/fabs.cl @@ -0,0 +1,11 @@ +#include +#include "../clcmacro.h" + +// Map the llvm intrinsic to an OpenCL function. +#define __CLC_FUNCTION __clc_fabs +#define __CLC_INTRINSIC "llvm.fabs" +#include + +#undef __CLC_FUNCTION +#define __CLC_FUNCTION fabs +#include "unary_builtin.inc"