1.0.4.62: Enhance BIGNUM-REPLACE
authorNathan Froyd <froydnj@cs.rice.edu>
Wed, 11 Apr 2007 16:20:17 +0000 (16:20 +0000)
committerNathan Froyd <froydnj@cs.rice.edu>
Wed, 11 Apr 2007 16:20:17 +0000 (16:20 +0000)
* Only require one iteration variable if (EQL START1 START2)

src/code/bignum.lisp
version.lisp-expr

index 1ed5942..819ef3a 100644 (file)
                (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
index 6bca730..863b227 100644 (file)
@@ -17,4 +17,4 @@
 ;;; checkins which aren't released. (And occasionally for internal
 ;;; versions, especially for internal versions off the main CVS
 ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".)
-"1.0.4.61"
+"1.0.4.62"