X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcompiler%2Fx86%2Fvm.lisp;h=ae0b11147bbd21bf80f7e57e664bc42dd5b4271d;hb=0a2d9c98c53cfe7b3874ca96b11dd629a360aa42;hp=4079bdec5dcd4a95cb6d8e895ee81735757d0b7f;hpb=06b4f7dc62e1ce045ff7409686f27534ecb13ada;p=sbcl.git diff --git a/src/compiler/x86/vm.lisp b/src/compiler/x86/vm.lisp index 4079bde..ae0b111 100644 --- a/src/compiler/x86/vm.lisp +++ b/src/compiler/x86/vm.lisp @@ -161,7 +161,7 @@ ;;; has my gratitude.) (FIXME: Maybe this should be me..) (eval-when (:compile-toplevel :load-toplevel :execute) (def!constant kludge-nondeterministic-catch-block-size - #!-win32 6 #!+win32 8)) + #!-win32 5 #!+win32 7)) (!define-storage-classes @@ -170,7 +170,8 @@ ;; 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) ;; @@ -282,14 +283,14 @@ ;; 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)) @@ -390,20 +391,22 @@ (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))))) ;; For an immediate TN, return its value encoded for use as a literal. ;; For any other TN, return the TN. Only works for FIXNUMs, @@ -421,13 +424,22 @@ ;;;; miscellaneous function call parameters -;;; offsets of special stack frame locations -(def!constant ocfp-save-offset 0) -(def!constant return-pc-save-offset 1) +;;; Offsets of special stack frame locations relative to EBP. +;;; +;;; Consider the standard prologue PUSH EBP; MOV EBP, ESP: the return +;;; address is at EBP+4, the old control stack frame pointer is at +;;; EBP, the magic 3rd slot is at EBP-4. Then come the locals from +;;; EBP-8 on. +(def!constant return-pc-save-offset 0) +(def!constant ocfp-save-offset 1) +;;; Let SP be the stack pointer before CALLing, and FP is the frame +;;; pointer after the standard prologue. SP + +;;; FRAME-WORD-OFFSET(SP->FP-OFFSET + I) = FP + FRAME-WORD-OFFSET(I). +(def!constant sp->fp-offset 2) (declaim (inline frame-word-offset)) (defun frame-word-offset (index) - (- (1+ index))) + (- (1- index))) (declaim (inline frame-byte-offset)) (defun frame-byte-offset (index)