REX.b and EVEX.x are not decoded when determining whether the addressing mode is RIP-relative.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
Looks good with the test case changed as below.
test/MC/Disassembler/X86/x86-64.txt | ||
---|---|---|
327 ↗ | (On Diff #25695) | XFAIL doesn't work this way... You only write one XFAIL per test file, and it fails the entire file. I think you want to write the CHECKs as they are today, and as FIXME:s for what they should be. |
Besides inline comments, this looks good to me, as typical uses of RIP relative addressing seem to disassemble correctly now.
test/MC/Disassembler/X86/x86-64.txt | ||
---|---|---|
314 ↗ | (On Diff #25695) | I'm getting a #UD on this instruction. Well, technically on: 62 11 5c 40 58 3d ff 7f ff ff, or vaddps -32769(%rip), %zmm20, %zmm15 I've attached both LLDB and GDB's output (LLDB doesn't use this patch yet, so it doesn't disassemble past the instruction). Also GDB disassembles it differently from this patch, as it says the RIP relative immediate is -8001, but by my count it should be -32769 (which llvm-mc disassembles it to using this patch). Note: I monkey-patched a C binary with the instruction, so it's not a proper compiled object, but it should at least execute/segfault; but I get an illegal instruction error on that exact instruction, so I think it's not the patching that's the problem. Unfortunately I can't seem to find the source or a binary download for the xed program on Intel's website or anywhere, otherwise I'd try to get a "second opinion". Hopefully something else is going on, otherwise we might actually all have disassembler bugs to repair :) |
Ignore previous comment; I see now that the instruction #UD's because they haven't made/released processors which implement EVEX prefixes yet, so all's right with the world ;)
Carry on!