mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-13 22:24:07 +00:00
PHI and INLINEASM are now builtin instructions provided by Target.td
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25673 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -205,10 +205,10 @@ void CodeGenTarget::ReadLegalValueTypes() const {
|
|||||||
|
|
||||||
void CodeGenTarget::ReadInstructions() const {
|
void CodeGenTarget::ReadInstructions() const {
|
||||||
std::vector<Record*> Insts = Records.getAllDerivedDefinitions("Instruction");
|
std::vector<Record*> Insts = Records.getAllDerivedDefinitions("Instruction");
|
||||||
|
if (Insts.size() <= 2)
|
||||||
if (Insts.empty())
|
|
||||||
throw std::string("No 'Instruction' subclasses defined!");
|
throw std::string("No 'Instruction' subclasses defined!");
|
||||||
|
|
||||||
|
// Parse the instructions defined in the .td file.
|
||||||
std::string InstFormatName =
|
std::string InstFormatName =
|
||||||
getAsmWriter()->getValueAsString("InstFormatName");
|
getAsmWriter()->getValueAsString("InstFormatName");
|
||||||
|
|
||||||
@ -219,29 +219,25 @@ void CodeGenTarget::ReadInstructions() const {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// getPHIInstruction - Return the designated PHI instruction.
|
|
||||||
///
|
|
||||||
const CodeGenInstruction &CodeGenTarget::getPHIInstruction() const {
|
|
||||||
Record *PHI = getInstructionSet()->getValueAsDef("PHIInst");
|
|
||||||
std::map<std::string, CodeGenInstruction>::const_iterator I =
|
|
||||||
getInstructions().find(PHI->getName());
|
|
||||||
if (I == Instructions.end())
|
|
||||||
throw "Could not find PHI instruction named '" + PHI->getName() + "'!";
|
|
||||||
return I->second;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// getInstructionsByEnumValue - Return all of the instructions defined by the
|
/// getInstructionsByEnumValue - Return all of the instructions defined by the
|
||||||
/// target, ordered by their enum value.
|
/// target, ordered by their enum value.
|
||||||
void CodeGenTarget::
|
void CodeGenTarget::
|
||||||
getInstructionsByEnumValue(std::vector<const CodeGenInstruction*>
|
getInstructionsByEnumValue(std::vector<const CodeGenInstruction*>
|
||||||
&NumberedInstructions) {
|
&NumberedInstructions) {
|
||||||
|
std::map<std::string, CodeGenInstruction>::const_iterator I;
|
||||||
|
I = getInstructions().find("PHI");
|
||||||
|
if (I == Instructions.end()) throw "Could not find 'PHI' instruction!";
|
||||||
|
const CodeGenInstruction *PHI = &I->second;
|
||||||
|
|
||||||
|
I = getInstructions().find("INLINEASM");
|
||||||
|
if (I == Instructions.end()) throw "Could not find 'INLINEASM' instruction!";
|
||||||
|
const CodeGenInstruction *INLINEASM = &I->second;
|
||||||
|
|
||||||
// Print out the rest of the instructions now.
|
// Print out the rest of the instructions now.
|
||||||
unsigned i = 0;
|
|
||||||
const CodeGenInstruction *PHI = &getPHIInstruction();
|
|
||||||
NumberedInstructions.push_back(PHI);
|
NumberedInstructions.push_back(PHI);
|
||||||
|
NumberedInstructions.push_back(INLINEASM);
|
||||||
for (inst_iterator II = inst_begin(), E = inst_end(); II != E; ++II)
|
for (inst_iterator II = inst_begin(), E = inst_end(); II != E; ++II)
|
||||||
if (&II->second != PHI)
|
if (&II->second != PHI &&&II->second != INLINEASM)
|
||||||
NumberedInstructions.push_back(&II->second);
|
NumberedInstructions.push_back(&II->second);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -148,10 +148,6 @@ public:
|
|||||||
&NumberedInstructions);
|
&NumberedInstructions);
|
||||||
|
|
||||||
|
|
||||||
/// getPHIInstruction - Return the designated PHI instruction.
|
|
||||||
///
|
|
||||||
const CodeGenInstruction &getPHIInstruction() const;
|
|
||||||
|
|
||||||
/// isLittleEndianEncoding - are instruction bit patterns defined as [0..n]?
|
/// isLittleEndianEncoding - are instruction bit patterns defined as [0..n]?
|
||||||
///
|
///
|
||||||
bool isLittleEndianEncoding() const;
|
bool isLittleEndianEncoding() const;
|
||||||
|
Reference in New Issue
Block a user