X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcompiler%2Fx86-64%2Fchar.lisp;h=b70458c3af85d118ecb681987cd1f7cf634a3bcc;hb=b83353d9f998e5c0e34604b5593df70c66d2c510;hp=3b2307ec0dbcdcfa0e074242f83b3e4dee672e71;hpb=fb2d70782a537348895f6a04f257d1f1fcc7942d;p=sbcl.git diff --git a/src/compiler/x86-64/char.lisp b/src/compiler/x86-64/char.lisp index 3b2307e..b70458c 100644 --- a/src/compiler/x86-64/char.lisp +++ b/src/compiler/x86-64/char.lisp @@ -27,9 +27,14 @@ :load-if (not (location= x y)))) (:note "character untagging") (:generator 1 - (let ((y-dword (make-dword-tn y))) - (move y-dword (make-dword-tn x)) - (inst shr y-dword n-widetag-bits)))) + (cond ((and (sc-is y character-reg) (sc-is x any-reg descriptor-reg)) + (let ((y-dword (make-dword-tn y))) + (unless (location= x y) + (inst mov y-dword (make-dword-tn x))) + (inst shr y-dword n-widetag-bits))) + (t + (move y x) + (inst shr y n-widetag-bits))))) #!-sb-unicode (define-vop (move-to-character) (:args (x :scs (any-reg control-stack))) @@ -105,14 +110,14 @@ (character-stack #!-sb-unicode (inst mov - ;; FIXME: naked 8 (should be... what? n-register-bytes? - ;; n-word-bytes? Dunno. - (make-ea :byte :base fp :disp (- (* (1+ (tn-offset y)) 8))) + ;; XXX: If the sb-unicode case needs to handle c-call, + ;; why does the non-unicode case not need to? + (make-ea :byte :base fp :disp (frame-byte-offset (tn-offset y))) x) #!+sb-unicode (if (= (tn-offset fp) esp-offset) - (storew x fp (tn-offset y)) ; c-call - (storew x fp (- (1+ (tn-offset y))))))))) + (storew x fp (tn-offset y)) ; c-call + (storew x fp (frame-word-offset (tn-offset y)))))))) (define-move-vop move-character-arg :move-arg (any-reg character-reg) (character-reg)) @@ -169,47 +174,41 @@ :load-if (not (and (sc-is x character-reg) (sc-is y character-stack))))) (:arg-types character character) - (:conditional) - (:info target not-p) + (:info) (:policy :fast-safe) (:note "inline comparison") - (:variant-vars condition not-condition) (:generator 3 - (inst cmp x y) - (inst jmp (if not-p not-condition condition) target))) + (inst cmp x y))) (define-vop (fast-char=/character character-compare) (:translate char=) - (:variant :e :ne)) + (:conditional :e)) (define-vop (fast-char/character character-compare) (:translate char>) - (:variant :a :na)) + (:conditional :a)) (define-vop (character-compare/c) (:args (x :scs (character-reg character-stack))) (:arg-types character (:constant character)) - (:conditional) - (:info target not-p y) + (:info y) (:policy :fast-safe) (:note "inline constant comparison") - (:variant-vars condition not-condition) (:generator 2 - (inst cmp x (sb!xc:char-code y)) - (inst jmp (if not-p not-condition condition) target))) + (inst cmp x (sb!xc:char-code y)))) (define-vop (fast-char=/character/c character-compare/c) (:translate char=) - (:variant :e :ne)) + (:conditional :e)) (define-vop (fast-char/character/c character-compare/c) (:translate char>) - (:variant :a :na)) + (:conditional :a))