0.8.18.14:
[sbcl.git] / src / assembly / x86-64 / support.lisp
1 ;;;; This software is part of the SBCL system. See the README file for
2 ;;;; more information.
3 ;;;;
4 ;;;; This software is derived from the CMU CL system, which was
5 ;;;; written at Carnegie Mellon University and released into the
6 ;;;; public domain. The software is in the public domain and is
7 ;;;; provided with absolutely no warranty. See the COPYING and CREDITS
8 ;;;; files for more information.
9
10 (in-package "SB!VM")
11
12 (!def-vm-support-routine generate-call-sequence (name style vop)
13   (ecase style
14     (:raw
15      (values
16       `((inst lea r13-tn
17               (make-ea :qword :disp (make-fixup ',name :assembly-routine)))
18         (inst call r13-tn))
19       nil))
20     (:full-call
21      (values
22       `((note-this-location ,vop :call-site)
23         (inst lea r13-tn
24               (make-ea :qword :disp (make-fixup ',name :assembly-routine)))
25         (inst call r13-tn)
26         (note-this-location ,vop :single-value-return)
27         (move rsp-tn rbx-tn))
28       '((:save-p :compute-only))))
29     (:none
30      (values
31       `((inst lea r13-tn
32               (make-ea :qword :disp (make-fixup ',name :assembly-routine)))
33         (inst jmp r13-tn))
34       nil))))
35
36 (!def-vm-support-routine generate-return-sequence (style)
37   (ecase style
38     (:raw
39      `(inst ret))
40     (:full-call
41      `(
42        (inst pop rax-tn)
43
44        (inst add rax-tn 3)
45        (inst jmp rax-tn)))
46     (:none)))