Changeset 10561

Show
Ignore:
Timestamp:
08/25/08 00:01:47 (3 months ago)
Author:
gb
Message:

In ALLOC-C-FRAME (and the variable-sized version): push 2 words
beyond the 16-byte aligned frame; store the cstack backlink and
lisp's %ebp in those two words.

Likewise, put a two-word "header" in things temp-pushed on the
cstack.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/source/compiler/X86/X8632/x8632-vinsns.lisp

    r10542 r10561  
    17271727                                      ((temp :imm))) 
    17281728  (movl (:@ (:%seg :rcontext) x8632::tcr.foreign-sp) (:%l temp)) 
    1729   (movss (:%xmm arg) (:@ (:apply + 4 (:apply ash offset 2)) (:%l temp)))) 
     1729  (movss (:%xmm arg) (:@ (:apply + 8 (:apply ash offset 2)) (:%l temp)))) 
    17301730 
    17311731(define-x8632-vinsn reload-single-c-arg (((arg :single-float)) 
     
    17331733                                         ((temp :imm))) 
    17341734  (movl (:@ (:%seg :rcontext) x8632::tcr.foreign-sp) (:%l temp)) 
    1735   (movss (:@ (:apply + 4 (:apply ash offset 2)) (:%l temp)) (:%xmm arg))) 
     1735  (movss (:@ (:apply + 8 (:apply ash offset 2)) (:%l temp)) (:%xmm arg))) 
    17361736 
    17371737(define-x8632-vinsn set-double-c-arg (() 
     
    17401740                                      ((temp :imm))) 
    17411741  (movl (:@ (:%seg :rcontext) x8632::tcr.foreign-sp) (:%l temp)) 
    1742   (movsd (:%xmm arg) (:@ (:apply + 4 (:apply ash offset 2)) (:%l temp)))) 
     1742  (movsd (:%xmm arg) (:@ (:apply + 8 (:apply ash offset 2)) (:%l temp)))) 
    17431743 
    17441744(define-x8632-vinsn reload-double-c-arg (((arg :double-float)) 
     
    17461746                                         ((temp :imm))) 
    17471747  (movl (:@ (:%seg :rcontext) x8632::tcr.foreign-sp) (:%l temp)) 
    1748   (movsd (:@ (:apply + 4 (:apply ash offset 2)) (:%l temp)) (:%xmm arg))) 
     1748  (movsd (:@ (:apply + 8 (:apply ash offset 2)) (:%l temp)) (:%xmm arg))) 
    17491749 
    17501750(define-x8632-subprim-call-vinsn (ff-call)  .SPffcall) 
     
    30743074  (movl (:@ (:%seg :rcontext) x8632::tcr.foreign-sp) (:%l temp)) 
    30753075  (movd (:%mmx x8632::stack-temp) (:@ (:%l temp))) 
     3076  (movl (:%l x8632::ebp) (:@ 4 (:%l temp))) 
    30763077  (leal (:@ (+ 8 x8632::fulltag-misc) (:%l  temp)) (:%l dest)) 
    30773078  (movl (:$l x8632::macptr-header) (:@ x8632::macptr.header (:%l dest))) 
     
    37073708  ;; align stack to 16-byte boundary 
    37083709  (andb (:$b -16) (:@ (:%seg :rcontext) x8632::tcr.foreign-sp)) 
    3709   (subl (:$b x8632::node-size) (:@ (:%seg :rcontext) x8632::tcr.foreign-sp)) 
     3710  (subl (:$b (* 2 x8632::node-size)) (:@ (:%seg :rcontext) x8632::tcr.foreign-sp)) 
    37103711  (movl (:@ (:%seg :rcontext) x8632::tcr.foreign-sp) (:%l temp)) 
    3711   (movd (:%mmx x8632::stack-temp) (:@ (:%l temp)))) 
     3712  (movd (:%mmx x8632::stack-temp) (:@ (:%l temp))) 
     3713  (movl (:% x8632::ebp) (:@ 4 (:%l temp)))) 
    37123714 
    37133715(define-x8632-vinsn alloc-variable-c-frame (() 
     
    37183720  ;; align stack to 16-byte boundary 
    37193721  (andb (:$b -16) (:@ (:%seg :rcontext) x8632::tcr.foreign-sp)) 
    3720   (subl (:$b x8632::node-size) (:@ (:%seg :rcontext) x8632::tcr.foreign-sp)) 
     3722  (subl (:$b (* 2 x8632::node-size)) (:@ (:%seg :rcontext) x8632::tcr.foreign-sp)) 
    37213723  (movl (:@ (:%seg :rcontext) x8632::tcr.foreign-sp) (:%l temp)) 
    3722   (movd (:%mmx x8632::stack-temp) (:@ (:%l temp)))) 
     3724  (movd (:%mmx x8632::stack-temp) (:@ (:%l temp))) 
     3725  (movl (:% x8632::ebp) (:@ 4 (:%l temp)))) 
    37233726 
    37243727(define-x8632-vinsn set-c-arg (() 
     
    37273730                               ((temp :imm))) 
    37283731  (movl (:@ (:%seg :rcontext) x8632::tcr.foreign-sp) (:%l temp)) 
    3729   (movl (:%l arg) (:@ (:apply + 4 (:apply ash offset 2)) (:%l temp)))) 
     3732  (movl (:%l arg) (:@ (:apply + 8 (:apply ash offset 2)) (:%l temp)))) 
    37303733 
    37313734;;; This is a pretty big crock. 
     
    37343737                                        ((temp :imm))) 
    37353738  (movl (:@ (:%seg :rcontext) x8632::tcr.foreign-sp) (:%l temp)) 
    3736   (movq (:%mmx x8632::mm0) (:@ (:apply + 4 (:apply ash offset 2)) (:%l temp)))) 
     3739  (movq (:%mmx x8632::mm0) (:@ (:apply + 8 (:apply ash offset 2)) (:%l temp)))) 
    37373740 
    37383741(define-x8632-vinsn eep.address (((dest t)) 
     
    39623965     ((temp :imm))) 
    39633966  (movd (:@ (:%seg :rcontext) x8632::tcr.foreign-sp) (:%mmx x8632::stack-temp)) 
    3964   (subl (:$b 8) (:@ (:%seg :rcontext) x8632::tcr.foreign-sp)) 
     3967  (subl (:$b 16) (:@ (:%seg :rcontext) x8632::tcr.foreign-sp)) 
    39653968  (movl (:@ (:%seg :rcontext) x8632::tcr.foreign-sp) (:%l temp)) 
    39663969  (movd (:%mmx x8632::stack-temp) (:@ (:%l temp))) 
    3967   (movl (:%l w) (:@ 4 (:%l temp)))) 
     3970  (movl (:%l x8632::ebp) (:@ 4 (:%l temp))) 
     3971  (movl (:%l w) (:@ 8 (:%l temp)))) 
    39683972 
    39693973(define-x8632-vinsn (temp-pop-unboxed-word :pop :word :csp) 
     
    39713975     ()) 
    39723976  (movl (:@ (:%seg :rcontext) x8632::tcr.foreign-sp) (:%l w)) 
    3973   (movl (:@ 4 (:%l w)) (:%l w)) 
    3974   (addl (:$b 8) (:@ (:%seg :rcontext) x8632::tcr.foreign-sp))) 
     3977  (movl (:@ 8 (:%l w)) (:%l w)) 
     3978  (addl (:$b 16) (:@ (:%seg :rcontext) x8632::tcr.foreign-sp))) 
    39753979 
    39763980(define-x8632-vinsn (temp-push-node :push :word :tsp) 
     
    40024006     ((temp :imm))) 
    40034007  (movd (:@ (:%seg :rcontext) x8632::tcr.foreign-sp) (:%mmx x8632::stack-temp)) 
    4004   (subl (:$b 8) (:@ (:%seg :rcontext) x8632::tcr.foreign-sp)) 
     4008  (subl (:$b 16) (:@ (:%seg :rcontext) x8632::tcr.foreign-sp)) 
    40054009  (movl (:@ (:%seg :rcontext) x8632::tcr.foreign-sp) (:%l temp)) 
    40064010  (movd (:%mmx x8632::stack-temp) (:@ (:%l temp))) 
    4007   (movss (:%xmm f) (:@ 4 (:%l temp)))) 
     4011  (movl (:%l x8632::ebp) (:@ 4 (:%l temp))) 
     4012  (movss (:%xmm f) (:@ 8 (:%l temp)))) 
    40084013 
    40094014(define-x8632-vinsn (temp-pop-single-float :pop :word :csp) 
     
    40124017     ((temp :imm))) 
    40134018  (movl (:@ (:%seg :rcontext) x8632::tcr.foreign-sp) (:%l temp)) 
    4014   (movss (:@ 4 (:%l temp)) (:%xmm f)) 
    4015   (addl (:$b 8) (:@ (:%seg :rcontext) x8632::tcr.foreign-sp))) 
     4019  (movss (:@ 8 (:%l temp)) (:%xmm f)) 
     4020  (addl (:$b 16) (:@ (:%seg :rcontext) x8632::tcr.foreign-sp))) 
    40164021 
    40174022(define-x8632-vinsn (temp-push-double-float :push :word :csp) 
     
    40234028  (movl (:@ (:%seg :rcontext) x8632::tcr.foreign-sp) (:%l temp)) 
    40244029  (movd (:%mmx x8632::stack-temp) (:@ (:%l temp))) 
     4030  (movl (:%l x8632::ebp) (:@ 4 (:%l temp))) 
    40254031  (movsd (:%xmm f) (:@ 8 (:%l temp)))) 
    40264032