+(define-vop (character-compare/c)
+ (:args (x :scs (character-reg)))
+ (:arg-types character
+ ;; KLUDGE: having a SATISFIES type here is too hairy for
+ ;; the cross-compiler (running on an arbitrary CL host)
+ ;; to cope with. Since we know we only have standard
+ ;; characters in the build anyway, we can restrict the
+ ;; cross-compiler's arg type to standard char, and all
+ ;; is well.
+ #+sb-xc-host
+ (:constant standard-char)
+ #-sb-xc-host
+ (:constant (satisfies inlinable-character-constant-p)))
+ (:conditional)
+ (:info target not-p y)
+ (:policy :fast-safe)
+ (:note "inline comparison")
+ (:variant-vars condition not-condition)
+ (:generator 2
+ (inst cmplwi x (sb!xc:char-code y))
+ (inst b? (if not-p not-condition condition) target)))
+
+(define-vop (fast-char=/character/c character-compare/c)
+ (:translate char=)
+ (:variant :eq :ne))
+
+(define-vop (fast-char</character/c character-compare/c)
+ (:translate char<)
+ (:variant :lt :ge))
+
+(define-vop (fast-char>/character/c character-compare/c)
+ (:translate char>)
+ (:variant :gt :le))