Simplify (and robustify) regular PACKing
[sbcl.git] / src / compiler / mips / vm.lisp
index ec25ba0..cf90976 100644 (file)
@@ -61,7 +61,8 @@
   (defreg l1 24) ; tagged temporary 1
   (defreg alloc 25) ; ALLOC pointer
   ;; 26 and 27 are used by the system kernel.
-  ;; 28 is the global pointer of our C runtime.
+  ;; 28 is the global pointer of our C runtime, and used for
+  ;; jump/branch relaxation in Lisp.
   (defreg nsp 29) ; number (native) stack pointer
   ;; C frame pointer, or additional saved register.
   (defreg code 30) ; current function object
   (defreg lip 31) ; Lisp interior pointer
 
   (defregset non-descriptor-regs
-      nl0 nl1 nl2 nl3 nl4 cfunc nargs)
+      nl0 nl1 nl2 nl3 nl4 cfunc nargs nfp)
 
   (defregset descriptor-regs
-      a0 a1 a2 a3 a4 a5 fdefn lexenv nfp ocfp lra l0 l1)
+      a0 a1 a2 a3 a4 a5 fdefn lexenv ocfp lra l0 l1)
 
   (defregset *register-arg-offsets*
       a0 a1 a2 a3 a4 a5)
                                                          "-SC-NUMBER"))))
                 (list* `(define-storage-class ,sc-name ,index
                           ,@(cdr class))
-                       `(defconstant ,constant-name ,index)
-                       `(export ',constant-name)
+                       `(def!constant ,constant-name ,index)
                        forms)))
        (index 0 (1+ index))
        (classes classes (cdr classes)))
       ((null classes)
        (nreverse forms))))
 
-(def!constant kludge-nondeterministic-catch-block-size 7)
+(def!constant kludge-nondeterministic-catch-block-size 6)
 
 (!define-storage-classes
 
   ;; The control stack.  (Scanned by GC)
   (control-stack control-stack)
 
-  ;; The non-descriptor stacks.
-  (signed-stack non-descriptor-stack) ; (signed-byte 32)
-  (unsigned-stack non-descriptor-stack) ; (unsigned-byte 32)
-  (character-stack non-descriptor-stack) ; non-descriptor characters.
-  (sap-stack non-descriptor-stack) ; System area pointers.
-  (single-stack non-descriptor-stack) ; single-floats
-  (double-stack non-descriptor-stack :element-size 2) ; double floats.
-  ;; complex-single-floats
-  (complex-single-stack non-descriptor-stack :element-size 2)
-  ;; complex-double-floats.
-  (complex-double-stack non-descriptor-stack :element-size 4 :alignment 2)
-
-
-  ;; **** Things that can go in the integer registers.
+  ;; We put ANY-REG and DESCRIPTOR-REG early so that their SC-NUMBER
+  ;; is small and therefore the error trap information is smaller.
+  ;; Moving them up here from their previous place down below saves
+  ;; ~250K in core file size.  --njf, 2006-01-27
 
   ;; Immediate descriptor objects.  Don't have to be seen by GC, but nothing
   ;; bad will happen if they are.  (fixnums, characters, header values, etc).
    :save-p t
    :alternate-scs (control-stack))
 
+  ;; The non-descriptor stacks.
+  (signed-stack non-descriptor-stack) ; (signed-byte 32)
+  (unsigned-stack non-descriptor-stack) ; (unsigned-byte 32)
+  (character-stack non-descriptor-stack) ; non-descriptor characters.
+  (sap-stack non-descriptor-stack) ; System area pointers.
+  (single-stack non-descriptor-stack) ; single-floats
+  (double-stack non-descriptor-stack
+                :element-size 2 :alignment 2) ; double floats.
+  ;; complex-single-floats
+  (complex-single-stack non-descriptor-stack :element-size 2)
+  ;; complex-double-floats.
+  (complex-double-stack non-descriptor-stack :element-size 4 :alignment 2)
+
+
+  ;; **** Things that can go in the integer registers.
+
   ;; Non-Descriptor characters
   (character-reg registers
    :locations #.non-descriptor-regs
 \f
 ;;; If VALUE can be represented as an immediate constant, then return the
 ;;; appropriate SC number, otherwise return NIL.
-(!def-vm-support-routine immediate-constant-sc (value)
+(defun immediate-constant-sc (value)
   (typecase value
     ((integer 0 0)
      (sc-number-or-lose 'zero))
          (sc-number-or-lose 'immediate)
          nil))
     ((or (integer #.sb!xc:most-negative-fixnum #.sb!xc:most-positive-fixnum)
-         system-area-pointer character)
+         character)
      (sc-number-or-lose 'immediate))
     (system-area-pointer
      (sc-number-or-lose 'immediate))
     (character
      (sc-number-or-lose 'immediate))))
 
+(defun boxed-immediate-sc-p (sc)
+  (or (eql sc (sc-number-or-lose 'zero))
+      (eql sc (sc-number-or-lose 'null))
+      (eql sc (sc-number-or-lose 'immediate))))
 \f
 ;;;; Function Call Parameters
 
 ;;; The SC numbers for register and stack arguments/return values.
 ;;;
-(defconstant register-arg-scn (meta-sc-number-or-lose 'descriptor-reg))
-(defconstant immediate-arg-scn (meta-sc-number-or-lose 'any-reg))
-(defconstant control-stack-arg-scn (meta-sc-number-or-lose 'control-stack))
+(def!constant register-arg-scn (meta-sc-number-or-lose 'descriptor-reg))
+(def!constant immediate-arg-scn (meta-sc-number-or-lose 'any-reg))
+(def!constant control-stack-arg-scn (meta-sc-number-or-lose 'control-stack))
 
 (eval-when (:compile-toplevel :load-toplevel :execute)
 
 ;;; Offsets of special stack frame locations
-(defconstant ocfp-save-offset 0)
-(defconstant lra-save-offset 1)
-(defconstant nfp-save-offset 2)
+(def!constant ocfp-save-offset 0)
+(def!constant lra-save-offset 1)
+(def!constant nfp-save-offset 2)
 
 ;;; The number of arguments/return values passed in registers.
 ;;;
-(defconstant register-arg-count 6)
+(def!constant register-arg-count 6)
 
 ;;; The offsets within the register-arg SC that we pass values in, first
 ;;; value first.
 
 ;;; A list of TN's describing the register arguments.
 ;;;
-(defparameter register-arg-tns
+(defparameter *register-arg-tns*
   (mapcar #'(lambda (n)
               (make-random-tn :kind :normal
                               :sc (sc-or-lose 'descriptor-reg)
           *register-arg-offsets*))
 
 ;;; This is used by the debugger.
-(defconstant single-value-return-byte-offset 8)
+(def!constant single-value-return-byte-offset 8)
 \f
 ;;; This function is called by debug output routines that want a pretty name
 ;;; for a TN's location.  It returns a thing that can be printed with PRINC.
-(!def-vm-support-routine location-print-name (tn)
+(defun location-print-name (tn)
   (declare (type tn tn))
   (let ((sb (sb-name (sc-sb (tn-sc tn))))
         (offset (tn-offset tn)))
       (constant (format nil "Const~D" offset))
       (immediate-constant "Immed"))))
 
+(defun combination-implementation-style (node)
+  (declare (type sb!c::combination node) (ignore node))
+  (values :default nil))
 
+(defun primitive-type-indirect-cell-type (ptype)
+  (declare (ignore ptype))
+  nil)