mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-23 02:29:18 +00:00
Follow the current hack set and enable the correct parsing of bkpt while in thumb mode.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123772 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
435b4d2eba
commit
fdcee77887
@ -81,6 +81,8 @@ class ARMAsmParser : public TargetAsmParser {
|
|||||||
bool MatchAndEmitInstruction(SMLoc IDLoc,
|
bool MatchAndEmitInstruction(SMLoc IDLoc,
|
||||||
SmallVectorImpl<MCParsedAsmOperand*> &Operands,
|
SmallVectorImpl<MCParsedAsmOperand*> &Operands,
|
||||||
MCStreamer &Out);
|
MCStreamer &Out);
|
||||||
|
void GetMnemonicAcceptInfo(StringRef Mnemonic, bool &CanAcceptCarrySet,
|
||||||
|
bool &CanAcceptPredicationCode);
|
||||||
|
|
||||||
/// @name Auto-generated Match Functions
|
/// @name Auto-generated Match Functions
|
||||||
/// {
|
/// {
|
||||||
@ -1169,8 +1171,11 @@ static StringRef SplitMnemonicAndCC(StringRef Mnemonic,
|
|||||||
/// inclusion of carry set or predication code operands.
|
/// inclusion of carry set or predication code operands.
|
||||||
//
|
//
|
||||||
// FIXME: It would be nice to autogen this.
|
// FIXME: It would be nice to autogen this.
|
||||||
static void GetMnemonicAcceptInfo(StringRef Mnemonic, bool &CanAcceptCarrySet,
|
void ARMAsmParser::
|
||||||
|
GetMnemonicAcceptInfo(StringRef Mnemonic, bool &CanAcceptCarrySet,
|
||||||
bool &CanAcceptPredicationCode) {
|
bool &CanAcceptPredicationCode) {
|
||||||
|
bool isThumb = TM.getSubtarget<ARMSubtarget>().isThumb();
|
||||||
|
|
||||||
if (Mnemonic == "and" || Mnemonic == "lsl" || Mnemonic == "lsr" ||
|
if (Mnemonic == "and" || Mnemonic == "lsl" || Mnemonic == "lsr" ||
|
||||||
Mnemonic == "rrx" || Mnemonic == "ror" || Mnemonic == "sub" ||
|
Mnemonic == "rrx" || Mnemonic == "ror" || Mnemonic == "sub" ||
|
||||||
Mnemonic == "smull" || Mnemonic == "add" || Mnemonic == "adc" ||
|
Mnemonic == "smull" || Mnemonic == "add" || Mnemonic == "adc" ||
|
||||||
@ -1188,7 +1193,8 @@ static void GetMnemonicAcceptInfo(StringRef Mnemonic, bool &CanAcceptCarrySet,
|
|||||||
Mnemonic == "cps" || Mnemonic == "mcr2" || Mnemonic == "it" ||
|
Mnemonic == "cps" || Mnemonic == "mcr2" || Mnemonic == "it" ||
|
||||||
Mnemonic == "mcrr2" || Mnemonic == "cbz" || Mnemonic == "cdp2" ||
|
Mnemonic == "mcrr2" || Mnemonic == "cbz" || Mnemonic == "cdp2" ||
|
||||||
Mnemonic == "trap" || Mnemonic == "mrc2" || Mnemonic == "mrrc2" ||
|
Mnemonic == "trap" || Mnemonic == "mrc2" || Mnemonic == "mrrc2" ||
|
||||||
Mnemonic == "dsb" || Mnemonic == "movs") {
|
Mnemonic == "dsb" || Mnemonic == "movs" ||
|
||||||
|
(isThumb && Mnemonic == "bkpt")) {
|
||||||
CanAcceptPredicationCode = false;
|
CanAcceptPredicationCode = false;
|
||||||
} else {
|
} else {
|
||||||
CanAcceptPredicationCode = true;
|
CanAcceptPredicationCode = true;
|
||||||
|
@ -127,3 +127,6 @@
|
|||||||
|
|
||||||
@ CHECK: bfi r0, r0, #5, #7 @ encoding: [0x90,0x02,0xcb,0xe7]
|
@ CHECK: bfi r0, r0, #5, #7 @ encoding: [0x90,0x02,0xcb,0xe7]
|
||||||
bfi r0, r0, #5, #7
|
bfi r0, r0, #5, #7
|
||||||
|
|
||||||
|
@ CHECK: bkpt #10 @ encoding: [0x7a,0x00,0x20,0xe1]
|
||||||
|
bkpt #10
|
||||||
|
@ -35,3 +35,6 @@
|
|||||||
|
|
||||||
@ CHECK: ldr r3, [r1, r2] @ encoding: [0x8b,0x58]
|
@ CHECK: ldr r3, [r1, r2] @ encoding: [0x8b,0x58]
|
||||||
ldr r3, [r1, r2]
|
ldr r3, [r1, r2]
|
||||||
|
|
||||||
|
@ CHECK: bkpt #2 @ encoding: [0x02,0xbe]
|
||||||
|
bkpt #2
|
||||||
|
Loading…
Reference in New Issue
Block a user