[pypy-svn] r72556 - in pypy/branch/fix-64/pypy/rpython/lltypesystem: . test

arigo at codespeak.net arigo at codespeak.net
Mon Mar 22 14:53:00 CET 2010


Author: arigo
Date: Mon Mar 22 14:52:58 2010
New Revision: 72556

Modified:
   pypy/branch/fix-64/pypy/rpython/lltypesystem/llgroup.py
   pypy/branch/fix-64/pypy/rpython/lltypesystem/test/test_llgroup.py
Log:
Fix test_llgroup.


Modified: pypy/branch/fix-64/pypy/rpython/lltypesystem/llgroup.py
==============================================================================
--- pypy/branch/fix-64/pypy/rpython/lltypesystem/llgroup.py	(original)
+++ pypy/branch/fix-64/pypy/rpython/lltypesystem/llgroup.py	Mon Mar 22 14:52:58 2010
@@ -97,7 +97,8 @@
     '&~0xFFFF' or with a direct masking like '&0x10000' (resp. on 64-bit
     platform, with '&~0xFFFFFFFF' or '&0x100000000').
     """
-    MASK = (1<<(LONG_BIT//2))-1     # 0xFFFF or 0xFFFFFFFF
+    SHIFT = LONG_BIT//2
+    MASK = (1<<SHIFT)-1     # 0xFFFF or 0xFFFFFFFF
 
     def annotation(self):
         from pypy.annotation import model

Modified: pypy/branch/fix-64/pypy/rpython/lltypesystem/test/test_llgroup.py
==============================================================================
--- pypy/branch/fix-64/pypy/rpython/lltypesystem/test/test_llgroup.py	(original)
+++ pypy/branch/fix-64/pypy/rpython/lltypesystem/test/test_llgroup.py	Mon Mar 22 14:52:58 2010
@@ -67,10 +67,12 @@
     test.build()
     grpptr = test.grpptr
     g1x = [test.g1a, test.g1b]
-    cs1 = CombinedSymbolic(test.g1b, 0x450000)
-    cs2 = CombinedSymbolic(test.g1b, 0x410000)
-    assert llop.extract_ushort(rffi.USHORT, cs1) is test.g1b
-    assert cs1 & ~0xFFFF == 0x450000
+    SHIFT = CombinedSymbolic.SHIFT
+    MASK  = CombinedSymbolic.MASK
+    cs1 = CombinedSymbolic(test.g1b, 0x45 << SHIFT)
+    cs2 = CombinedSymbolic(test.g1b, 0x41 << SHIFT)
+    assert llop.extract_ushort(HALFWORD, cs1) is test.g1b
+    assert cs1 & ~MASK == 0x45 << SHIFT
     cslist = [cs1, cs2]
     #
     def f():
@@ -99,11 +101,11 @@
             assert p.x == expected[i]
         #
         for i in range(2):
-            s = llop.extract_ushort(rffi.USHORT, cslist[i])
+            s = llop.extract_ushort(HALFWORD, cslist[i])
             p = llop.get_group_member(lltype.Ptr(test.S1), grpptr, s)
             assert p == test.p1b
-        assert cslist[0] & ~0xFFFF == 0x450000
-        assert cslist[1] & ~0xFFFF == 0x410000
+        assert cslist[0] & ~MASK == 0x45 << SHIFT
+        assert cslist[1] & ~MASK == 0x41 << SHIFT
         #
         return 42
     return f



More information about the Pypy-commit mailing list