X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcompiler%2Falpha%2Fchar.lisp;h=5318c40d5f4acc2b149214144bbb91569a79eb83;hb=11f02398a1a9ccbde847c82fd233e8378e45c29c;hp=e3142c65caaa510b3a83ea36dfe85ae5389c3a5c;hpb=0bca0cb1bf5ce5572ab5cd7ba59f87fed1f2edb0;p=sbcl.git diff --git a/src/compiler/alpha/char.lisp b/src/compiler/alpha/char.lisp index e3142c6..5318c40 100644 --- a/src/compiler/alpha/char.lisp +++ b/src/compiler/alpha/char.lisp @@ -127,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))