X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcompiler%2Fx86%2Fchar.lisp;h=2def9d479b5b78d0a2468447ea627abcb4e3dfc5;hb=22c1de0a40df83bb5628974010a879cb2c17ff53;hp=c6e58b5ac1a15322805b6b99d38f748b60515a7a;hpb=cea4896b2482b7b2b429c1631d774b4cfbc0efba;p=sbcl.git diff --git a/src/compiler/x86/char.lisp b/src/compiler/x86/char.lisp index c6e58b5..2def9d4 100644 --- a/src/compiler/x86/char.lisp +++ b/src/compiler/x86/char.lisp @@ -40,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 @@ -62,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) @@ -77,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 @@ -138,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))