1.0.1.3:
[sbcl.git] / src / compiler / mips / macros.lisp
index 0bcc9c3..9e09443 100644 (file)
        (storew ,temp-tn ,result-tn 0 other-pointer-lowtag)
        ,@body)))
 
+(defun align-csp (temp)
+  ;; is used for stack allocation of dynamic-extent objects
+  (let ((aligned (gen-label)))
+    (inst and temp csp-tn lowtag-mask)
+    (inst beq temp aligned)
+    (inst nop)
+    (inst addu csp-tn n-word-bytes)
+    (storew zero-tn csp-tn -1)
+    (emit-label aligned)))
+
 \f
 ;;;; Three Way Comparison
 (defun three-way-comparison (x y condition flavor not-p target temp)
        (:results (value :scs ,scs))
        (:result-types ,el-type)
        (:generator 5
-         (inst add lip object index)
-         (inst lw value lip (- (* ,offset n-word-bytes) ,lowtag))
-         (inst nop)))
+         (inst addu lip object index)
+         (loadw value lip ,offset ,lowtag)))
      (define-vop (,(symbolicate name "-C"))
        ,@(when translate
            `((:translate ,translate)))
        (:results (value :scs ,scs))
        (:result-types ,el-type)
        (:generator 4
-         (inst lw value object (- (* (+ ,offset index) n-word-bytes) ,lowtag))
-         (inst nop)))))
+         (loadw value object (+ ,offset index) ,lowtag)))))
 
 (defmacro define-full-setter (name type offset lowtag scs el-type
                                    &optional translate)
        (:results (result :scs ,scs))
        (:result-types ,el-type)
        (:generator 2
-         (inst add lip object index)
-         (inst sw value lip (- (* ,offset n-word-bytes) ,lowtag))
+         (inst addu lip object index)
+         (storew value lip ,offset ,lowtag)
          (move result value)))
      (define-vop (,(symbolicate name "-C"))
        ,@(when translate
        (:results (result :scs ,scs))
        (:result-types ,el-type)
        (:generator 1
-         (inst sw value object (- (* (+ ,offset index) n-word-bytes) ,lowtag))
+         (storew value object (+ ,offset index) ,lowtag)
          (move result value)))))