X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Fbignum.lisp;h=901cf04f358425f55b654ccc2f42818db3946885;hb=cf0b72cd4052a09b9a305081524bd44e2948c1e5;hp=1ed59421957f6bd375ae648610a70552404aaad3;hpb=9ae9ab3401d397d6bac97df1150b983f6d2b6f0e;p=sbcl.git diff --git a/src/code/bignum.lisp b/src/code/bignum.lisp index 1ed5942..901cf04 100644 --- a/src/code/bignum.lisp +++ b/src/code/bignum.lisp @@ -499,14 +499,21 @@ (declare (fixnum ,i1 ,i2)) (%bignum-set ,n-dest ,i1 (%bignum-ref ,n-src ,i2)))) - `(let ((,n-end1 ,end1) - (,n-end2 ,end2)) - (do ((,i1 ,start1 (1+ ,i1)) - (,i2 ,start2 (1+ ,i2))) - ((or (>= ,i1 ,n-end1) (>= ,i2 ,n-end2))) - (declare (type bignum-index ,i1 ,i2)) - (%bignum-set ,n-dest ,i1 - (%bignum-ref ,n-src ,i2)))))))) + (if (eql start1 start2) + `(let ((,n-end1 (min ,end1 ,end2))) + (do ((,i1 ,start1 (1+ ,i1))) + ((>= ,i1 ,n-end1)) + (declare (type bignum-index ,i1)) + (%bignum-set ,n-dest ,i1 + (%bignum-ref ,n-src ,i1)))) + `(let ((,n-end1 ,end1) + (,n-end2 ,end2)) + (do ((,i1 ,start1 (1+ ,i1)) + (,i2 ,start2 (1+ ,i2))) + ((or (>= ,i1 ,n-end1) (>= ,i2 ,n-end2))) + (declare (type bignum-index ,i1 ,i2)) + (%bignum-set ,n-dest ,i1 + (%bignum-ref ,n-src ,i2))))))))) (sb!xc:defmacro with-bignum-buffers (specs &body body) #!+sb-doc @@ -1922,6 +1929,6 @@ (let ((xi (%bignum-ref x i))) (mixf result (logand most-positive-fixnum - xi - (ash xi -7))))) + (logxor xi + (ash xi -7)))))) result))