Skip to content

Commit

Permalink
fabs: Remove llvm intrinsic from the header.
Browse files Browse the repository at this point in the history
Reviewer: Aaron Watry
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 356014
  • Loading branch information
jvesely committed Mar 13, 2019
1 parent 54eb4d3 commit fda15e5
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 5 deletions.
11 changes: 6 additions & 5 deletions libclc/generic/include/clc/math/fabs.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#undef fabs
#define fabs __clc_fabs
#define __CLC_BODY <clc/math/unary_decl.inc>
#define __CLC_FUNCTION fabs

#define __CLC_FUNCTION __clc_fabs
#define __CLC_INTRINSIC "llvm.fabs"
#include <clc/math/unary_intrin.inc>
#include <clc/math/gentype.inc>

#undef __CLC_BODY
#undef __CLC_FUNCTION
1 change: 1 addition & 0 deletions libclc/generic/lib/SOURCES
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 11 additions & 0 deletions libclc/generic/lib/math/fabs.cl
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#include <clc/clc.h>
#include "../clcmacro.h"

// Map the llvm intrinsic to an OpenCL function.
#define __CLC_FUNCTION __clc_fabs
#define __CLC_INTRINSIC "llvm.fabs"
#include <clc/math/unary_intrin.inc>

#undef __CLC_FUNCTION
#define __CLC_FUNCTION fabs
#include "unary_builtin.inc"

0 comments on commit fda15e5

Please sign in to comment.