round: 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@356017 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/generic/include/clc/math/round.h b/generic/include/clc/math/round.h
index 43e16ae..cd76e34 100644
--- a/generic/include/clc/math/round.h
+++ b/generic/include/clc/math/round.h
@@ -1,9 +1,7 @@
-#undef round
-#define round __clc_round
+#define __CLC_BODY <clc/math/unary_decl.inc>
+#define __CLC_FUNCTION round
 
-#define __CLC_FUNCTION __clc_round
-#define __CLC_INTRINSIC "llvm.round"
-#include <clc/math/unary_intrin.inc>
+#include <clc/math/gentype.inc>
 
+#undef __CLC_BODY
 #undef __CLC_FUNCTION
-#undef __CLC_INTRINSIC
diff --git a/generic/lib/SOURCES b/generic/lib/SOURCES
index fa50f10..a54aa8a 100644
--- a/generic/lib/SOURCES
+++ b/generic/lib/SOURCES
@@ -175,6 +175,7 @@
 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/generic/lib/math/round.cl b/generic/lib/math/round.cl
new file mode 100644
index 0000000..285328a
--- /dev/null
+++ b/generic/lib/math/round.cl
@@ -0,0 +1,10 @@
+#include <clc/clc.h>
+
+// Map the llvm intrinsic to an OpenCL function.
+#define __CLC_FUNCTION __clc_round
+#define __CLC_INTRINSIC "llvm.round"
+#include <clc/math/unary_intrin.inc>
+
+#undef __CLC_FUNCTION
+#define __CLC_FUNCTION round
+#include "unary_builtin.inc"