[Beignet] [PATCH] add built-in function "atan2pi"

Yang, Rong R rong.r.yang at intel.com
Tue Sep 10 23:20:04 PDT 2013


One inline comment below.
And is it conforme to openCL spec section 7.5.1?

-----Original Message-----
From: beignet-bounces+rong.r.yang=intel.com at lists.freedesktop.org [mailto:beignet-bounces+rong.r.yang=intel.com at lists.freedesktop.org] On Behalf Of Homer Hsing
Sent: Monday, September 02, 2013 8:49 AM
To: beignet at lists.freedesktop.org
Subject: [Beignet] [PATCH] add built-in function "atan2pi"


Signed-off-by: Homer Hsing <homer.xing at intel.com<mailto:homer.xing at intel.com>>
---
 backend/src/builtin_vector_proto.def | 2 +-
 backend/src/ocl_stdlib.tmpl.h        | 4 ++++
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/backend/src/builtin_vector_proto.def b/backend/src/builtin_vector_proto.def
index b24e7ea..82dd36c 100644
--- a/backend/src/builtin_vector_proto.def
+++ b/backend/src/builtin_vector_proto.def
@@ -9,7 +9,7 @@ gentype atan (gentype y_over_x)  gentype atan2 (gentype y, gentype x)  gentype atanh (gentype)  gentype atanpi (gentype x) -#gentype atan2pi (gentype y, gentype x)
+gentype atan2pi (gentype y, gentype x)
 gentype cbrt (gentype)
 gentype ceil (gentype)
 gentype copysign (gentype x, gentype y) diff --git a/backend/src/ocl_stdlib.tmpl.h b/backend/src/ocl_stdlib.tmpl.h index 7f1032f..d8e8afc 100644
--- a/backend/src/ocl_stdlib.tmpl.h
+++ b/backend/src/ocl_stdlib.tmpl.h
@@ -1364,6 +1364,9 @@ INLINE_OVERLOADABLE float __gen_ocl_internal_atan2(float y, float x) {
     return - M_PI_F + z;
   }
 }
+INLINE_OVERLOADABLE float __gen_ocl_internal_atan2pi(float y, float x)
+{
+  return __gen_ocl_internal_atan2pi(y, x) / M_PI_F; }

Is it __gen_ocl_internal_atan2 here?


 INLINE_OVERLOADABLE float __gen_ocl_internal_fabs(float x)  { return __gen_ocl_fabs(x); }  INLINE_OVERLOADABLE float __gen_ocl_internal_trunc(float x) { return __gen_ocl_rndz(x); }  INLINE_OVERLOADABLE float __gen_ocl_internal_round(float x) { return __gen_ocl_rnde(x); } @@ -1397,6 +1400,7 @@ INLINE_OVERLOADABLE float __gen_ocl_internal_rint(float x) {  #define tanh __gen_ocl_internal_tanh  #define atan __gen_ocl_internal_atan  #define atan2 __gen_ocl_internal_atan2
+#define atan2pi __gen_ocl_internal_atan2pi
 #define atanpi __gen_ocl_internal_atanpi  #define atanh __gen_ocl_internal_atanh  #define pow powr
--
1.8.1.2

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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/beignet/attachments/20130911/d86dcc66/attachment-0001.html>


More information about the Beignet mailing list