Adjust SETcc instruction encoding on x86-64.
[sbcl.git] / src / compiler / x86-64 / system.lisp
index 2d710d9..083374f 100644 (file)
   (:translate widetag-of)
   (:policy :fast-safe)
   (:args (object :scs (descriptor-reg)))
-  (:temporary (:sc unsigned-reg :offset eax-offset :to (:result 0)) rax)
+  (:temporary (:sc unsigned-reg :offset rax-offset :target result
+                   :to (:result 0)) rax)
   (:results (result :scs (unsigned-reg)))
   (:result-types positive-fixnum)
   (:generator 6
-    (inst mov rax object)
+    (inst movzx rax (reg-in-size object :byte))
     (inst and al-tn lowtag-mask)
     (inst cmp al-tn other-pointer-lowtag)
     (inst jmp :e OTHER-PTR)
     (inst cmp al-tn fun-pointer-lowtag)
     (inst jmp :e FUNCTION-PTR)
 
-    ;; Pick off structures and list pointers.
-    (inst test al-tn 1)
-    (inst jmp :ne DONE)
-
     ;; Pick off fixnums.
-    (inst and al-tn fixnum-tag-mask)
+    (inst test al-tn fixnum-tag-mask)
     (inst jmp :e DONE)
 
+    ;; Pick off structures and list pointers.
+    (inst test al-tn 2)
+    (inst jmp :ne DONE)
+
     ;; must be an other immediate
-    (inst mov rax object)
+    (inst movzx rax (reg-in-size object :byte))
     (inst jmp DONE)
 
     FUNCTION-PTR
-    (load-type al-tn object (- fun-pointer-lowtag))
+    (load-type rax object (- fun-pointer-lowtag))
     (inst jmp DONE)
 
     OTHER-PTR
-    (load-type al-tn object (- other-pointer-lowtag))
+    (load-type rax object (- other-pointer-lowtag))
 
     DONE
-    (inst movzx result al-tn)))
+    (move result rax)))
 \f
 (define-vop (fun-subtype)
   (:translate fun-subtype)
   (:policy :fast-safe)
   (:args (function :scs (descriptor-reg)))
-  (:temporary (:sc byte-reg :from (:eval 0) :to (:eval 1)) temp)
   (:results (result :scs (unsigned-reg)))
   (:result-types positive-fixnum)
   (:generator 6
-    (load-type temp function (- fun-pointer-lowtag))
-    (inst movzx result temp)))
+    (load-type result function (- fun-pointer-lowtag))))
 
 (define-vop (set-fun-subtype)
   (:translate (setf fun-subtype))
     ;; fixnum.
     (inst and res (lognot lowtag-mask))
     (inst shr res 1)))
-
-(define-vop (make-other-immediate-type)
-  (:args (val :scs (any-reg descriptor-reg) :target res)
-         (type :scs (unsigned-reg immediate)))
-  (:results (res :scs (any-reg descriptor-reg) :from (:argument 0)))
-  (:generator 2
-    (move res val)
-    (inst shl res (- n-widetag-bits n-fixnum-tag-bits))
-    (inst or res (sc-case type
-                   (unsigned-reg type)
-                   (immediate (tn-value type))))))
 \f
 ;;;; allocation
 
   (:generator 1
     (inst break pending-interrupt-trap)))
 
+#!+sb-safepoint
+(define-vop (insert-safepoint)
+  (:policy :fast-safe)
+  (:translate sb!kernel::gc-safepoint)
+  (:generator 0
+    (emit-safepoint)))
+
 #!+sb-thread
 (defknown current-thread-offset-sap ((unsigned-byte 64))
   system-area-pointer (flushable))