diff options
author | Craig Topper <craig.topper@gmail.com> | 2011-09-02 04:17:54 +0000 |
---|---|---|
committer | Craig Topper <craig.topper@gmail.com> | 2011-09-02 04:17:54 +0000 |
commit | 5ffedb9352ad24f50fa647153dcf04af4e84dbb1 (patch) | |
tree | 4aa7bebc759904ec3b533378f3d91f0b22e874d6 /utils | |
parent | 24fbb5875c7f45bfab43a656c049d73146dcdfff (diff) | |
download | external_llvm-5ffedb9352ad24f50fa647153dcf04af4e84dbb1.zip external_llvm-5ffedb9352ad24f50fa647153dcf04af4e84dbb1.tar.gz external_llvm-5ffedb9352ad24f50fa647153dcf04af4e84dbb1.tar.bz2 |
Make IC_VEX* not inherit from IC_*. Prevents instructions with no VEX form from disassembling to their non-VEX form. Also prevents weak filter collisons that were keeping valid VEX instructions from decoding properly. Make VEX_L* not inherit from VEX_* because the VEX.L bit always important. This stops packed int VEX encodings from being disassembled when specified with VEX.L=1. Fixes PR10831 and PR10806.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138997 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils')
-rw-r--r-- | utils/TableGen/X86DisassemblerTables.cpp | 49 |
1 files changed, 23 insertions, 26 deletions
diff --git a/utils/TableGen/X86DisassemblerTables.cpp b/utils/TableGen/X86DisassemblerTables.cpp index 3e48c0b..e0cbb18 100644 --- a/utils/TableGen/X86DisassemblerTables.cpp +++ b/utils/TableGen/X86DisassemblerTables.cpp @@ -38,20 +38,21 @@ static inline bool inheritsFrom(InstructionContext child, switch (parent) { case IC: - return true; + return(inheritsFrom(child, IC_64BIT) || + inheritsFrom(child, IC_OPSIZE) || + inheritsFrom(child, IC_XD) || + inheritsFrom(child, IC_XS)); case IC_64BIT: return(inheritsFrom(child, IC_64BIT_REXW) || inheritsFrom(child, IC_64BIT_OPSIZE) || inheritsFrom(child, IC_64BIT_XD) || inheritsFrom(child, IC_64BIT_XS)); case IC_OPSIZE: - return(inheritsFrom(child, IC_64BIT_OPSIZE)); + return inheritsFrom(child, IC_64BIT_OPSIZE); case IC_XD: - return(inheritsFrom(child, IC_64BIT_XD) || - inheritsFrom(child, IC_VEX_XD)); + return inheritsFrom(child, IC_64BIT_XD); case IC_XS: - return(inheritsFrom(child, IC_64BIT_XS) || - inheritsFrom(child, IC_VEX_XS)); + return inheritsFrom(child, IC_64BIT_XS); case IC_64BIT_REXW: return(inheritsFrom(child, IC_64BIT_REXW_XS) || inheritsFrom(child, IC_64BIT_REXW_XD) || @@ -69,35 +70,31 @@ static inline bool inheritsFrom(InstructionContext child, case IC_64BIT_REXW_OPSIZE: return false; case IC_VEX: - return(inheritsFrom(child, IC_VEX_XS) || - inheritsFrom(child, IC_VEX_XD) || - inheritsFrom(child, IC_VEX_L) || - inheritsFrom(child, IC_VEX_W) || - inheritsFrom(child, IC_VEX_OPSIZE)); + return inheritsFrom(child, IC_VEX_W); case IC_VEX_XS: - return(inheritsFrom(child, IC_VEX_L_XS) || - inheritsFrom(child, IC_VEX_W_XS)); + return inheritsFrom(child, IC_VEX_W_XS); case IC_VEX_XD: - return(inheritsFrom(child, IC_VEX_L_XD) || - inheritsFrom(child, IC_VEX_W_XD)); + return inheritsFrom(child, IC_VEX_W_XD); + case IC_VEX_OPSIZE: + return inheritsFrom(child, IC_VEX_W_OPSIZE); + case IC_VEX_W: + return false; + case IC_VEX_W_XS: + return false; + case IC_VEX_W_XD: + return false; + case IC_VEX_W_OPSIZE: + return false; case IC_VEX_L: - return(inheritsFrom(child, IC_VEX_L_XS) || - inheritsFrom(child, IC_VEX_L_XD)); + return false; case IC_VEX_L_XS: return false; case IC_VEX_L_XD: return false; - case IC_VEX_W: - return(inheritsFrom(child, IC_VEX_W_XS) || - inheritsFrom(child, IC_VEX_W_XD) || - inheritsFrom(child, IC_VEX_W_OPSIZE)); - case IC_VEX_W_XS: - return false; - case IC_VEX_W_XD: + case IC_VEX_L_OPSIZE: return false; - case IC_VEX_OPSIZE: - return inheritsFrom(child, IC_VEX_W_OPSIZE); default: + llvm_unreachable("Unknown instruction class"); return false; } } |