From: Juho Snellman Date: Sun, 16 Jul 2006 06:42:11 +0000 (+0000) Subject: 0.9.14.17: X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=10e203ce6b6846114f93ea83ab2451ee7c640269;p=sbcl.git 0.9.14.17: Implement x86-64 MOVE-FROM-SIGNED overflow detection using IMUL instead of using three separate shifts / checks, which is somewhat faster and smaller. --- diff --git a/src/compiler/x86-64/move.lisp b/src/compiler/x86-64/move.lisp index a9a7ec5..cc24df4 100644 --- a/src/compiler/x86-64/move.lisp +++ b/src/compiler/x86-64/move.lisp @@ -280,11 +280,15 @@ (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) diff --git a/version.lisp-expr b/version.lisp-expr index e62d17e..c7dd53a 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -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"