[pypy-svn] r32705 - in pypy/dist/pypy/translator/cli: . test
antocuni at codespeak.net
antocuni at codespeak.net
Thu Sep 28 18:26:56 CEST 2006
Author: antocuni
Date: Thu Sep 28 18:26:55 2006
New Revision: 32705
Modified:
pypy/dist/pypy/translator/cli/opcodes.py
pypy/dist/pypy/translator/cli/test/test_op.py
Log:
Added support for uint_neg
Modified: pypy/dist/pypy/translator/cli/opcodes.py
==============================================================================
--- pypy/dist/pypy/translator/cli/opcodes.py (original)
+++ pypy/dist/pypy/translator/cli/opcodes.py Thu Sep 28 18:26:55 2006
@@ -117,7 +117,7 @@
'int_mod_ovf_zer': _check_zer('rem'),
'uint_is_true': [PushAllArgs, 'ldc.i4.0', 'cgt.un'],
- 'uint_neg': None, # What's the meaning?
+ 'uint_neg': 'neg',
'uint_abs': _abs('unsigned int32'), # TODO: ?
'uint_invert': 'not',
Modified: pypy/dist/pypy/translator/cli/test/test_op.py
==============================================================================
--- pypy/dist/pypy/translator/cli/test/test_op.py (original)
+++ pypy/dist/pypy/translator/cli/test/test_op.py Thu Sep 28 18:26:55 2006
@@ -57,6 +57,11 @@
return x >> y
assert self.interpret(fn, [r_longlong(32), 1]) == 16
+ def test_uint_neg(self):
+ def fn(x):
+ return -x
+ check(fn, [r_uint], [r_uint(42)])
+
def test_op():
yield check, op_any_ge, [int, int], (42, 42)
yield check, op_any_ge, [int, int], (13, 42)
More information about the Pypy-commit
mailing list