bad disassembly for CMPP[SD] and other x86 instructions with noise after a displaced EA
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
SBCL |
Fix Released
|
Low
|
Lutz Euler |
Bug Description
* (defun foo (x) (= #C(2.0 3.0) (the (complex single-float) x)))
FOO
* (disassemble 'foo)
; disassembly for FOO
; 0293C238: 8BC1 MOV EAX, ECX ; no-arg-parsing entry point
; 3A: 240F AND AL, 15
; 3C: 3C0F CMP AL, 15
; 3E: 7539 JNE L0
; 40: 8A41F1 MOV AL, [RCX-15]
; 43: 3C26 CMP AL, 38
; 45: 7532 JNE L0
; 47: 488BC1 MOV RAX, RCX
; 4A: F30F7E40F9 MOVQ XMM0, [RAX-7]
; 4F: 0FC2053900000000 CMP
debugger invoked on a SB-INT:
The pattern reads the first byte of the displacement instead of the instruction's last byte. The few instructions fixed in 9d2548c (Correct RIP-relative offset for strange x86-64 instructions) seem to be the only ones for which the EA does not mark the end of the instruction.
Changed in sbcl: | |
status: | Confirmed → In Progress |
assignee: | nobody → Lutz Euler (lutz-euler) |
Changed in sbcl: | |
status: | Fix Committed → Fix Released |
Here is the patch I would like to propose.
See the commit message and the documentation
in the changed files for the details.
Paul, I hope it's OK that I cleaned up the instruction xmm-comparison- sse-inst.
definitions in the course of this: The extra instruction
formats are not necessary if the immediate field
is named "imm" instead of "cc". More so as they
defined a default printer that was never used.
There was provision to not have a printer expression
in the macrolet of define-
I deleted it as it was not used. I renamed the macro
as I believe that having both "xmm" and "sse" in a
single name is redundant.
Lutz