X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcompiler%2Fx86%2Fpred.lisp;h=8153429badf674741dba5b23ca4a362a71e95de4;hb=40e3ba03d0e1b824e4d1ae75d74246b975b70964;hp=1aee78352d9a652961c821103b5ade70b975bdfa;hpb=63817d29028c8551cda23f432a3328acd7fdd62f;p=sbcl.git diff --git a/src/compiler/x86/pred.lisp b/src/compiler/x86/pred.lisp index 1aee783..8153429 100644 --- a/src/compiler/x86/pred.lisp +++ b/src/compiler/x86/pred.lisp @@ -27,12 +27,12 @@ ;;; not immediate data. (define-vop (if-eq) (:args (x :scs (any-reg descriptor-reg control-stack constant) - :load-if (not (and (sc-is x immediate) - (sc-is y any-reg descriptor-reg - control-stack constant)))) - (y :scs (any-reg descriptor-reg immediate) - :load-if (not (and (sc-is x any-reg descriptor-reg immediate) - (sc-is y control-stack constant))))) + :load-if (not (and (sc-is x immediate) + (sc-is y any-reg descriptor-reg + control-stack constant)))) + (y :scs (any-reg descriptor-reg immediate) + :load-if (not (and (sc-is x any-reg descriptor-reg immediate) + (sc-is y control-stack constant))))) (:conditional) (:info target not-p) (:policy :fast-safe) @@ -41,29 +41,29 @@ (cond ((sc-is y immediate) (let ((val (tn-value y))) - (etypecase val - (integer - (if (and (zerop val) (sc-is x any-reg descriptor-reg)) - (inst test x x) ; smaller - (inst cmp x (fixnumize val)))) - (symbol - (inst cmp x (+ nil-value (static-symbol-offset val)))) - (character - (inst cmp x (logior (ash (char-code val) n-widetag-bits) - character-widetag)))))) + (etypecase val + (integer + (if (and (zerop val) (sc-is x any-reg descriptor-reg)) + (inst test x x) ; smaller + (inst cmp x (fixnumize val)))) + (symbol + (inst cmp x (+ nil-value (static-symbol-offset val)))) + (character + (inst cmp x (logior (ash (char-code val) n-widetag-bits) + character-widetag)))))) ((sc-is x immediate) ; and y not immediate ;; Swap the order to fit the compare instruction. (let ((val (tn-value x))) - (etypecase val - (integer - (if (and (zerop val) (sc-is y any-reg descriptor-reg)) - (inst test y y) ; smaller - (inst cmp y (fixnumize val)))) - (symbol - (inst cmp y (+ nil-value (static-symbol-offset val)))) - (character - (inst cmp y (logior (ash (char-code val) n-widetag-bits) - character-widetag)))))) + (etypecase val + (integer + (if (and (zerop val) (sc-is y any-reg descriptor-reg)) + (inst test y y) ; smaller + (inst cmp y (fixnumize val)))) + (symbol + (inst cmp y (+ nil-value (static-symbol-offset val)))) + (character + (inst cmp y (logior (ash (char-code val) n-widetag-bits) + character-widetag)))))) (t (inst cmp x y)))