https://sourceware.org/bugzilla/show_bug.cgi?id=25445
Bug ID: 25445 Summary: movsx with 0x66 prefix incorrectly disassembled Product: binutils Version: 2.35 (HEAD) Status: NEW Severity: normal Priority: P2 Component: binutils Assignee: unassigned at sourceware dot org Reporter: hjl.tools at gmail dot com Target Milestone: --- Target: i386, x86-64 [hjl@gnu-cfl-1 testsuite]$ cat movsx.s .text .byte 0x66, 0x63, 0x08 [hjl@gnu-cfl-1 testsuite]$ gcc -c movsx.s [hjl@gnu-cfl-1 testsuite]$ objdump -dw movsx.o movsx.o: file format elf64-x86-64 Disassembly of section .text: 0000000000000000 <.text>: 0: 66 63 08 movslq (%rax),%cx [hjl@gnu-cfl-1 testsuite]$ AMD64 spec has This instruction requires the REX prefix 64-bit operand size bit (REX.W) to be set to 1 to sign-extend a 32-bit source operand to a 64-bit result. Without the REX operand-size prefix, the operand size will be 32 bits, the default for 64-bit mode, and the source is zero-extended into a 64-bit register. With a 16- bit operand size, only 16 bits are copied, without modifying the upper 48 bits in the destination. Intel64 spec has 63 /r* MOVSXD r16, r/m16 RM Move word to word with sign-extension. 63 /r* MOVSXD r32, r/m32 RM Move doubleword to doubleword with sign- extension. REX.W + 63 /r MOVSXD r64, r/m32 RM Move doubleword to quadword with sign-extension. -- You are receiving this mail because: You are on the CC list for the bug.