Changeset 6293


Ignore:
Timestamp:
Apr 18, 2007, 2:57:49 AM (15 years ago)
Author:
gb
Message:

Use %rip-relative addressing to recover %fn at return address. Try to use
it consistently, even if %fn is known not to be modified. (May have missed
a few cases.) Need to learn how to use labels with %rip, since the absolute-offset
calculation is weird.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/x8664-call/ccl/compiler/X86/X8664/x8664-vinsns.lisp

    r5970 r6293  
    274274  (movsd (:%xmm val) (:@ (:apply + x8664::misc-data-offset (:apply ash idx 3)) (:%q v))))
    275275
     276
     277
    276278(define-x8664-vinsn (call-known-symbol :call) (((result (:lisp x8664::arg_z)))
    277279                                               ())
     
    282284  (:long (:^ :back))
    283285  :back
    284   (leaq (:@ (:apply - (:^ :back)) (:% x8664::ra0)) (:%q x8664::fn)))
     286  (leaq (:@ (:apply - (:^ :disp)) (:% x8664::rip)) (:%q x8664::fn))
     287  :disp)
    285288
    286289;;; It's neccessary to use x8664:xfn to reference the current function
     
    995998  (:long (:^ :back))
    996999  :back
    997   (leaq (:@ (:apply - (:^ :back)) (:% x8664::ra0)) (:%q x8664::fn)))
     1000  (leaq (:@ (:apply - (:^ :disp)) (:% x8664::rip)) (:%q x8664::fn))
     1001  :disp
     1002)
    9981003
    9991004(define-x8664-vinsn fixnum-subtract-from (((dest t)
     
    11481153  (:long (:^ :back))
    11491154  :back
    1150   ;; We don't lose FN while consing the bignum.
     1155  (leaq (:@ (:apply - (:^ :disp)) (:% x8664::rip)) (:%q x8664::fn))
     1156  :disp
    11511157  ((:not (:pred = x8664::arg_z
    11521158                (:apply %hard-regspec-value val)))
     
    11691175  (:long (:^ :back))
    11701176  :back
    1171   ;; We don't lose FN while consing the bignum.
     1177  (leaq (:@ (:apply - (:^ :disp)) (:% x8664::rip)) (:%q x8664::fn))
     1178  :disp
    11721179  ((:not (:pred = x8664::arg_z
    11731180                (:apply %hard-regspec-value val)))
     
    12951302  (:long (:^ :back))
    12961303  :back
    1297   (leaq (:@ (:apply - (:^ :back)) (:% x8664::ra0)) (:%q x8664::fn)))
     1304  (leaq (:@ (:apply - (:^ :disp)) (:% x8664::rip)) (:%q x8664::fn))
     1305  :disp
     1306  )
    12981307
    12991308(define-x8664-vinsn double-float-compare (()
     
    15391548  (pushq (:%q x8664::ra0)))
    15401549
    1541 
     1550;; ????
    15421551(define-x8664-vinsn emit-aligned-label (()
    15431552                                        ((label :label)))
     
    15901599  (:long (:^ :back))
    15911600  :back
    1592   (leaq (:@ (:apply - (:^ :back)) (:% x8664::ra0)) (:%q x8664::fn)))
     1601  (leaq (:@ (:apply - (:^ :disp)) (:% x8664::rip)) (:%q x8664::fn))
     1602  :disp
     1603)
    15931604
    15941605(define-x8664-vinsn (jump-known-function :jumplr) (()
     
    16041615  (:align 3)
    16051616  (:long (:^ :back))
    1606   :back)
     1617  :back
     1618  (leaq (:@ (:apply - (:^ :disp)) (:% x8664::rip)) (:%q x8664::fn))
     1619  :disp  )
    16071620
    16081621
     
    16751688
    16761689
    1677 (defmacro define-x8664-subprim-call-vinsn ((name &rest other-attrs) spno &optional (recover-fn nil))
     1690(defmacro define-x8664-subprim-call-vinsn ((name &rest other-attrs) spno)
    16781691  `(define-x8664-vinsn (,name :call :subprim-call ,@other-attrs) (() ())
    16791692    (leaq (:@ (:^ :back) (:%q x8664::fn)) (:%q x8664::ra0))
     
    16821695    (:long (:^ :back))
    16831696    :back
    1684     ,@(if recover-fn
    1685           `((leaq (:@ (:apply - (:^ :back)) (:%q x8664::ra0)) (:%q x8664::fn))))))
     1697    (leaq (:@ (:apply - (:^ :disp)) (:% x8664::rip)) (:%q x8664::fn))
     1698    :disp))
    16861699
    16871700(defmacro define-x8664-subprim-jump-vinsn ((name &rest other-attrs) spno)
     
    17731786  (:long (:^ :back))
    17741787  :back
    1775   (leaq (:@ (:apply - (:^ :back)) (:%q x8664::ra0)) (:%q x8664::fn)))
     1788  (leaq (:@ (:apply - (:^ :disp)) (:% x8664::rip)) (:%q x8664::fn))
     1789  :disp )
    17761790
    17771791(define-x8664-vinsn (mkcatch1v :call :subprim-call) (()
     
    17831797  (:long (:^ :back))
    17841798  :back
    1785   (leaq (:@ (:apply - (:^ :back)) (:%q x8664::ra0)) (:%q x8664::fn)))
     1799  (leaq (:@ (:apply - (:^ :disp)) (:% x8664::rip)) (:%q x8664::fn))
     1800  :disp)
    17861801
    17871802(define-x8664-vinsn (mkunwind :call :subprim-call) (()
     
    18151830  (:long (:^ :back))
    18161831  :back
    1817   (leaq (:@ (:apply - (:^ :back)) (:%q x8664::ra0)) (:%q x8664::fn)))
     1832  (leaq (:@ (:apply - (:^ :disp)) (:% x8664::rip)) (:%q x8664::fn))
     1833  :disp)
    18181834
    18191835(define-x8664-vinsn tail-funcall (()
     
    18541870  (jmp (:@ .SPspecrefcheck))
    18551871  (:align 3)
    1856   (:long (:^ :back))
    1857   :back)
     1872  (:long (:^ :back)) 
     1873  :back
     1874  (leaq (:@ (:apply - (:^ :disp)) (:% x8664::rip)) (:%q x8664::fn))
     1875  :disp )
    18581876
    18591877(define-x8664-vinsn ref-symbol-value-inline (((dest :lisp))
     
    18841902  (:align 3)
    18851903  (:long (:^ :back))
    1886   :back)
     1904  :back
     1905  (leaq (:@ (:apply - (:^ :disp)) (:% x8664::rip)) (:%q x8664::fn))
     1906  :disp  )
    18871907
    18881908(define-x8664-vinsn %ref-symbol-value-inline (((dest :lisp))
     
    29522972  (movq (:@ x8664::misc-data-offset (:%q vcell)) (:%q dest)))
    29532973
    2954 ;;; The only current use of this - calling .SPgvset - doesn't need
    2955 ;;; to recover %fn from %ra0.
    29562974(define-x8664-vinsn (call-subprim-3 :call :subprim-call) (((dest t))
    29572975                                                          ((spno :s32const)
     
    29632981  (:align 3)
    29642982  (:long (:^ :back))
    2965   :back)
     2983  :back
     2984  (leaq (:@ (:apply - (:^ :disp)) (:% x8664::rip)) (:%q x8664::fn))
     2985  :disp)
    29662986
    29672987(define-x8664-vinsn setup-vcell-allocation (()
     
    31853205  (:long (:^ :back))
    31863206  :back
    3187   (leaq (:@ (:apply - (:^ :back)) (:%q x8664::ra0)) (:%q x8664::fn)))
     3207  (leaq (:@ (:apply - (:^ :disp)) (:% x8664::rip)) (:%q x8664::fn))
     3208  :disp)
    31883209
    31893210(define-x8664-vinsn set-z-flag-if-istruct-typep (()
     
    32093230(define-x8664-subprim-call-vinsn (ksignalerr) .SPksignalerr)
    32103231
    3211 (define-x8664-subprim-call-vinsn (misc-alloc-init) .SPmisc-alloc-init t)
     3232(define-x8664-subprim-call-vinsn (misc-alloc-init) .SPmisc-alloc-init)
    32123233
    32133234(define-x8664-subprim-call-vinsn (misc-alloc) .SPmisc-alloc)
     
    32653286  (:long (:^ :back))
    32663287  :back
    3267   (leaq (:@ (:apply - (:^ :back)) (:%q x8664::ra0)) (:%q x8664::fn)))
     3288  (leaq (:@ (:apply - (:^ :disp)) (:% x8664::rip)) (:%q x8664::fn))
     3289  :disp)
    32683290
    32693291(define-x8664-vinsn set-macptr-address (()
     
    33313353  (:align 3)
    33323354  (:long (:^ :back))
    3333   :back)
     3355  :back
     3356  (leaq (:@ (:apply - (:^ :disp)) (:% x8664::rip)) (:%q x8664::fn))
     3357  :disp )
    33343358
    33353359
     
    34243448(define-x8664-subprim-call-vinsn (req-heap-rest-arg) .SPreq-heap-rest-arg)
    34253449
    3426 (define-x8664-subprim-call-vinsn (stack-misc-alloc-init)  .SPstack-misc-alloc-init t)
     3450(define-x8664-subprim-call-vinsn (stack-misc-alloc-init)  .SPstack-misc-alloc-init)
    34273451
    34283452(define-x8664-vinsn fixnum->unsigned-natural (((dest :u64))
     
    35003524
    35013525(define-x8664-subprim-call-vinsn (setqsym) .SPsetqsym)
     3526
     3527(define-x8664-vinsn recover-fn-from-rip (()
     3528                                         ())
     3529  (leaq (:@ (:apply - (:^ :disp)) (:%q x8664::rip)) (:%q x8664::fn))
     3530  :disp)
    35023531
    35033532(define-x8664-vinsn recover-fn-from-ra0 (()
     
    35463575    (jmp (:@ .SPunbind)))
    35473576   (:align 3)
    3548    (:long (:^ :back))
    3549    :back)) 
     3577   (:long (:^ :back))   
     3578   :back
     3579   (leaq (:@ (:apply - (:^ :disp)) (:% x8664::rip)) (:%q x8664::fn))
     3580   :disp)) 
    35503581
    35513582(define-x8664-subprim-jump-vinsn (tail-call-sym-gen) .SPtcallsymgen)
Note: See TracChangeset for help on using the changeset viewer.