Use new MAP-RESTARTS in FIND-RESTART, COMPUTE-RESTARTS; fix FIND-RESTART
[sbcl.git] / src / compiler / ppc / char.lisp
index 4aa8420..a7400ab 100644 (file)
 ;;; Move untagged character values.
 (define-vop (character-move)
   (:args (x :target y
-           :scs (character-reg)
-           :load-if (not (location= x y))))
+            :scs (character-reg)
+            :load-if (not (location= x y))))
   (:results (y :scs (character-reg)
-              :load-if (not (location= x y))))
+               :load-if (not (location= x y))))
   (:note "character move")
   (:effects)
   (:affected)
@@ -52,9 +52,9 @@
 ;;; Move untagged character arguments/return-values.
 (define-vop (move-character-arg)
   (:args (x :target y
-           :scs (character-reg))
-        (fp :scs (any-reg)
-            :load-if (not (sc-is y character-reg))))
+            :scs (character-reg))
+         (fp :scs (any-reg)
+             :load-if (not (sc-is y character-reg))))
   (:results (y))
   (:note "character arg move")
   (:generator 0
@@ -81,7 +81,7 @@
   (:results (res :scs (any-reg)))
   (:result-types positive-fixnum)
   (:generator 1
-    (inst slwi res ch 2)))
+    (inst slwi res ch n-fixnum-tag-bits)))
 
 (define-vop (code-char)
   (:translate code-char)
   (:results (res :scs (character-reg)))
   (:result-types character)
   (:generator 1
-    (inst srwi res code 2)))
+    (inst srwi res code n-fixnum-tag-bits)))
 \f
 ;;; Comparison of characters.
 (define-vop (character-compare)
   (:args (x :scs (character-reg))
-        (y :scs (character-reg)))
+         (y :scs (character-reg)))
   (:arg-types character character)
   (:conditional)
   (:info target not-p)
 
 (define-vop (character-compare/c)
   (:args (x :scs (character-reg)))
-  (:arg-types character (:constant character))
+  (: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)