1.0.24.35: Flag-setting VOPs on x86[-64] and conditional moves
[sbcl.git] / src / compiler / x86-64 / char.lisp
index 3b2307e..8e92290 100644 (file)
                :load-if (not (location= x y))))
   (:note "character untagging")
   (:generator 1
-    (let ((y-dword (make-dword-tn y)))
-      (move y-dword (make-dword-tn x))
-      (inst shr y-dword n-widetag-bits))))
+    (cond ((and (sc-is y character-reg) (sc-is x any-reg descriptor-reg))
+           (let ((y-dword (make-dword-tn y)))
+             (unless (location= x y)
+               (inst mov y-dword (make-dword-tn x)))
+             (inst shr y-dword n-widetag-bits)))
+          (t
+           (move y x)
+           (inst shr y n-widetag-bits)))))
 #!-sb-unicode
 (define-vop (move-to-character)
   (:args (x :scs (any-reg control-stack)))
             :load-if (not (and (sc-is x character-reg)
                                (sc-is y character-stack)))))
   (:arg-types character character)
-  (:conditional)
-  (:info target not-p)
+  (:info)
   (:policy :fast-safe)
   (:note "inline comparison")
-  (:variant-vars condition not-condition)
   (:generator 3
-    (inst cmp x y)
-    (inst jmp (if not-p not-condition condition) target)))
+    (inst cmp x y)))
 
 (define-vop (fast-char=/character character-compare)
   (:translate char=)
-  (:variant :e :ne))
+  (:conditional :e))
 
 (define-vop (fast-char</character character-compare)
   (:translate char<)
-  (:variant :b :nb))
+  (:conditional :b))
 
 (define-vop (fast-char>/character character-compare)
   (:translate char>)
-  (:variant :a :na))
+  (:conditional :a))
 
 (define-vop (character-compare/c)
   (:args (x :scs (character-reg character-stack)))
   (:arg-types character (:constant character))
-  (:conditional)
-  (:info target not-p y)
+  (:info 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)))
+    (inst cmp x (sb!xc:char-code y))))
 
 (define-vop (fast-char=/character/c character-compare/c)
   (:translate char=)
-  (:variant :e :ne))
+  (:conditional :e))
 
 (define-vop (fast-char</character/c character-compare/c)
   (:translate char<)
-  (:variant :b :nb))
+  (:conditional :b))
 
 (define-vop (fast-char>/character/c character-compare/c)
   (:translate char>)
-  (:variant :a :na))
+  (:conditional :a))