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/CodeGenInstruction.h | |
parent | fa326c709fdd73dcaa4802e35d65e519d6cc3b23 (diff) | |
download | llvm-f64f9a4b75d07819866bfcf918b922a76d3e1600.tar.gz llvm-f64f9a4b75d07819866bfcf918b922a76d3e1600.tar.bz2 llvm-f64f9a4b75d07819866bfcf918b922a76d3e1600.tar.xz |
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/CodeGenInstruction.h')
-rw-r--r-- | utils/TableGen/CodeGenInstruction.h | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/utils/TableGen/CodeGenInstruction.h b/utils/TableGen/CodeGenInstruction.h index d99af1b67a..e0d6b9837e 100644 --- a/utils/TableGen/CodeGenInstruction.h +++ b/utils/TableGen/CodeGenInstruction.h @@ -57,6 +57,11 @@ namespace llvm { unsigned MIOperandNo; unsigned MINumOperands; // The number of operands. + /// DoNotEncode - Bools are set to true in this vector for each operand in + /// the DisableEncoding list. These should not be emitted by the code + /// emitter. + std::vector<bool> DoNotEncode; + /// MIOperandInfo - Default MI operand type. Note an operand may be made /// up of multiple MI operands. DagInit *MIOperandInfo; @@ -82,7 +87,6 @@ namespace llvm { bool isCall; bool isLoad; bool isStore; - bool isTwoAddress; bool isPredicated; bool isConvertibleToThreeAddress; bool isCommutable; @@ -107,6 +111,25 @@ namespace llvm { return OperandList[Op.first].MIOperandNo + Op.second; } + /// getSubOperandNumber - Unflatten a operand number into an + /// operand/suboperand pair. + std::pair<unsigned,unsigned> getSubOperandNumber(unsigned Op) const { + for (unsigned i = 0; ; ++i) { + assert(i < OperandList.size() && "Invalid flat operand #"); + if (OperandList[i].MIOperandNo+OperandList[i].MINumOperands > Op) + return std::make_pair(i, Op-OperandList[i].MIOperandNo); + } + } + + + /// isFlatOperandNotEmitted - Return true if the specified flat operand # + /// should not be emitted with the code emitter. + bool isFlatOperandNotEmitted(unsigned FlatOpNo) const { + std::pair<unsigned,unsigned> Op = getSubOperandNumber(FlatOpNo); + if (OperandList[Op.first].DoNotEncode.size() > Op.second) + return OperandList[Op.first].DoNotEncode[Op.second]; + return false; + } CodeGenInstruction(Record *R, const std::string &AsmStr); |