X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcompiler%2Falpha%2Fchar.lisp;h=5c65b59084fe5fe02a1f5f02f0e648a3b7dca635;hb=1d46d379bb7a6424524b978f213ef69be5f1ad69;hp=5a73ff2c1bd2a73b501e92583de425ff78ac6393;hpb=63fcb94b875a97e468d9add229e220ecceec2352;p=sbcl.git diff --git a/src/compiler/alpha/char.lisp b/src/compiler/alpha/char.lisp index 5a73ff2..5c65b59 100644 --- a/src/compiler/alpha/char.lisp +++ b/src/compiler/alpha/char.lisp @@ -18,7 +18,7 @@ (:args (x :scs (any-reg descriptor-reg))) (:results (y :scs (base-char-reg))) (:generator 1 - (inst srl x sb!vm:type-bits y))) + (inst srl x n-widetag-bits y))) ;;; (define-move-vop move-to-base-char :move (any-reg descriptor-reg) (base-char-reg)) @@ -28,8 +28,8 @@ (:args (x :scs (base-char-reg))) (:results (y :scs (any-reg descriptor-reg))) (:generator 1 - (inst sll x sb!vm:type-bits y) - (inst bis y sb!vm:base-char-type y))) + (inst sll x n-widetag-bits y) + (inst bis y base-char-widetag y))) ;;; (define-move-vop move-from-base-char :move (base-char-reg) (any-reg descriptor-reg)) @@ -49,9 +49,8 @@ (define-move-vop base-char-move :move (base-char-reg) (base-char-reg)) - ;;; 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) @@ -64,14 +63,14 @@ (base-char-stack (storew x fp (tn-offset y)))))) ;;; -(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 @@ -128,3 +127,37 @@ (define-vop (fast-char>/base-char base-char-compare) (:translate char>) (:variant :gt)) + +(define-vop (base-char-compare/c) + (:args (x :scs (base-char-reg))) + (:arg-types base-char (:constant base-char)) + (:temporary (:scs (non-descriptor-reg)) temp) + (:conditional) + (:info target not-p y) + (:policy :fast-safe) + (:note "inline constant comparison") + (:variant-vars cond) + (:generator 2 + (ecase cond + (:eq (inst cmpeq x (sb!xc:char-code y) temp)) + (:lt (inst cmplt x (sb!xc:char-code y) temp)) + (:gt (inst cmple x (sb!xc:char-code y) temp))) + (if not-p + (if (eq cond :gt) + (inst bne temp target) + (inst beq temp target)) + (if (eq cond :gt) + (inst beq temp target) + (inst bne temp target))))) + +(define-vop (fast-char=/base-char/c base-char-compare/c) + (:translate char=) + (:variant :eq)) + +(define-vop (fast-char/base-char/c base-char-compare/c) + (:translate char>) + (:variant :gt))