diff options
author | Chris Lattner <sabre@nondot.org> | 2006-11-15 23:23:02 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2006-11-15 23:23:02 +0000 |
commit | f64f9a4b75d07819866bfcf918b922a76d3e1600 (patch) | |
tree | d3fdce7cae19e5acb2baa98bdff25c7b244a4945 /utils/TableGen/CodeEmitterGen.cpp | |
parent | fa326c709fdd73dcaa4802e35d65e519d6cc3b23 (diff) | |
download | external_llvm-f64f9a4b75d07819866bfcf918b922a76d3e1600.zip external_llvm-f64f9a4b75d07819866bfcf918b922a76d3e1600.tar.gz external_llvm-f64f9a4b75d07819866bfcf918b922a76d3e1600.tar.bz2 |
Remove the isTwoAddress property from the CodeGenInstruction class. It should
not be used for anything other than backwards compat constraint handling.
Add support for a new DisableEncoding property which contains a list of
registers that should not be encoded by the generated code emitter. Convert
the codeemitter generator to use this, fixing some PPC JIT regressions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31769 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils/TableGen/CodeEmitterGen.cpp')
-rw-r--r-- | utils/TableGen/CodeEmitterGen.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/utils/TableGen/CodeEmitterGen.cpp b/utils/TableGen/CodeEmitterGen.cpp index bc415fc..c64b5f4 100644 --- a/utils/TableGen/CodeEmitterGen.cpp +++ b/utils/TableGen/CodeEmitterGen.cpp @@ -125,7 +125,8 @@ void CodeEmitterGen::run(std::ostream &o) { BitsInit *BI = R->getValueAsBitsInit("Inst"); const std::vector<RecordVal> &Vals = R->getValues(); - + CodeGenInstruction &CGI = Target.getInstruction(InstName); + // Loop over all of the fields in the instruction, determining which are the // operands to the instruction. unsigned op = 0; @@ -154,16 +155,15 @@ void CodeEmitterGen::run(std::ostream &o) { } if (!gotOp) { + /// If this operand is not supposed to be emitted by the generated + /// emitter, skip it. + while (CGI.isFlatOperandNotEmitted(op)) + ++op; + Case += " // op: " + VarName + "\n" + " op = getMachineOpValue(MI, MI.getOperand(" - + utostr(op++) - + "));\n"; + + utostr(op++) + "));\n"; gotOp = true; - - // If this is a two-address instruction and we just got the dest - // op, skip the src op. - if (op == 1 && Target.getInstruction(InstName).isTwoAddress) - ++op; } unsigned opMask = (1 << N) - 1; @@ -185,7 +185,7 @@ void CodeEmitterGen::run(std::ostream &o) { } } - std::vector<std::string> &InstList = CaseMap[Case]; + std::vector<std::string> &InstList = CaseMap[Case]; InstList.push_back(InstName); } |