Initial revision
[sbcl.git] / src / assembly / x86 / 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 (file-comment
13  "$Header$")
14
15 (def-vm-support-routine generate-call-sequence (name style vop)
16   (ecase style
17     (:raw
18      (values
19       `((inst call (make-fixup ',name :assembly-routine)))
20       nil))
21     (:full-call
22      (values
23       `((note-this-location ,vop :call-site)
24         (inst call (make-fixup ',name :assembly-routine))
25         (note-this-location ,vop :single-value-return)
26         (move esp-tn ebx-tn))
27       '((:save-p :compute-only))))
28     (:none
29      (values
30       `((inst jmp (make-fixup ',name :assembly-routine)))
31       nil))))
32
33 (def-vm-support-routine generate-return-sequence (style)
34   (ecase style
35     (:raw
36      `(inst ret))
37     (:full-call
38      `(
39        (inst pop eax-tn)
40
41        (inst add eax-tn 2)
42        (inst jmp eax-tn)))
43     (:none)))