llvm.org GIT mirror llvm / 59e648e
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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194512 91177308-0d34-0410-b5e6-96231b3b80d8 Tim Northover 6 years ago
2 changed file(s) with 21 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
54805480 "writeback register not allowed in register list");
54815481 break;
54825482 }
5483 case ARM::sysLDMIA_UPD:
5484 case ARM::sysLDMDA_UPD:
5485 case ARM::sysLDMDB_UPD:
5486 case ARM::sysLDMIB_UPD:
5487 if (!listContainsReg(Inst, 3, ARM::PC))
5488 return Error(Operands[4]->getStartLoc(),
5489 "writeback register only allowed on system LDM "
5490 "if PC in register-list");
5491 break;
5492 case ARM::sysSTMIA_UPD:
5493 case ARM::sysSTMDA_UPD:
5494 case ARM::sysSTMDB_UPD:
5495 case ARM::sysSTMIB_UPD:
5496 return Error(Operands[2]->getStartLoc(),
5497 "system STM cannot have writeback register");
5498 break;
54835499 case ARM::tMUL: {
54845500 // The second source operand must be the same register as the destination
54855501 // operand.
459459 @ CHECK-ERRORS: error: instruction requires: FPARMv8
460460 @ CHECK-ERRORS: error: instruction requires: FPARMv8
461461 @ CHECK-ERRORS: error: instruction requires: FPARMv8
463 stm sp!, {r0, pc}^
464 ldm sp!, {r0}^
465 @ CHECK-ERRORS: error: system STM cannot have writeback register
466 @ CHECK-ERRORS: error: writeback register only allowed on system LDM if PC in register-list