X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fcompiler%2Fx86-64%2Fmove.lisp;h=4caf11f995520e210952ca20d8714a204a8c3321;hb=c9b36f04557bd6c7208863e73bae7b1bc6e64842;hp=cc24df402b9a5425f27bbc49720f4d3415dcc935;hpb=10e203ce6b6846114f93ea83ab2451ee7c640269;p=sbcl.git diff --git a/src/compiler/x86-64/move.lisp b/src/compiler/x86-64/move.lisp index cc24df4..4caf11f 100644 --- a/src/compiler/x86-64/move.lisp +++ b/src/compiler/x86-64/move.lisp @@ -1,4 +1,4 @@ -;;;; the x86 VM definition of operand loading/saving and the MOVE vop +;;;; the x86-64 VM definition of operand loading/saving and the MOVE vop ;;;; This software is part of the SBCL system. See the README file for ;;;; more information. @@ -28,7 +28,10 @@ (define-move-fun (load-number 1) (vop x y) ((immediate) (signed-reg unsigned-reg)) - (inst mov y (tn-value x))) + (let ((val (tn-value x))) + (if (zerop val) + (inst xor y y) + (inst mov y val)))) (define-move-fun (load-character 1) (vop x y) ((immediate) (character-reg)) @@ -279,7 +282,6 @@ (aver (not (location= x y))) (let ((bignum (gen-label)) (done (gen-label))) - (inst mov y x) ;; 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 @@ -288,7 +290,7 @@ ;; 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 imul y x (ash 1 n-fixnum-tag-bits)) (inst jmp :o bignum) (emit-label done)