96f1ef38b35a5bfb17f71d8675887395b8676d77
[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 temp-reg-tn
17               (make-ea :qword :disp (make-fixup ',name :assembly-routine)))
18         (inst call temp-reg-tn))
19       nil))
20     (:full-call
21      (values
22       `((note-this-location ,vop :call-site)
23         (inst lea temp-reg-tn
24               (make-ea :qword :disp (make-fixup ',name :assembly-routine)))
25         (inst call temp-reg-tn)
26         (note-this-location ,vop :single-value-return)
27         (inst jmp :nc single-value)
28         (move rsp-tn rbx-tn)
29         single-value)
30       '((:save-p :compute-only))))
31     (:none
32      (values
33       `((inst lea temp-reg-tn
34               (make-ea :qword :disp (make-fixup ',name :assembly-routine)))
35         (inst jmp temp-reg-tn))
36       nil))))
37
38 (!def-vm-support-routine generate-return-sequence (style)
39   (ecase style
40     (:raw
41      `(inst ret))
42     (:full-call
43      `((inst clc)
44        (inst ret)))
45     (:none)))