Don't warn when #'(setf fun) is used in the presence of a setf-macro.
[sbcl.git] / src / compiler / x86 / target-insts.lisp
1 ;;;; target-only stuff from CMU CL's src/compiler/x86/insts.lisp
2 ;;;;
3 ;;;; i.e. stuff which was in CMU CL's insts.lisp file, but which in
4 ;;;; the SBCL build process can't be compiled into code for the
5 ;;;; cross-compilation host
6
7 ;;;; This software is part of the SBCL system. See the README file for
8 ;;;; more information.
9 ;;;;
10 ;;;; This software is derived from the CMU CL system, which was
11 ;;;; written at Carnegie Mellon University and released into the
12 ;;;; public domain. The software is in the public domain and is
13 ;;;; provided with absolutely no warranty. See the COPYING and CREDITS
14 ;;;; files for more information.
15
16 (in-package "SB!VM")
17
18 (defun print-mem-access (value stream print-size-p dstate)
19   (declare (type list value)
20            (type stream stream)
21            (type (member t nil) print-size-p)
22            (type sb!disassem:disassem-state dstate))
23   (when print-size-p
24     (princ (inst-operand-size dstate) stream)
25     (princ '| PTR | stream))
26   (maybe-print-segment-override stream dstate)
27   (write-char #\[ stream)
28   (let ((firstp t))
29     (macrolet ((pel ((var val) &body body)
30                  ;; Print an element of the address, maybe with
31                  ;; a leading separator.
32                  `(let ((,var ,val))
33                     (when ,var
34                       (unless firstp
35                         (write-char #\+ stream))
36                       ,@body
37                       (setq firstp nil)))))
38       (pel (base-reg (first value))
39         (print-addr-reg base-reg stream dstate))
40       (pel (index-reg (third value))
41         (print-addr-reg index-reg stream dstate)
42         (let ((index-scale (fourth value)))
43           (when (and index-scale (not (= index-scale 1)))
44             (write-char #\* stream)
45             (princ index-scale stream))))
46       (let ((offset (second value)))
47         (when (and offset (or firstp (not (zerop offset))))
48           (unless (or firstp (minusp offset))
49             (write-char #\+ stream))
50           (if firstp
51             (progn
52               (sb!disassem:princ16 offset stream)
53               (or (minusp offset)
54                   (nth-value 1
55                     (sb!disassem::note-code-constant-absolute offset dstate))
56                   (sb!disassem:maybe-note-assembler-routine offset
57                                                             nil
58                                                             dstate)))
59             (princ offset stream))))))
60   (write-char #\] stream))