X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcompiler%2Fx86%2Fchar.lisp;h=2def9d479b5b78d0a2468447ea627abcb4e3dfc5;hb=bffa99d35c7d50ac46b9eb7dbe25d1ab1a0e6145;hp=7d9f8aaa9f18d4d22116998408fa1aefeca523f1;hpb=a530bbe337109d898d5b4a001fc8f1afa3b5dc39;p=sbcl.git diff --git a/src/compiler/x86/char.lisp b/src/compiler/x86/char.lisp index 7d9f8aa..2def9d4 100644 --- a/src/compiler/x86/char.lisp +++ b/src/compiler/x86/char.lisp @@ -10,9 +10,6 @@ ;;;; files for more information. (in-package "SB!VM") - -(file-comment - "$Header$") ;;;; moves and coercions @@ -43,7 +40,7 @@ (:note "character tagging") (:generator 1 (move ah x) ; Maybe move char byte. - (inst mov al base-char-type) ; x86 to type bits + (inst mov al base-char-widetag) ; x86 to type bits (inst and eax-tn #xffff) ; Remove any junk bits. (move y eax-tn))) (define-move-vop move-from-base-char :move @@ -65,7 +62,7 @@ (base-char-reg) (base-char-reg base-char-stack)) ;;; Move untagged base-char arguments/return-values. -(define-vop (move-base-char-argument) +(define-vop (move-base-char-arg) (:args (x :target y :scs (base-char-reg)) (fp :scs (any-reg) @@ -80,12 +77,12 @@ (inst mov (make-ea :byte :base fp :disp (- (* (1+ (tn-offset y)) 4))) x))))) -(define-move-vop move-base-char-argument :move-argument +(define-move-vop move-base-char-arg :move-arg (any-reg base-char-reg) (base-char-reg)) -;;; Use standard MOVE-ARGUMENT + coercion to move an untagged base-char +;;; Use standard MOVE-ARG + coercion to move an untagged base-char ;;; to a descriptor passing location. -(define-move-vop move-argument :move-argument +(define-move-vop move-arg :move-arg (base-char-reg) (any-reg descriptor-reg)) ;;;; other operations @@ -141,3 +138,27 @@ (define-vop (fast-char>/base-char base-char-compare) (:translate char>) (:variant :a :na)) + +(define-vop (base-char-compare/c) + (:args (x :scs (base-char-reg base-char-stack))) + (:arg-types base-char (:constant base-char)) + (:conditional) + (:info target not-p 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))) + +(define-vop (fast-char=/base-char/c base-char-compare/c) + (:translate char=) + (:variant :e :ne)) + +(define-vop (fast-char/base-char/c base-char-compare/c) + (:translate char>) + (:variant :a :na))