Author: David Schneider <[email protected]>
Branch: disable_merge_different_int_types
Changeset: r49950:f3f7ebd8ca8a
Date: 2011-11-29 12:35 +0100
http://bitbucket.org/pypy/pypy/changeset/f3f7ebd8ca8a/
Log: (arigo, bivab): add some u's and shuffle operations around
diff --git a/pypy/jit/codewriter/jtransform.py
b/pypy/jit/codewriter/jtransform.py
--- a/pypy/jit/codewriter/jtransform.py
+++ b/pypy/jit/codewriter/jtransform.py
@@ -1053,35 +1053,20 @@
# jit.codewriter.support.
for _op, _oopspec in [('llong_invert', 'INVERT'),
- ('ullong_invert', 'INVERT'),
('llong_lt', 'LT'),
('llong_le', 'LE'),
('llong_eq', 'EQ'),
('llong_ne', 'NE'),
('llong_gt', 'GT'),
('llong_ge', 'GE'),
- ('ullong_lt', 'ULT'),
- ('ullong_le', 'ULE'),
- ('ullong_eq', 'EQ'),
- ('ullong_ne', 'NE'),
- ('ullong_gt', 'UGT'),
- ('ullong_ge', 'UGE'),
('llong_add', 'ADD'),
('llong_sub', 'SUB'),
('llong_mul', 'MUL'),
('llong_and', 'AND'),
('llong_or', 'OR'),
('llong_xor', 'XOR'),
- ('ullong_add', 'ADD'),
- ('ullong_sub', 'SUB'),
- ('ullong_mul', 'MUL'),
- ('ullong_and', 'AND'),
- ('ullong_or', 'OR'),
- ('ullong_xor', 'XOR'),
('llong_lshift', 'LSHIFT'),
('llong_rshift', 'RSHIFT'),
- ('ullong_lshift', 'LSHIFT'),
- ('ullong_rshift', 'URSHIFT'),
('cast_int_to_longlong', 'FROM_INT'),
('truncate_longlong_to_int', 'TO_INT'),
('cast_float_to_longlong', 'FROM_FLOAT'),
@@ -1104,6 +1089,21 @@
('cast_uint_to_ulonglong', 'FROM_UINT'),
('cast_float_to_ulonglong', 'FROM_FLOAT'),
('cast_ulonglong_to_float', 'U_TO_FLOAT'),
+ ('ullong_invert', 'INVERT'),
+ ('ullong_lt', 'ULT'),
+ ('ullong_le', 'ULE'),
+ ('ullong_eq', 'EQ'),
+ ('ullong_ne', 'NE'),
+ ('ullong_gt', 'UGT'),
+ ('ullong_ge', 'UGE'),
+ ('ullong_add', 'ADD'),
+ ('ullong_sub', 'SUB'),
+ ('ullong_mul', 'MUL'),
+ ('ullong_and', 'AND'),
+ ('ullong_or', 'OR'),
+ ('ullong_xor', 'XOR'),
+ ('ullong_lshift', 'LSHIFT'),
+ ('ullong_rshift', 'URSHIFT'),
]:
exec py.code.Source('''
def rewrite_op_%s(self, op):
diff --git a/pypy/jit/codewriter/support.py b/pypy/jit/codewriter/support.py
--- a/pypy/jit/codewriter/support.py
+++ b/pypy/jit/codewriter/support.py
@@ -258,6 +258,9 @@
y = ~r_ulonglong(xll)
return u_to_longlong(y)
+def _ll_1_ullong_invert(xull):
+ return ~xull
+
def _ll_2_llong_lt(xll, yll):
return xll < yll
@@ -276,16 +279,22 @@
def _ll_2_llong_ge(xll, yll):
return xll >= yll
-def _ll_2_llong_ult(xull, yull):
+def _ll_2_ullong_eq(xull, yull):
+ return xull == yull
+
+def _ll_2_ullong_ne(xull, yull):
+ return xull != yull
+
+def _ll_2_ullong_ult(xull, yull):
return xull < yull
-def _ll_2_llong_ule(xull, yull):
+def _ll_2_ullong_ule(xull, yull):
return xull <= yull
-def _ll_2_llong_ugt(xull, yull):
+def _ll_2_ullong_ugt(xull, yull):
return xull > yull
-def _ll_2_llong_uge(xull, yull):
+def _ll_2_ullong_uge(xull, yull):
return xull >= yull
def _ll_2_llong_add(xll, yll):
@@ -312,14 +321,41 @@
z = r_ulonglong(xll) ^ r_ulonglong(yll)
return u_to_longlong(z)
+def _ll_2_ullong_add(xull, yull):
+ z = (xull) + (yull)
+ return (z)
+
+def _ll_2_ullong_sub(xull, yull):
+ z = (xull) - (yull)
+ return (z)
+
+def _ll_2_ullong_mul(xull, yull):
+ z = (xull) * (yull)
+ return (z)
+
+def _ll_2_ullong_and(xull, yull):
+ z = (xull) & (yull)
+ return (z)
+
+def _ll_2_ullong_or(xull, yull):
+ z = (xull) | (yull)
+ return (z)
+
+def _ll_2_ullong_xor(xull, yull):
+ z = (xull) ^ (yull)
+ return (z)
+
def _ll_2_llong_lshift(xll, y):
z = r_ulonglong(xll) << y
- return u_to_longlong(z)
+ return (z)
+
+def _ll_2_ullong_lshift(xull, y):
+ return xull << y
def _ll_2_llong_rshift(xll, y):
return xll >> y
-def _ll_2_llong_urshift(xull, y):
+def _ll_2_ullong_urshift(xull, y):
return xull >> y
def _ll_1_llong_from_int(x):
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit