mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-21 23:17:16 +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:
@@ -343,7 +343,7 @@ CodeGenInstruction::CodeGenInstruction(Record *R, const std::string &AsmStr)
|
||||
isCall = R->getValueAsBit("isCall");
|
||||
isLoad = R->getValueAsBit("isLoad");
|
||||
isStore = R->getValueAsBit("isStore");
|
||||
isTwoAddress = R->getValueAsBit("isTwoAddress");
|
||||
bool isTwoAddress = R->getValueAsBit("isTwoAddress");
|
||||
isPredicated = false; // set below.
|
||||
isConvertibleToThreeAddress = R->getValueAsBit("isConvertibleToThreeAddress");
|
||||
isCommutable = R->getValueAsBit("isCommutable");
|
||||
@@ -413,6 +413,7 @@ CodeGenInstruction::CodeGenInstruction(Record *R, const std::string &AsmStr)
|
||||
MIOperandNo += NumOps;
|
||||
}
|
||||
|
||||
// Parse Constraints.
|
||||
ParseConstraints(R->getValueAsString("Constraints"), this);
|
||||
|
||||
// For backward compatibility: isTwoAddress means operand 1 is tied to
|
||||
@@ -430,6 +431,21 @@ CodeGenInstruction::CodeGenInstruction(Record *R, const std::string &AsmStr)
|
||||
for (unsigned j = 0, e = OperandList[op].MINumOperands; j != e; ++j)
|
||||
if (OperandList[op].Constraints[j].empty())
|
||||
OperandList[op].Constraints[j] = "0";
|
||||
|
||||
// Parse the DisableEncoding field.
|
||||
std::string DisableEncoding = R->getValueAsString("DisableEncoding");
|
||||
while (1) {
|
||||
std::string OpName = getToken(DisableEncoding, " ,\t");
|
||||
if (OpName.empty()) break;
|
||||
|
||||
// Figure out which operand this is.
|
||||
std::pair<unsigned,unsigned> Op = ParseOperandName(OpName, false);
|
||||
|
||||
// Mark the operand as not-to-be encoded.
|
||||
if (Op.second >= OperandList[Op.first].DoNotEncode.size())
|
||||
OperandList[Op.first].DoNotEncode.resize(Op.second+1);
|
||||
OperandList[Op.first].DoNotEncode[Op.second] = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user