0.8.15.13:
[sbcl.git] / src / compiler / x86 / char.lisp
index 7d9f8aa..2def9d4 100644 (file)
@@ -10,9 +10,6 @@
 ;;;; files for more information.
 
 (in-package "SB!VM")
-
-(file-comment
- "$Header$")
 \f
 ;;;; 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)
        (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))
 \f
 ;;;; other operations
 (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 :b :nb))
+
+(define-vop (fast-char>/base-char/c base-char-compare/c)
+  (:translate char>)
+  (:variant :a :na))