468718b282b4d5d5ecacc82f7e9c7b3e1ff5f408
[sbcl.git] / src / compiler / alpha / show.lisp
1 ;;;; temporary printing utilities and similar noise
2
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.
11
12 (in-package "SB!VM")
13
14 (define-vop (print)
15   (:args (object :scs (descriptor-reg) :target a0))
16   (:results (result :scs (descriptor-reg)))
17   (:save-p t)
18   (:temporary (:sc any-reg :offset cfunc-offset :target result :to (:result 0))
19               cfunc)
20   (:temporary (:sc descriptor-reg :offset nl0-offset :from (:argument 0)) a0)
21   (:temporary (:sc control-stack :offset nfp-save-offset) nfp-save)
22   (:temporary (:scs (non-descriptor-reg)) temp)
23   (:vop-var vop)
24   (:generator 0
25     (let ((cur-nfp (current-nfp-tn vop)))
26       (move object a0)
27       (when cur-nfp
28         (store-stack-tn nfp-save cur-nfp))
29       (inst li (make-fixup "debug_print" :foreign) cfunc)
30       (inst li (make-fixup "call_into_c" :foreign) temp)
31       (inst jsr lip-tn temp (make-fixup "call_into_c" :foreign))
32       (when cur-nfp
33         (maybe-load-stack-nfp-tn cur-nfp nfp-save temp))
34       (move cfunc result))))