fabs: Remove llvm intrinsic from the header.

Reviewer: Aaron Watry
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>

git-svn-id: https://llvm.org/svn/llvm-project/libclc/trunk@356014 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/generic/include/clc/math/fabs.h b/generic/include/clc/math/fabs.h
index ee2f893..0afde5f 100644
--- a/generic/include/clc/math/fabs.h
+++ b/generic/include/clc/math/fabs.h
@@ -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
diff --git a/generic/lib/SOURCES b/generic/lib/SOURCES
index 03a0479..7b53147 100644
--- a/generic/lib/SOURCES
+++ b/generic/lib/SOURCES
@@ -103,6 +103,7 @@
 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/generic/lib/math/fabs.cl b/generic/lib/math/fabs.cl
new file mode 100644
index 0000000..9f740c7
--- /dev/null
+++ b/generic/lib/math/fabs.cl
@@ -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"