[pypy-commit] pypy default: This speedup case should work fine for 32bit too

stian noreply at buildbot.pypy.org
Sun Sep 2 01:40:32 CEST 2012


Author: stian
Branch: 
Changeset: r57076:a988d66682e8
Date: 2012-09-02 01:40 +0200
http://bitbucket.org/pypy/pypy/changeset/a988d66682e8/

Log:	This speedup case should work fine for 32bit too

diff --git a/pypy/rlib/rbigint.py b/pypy/rlib/rbigint.py
--- a/pypy/rlib/rbigint.py
+++ b/pypy/rlib/rbigint.py
@@ -168,14 +168,9 @@
         # waste of time and space given that 5*15 = 75 bits are rarely
         # needed.
         # XXX: Even better!
-        if SHIFT >= 63:
-            carry = ival >> SHIFT
-            if carry:
-                return rbigint([_store_digit(ival & MASK),
-                    _store_digit(carry & MASK)], sign, 2)
-            else:
-                return rbigint([_store_digit(ival & MASK)], sign, 1)
-            
+        assert SHIFT == LONG_BIT - 1
+        return rbigint([_store_digit(ival)], sign, 1)
+        """   
         t = ival
         ndigits = 0
         while t:
@@ -189,7 +184,7 @@
             t >>= SHIFT
             p += 1
 
-        return v
+        return v"""
 
     @staticmethod
     def frombool(b):


More information about the pypy-commit mailing list