(: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))
(: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))
(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)
(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))
\f
;;;; other operations
(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 :lt))
+
+(define-vop (fast-char>/base-char/c base-char-compare/c)
+ (:translate char>)
+ (:variant :gt))