Tweaks to get sb-simd 1.3 to compile
[sbcl/simd.git] / src / compiler / sparc / debug.lisp
blobfffdd1f69f977061dad824336db02d9538f7ed15
1 ;;;; Sparc compiler support for the new whizzy debugger
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 (define-vop (debug-cur-sp)
15 (:translate current-sp)
16 (:policy :fast-safe)
17 (:results (res :scs (sap-reg)))
18 (:result-types system-area-pointer)
19 (:generator 1
20 (move res csp-tn)))
22 (define-vop (debug-cur-fp)
23 (:translate current-fp)
24 (:policy :fast-safe)
25 (:results (res :scs (sap-reg)))
26 (:result-types system-area-pointer)
27 (:generator 1
28 (move res cfp-tn)))
30 (define-vop (read-control-stack)
31 (:translate sb!kernel:stack-ref)
32 (:policy :fast-safe)
33 (:args (sap :scs (sap-reg))
34 (offset :scs (any-reg)))
35 (:arg-types system-area-pointer positive-fixnum)
36 (:results (result :scs (descriptor-reg)))
37 (:result-types *)
38 (:generator 5
39 (inst ld result sap offset)))
41 (define-vop (write-control-stack)
42 (:translate sb!kernel:%set-stack-ref)
43 (:policy :fast-safe)
44 (:args (sap :scs (sap-reg))
45 (offset :scs (any-reg))
46 (value :scs (descriptor-reg) :target result))
47 (:arg-types system-area-pointer positive-fixnum *)
48 (:results (result :scs (descriptor-reg)))
49 (:result-types *)
50 (:generator 5
51 (inst st value sap offset)
52 (move result value)))
54 (define-vop (code-from-mumble)
55 (:policy :fast-safe)
56 (:args (thing :scs (descriptor-reg)))
57 (:results (code :scs (descriptor-reg)))
58 (:temporary (:scs (non-descriptor-reg)) temp)
59 (:variant-vars lowtag)
60 (:generator 5
61 (let ((bogus (gen-label))
62 (done (gen-label)))
63 (loadw temp thing 0 lowtag)
64 (inst srl temp n-widetag-bits)
65 (inst cmp temp)
66 (inst b :eq bogus)
67 (inst sll temp (1- (integer-length n-word-bytes)))
68 (unless (= lowtag other-pointer-lowtag)
69 (inst add temp (- lowtag other-pointer-lowtag)))
70 (inst sub code thing temp)
71 (emit-label done)
72 (assemble (*elsewhere*)
73 (emit-label bogus)
74 (inst b done)
75 (move code null-tn)))))
77 (define-vop (code-from-lra code-from-mumble)
78 (:translate lra-code-header)
79 (:variant other-pointer-lowtag))
81 (define-vop (code-from-function code-from-mumble)
82 (:translate fun-code-header)
83 (:variant fun-pointer-lowtag))
85 (define-vop (%make-lisp-obj)
86 (:policy :fast-safe)
87 (:translate %make-lisp-obj)
88 (:args (value :scs (unsigned-reg) :target result))
89 (:arg-types unsigned-num)
90 (:results (result :scs (descriptor-reg)))
91 (:generator 1
92 (move result value)))
94 (define-vop (get-lisp-obj-address)
95 (:policy :fast-safe)
96 (:translate get-lisp-obj-address)
97 (:args (thing :scs (descriptor-reg) :target result))
98 (:results (result :scs (unsigned-reg)))
99 (:result-types unsigned-num)
100 (:generator 1
101 (move result thing)))
104 (define-vop (fun-word-offset)
105 (:policy :fast-safe)
106 (:translate fun-word-offset)
107 (:args (fun :scs (descriptor-reg)))
108 (:results (res :scs (unsigned-reg)))
109 (:result-types positive-fixnum)
110 (:generator 5
111 (loadw res fun 0 fun-pointer-lowtag)
112 (inst srl res n-widetag-bits)))