0.7.7.9:
[sbcl.git] / src / assembly / mips / support.lisp
1 (in-package "SB!VM")
2
3 (!def-vm-support-routine generate-call-sequence (name style vop)
4   (ecase style
5     (:raw
6      (values
7       `((inst jal (make-fixup ',name :assembly-routine))
8         (inst nop))
9       `()))
10     (:full-call
11      (let ((temp (make-symbol "TEMP"))
12            (nfp-save (make-symbol "NFP-SAVE"))
13            (lra (make-symbol "LRA")))
14        (values
15         `((let ((lra-label (gen-label))
16                 (cur-nfp (current-nfp-tn ,vop)))
17             (when cur-nfp
18               (store-stack-tn ,nfp-save cur-nfp))
19             (inst compute-lra-from-code ,lra code-tn lra-label ,temp)
20             (note-next-instruction ,vop :call-site)
21             (inst j (make-fixup ',name :assembly-routine))
22             (inst nop)
23             (emit-return-pc lra-label)
24             (note-this-location ,vop :single-value-return)
25             (without-scheduling ()
26               (move csp-tn ocfp-tn)
27               (inst nop))
28             (inst compute-code-from-lra code-tn code-tn
29                   lra-label ,temp)
30             (when cur-nfp
31               (load-stack-tn cur-nfp ,nfp-save))))
32         `((:temporary (:scs (non-descriptor-reg) :from (:eval 0) :to (:eval 1))
33                       ,temp)
34           (:temporary (:sc descriptor-reg :offset lra-offset
35                        :from (:eval 0) :to (:eval 1))
36                       ,lra)
37           (:temporary (:scs (control-stack) :offset nfp-save-offset)
38                       ,nfp-save)
39           (:save-p t)))))
40     (:none
41      (values
42       `((inst j (make-fixup ',name :assembly-routine))
43         (inst nop))
44       nil))))
45
46
47 (!def-vm-support-routine generate-return-sequence (style)
48   (ecase style
49     (:raw
50      `((inst j lip-tn)
51        (inst nop)))
52     (:full-call
53      `((lisp-return (make-random-tn :kind :normal
54                                     :sc (sc-or-lose
55                                          'descriptor-reg)
56                                     :offset lra-offset)
57                     lip-tn :offset 2)))
58     (:none)))