mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-25 13:24:46 +00:00
[Sparc] Emit correct encoding for atomic instructions. Also, add support for parsing CAS instructions to test the CAS encoding.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200963 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -546,7 +546,24 @@ parseOperand(SmallVectorImpl<MCParsedAsmOperand*> &Operands,
|
||||
Parser.getTok().getLoc()));
|
||||
Parser.Lex(); // Eat the [
|
||||
|
||||
ResTy = parseMEMOperand(Operands);
|
||||
if (Mnemonic == "cas" || Mnemonic == "casx") {
|
||||
SMLoc S = Parser.getTok().getLoc();
|
||||
if (getLexer().getKind() != AsmToken::Percent)
|
||||
return MatchOperand_NoMatch;
|
||||
Parser.Lex(); // eat %
|
||||
|
||||
unsigned RegNo, RegKind;
|
||||
if (!matchRegisterName(Parser.getTok(), RegNo, RegKind))
|
||||
return MatchOperand_NoMatch;
|
||||
|
||||
Parser.Lex(); // Eat the identifier token.
|
||||
SMLoc E = SMLoc::getFromPointer(Parser.getTok().getLoc().getPointer()-1);
|
||||
Operands.push_back(SparcOperand::CreateReg(RegNo, RegKind, S, E));
|
||||
ResTy = MatchOperand_Success;
|
||||
} else {
|
||||
ResTy = parseMEMOperand(Operands);
|
||||
}
|
||||
|
||||
if (ResTy != MatchOperand_Success)
|
||||
return ResTy;
|
||||
|
||||
|
Reference in New Issue
Block a user