diff options
author | Craig Topper <craig.topper@gmail.com> | 2011-10-11 04:34:23 +0000 |
---|---|---|
committer | Craig Topper <craig.topper@gmail.com> | 2011-10-11 04:34:23 +0000 |
commit | 29480fd798dc6452948f63825ff41c66f09c2493 (patch) | |
tree | 1c53f0e1fbfb54a46f9264f0702404f3ade67f50 /utils | |
parent | 7aabcb1fc0a94becb437134747a63ff686c0661f (diff) | |
download | external_llvm-29480fd798dc6452948f63825ff41c66f09c2493.tar.gz external_llvm-29480fd798dc6452948f63825ff41c66f09c2493.tar.bz2 external_llvm-29480fd798dc6452948f63825ff41c66f09c2493.zip |
Fix disassembling of popcntw. Also remove some code that says it accounts for 64BIT_REXW_XD not existing, but it does exist.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141642 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils')
-rw-r--r-- | utils/TableGen/X86DisassemblerTables.cpp | 7 | ||||
-rw-r--r-- | utils/TableGen/X86RecognizableInstr.cpp | 10 |
2 files changed, 15 insertions, 2 deletions
diff --git a/utils/TableGen/X86DisassemblerTables.cpp b/utils/TableGen/X86DisassemblerTables.cpp index f42119c074..e8c9a48973 100644 --- a/utils/TableGen/X86DisassemblerTables.cpp +++ b/utils/TableGen/X86DisassemblerTables.cpp @@ -56,6 +56,8 @@ static inline bool inheritsFrom(InstructionContext child, return inheritsFrom(child, IC_64BIT_XS); case IC_XD_OPSIZE: return inheritsFrom(child, IC_64BIT_XD_OPSIZE); + case IC_XS_OPSIZE: + return inheritsFrom(child, IC_64BIT_XS_OPSIZE); case IC_64BIT_REXW: return(inheritsFrom(child, IC_64BIT_REXW_XS) || inheritsFrom(child, IC_64BIT_REXW_XD) || @@ -67,6 +69,7 @@ static inline bool inheritsFrom(InstructionContext child, case IC_64BIT_XS: return(inheritsFrom(child, IC_64BIT_REXW_XS)); case IC_64BIT_XD_OPSIZE: + case IC_64BIT_XS_OPSIZE: return false; case IC_64BIT_REXW_XD: case IC_64BIT_REXW_XS: @@ -524,6 +527,8 @@ void DisassemblerTables::emitContextTable(raw_ostream &o, uint32_t &i) const { o << "IC_64BIT_REXW_OPSIZE"; else if ((index & ATTR_64BIT) && (index & ATTR_XD) && (index & ATTR_OPSIZE)) o << "IC_64BIT_XD_OPSIZE"; + else if ((index & ATTR_64BIT) && (index & ATTR_XS) && (index & ATTR_OPSIZE)) + o << "IC_64BIT_XS_OPSIZE"; else if ((index & ATTR_64BIT) && (index & ATTR_XS)) o << "IC_64BIT_XS"; else if ((index & ATTR_64BIT) && (index & ATTR_XD)) @@ -534,6 +539,8 @@ void DisassemblerTables::emitContextTable(raw_ostream &o, uint32_t &i) const { o << "IC_64BIT_REXW"; else if ((index & ATTR_64BIT)) o << "IC_64BIT"; + else if ((index & ATTR_XS) && (index & ATTR_OPSIZE)) + o << "IC_XS_OPSIZE"; else if ((index & ATTR_XD) && (index & ATTR_OPSIZE)) o << "IC_XD_OPSIZE"; else if (index & ATTR_XS) diff --git a/utils/TableGen/X86RecognizableInstr.cpp b/utils/TableGen/X86RecognizableInstr.cpp index ee9deb3628..e7092c762c 100644 --- a/utils/TableGen/X86RecognizableInstr.cpp +++ b/utils/TableGen/X86RecognizableInstr.cpp @@ -314,13 +314,17 @@ InstructionContext RecognizableInstr::insnContext() const { } else if (Is64Bit || HasREX_WPrefix) { if (HasREX_WPrefix && HasOpSizePrefix) insnContext = IC_64BIT_REXW_OPSIZE; - else if (HasOpSizePrefix && (Prefix == X86Local::XD || Prefix == X86Local::TF)) + else if (HasOpSizePrefix && + (Prefix == X86Local::XD || Prefix == X86Local::TF)) insnContext = IC_64BIT_XD_OPSIZE; + else if (HasOpSizePrefix && Prefix == X86Local::XS) + insnContext = IC_64BIT_XS_OPSIZE; else if (HasOpSizePrefix) insnContext = IC_64BIT_OPSIZE; else if (HasREX_WPrefix && Prefix == X86Local::XS) insnContext = IC_64BIT_REXW_XS; - else if (HasREX_WPrefix && (Prefix == X86Local::XD || Prefix == X86Local::TF)) + else if (HasREX_WPrefix && + (Prefix == X86Local::XD || Prefix == X86Local::TF)) insnContext = IC_64BIT_REXW_XD; else if (Prefix == X86Local::XD || Prefix == X86Local::TF) insnContext = IC_64BIT_XD; @@ -334,6 +338,8 @@ InstructionContext RecognizableInstr::insnContext() const { if (HasOpSizePrefix && (Prefix == X86Local::XD || Prefix == X86Local::TF)) insnContext = IC_XD_OPSIZE; + else if (HasOpSizePrefix && Prefix == X86Local::XS) + insnContext = IC_XS_OPSIZE; else if (HasOpSizePrefix) insnContext = IC_OPSIZE; else if (Prefix == X86Local::XD || Prefix == X86Local::TF) |