floor: Remove llvm isntrinsic from the header.

Reviewer: Aaron Watry
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 356015
GitOrigin-RevId: fd199f013948d6d9304caefed4cfd35d6f1e18ca
diff --git a/generic/include/clc/math/floor.h b/generic/include/clc/math/floor.h
index 2337d35..b4e9644 100644
--- a/generic/include/clc/math/floor.h
+++ b/generic/include/clc/math/floor.h
@@ -1,6 +1,7 @@
-#undef floor
-#define floor __clc_floor
+#define __CLC_BODY <clc/math/unary_decl.inc>
+#define __CLC_FUNCTION floor
 
-#define __CLC_FUNCTION __clc_floor
-#define __CLC_INTRINSIC "llvm.floor"
-#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 7b53147..d2ad430 100644
--- a/generic/lib/SOURCES
+++ b/generic/lib/SOURCES
@@ -105,6 +105,7 @@
 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/generic/lib/math/floor.cl b/generic/lib/math/floor.cl
new file mode 100644
index 0000000..333707c
--- /dev/null
+++ b/generic/lib/math/floor.cl
@@ -0,0 +1,11 @@
+#include <clc/clc.h>
+#include "../clcmacro.h"
+
+// Map the llvm intrinsic to an OpenCL function.
+#define __CLC_FUNCTION __clc_floor
+#define __CLC_INTRINSIC "llvm.floor"
+#include <clc/math/unary_intrin.inc>
+
+#undef __CLC_FUNCTION
+#define __CLC_FUNCTION floor
+#include "unary_builtin.inc"