Correct disassembly of some SSE instructions on x86-64.
authorLutz Euler <lutz.euler@freenet.de>
Sat, 14 Apr 2012 15:46:44 +0000 (17:46 +0200)
committerLutz Euler <lutz.euler@freenet.de>
Sat, 14 Apr 2012 15:46:44 +0000 (17:46 +0200)
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
src/compiler/x86-64/insts.lisp

diff --git a/NEWS b/NEWS
index 32b39f5..1c5d75f 100644 (file)
--- 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.
index 07082f7..1092029 100644 (file)
       (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.
   :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*
   (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
   (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
   (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