0.7.7.9:
[sbcl.git] / src / compiler / sparc / macros.lisp
index d0b30b7..17c1ddc 100644 (file)
                               :element-type '(unsigned-byte 8)
                               :fill-pointer 0
                               :adjustable t))))
+     (declare (type (vector (unsigned-byte 8) 16) ,var))
      (setf (fill-pointer ,var) 0)
      (unwind-protect
         (progn
 
 
 \f
-;;; PSEUDO-ATOMIC -- Handy macro for making sequences look atomic.
-;;;
+;;; a handy macro for making sequences look atomic
 (defmacro pseudo-atomic ((&key (extra 0)) &rest forms)
   (let ((n-extra (gensym)))
     `(let ((,n-extra ,extra))
-       ;; Set the pseudo-atomic flag
+       ;; Set the pseudo-atomic flag.
        (without-scheduling ()
         (inst add alloc-tn 4))
        ,@forms
-       ;; Reset the pseudo-atomic flag
+       ;; Reset the pseudo-atomic flag.
        (without-scheduling ()
         #+nil (inst taddcctv alloc-tn (- ,n-extra 4))
-       ;; Remove the pseudo-atomic flag
+       ;; Remove the pseudo-atomic flag.
        (inst add alloc-tn (- ,n-extra 4))
-       ;; Check to see if pseudo-atomic interrupted flag is set (bit 0 = 1)
+       ;; Check to see if pseudo-atomic interrupted flag is set (bit 0 = 1).
        (inst andcc zero-tn alloc-tn 3)
        ;; The C code needs to process this correctly and fixup alloc-tn.
-       (inst t :ne pseudo-atomic-trap)
-       ))))
+       (inst t :ne pseudo-atomic-trap)))))
 
 ;;; FIXME: test typing macros. Should(?) be in type-vops.lisp, except
 ;;; that they're also used in subprim.lisp
      (when fixnump
        `((inst andcc zero-tn ,reg fixnum-tag-mask)
         ,(if (or lowtags hdrs)
-             `(inst b :eq ,(if not-p not-target target)
-               #!+sparc-v9 ,(if not-p :pn :pt))
-             `(inst b ,(if not-p :ne :eq) ,target
-               #!+sparc-v9 ,(if not-p :pn :pt)))))
+             `(if (member :sparc-v9 *backend-subfeatures*)
+                  (inst b :eq ,(if not-p not-target target) ,(if not-p :pn :pt))
+                  (inst b :eq ,(if not-p not-target target)))
+             `(if (member :sparc-v9 *backend-subfeatures*)
+                  (inst b ,(if not-p :ne :eq) ,target ,(if not-p :pn :pt))
+                  (inst b ,(if not-p :ne :eq) ,target)))))
      (when (or lowtags hdrs)
        `((inst and ,temp ,reg lowtag-mask)))
      (when lowtags
                           (1- lowtag-limit) lowtags)))
      (when hdrs
        `((inst cmp ,temp ,lowtag)
-        (inst b :ne ,(if not-p target not-target)
-         #!+sparc-v9 ,(if not-p :pn :pt))
+        (if (member :sparc-v9 *backend-subfeatures*)
+            (inst b :ne ,(if not-p target not-target) ,(if not-p :pn :pt))
+            (inst b :ne ,(if not-p target not-target)))
         (inst nop)
         (load-type ,temp ,reg (- ,lowtag))
         ,@(gen-other-immediate-test temp target not-target not-p hdrs))))))