[Libclc-dev] [PATCH 2/2] Implement round builtin

Tom Stellard tom at stellard.net
Fri Nov 1 11:25:35 PDT 2013


From: Tom Stellard <thomas.stellard at amd.com>

---
 generic/include/clc/clc.h        | 1 +
 generic/include/clc/math/round.h | 9 +++++++++
 2 files changed, 10 insertions(+)
 create mode 100644 generic/include/clc/math/round.h

diff --git a/generic/include/clc/clc.h b/generic/include/clc/clc.h
index dd4bb29..8f0dbd3 100644
--- a/generic/include/clc/clc.h
+++ b/generic/include/clc/clc.h
@@ -48,6 +48,7 @@
 #include <clc/math/nextafter.h>
 #include <clc/math/pow.h>
 #include <clc/math/rint.h>
+#include <clc/math/round.h>
 #include <clc/math/sin.h>
 #include <clc/math/sqrt.h>
 #include <clc/math/native_cos.h>
diff --git a/generic/include/clc/math/round.h b/generic/include/clc/math/round.h
new file mode 100644
index 0000000..43e16ae
--- /dev/null
+++ b/generic/include/clc/math/round.h
@@ -0,0 +1,9 @@
+#undef round
+#define round __clc_round
+
+#define __CLC_FUNCTION __clc_round
+#define __CLC_INTRINSIC "llvm.round"
+#include <clc/math/unary_intrin.inc>
+
+#undef __CLC_FUNCTION
+#undef __CLC_INTRINSIC
-- 
1.8.1.4





More information about the Libclc-dev mailing list