Add (profile :threads) :broken-on :win32
[sbcl.git] / src / assembly / arm64 / support.lisp
bloba2b01175382a23727477deb37598cc73966a04c1
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 vop))
16 (ecase style
17 ((:none :raw)
18 (values
19 `((progn
20 ,@(if (eq style :none)
21 `((load-inline-constant tmp-tn '(:fixup ,name :assembly-routine))
22 (inst br tmp-tn))
23 `((load-inline-constant lr-tn '(:fixup ,name :assembly-routine))
24 (inst blr lr-tn)))))
25 nil))
26 #+(or)
27 (:full-call
28 (let ((temp (make-symbol "TEMP"))
29 (jump (make-symbol "JUMP"))
30 (nfp-save (make-symbol "NFP-SAVE"))
31 (lra (make-symbol "LRA")))
32 (values
33 `((let ((lra-label (gen-label))
34 (cur-nfp (current-nfp-tn ,vop)))
35 (when cur-nfp
36 (store-stack-tn ,nfp-save cur-nfp))
37 (inst compute-lra-from-code ,lra code-tn lra-label ,temp)
38 (note-next-instruction ,vop :call-site)
39 (inst lr ,jump (make-fixup ',name :assembly-routine))
40 (inst mtlr ,jump)
41 (inst blr)
42 (emit-return-pc lra-label)
43 (note-this-location ,vop :single-value-return)
44 (without-scheduling ()
45 (move csp-tn ocfp-tn)
46 (inst nop))
47 (inst compute-code-from-lra code-tn lra-tn
48 lra-label ,temp)
49 (when cur-nfp
50 (load-stack-tn cur-nfp ,nfp-save))))
51 `((:temporary (:scs (non-descriptor-reg) :from (:eval 0) :to (:eval 1))
52 ,temp)
53 (:temporary (:sc descriptor-reg :offset lra-offset
54 :from (:eval 0) :to (:eval 1))
55 ,lra)
56 (:temporary (:scs (control-stack) :offset nfp-save-offset)
57 ,nfp-save)
58 (:temporary (:sc any-reg) ,jump)
59 (:save-p :compute-only)))))))
61 (defun generate-return-sequence (style)
62 (ecase style
63 (:raw
64 `((inst br lr-tn)))
65 #+(or)
66 (:full-call
67 `((lisp-return (make-random-tn :kind :normal
68 :sc (sc-or-lose 'descriptor-reg )
69 :offset lra-offset)
70 (make-random-tn :kind :normal
71 :sc (sc-or-lose 'interior-reg )
72 :offset lip-offset)
73 :offset 2)))
74 (:none)))
76 #-sb-xc-host ; CONTEXT-REGISTER is not defined at xc-time
77 (defun return-machine-address (scp)
78 (context-register scp lr-offset))