sset: change MEMBER to FIXNUMP.
[sbcl.git] / src / assembly / mips / support.lisp
blob0648c4548a492dafe05ed271667e12335a5f483e
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
4 ;;;; more information.
5 ;;;;
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.
12 (in-package "SB!VM")
14 (defun generate-call-sequence (name style vop options)
15 (declare (ignore options))
16 (ecase style
17 ((:raw :none)
18 (values
19 `((inst jal (make-fixup ',name :assembly-routine))
20 (inst nop))
21 `()))
22 (:full-call
23 (let ((temp (make-symbol "TEMP"))
24 (nfp-save (make-symbol "NFP-SAVE"))
25 (lra (make-symbol "LRA")))
26 (values
27 `((let ((lra-label (gen-label))
28 (cur-nfp (current-nfp-tn ,vop)))
29 (when cur-nfp
30 (store-stack-tn ,nfp-save cur-nfp))
31 (inst compute-lra-from-code ,lra code-tn lra-label ,temp)
32 (note-next-instruction ,vop :call-site)
33 (inst j (make-fixup ',name :assembly-routine))
34 (inst nop)
35 (without-scheduling ()
36 (emit-return-pc lra-label)
37 (note-this-location ,vop :single-value-return)
38 (inst move csp-tn ocfp-tn)
39 (inst nop))
40 (inst compute-code-from-lra code-tn code-tn
41 lra-label ,temp)
42 (when cur-nfp
43 (load-stack-tn cur-nfp ,nfp-save))))
44 `((:temporary (:scs (non-descriptor-reg) :from (:eval 0) :to (:eval 1))
45 ,temp)
46 (:temporary (:sc descriptor-reg :offset lra-offset
47 :from (:eval 0) :to (:eval 1))
48 ,lra)
49 (:temporary (:scs (control-stack) :offset nfp-save-offset)
50 ,nfp-save)
51 (:save-p t)))))))
53 (defun generate-return-sequence (style)
54 (ecase style
55 (:raw
56 `((inst j lip-tn)
57 (inst nop)))
58 (:full-call
59 `((lisp-return (make-random-tn :kind :normal
60 :sc (sc-or-lose
61 'descriptor-reg)
62 :offset lra-offset)
63 lip-tn :offset 2)))
64 (:none)))
66 #-sb-xc-host ; CONTEXT-REGISTER is not defined at xc-time
67 (defun return-machine-address (scp)
68 (context-register scp lip-offset))