From f64f9a4b75d07819866bfcf918b922a76d3e1600 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Wed, 15 Nov 2006 23:23:02 +0000 Subject: 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 --- utils/TableGen/CodeGenInstruction.h | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) (limited to 'utils/TableGen/CodeGenInstruction.h') 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 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 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 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); -- cgit v1.2.3