mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-13 20:32:21 +00:00
Thumb parsing and encoding for RSB.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138308 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
8e1e60b5f8
commit
934755ac04
@ -3029,6 +3029,19 @@ bool ARMAsmParser::ParseInstruction(StringRef Name, SMLoc NameLoc,
|
||||
delete Op;
|
||||
}
|
||||
}
|
||||
// Similarly, the Thumb1 "RSB" instruction has a literal "#0" on the
|
||||
// end. Convert it to a token here.
|
||||
if (Mnemonic == "rsb" && isThumb() && Operands.size() == 6 &&
|
||||
static_cast<ARMOperand*>(Operands[5])->isImm()) {
|
||||
ARMOperand *Op = static_cast<ARMOperand*>(Operands[5]);
|
||||
const MCConstantExpr *CE = dyn_cast<MCConstantExpr>(Op->getImm());
|
||||
if (CE && CE->getValue() == 0) {
|
||||
Operands.erase(Operands.begin() + 5);
|
||||
Operands.push_back(ARMOperand::CreateToken("#0", Op->getStartLoc()));
|
||||
delete Op;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -399,3 +399,11 @@ _func:
|
||||
rors r2, r7
|
||||
|
||||
@ CHECK: rors r2, r7 @ encoding: [0xfa,0x41]
|
||||
|
||||
|
||||
@------------------------------------------------------------------------------
|
||||
@ RSB
|
||||
@------------------------------------------------------------------------------
|
||||
rsbs r1, r3, #0
|
||||
|
||||
rsbs r1, r3, #0 @ encoding: [0x59,0x42]
|
||||
|
Loading…
Reference in New Issue
Block a user