[Piglit] [PATCH 28/34] gen_cl_int_builtins.py: Replace use of Long type

Dylan Baker baker.dylan.c at gmail.com
Fri Feb 20 18:18:15 PST 2015


Python3 doesn't have long types (ints will now grow until you run out of
memory). Use bit shifting instead.

This produces the same output before and after

Thanks to Jason Ekstrand for help with this.

Signed-off-by: Dylan Baker <dylanx.c.baker at intel.com>
---
 generated_tests/gen_cl_int_builtins.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/generated_tests/gen_cl_int_builtins.py b/generated_tests/gen_cl_int_builtins.py
index 2e10f92..15ce308 100644
--- a/generated_tests/gen_cl_int_builtins.py
+++ b/generated_tests/gen_cl_int_builtins.py
@@ -114,7 +114,7 @@ def pow(val, pow):
 
 def rotate_right(x, n, bits):
     # Find all bits that will wrap
-    mask = (2L**n) - 1
+    mask = (1 << n) - 1
     wrapped_bits = x & mask
 
     # sign extension needs to be masked out
-- 
2.3.0



More information about the Piglit mailing list