mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-23 11:13:28 +01:00
ARM: diagnose invalid system LDM/STM
The system LDM and STM instructions can't usually writeback to the base register. The one exception is when an LDM is actually an exception-return (i.e. contains PC in the register list). (There's already a test that "ldm sp!, {r0-r3, pc}^" works, which is why there is no positive test). rdar://problem/15223374 llvm-svn: 194512
This commit is contained in:
parent
6a7ac370ae
commit
872e6a81fc
@ -5481,6 +5481,22 @@ validateInstruction(MCInst &Inst,
|
||||
"writeback register not allowed in register list");
|
||||
break;
|
||||
}
|
||||
case ARM::sysLDMIA_UPD:
|
||||
case ARM::sysLDMDA_UPD:
|
||||
case ARM::sysLDMDB_UPD:
|
||||
case ARM::sysLDMIB_UPD:
|
||||
if (!listContainsReg(Inst, 3, ARM::PC))
|
||||
return Error(Operands[4]->getStartLoc(),
|
||||
"writeback register only allowed on system LDM "
|
||||
"if PC in register-list");
|
||||
break;
|
||||
case ARM::sysSTMIA_UPD:
|
||||
case ARM::sysSTMDA_UPD:
|
||||
case ARM::sysSTMDB_UPD:
|
||||
case ARM::sysSTMIB_UPD:
|
||||
return Error(Operands[2]->getStartLoc(),
|
||||
"system STM cannot have writeback register");
|
||||
break;
|
||||
case ARM::tMUL: {
|
||||
// The second source operand must be the same register as the destination
|
||||
// operand.
|
||||
|
@ -460,3 +460,8 @@
|
||||
@ CHECK-ERRORS: error: instruction requires: FPARMv8
|
||||
@ CHECK-ERRORS: error: instruction requires: FPARMv8
|
||||
@ CHECK-ERRORS: error: instruction requires: FPARMv8
|
||||
|
||||
stm sp!, {r0, pc}^
|
||||
ldm sp!, {r0}^
|
||||
@ CHECK-ERRORS: error: system STM cannot have writeback register
|
||||
@ CHECK-ERRORS: error: writeback register only allowed on system LDM if PC in register-list
|
||||
|
Loading…
Reference in New Issue
Block a user