mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-30 04:35:00 +00:00
Support a valid, but not very useful, encoding of CPSIE where none of the AIF bits are set.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141190 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
b73a8414a7
commit
2dbb46a0a0
@ -2085,20 +2085,24 @@ parseProcIFlagsOperand(SmallVectorImpl<MCParsedAsmOperand*> &Operands) {
|
||||
assert(Tok.is(AsmToken::Identifier) && "Token is not an Identifier");
|
||||
StringRef IFlagsStr = Tok.getString();
|
||||
|
||||
// An iflags string of "none" is interpreted to mean that none of the AIF
|
||||
// bits are set. Not a terribly useful instruction, but a valid encoding.
|
||||
unsigned IFlags = 0;
|
||||
for (int i = 0, e = IFlagsStr.size(); i != e; ++i) {
|
||||
unsigned Flag = StringSwitch<unsigned>(IFlagsStr.substr(i, 1))
|
||||
.Case("a", ARM_PROC::A)
|
||||
.Case("i", ARM_PROC::I)
|
||||
.Case("f", ARM_PROC::F)
|
||||
.Default(~0U);
|
||||
if (IFlagsStr != "none") {
|
||||
for (int i = 0, e = IFlagsStr.size(); i != e; ++i) {
|
||||
unsigned Flag = StringSwitch<unsigned>(IFlagsStr.substr(i, 1))
|
||||
.Case("a", ARM_PROC::A)
|
||||
.Case("i", ARM_PROC::I)
|
||||
.Case("f", ARM_PROC::F)
|
||||
.Default(~0U);
|
||||
|
||||
// If some specific iflag is already set, it means that some letter is
|
||||
// present more than once, this is not acceptable.
|
||||
if (Flag == ~0U || (IFlags & Flag))
|
||||
return MatchOperand_NoMatch;
|
||||
// If some specific iflag is already set, it means that some letter is
|
||||
// present more than once, this is not acceptable.
|
||||
if (Flag == ~0U || (IFlags & Flag))
|
||||
return MatchOperand_NoMatch;
|
||||
|
||||
IFlags |= Flag;
|
||||
IFlags |= Flag;
|
||||
}
|
||||
}
|
||||
|
||||
Parser.Lex(); // Eat identifier token.
|
||||
|
@ -624,6 +624,9 @@ void ARMInstPrinter::printCPSIFlag(const MCInst *MI, unsigned OpNum,
|
||||
for (int i=2; i >= 0; --i)
|
||||
if (IFlags & (1 << i))
|
||||
O << ARM_PROC::IFlagsToString(1 << i);
|
||||
|
||||
if (IFlags == 0)
|
||||
O << "none";
|
||||
}
|
||||
|
||||
void ARMInstPrinter::printMSRMaskOperand(const MCInst *MI, unsigned OpNum,
|
||||
|
@ -71,3 +71,6 @@
|
||||
@ CHECK: ssat16 r0, #7, r0 @ encoding: [0x30,0x0f,0xa6,0xe6]
|
||||
ssat16 r0, #7, r0
|
||||
|
||||
@ CHECK: cpsie none, #0 @ encoding: [0x00,0x00,0x0a,0xf1]
|
||||
cpsie none, #0
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user