[llvm] [X86] Ignore REX prefixes not immediately before opcode (PR #117299)

Aiden Grossman via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 21 23:48:54 PST 2024


================
@@ -770,3 +770,8 @@
 
 # CHECK: prefetchit1 (%rip)
 0x0f,0x18,0x35,0x00,0x00,0x00,0x00
+
+# Check that we correctly ignore a REX prefix that is not immediately before
+# the opcode.
+# CHECK: orw $25659, %ax
----------------
boomanaiden154 wrote:

The architecture manual explicitly mentions that the REX prefix should be ignored if it does not immediately precede the opcode.

Binutils is also incorrect here (not sure why). We've validated that this is the correct disassembly by executing this byte sequence and confirming semantics in a debugger. IACA also disassembles it this way, although I could not get XED to return the same results.

https://github.com/llvm/llvm-project/pull/117299


More information about the llvm-commits mailing list