Smaller stack frames on x86oids
[sbcl.git] / src / compiler / x86 / vm.lisp
index 5313dc3..39924ff 100644 (file)
 ;;; the new way:
 (define-storage-base float-registers :finite :size 8)
 
-(define-storage-base stack :unbounded :size 8)
+(define-storage-base stack :unbounded :size 4 :size-increment 1)
 (define-storage-base constant :non-packed)
 (define-storage-base immediate-constant :non-packed)
 (define-storage-base noise :unbounded :size 2)
 
   ;; some FP constants can be generated in the i387 silicon
   (fp-constant immediate-constant)
-
+  (fp-single-immediate immediate-constant)
+  (fp-double-immediate immediate-constant)
   (immediate immediate-constant)
 
   ;;
   ;; non-descriptor SINGLE-FLOATs
   (single-reg float-registers
               :locations (0 1 2 3 4 5 6 7)
-              :constant-scs (fp-constant)
+              :constant-scs (fp-constant fp-single-immediate)
               :save-p t
               :alternate-scs (single-stack))
 
   ;; non-descriptor DOUBLE-FLOATs
   (double-reg float-registers
               :locations (0 1 2 3 4 5 6 7)
-              :constant-scs (fp-constant)
+              :constant-scs (fp-constant fp-double-immediate)
               :save-p t
               :alternate-scs (double-stack))
 
 \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
     ((or (integer #.sb!xc:most-negative-fixnum #.sb!xc:most-positive-fixnum)
          character)
      (when (static-symbol-p value)
        (sc-number-or-lose 'immediate)))
     (single-float
-     (when (or (eql value 0f0) (eql value 1f0))
-       (sc-number-or-lose 'fp-constant)))
+       (case value
+         ((0f0 1f0) (sc-number-or-lose 'fp-constant))
+         (t (sc-number-or-lose 'fp-single-immediate))))
     (double-float
-     (when (or (eql value 0d0) (eql value 1d0))
-       (sc-number-or-lose 'fp-constant)))
+       (case value
+         ((0d0 1d0) (sc-number-or-lose 'fp-constant))
+         (t (sc-number-or-lose 'fp-double-immediate))))
     #!+long-float
     (long-float
-     (when (or (eql value 0l0) (eql value 1l0)
-               (eql value pi)
-               (eql value (log 10l0 2l0))
-               (eql value (log 2.718281828459045235360287471352662L0 2l0))
-               (eql value (log 2l0 10l0))
-               (eql value (log 2l0 2.718281828459045235360287471352662L0)))
-       (sc-number-or-lose 'fp-constant)))))
+       (when (or (eql value 0l0) (eql value 1l0)
+                 (eql value pi)
+                 (eql value (log 10l0 2l0))
+                 (eql value (log 2.718281828459045235360287471352662L0 2l0))
+                 (eql value (log 2l0 10l0))
+                 (eql value (log 2l0 2.718281828459045235360287471352662L0)))
+         (sc-number-or-lose 'fp-constant)))))
+
+(defun boxed-immediate-sc-p (sc)
+  (eql sc (sc-number-or-lose 'immediate)))
 
 ;; For an immediate TN, return its value encoded for use as a literal.
 ;; For any other TN, return the TN.  Only works for FIXNUMs,
 \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* ((sc (tn-sc tn))
          (sb (sb-name (sc-sb sc)))
       (noise (symbol-name (sc-name sc))))))
 ;;; FIXME: Could this, and everything that uses it, be made #!+SB-SHOW?
 
-(!def-vm-support-routine combination-implementation-style (node)
+(defun combination-implementation-style (node)
   (declare (type sb!c::combination node))
   (flet ((valid-funtype (args result)
            (sb!c::valid-fun-use node
       (logtest
        (cond
          ((valid-funtype '(fixnum fixnum) '*)
-          (values :direct nil))
+          (values :maybe nil))
          ((valid-funtype '((signed-byte 32) (signed-byte 32)) '*)
-          (values :direct nil))
+          (values :maybe nil))
          ((valid-funtype '((unsigned-byte 32) (unsigned-byte 32)) '*)
-          (values :direct nil))
+          (values :maybe nil))
          (t (values :default nil))))
       (logbitp
        (cond