[pypy-svn] pypy ootype-virtualrefs: implement ullong_or for the cli backend

antocuni commits-noreply at bitbucket.org
Wed Apr 6 18:58:23 CEST 2011


Author: Antonio Cuni <anto.cuni at gmail.com>
Branch: ootype-virtualrefs
Changeset: r43178:f10ff0abbcb8
Date: 2011-04-06 18:58 +0200
http://bitbucket.org/pypy/pypy/changeset/f10ff0abbcb8/

Log:	implement ullong_or for the cli backend

diff --git a/pypy/rpython/test/test_rint.py b/pypy/rpython/test/test_rint.py
--- a/pypy/rpython/test/test_rint.py
+++ b/pypy/rpython/test/test_rint.py
@@ -215,13 +215,13 @@
             assert res == f(inttype(0))
             assert type(res) == inttype
 
-    def test_and(self):
+    def test_and_or(self):
         inttypes = [int, r_uint, r_int64, r_ulonglong]
         for inttype in inttypes:
-            def f(a, b):
-                return a&b
-            res = self.interpret(f, [inttype(0x1234), inttype(0x00FF)])
-            assert res == f(0x1234, 0x00FF)
+            def f(a, b, c):
+                return a&b|c
+            res = self.interpret(f, [inttype(0x1234), inttype(0x00FF), inttype(0x5600)])
+            assert res == f(0x1234, 0x00FF, 0x5600)
 
     def test_neg_abs_ovf(self):
         for op in (operator.neg, abs):

diff --git a/pypy/translator/cli/opcodes.py b/pypy/translator/cli/opcodes.py
--- a/pypy/translator/cli/opcodes.py
+++ b/pypy/translator/cli/opcodes.py
@@ -268,6 +268,7 @@
     'ullong_lshift':            [PushAllArgs, 'conv.u4', 'shl'],
     'ullong_rshift':            [PushAllArgs, 'conv.i4', 'shr'],
     'ullong_and':               'and',
+    'ullong_or':                'or',
 
     'oois':                     'ceq',
     'ooisnot':                  _not('ceq'),


More information about the Pypy-commit mailing list