summaryrefslogtreecommitdiffstats
path: root/llvm/utils
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@intel.com>2018-06-18 18:47:07 +0000
committerCraig Topper <craig.topper@intel.com>2018-06-18 18:47:07 +0000
commit17bd84c12c8a773841513865033538103973baec (patch)
treeb8ed81d8bbad9984bc809b6b6efd3b21eb32a201 /llvm/utils
parentcafe947445c2bde7da61ead7ef119b93772e167c (diff)
downloadbcm5719-llvm-17bd84c12c8a773841513865033538103973baec.tar.gz
bcm5719-llvm-17bd84c12c8a773841513865033538103973baec.zip
[X86] Encode the EVEX2VEX exception list information in .td files instead of the emitter source.
Rather than having an exclusion list in tablegen sources, add a flag to the X86 instruction records that can be used to suppress checking for convertibility. llvm-svn: 334971
Diffstat (limited to 'llvm/utils')
-rw-r--r--llvm/utils/TableGen/X86EVEX2VEXTablesEmitter.cpp28
1 files changed, 2 insertions, 26 deletions
diff --git a/llvm/utils/TableGen/X86EVEX2VEXTablesEmitter.cpp b/llvm/utils/TableGen/X86EVEX2VEXTablesEmitter.cpp
index 20637cb8df0..c4c545f404f 100644
--- a/llvm/utils/TableGen/X86EVEX2VEXTablesEmitter.cpp
+++ b/llvm/utils/TableGen/X86EVEX2VEXTablesEmitter.cpp
@@ -52,35 +52,11 @@ private:
// Prints the given table as a C++ array of type
// X86EvexToVexCompressTableEntry
void printTable(const std::vector<Entry> &Table, raw_ostream &OS);
-
- bool inExceptionList(const CodeGenInstruction *Inst) {
- // List of EVEX instructions that match VEX instructions by the encoding
- // but do not perform the same operation.
- static constexpr const char *ExceptionList[] = {
- "VCVTQQ2PD",
- "VCVTQQ2PS",
- "VPMAXSQ",
- "VPMAXUQ",
- "VPMINSQ",
- "VPMINUQ",
- "VPMULLQ",
- "VPSRAQ",
- "VDBPSADBW",
- "VSCALEFPS"
- };
- // Instruction's name starts with one of the entries in the exception list
- for (StringRef InstStr : ExceptionList) {
- if (Inst->TheDef->getName().startswith(InstStr))
- return true;
- }
- return false;
- }
-
};
void X86EVEX2VEXTablesEmitter::printTable(const std::vector<Entry> &Table,
raw_ostream &OS) {
- std::string Size = (Table == EVEX2VEX128) ? "128" : "256";
+ StringRef Size = (Table == EVEX2VEX128) ? "128" : "256";
OS << "// X86 EVEX encoded instructions that have a VEX " << Size
<< " encoding\n"
@@ -332,7 +308,7 @@ void X86EVEX2VEXTablesEmitter::run(raw_ostream &OS) {
!Inst->TheDef->getValueAsBit("hasEVEX_B") &&
getValueFromBitsInit(Inst->TheDef->
getValueAsBitsInit("EVEX_LL")) != 2 &&
- !inExceptionList(Inst))
+ !Inst->TheDef->getValueAsBit("notEVEX2VEXConvertible"))
EVEXInsts.push_back(Inst);
}
OpenPOWER on IntegriCloud