1 ;;;; the machine-specific support routines needed by the file assembler
3 ;;;; This software is part of the SBCL system. See the README file for
6 ;;;; This software is derived from the CMU CL system, which was
7 ;;;; written at Carnegie Mellon University and released into the
8 ;;;; public domain. The software is in the public domain and is
9 ;;;; provided with absolutely no warranty. See the COPYING and CREDITS
10 ;;;; files for more information.
14 (defun generate-call-sequence (name style vop)
17 (let ((jump (make-symbol "JUMP")))
19 `((inst lr ,jump (make-fixup ',name :assembly-routine))
22 `((:temporary (:sc any-reg) ,jump)))))
24 (let ((temp (make-symbol "TEMP"))
25 (jump (make-symbol "JUMP"))
26 (nfp-save (make-symbol "NFP-SAVE"))
27 (lra (make-symbol "LRA")))
29 `((let ((lra-label (gen-label))
30 (cur-nfp (current-nfp-tn ,vop)))
32 (store-stack-tn ,nfp-save cur-nfp))
33 (inst compute-lra-from-code ,lra code-tn lra-label ,temp)
34 (note-next-instruction ,vop :call-site)
35 (inst lr ,jump (make-fixup ',name :assembly-routine))
38 (emit-return-pc lra-label)
39 (note-this-location ,vop :single-value-return)
40 (without-scheduling ()
43 (inst compute-code-from-lra code-tn lra-tn
46 (load-stack-tn cur-nfp ,nfp-save))))
47 `((:temporary (:scs (non-descriptor-reg) :from (:eval 0) :to (:eval 1))
49 (:temporary (:sc descriptor-reg :offset lra-offset
50 :from (:eval 0) :to (:eval 1))
52 (:temporary (:scs (control-stack) :offset nfp-save-offset)
54 (:temporary (:sc any-reg) ,jump)
55 (:save-p :compute-only)))))))
57 (defun generate-return-sequence (style)
62 `((lisp-return (make-random-tn :kind :normal
63 :sc (sc-or-lose 'descriptor-reg )
65 (make-random-tn :kind :normal
66 :sc (sc-or-lose 'interior-reg )
71 (defun return-machine-address (scp)
72 (sap-int (context-lr scp)))