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