X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fcompiler%2Fx86%2Ftarget-insts.lisp;h=c761ee092a81a576536f9910f7f6faf99abbd556;hb=b2ed34b667665e52609cf431c00179b136be450d;hp=1b25231b0e4df1c64b0440eb0f44c31672d77909;hpb=a530bbe337109d898d5b4a001fc8f1afa3b5dc39;p=sbcl.git diff --git a/src/compiler/x86/target-insts.lisp b/src/compiler/x86/target-insts.lisp index 1b25231..c761ee0 100644 --- a/src/compiler/x86/target-insts.lisp +++ b/src/compiler/x86/target-insts.lisp @@ -1,4 +1,8 @@ ;;;; target-only stuff from CMU CL's src/compiler/x86/insts.lisp +;;;; +;;;; i.e. stuff which was in CMU CL's insts.lisp file, but which in +;;;; the SBCL build process can't be compiled into code for the +;;;; cross-compilation host ;;;; This software is part of the SBCL system. See the README file for ;;;; more information. @@ -11,41 +15,46 @@ (in-package "SB!VM") -(file-comment - "$Header$") - (defun print-mem-access (value stream print-size-p dstate) (declare (type list value) - (type stream stream) - (type (member t nil) print-size-p) - (type sb!disassem:disassem-state dstate)) + (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) + (princ (inst-operand-size dstate) stream) (princ '| PTR | stream)) + (maybe-print-segment-override stream dstate) (write-char #\[ stream) (let ((firstp t)) (macrolet ((pel ((var val) &body body) - ;; Print an element of the address, maybe with - ;; a leading separator. - `(let ((,var ,val)) - (when ,var - (unless firstp - (write-char #\+ stream)) - ,@body - (setq firstp nil))))) + ;; Print an element of the address, maybe with + ;; a leading separator. + `(let ((,var ,val)) + (when ,var + (unless firstp + (write-char #\+ stream)) + ,@body + (setq firstp nil))))) (pel (base-reg (first value)) - (print-addr-reg base-reg stream dstate)) + (print-addr-reg base-reg stream dstate)) (pel (index-reg (third value)) - (print-addr-reg index-reg stream dstate) - (let ((index-scale (fourth value))) - (when (and index-scale (not (= index-scale 1))) - (write-char #\* stream) - (princ index-scale stream)))) + (print-addr-reg index-reg stream dstate) + (let ((index-scale (fourth value))) + (when (and index-scale (not (= index-scale 1))) + (write-char #\* stream) + (princ index-scale stream)))) (let ((offset (second value))) - (when (and offset (or firstp (not (zerop offset)))) - (unless (or firstp (minusp offset)) - (write-char #\+ stream)) - (if firstp - (sb!disassem:princ16 offset stream) - (princ offset stream)))))) + (when (and offset (or firstp (not (zerop offset)))) + (unless (or firstp (minusp offset)) + (write-char #\+ stream)) + (if firstp + (progn + (sb!disassem:princ16 offset stream) + (or (minusp offset) + (nth-value 1 + (sb!disassem::note-code-constant-absolute offset dstate)) + (sb!disassem:maybe-note-assembler-routine offset + nil + dstate))) + (princ offset stream)))))) (write-char #\] stream))