diff options
| author | Ahmed Bougacha <ahmed.bougacha@gmail.com> | 2016-07-14 14:53:21 +0000 |
|---|---|---|
| committer | Ahmed Bougacha <ahmed.bougacha@gmail.com> | 2016-07-14 14:53:21 +0000 |
| commit | 85dc93c56b39f400dcf6992bd9effac3d4bf6a90 (patch) | |
| tree | 1758c03d379f6778e15d60c8543de32bed4542f9 /llvm/lib/Target/X86/Disassembler/X86DisassemblerDecoder.cpp | |
| parent | 4f7a5e20aee6e1b4a9ad354bb80bdb551b946041 (diff) | |
| download | bcm5719-llvm-85dc93c56b39f400dcf6992bd9effac3d4bf6a90.tar.gz bcm5719-llvm-85dc93c56b39f400dcf6992bd9effac3d4bf6a90.zip | |
[X86] Decode MPX BND registers.
We were able to assemble, but not disassemble.
Note that fixupRMValue was truncating EA_REG_BND0-3 because we hit
the uint8_t max. The control registers were already squarely above
it, but I don't think they ever go in .r/m, only in .reg.
I also did notice an extra REX.W in our encoding, but I think that's
fine.
llvm-svn: 275427
Diffstat (limited to 'llvm/lib/Target/X86/Disassembler/X86DisassemblerDecoder.cpp')
| -rw-r--r-- | llvm/lib/Target/X86/Disassembler/X86DisassemblerDecoder.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/llvm/lib/Target/X86/Disassembler/X86DisassemblerDecoder.cpp b/llvm/lib/Target/X86/Disassembler/X86DisassemblerDecoder.cpp index 4766b741790..b0a150ab564 100644 --- a/llvm/lib/Target/X86/Disassembler/X86DisassemblerDecoder.cpp +++ b/llvm/lib/Target/X86/Disassembler/X86DisassemblerDecoder.cpp @@ -1450,10 +1450,10 @@ static int readModRM(struct InternalInstruction* insn) { } #define GENERIC_FIXUP_FUNC(name, base, prefix) \ - static uint8_t name(struct InternalInstruction *insn, \ - OperandType type, \ - uint8_t index, \ - uint8_t *valid) { \ + static uint16_t name(struct InternalInstruction *insn, \ + OperandType type, \ + uint8_t index, \ + uint8_t *valid) { \ *valid = 1; \ switch (type) { \ default: \ @@ -1503,6 +1503,10 @@ static int readModRM(struct InternalInstruction* insn) { return prefix##_DR0 + index; \ case TYPE_CONTROLREG: \ return prefix##_CR0 + index; \ + case TYPE_BNDR: \ + if (index > 3) \ + *valid = 0; \ + return prefix##_BND0 + index; \ } \ } |

