mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-24 23:28:41 +00:00
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
This commit is contained in:
@@ -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);
|
||||
|
||||
|
Reference in New Issue
Block a user