X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fcompiler%2Fx86-64%2Ftarget-insts.lisp;h=5411762a26fd57173228ea5982ab85fd647e1a77;hb=6e89948ce34d63b35eea687ca7cde0f2876c3062;hp=aef6243ae3a77bc5a2316842cb58e1743eab825e;hpb=aa9a97b0a8cc052833a0015f1deebe951acf371d;p=sbcl.git diff --git a/src/compiler/x86-64/target-insts.lisp b/src/compiler/x86-64/target-insts.lisp index aef6243..5411762 100644 --- a/src/compiler/x86-64/target-insts.lisp +++ b/src/compiler/x86-64/target-insts.lisp @@ -15,13 +15,20 @@ (in-package "SB!VM") -(defun print-mem-access (value stream print-size-p dstate) +;;; Prints a memory reference to STREAM. VALUE is a list of +;;; (BASE-REG OFFSET INDEX-REG INDEX-SCALE), where any component may be +;;; missing or nil to indicate that it's not used or has the obvious +;;; default value (e.g., 1 for the index-scale). BASE-REG can be the +;;; symbol RIP or a full register, INDEX-REG a full register. If WIDTH +;;; is non-nil it should be one of the symbols :BYTE, :WORD, :DWORD or +;;; :QWORD and a corresponding size indicator is printed first. +(defun print-mem-access (value width stream dstate) (declare (type list value) + (type (member nil :byte :word :dword :qword) width) (type stream stream) - (type (member t nil) print-size-p) (type sb!disassem:disassem-state dstate)) - (when print-size-p - (princ (sb!disassem:dstate-get-prop dstate 'width) stream) + (when width + (princ width stream) (princ '| PTR | stream)) (write-char #\[ stream) (let ((firstp t) (rip-p nil)) @@ -69,6 +76,6 @@ (sb!disassem:maybe-note-assembler-routine offset nil dstate)))) - (t - (princ offset stream))))))) + (t + (princ offset stream))))))) (write-char #\] stream))