[Beignet] [PATCH] GBE: fixed one bug for vector relational builtin functions.

Zhigang Gong zhigang.gong at linux.intel.com
Tue Oct 29 08:07:07 CET 2013


For most vector relational builtin functions, we need to
return -1 if the element result is true, return 0 if the element
result is 0. So we can simply put a - in front of the scalar
version of function for each element.

Reported by Yang Rong.

Signed-off-by: Zhigang Gong <zhigang.gong at linux.intel.com>
---
 backend/src/gen_builtin_vector.py |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/backend/src/gen_builtin_vector.py b/backend/src/gen_builtin_vector.py
index 0a30738..d7336af 100755
--- a/backend/src/gen_builtin_vector.py
+++ b/backend/src/gen_builtin_vector.py
@@ -293,6 +293,8 @@ class builtinProto():
                 if j % 2 == 0:
                     formatStr = self.append(formatStr, self.indentSpace())
 
+            if self.prefix == 'relational' and self.functionName != 'bitselect' and self.functionName != 'select':
+                formatStr += '-'
             formatStr += '{}('.format(self.functionName)
             for n in range(0, self.paramCount):
                 if n != 0:
-- 
1.7.9.5



More information about the Beignet mailing list