mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-14 11:32:34 +00:00
ARM ldm/stm register lists can be out of order.
It's not a good style idea, as the registers will be laid down in memory in numerical order, not the order they're in the list, but it's legal. vldm/vstm are stricter. rdar://11064740 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152943 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
0ccae0b1f6
commit
be7cf2b377
@ -2854,8 +2854,12 @@ parseRegisterList(SmallVectorImpl<MCParsedAsmOperand*> &Operands) {
|
||||
if (!RC->contains(Reg))
|
||||
return Error(RegLoc, "invalid register in register list");
|
||||
// List must be monotonically increasing.
|
||||
if (getARMRegisterNumbering(Reg) < getARMRegisterNumbering(OldReg))
|
||||
return Error(RegLoc, "register list not in ascending order");
|
||||
if (getARMRegisterNumbering(Reg) < getARMRegisterNumbering(OldReg)) {
|
||||
if (ARMMCRegisterClasses[ARM::GPRRegClassID].contains(Reg))
|
||||
Warning(RegLoc, "register list not in ascending order");
|
||||
else
|
||||
return Error(RegLoc, "register list not in ascending order");
|
||||
}
|
||||
if (getARMRegisterNumbering(Reg) == getARMRegisterNumbering(OldReg)) {
|
||||
Warning(RegLoc, "duplicated register (" + RegTok.getString() +
|
||||
") in register list");
|
||||
|
@ -216,7 +216,7 @@
|
||||
@ Out of order STM registers
|
||||
stmda sp!, {r5, r2}
|
||||
|
||||
@ CHECK-ERRORS: error: register list not in ascending order
|
||||
@ CHECK-ERRORS: warning: register list not in ascending order
|
||||
@ CHECK-ERRORS: stmda sp!, {r5, r2}
|
||||
@ CHECK-ERRORS: ^
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user