0.9.14.17:
authorJuho Snellman <jsnell@iki.fi>
Sun, 16 Jul 2006 06:42:11 +0000 (06:42 +0000)
committerJuho Snellman <jsnell@iki.fi>
Sun, 16 Jul 2006 06:42:11 +0000 (06:42 +0000)
Implement x86-64 MOVE-FROM-SIGNED overflow detection using IMUL
        instead of using three separate shifts / checks, which is somewhat
        faster and smaller.

src/compiler/x86-64/move.lisp
version.lisp-expr

index a9a7ec5..cc24df4 100644 (file)
      (let ((bignum (gen-label))
            (done (gen-label)))
        (inst mov y x)
-       (inst shl y 1)
-       (inst jmp :o bignum)
-       (inst shl y 1)
-       (inst jmp :o bignum)
-       (inst shl y 1)
+       ;; We can't do the overflow check with SHL Y, 3, since the
+       ;; state of the overflow flag is only reliably set when
+       ;; shifting by 1. There used to be code here for doing "shift
+       ;; by one, check whether it overflowed" three times. But on all
+       ;; x86-64 processors IMUL is a reasonably fast instruction, so
+       ;; we can just do a straight multiply instead of trying to
+       ;; optimize it to a shift. This is both faster and smaller.
+       ;; -- JES, 2006-07-08
+       (inst imul y 8)
        (inst jmp :o bignum)
        (emit-label done)
 
index e62d17e..c7dd53a 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".)
-"0.9.14.16"
+"0.9.14.17"