mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-25 13:24:46 +00:00
[PowerPC] Add predicted forms of branches
This adds support for the predicted forms of branches (+/-). There are three cases to consider: - Branches using a PPC::Predicate code For these, I've added new PPC::Predicate codes corresponding to the BO values for predicted branch forms, and updated insn printing to print them correctly. I've also added new aliases for the asm parser matching the new forms. - bt/bf I've added new aliases matching to gBC etc. - bd(n)z variants I've added new instruction patterns for the predicted forms. In all cases, the new patterns are used for the asm parser only. (The new infrastructure ought to be sufficient to allow use by the compiler too at some point.) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184754 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -747,6 +747,22 @@ bool PPCAsmParser::
|
||||
ParseInstruction(ParseInstructionInfo &Info, StringRef Name, SMLoc NameLoc,
|
||||
SmallVectorImpl<MCParsedAsmOperand*> &Operands) {
|
||||
// The first operand is the token for the instruction name.
|
||||
// If the next character is a '+' or '-', we need to add it to the
|
||||
// instruction name, to match what TableGen is doing.
|
||||
if (getLexer().is(AsmToken::Plus)) {
|
||||
getLexer().Lex();
|
||||
char *NewOpcode = new char[Name.size() + 1];
|
||||
memcpy(NewOpcode, Name.data(), Name.size());
|
||||
NewOpcode[Name.size()] = '+';
|
||||
Name = StringRef(NewOpcode, Name.size() + 1);
|
||||
}
|
||||
if (getLexer().is(AsmToken::Minus)) {
|
||||
getLexer().Lex();
|
||||
char *NewOpcode = new char[Name.size() + 1];
|
||||
memcpy(NewOpcode, Name.data(), Name.size());
|
||||
NewOpcode[Name.size()] = '-';
|
||||
Name = StringRef(NewOpcode, Name.size() + 1);
|
||||
}
|
||||
// If the instruction ends in a '.', we need to create a separate
|
||||
// token for it, to match what TableGen is doing.
|
||||
size_t Dot = Name.find('.');
|
||||
|
Reference in New Issue
Block a user