From 91d6d6dd140340948d4142f1bdf1d9b4fb215b90 Mon Sep 17 00:00:00 2001 From: Lutz Euler Date: Sat, 14 Apr 2012 17:46:44 +0200 Subject: [PATCH] Correct disassembly of some SSE instructions on x86-64. CVTSD2SI, CVTSS2SI, CVTTSD2SI and CVTTSS2SI used to print a source memory operand with a size indicator wrongly indicating the size of the destination, for example "CVTTSS2SI RDX, QWORD PTR [RBP-8]". Correct this by printing the memory reference without a size indicator as the size of the source is implicit in the instruction. Remove an argument type and a print function that were used only for these instructions. --- NEWS | 1 + src/compiler/x86-64/insts.lisp | 20 +++----------------- 2 files changed, 4 insertions(+), 17 deletions(-) diff --git a/NEWS b/NEWS index 32b39f5..1c5d75f 100644 --- a/NEWS +++ b/NEWS @@ -5,6 +5,7 @@ changes relative to sbcl-1.0.56: (lp#936304) * optimization: fewer uses of full calls to signed modular functions. (lp#903821) + * bug fix: fixed disassembly of some SSE instructions on x86-64. * bug fix: SB-SIMPLE-STREAMS signals an error for bogus :CLASS arguments in OPEN. (lp#969352, thanks to Kambiz Darabi) * bug fix: CASE normal-clauses do not allow T and OTHERWISE as keys. diff --git a/src/compiler/x86-64/insts.lisp b/src/compiler/x86-64/insts.lisp index 07082f7..1092029 100644 --- a/src/compiler/x86-64/insts.lisp +++ b/src/compiler/x86-64/insts.lisp @@ -221,16 +221,6 @@ (print-xmmreg value stream dstate) (print-mem-access value nil stream dstate))) -;; Same as print-xmmreg/mem, but prints an explicit size indicator for -;; memory references. -(defun print-sized-xmmreg/mem (value stream dstate) - (declare (type (or list xmmreg) value) - (type stream stream) - (type sb!disassem:disassem-state dstate)) - (if (typep value 'xmmreg) - (print-xmmreg value stream dstate) - (print-mem-access value (inst-operand-size dstate) stream dstate))) - ;;; This prefilter is used solely for its side effects, namely to put ;;; the bits found in the REX prefix into the DSTATE for use by other ;;; prefilters and by printers. @@ -490,10 +480,6 @@ :prefilter #'prefilter-reg/mem :printer #'print-xmmreg/mem) -(sb!disassem:define-arg-type sized-xmmreg/mem - :prefilter #'prefilter-reg/mem - :printer #'print-sized-xmmreg/mem) - (eval-when (:compile-toplevel :load-toplevel :execute) (defparameter *conditions* @@ -902,7 +888,7 @@ (x0f :field (byte 8 0) :value #x0f) (op :field (byte 8 8)) (reg/mem :fields (list (byte 2 22) (byte 3 16)) - :type 'sized-xmmreg/mem) + :type 'xmmreg/mem) (reg :field (byte 3 19) :type 'reg)) (sb!disassem:define-instruction-format (ext-reg-xmm/mem 32 @@ -912,7 +898,7 @@ (x0f :field (byte 8 8) :value #x0f) (op :field (byte 8 16)) (reg/mem :fields (list (byte 2 30) (byte 3 24)) - :type 'sized-xmmreg/mem) + :type 'xmmreg/mem) (reg :field (byte 3 27) :type 'reg)) (sb!disassem:define-instruction-format (ext-rex-reg-xmm/mem 40 @@ -924,7 +910,7 @@ (x0f :field (byte 8 16) :value #x0f) (op :field (byte 8 24)) (reg/mem :fields (list (byte 2 38) (byte 3 32)) - :type 'sized-xmmreg/mem) + :type 'xmmreg/mem) (reg :field (byte 3 35) :type 'reg)) ;; XMM comparison instruction -- 1.7.10.4