mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-06 06:33:24 +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,7 +2085,10 @@ parseProcIFlagsOperand(SmallVectorImpl<MCParsedAsmOperand*> &Operands) {
|
|||||||
assert(Tok.is(AsmToken::Identifier) && "Token is not an Identifier");
|
assert(Tok.is(AsmToken::Identifier) && "Token is not an Identifier");
|
||||||
StringRef IFlagsStr = Tok.getString();
|
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;
|
unsigned IFlags = 0;
|
||||||
|
if (IFlagsStr != "none") {
|
||||||
for (int i = 0, e = IFlagsStr.size(); i != e; ++i) {
|
for (int i = 0, e = IFlagsStr.size(); i != e; ++i) {
|
||||||
unsigned Flag = StringSwitch<unsigned>(IFlagsStr.substr(i, 1))
|
unsigned Flag = StringSwitch<unsigned>(IFlagsStr.substr(i, 1))
|
||||||
.Case("a", ARM_PROC::A)
|
.Case("a", ARM_PROC::A)
|
||||||
@ -2100,6 +2103,7 @@ parseProcIFlagsOperand(SmallVectorImpl<MCParsedAsmOperand*> &Operands) {
|
|||||||
|
|
||||||
IFlags |= Flag;
|
IFlags |= Flag;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Parser.Lex(); // Eat identifier token.
|
Parser.Lex(); // Eat identifier token.
|
||||||
Operands.push_back(ARMOperand::CreateProcIFlags((ARM_PROC::IFlags)IFlags, S));
|
Operands.push_back(ARMOperand::CreateProcIFlags((ARM_PROC::IFlags)IFlags, S));
|
||||||
|
@ -624,6 +624,9 @@ void ARMInstPrinter::printCPSIFlag(const MCInst *MI, unsigned OpNum,
|
|||||||
for (int i=2; i >= 0; --i)
|
for (int i=2; i >= 0; --i)
|
||||||
if (IFlags & (1 << i))
|
if (IFlags & (1 << i))
|
||||||
O << ARM_PROC::IFlagsToString(1 << i);
|
O << ARM_PROC::IFlagsToString(1 << i);
|
||||||
|
|
||||||
|
if (IFlags == 0)
|
||||||
|
O << "none";
|
||||||
}
|
}
|
||||||
|
|
||||||
void ARMInstPrinter::printMSRMaskOperand(const MCInst *MI, unsigned OpNum,
|
void ARMInstPrinter::printMSRMaskOperand(const MCInst *MI, unsigned OpNum,
|
||||||
|
@ -71,3 +71,6 @@
|
|||||||
@ CHECK: ssat16 r0, #7, r0 @ encoding: [0x30,0x0f,0xa6,0xe6]
|
@ CHECK: ssat16 r0, #7, r0 @ encoding: [0x30,0x0f,0xa6,0xe6]
|
||||||
ssat16 r0, #7, r0
|
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