[Libclc-dev] [PATCH 1/2] Add rounding mode suffixes to conversion declarations

Tom Stellard tom at stellard.net
Thu Sep 13 13:37:28 PDT 2012


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

---
 generic/include/clc/convert.h | 6 +++++-
 generic/lib/convert.cl        | 6 +++++-
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/generic/include/clc/convert.h b/generic/include/clc/convert.h
index a7ae94a..74dd5b0 100644
--- a/generic/include/clc/convert.h
+++ b/generic/include/clc/convert.h
@@ -75,7 +75,11 @@ _CLC_CONVERT_DECL(float, float, _sat)
   _CLC_VECTOR_CONVERT_FROM(double, SUFFIX)
 #else
 #define _CLC_VECTOR_CONVERT_TO(SUFFIX) \
-  _CLC_VECTOR_CONVERT_TO1(SUFFIX)
+  _CLC_VECTOR_CONVERT_TO1(SUFFIX) \
+  _CLC_VECTOR_CONVERT_TO1(SUFFIX##_rte) \
+  _CLC_VECTOR_CONVERT_TO1(SUFFIX##_rtz) \
+  _CLC_VECTOR_CONVERT_TO1(SUFFIX##_rtp) \
+  _CLC_VECTOR_CONVERT_TO1(SUFFIX##_rtn)
 #endif
 
 _CLC_VECTOR_CONVERT_TO()
diff --git a/generic/lib/convert.cl b/generic/lib/convert.cl
index d5a6f31..412ac2c 100644
--- a/generic/lib/convert.cl
+++ b/generic/lib/convert.cl
@@ -115,7 +115,11 @@ CONVERT_ID(float, float, _sat)
   CONVERT_VECTORIZE_FROM(double, SUFFIX)
 #else
 #define CONVERT_VECTORIZE_TO(SUFFIX) \
-  CONVERT_VECTORIZE_TO1(SUFFIX)
+  CONVERT_VECTORIZE_TO1(SUFFIX) \
+  CONVERT_VECTORIZE_TO1(SUFFIX##_rte) \
+  CONVERT_VECTORIZE_TO1(SUFFIX##_rtz) \
+  CONVERT_VECTORIZE_TO1(SUFFIX##_rtp) \
+  CONVERT_VECTORIZE_TO1(SUFFIX##_rtn)
 #endif
 
 CONVERT_VECTORIZE_TO()
-- 
1.7.11.4





More information about the Libclc-dev mailing list