[Beignet] [PATCH] improve builtin function "rint"

Yang, Rong R rong.r.yang at intel.com
Thu Nov 14 00:43:23 PST 2013


LGTM.

-----Original Message-----
From: beignet-bounces at lists.freedesktop.org [mailto:beignet-bounces at lists.freedesktop.org] On Behalf Of Homer Hsing
Sent: Wednesday, November 13, 2013 4:49 PM
To: beignet at lists.freedesktop.org
Subject: [Beignet] [PATCH] improve builtin function "rint"

directly use __gen_ocl_rnde

Signed-off-by: Homer Hsing <homer.xing at intel.com>
---
 backend/src/ocl_stdlib.tmpl.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/backend/src/ocl_stdlib.tmpl.h b/backend/src/ocl_stdlib.tmpl.h index 038cf1c..62f5f78 100644
--- a/backend/src/ocl_stdlib.tmpl.h
+++ b/backend/src/ocl_stdlib.tmpl.h
@@ -1558,7 +1558,7 @@ INLINE_OVERLOADABLE float powr(float x, float y) { return __gen_ocl_pow(x,y); }  INLINE_OVERLOADABLE float fmod(float x, float y) { return x-y*__gen_ocl_rndz(x/y); }  INLINE_OVERLOADABLE float remainder(float x, float y) { return x-y*__gen_ocl_rnde(x/y); }  INLINE_OVERLOADABLE float __gen_ocl_internal_rint(float x) {
-  return 2 * __gen_ocl_internal_round(x / 2);
+  return __gen_ocl_rnde(x);
 }
 // TODO use llvm intrinsics definitions  #define cos native_cos
--
1.8.3.2

_______________________________________________
Beignet mailing list
Beignet at lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/beignet


More information about the Beignet mailing list