Fix build failure
[sbcl.git] / src / assembly / x86-64 / support.lisp
blob38aa4923c76662422342ccb09218238d54a8b2ce
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.
10 (in-package "SB!VM")
12 (defun invoke-asm-routine (inst routine vop temp-reg)
13 (declare (ignorable vop))
14 (cond #!+immobile-code
15 ((sb!c::code-immobile-p (sb!c::vop-node vop))
16 (setq temp-reg (make-fixup routine :assembly-routine)))
18 (inst mov temp-reg (make-fixup routine :assembly-routine))))
19 (ecase inst
20 (jmp (inst jmp temp-reg))
21 (call (inst call temp-reg))))
23 (defun generate-call-sequence (name style vop options)
24 ;; It will be nice if we can eliminate the global assumption that
25 ;; a certain register (TEMP-REG-TN - currently R11) is always available.
26 (let ((call-tn (or (second (assoc :call-temps options)) 'temp-reg-tn)))
27 (ecase style
28 (:raw
29 (values
30 `((note-this-location ,vop :call-site)
31 (invoke-asm-routine 'call ',name ,vop ,call-tn)
32 (note-this-location ,vop :single-value-return))
33 nil))
34 (:full-call
35 (values
36 `((note-this-location ,vop :call-site)
37 (invoke-asm-routine 'call ',name ,vop ,call-tn)
38 (note-this-location ,vop :single-value-return))
39 '((:save-p :compute-only))))
40 (:none
41 (values
42 `((invoke-asm-routine 'jmp ',name ,vop ,call-tn))
43 nil)))))
45 (defun generate-return-sequence (style)
46 (ecase style
47 (:raw
48 `((inst ret)))
49 (:full-call
50 `((inst clc)
51 (inst ret)))
52 (:none)))