[Hexagon] Apply tiny core packet size slots limit

This commit is contained in:
Brian Cain 2018-05-03 11:04:26 -05:00 committed by Krzysztof Parzyszek
parent a247360173
commit 1f71e46f2a
3 changed files with 14 additions and 14 deletions

View File

@ -378,18 +378,8 @@ bool HexagonMCChecker::checkCOFMax1() {
}
bool HexagonMCChecker::checkSlots() {
unsigned slotsUsed = 0;
for (auto HMI : HexagonMCInstrInfo::bundleInstructions(MCB)) {
MCInst const &MCI = *HMI.getInst();
if (HexagonMCInstrInfo::isImmext(MCI))
continue;
if (HexagonMCInstrInfo::isDuplex(MCII, MCI))
slotsUsed += 2;
else
++slotsUsed;
}
if (slotsUsed > HEXAGON_PACKET_SIZE) {
if (HexagonMCInstrInfo::slotsConsumed(MCII, STI, MCB) >
HexagonMCInstrInfo::packetSizeSlots(STI)) {
reportError("invalid instruction packet: out of slots");
return false;
}

View File

@ -326,8 +326,7 @@ unsigned packetSizeSlots(MCSubtargetInfo const &STI);
unsigned slotsConsumed(MCInstrInfo const &MCII, MCSubtargetInfo const &STI,
MCInst const &MCI);
// Pad the bundle with nops to satisfy endloop requirements
// Pad the bundle with nops to satisfy endloop requirements.
void padEndloop(MCInst &MCI, MCContext &Context);
class PredicateInfo {
public:

View File

@ -0,0 +1,11 @@
# RUN: not llvm-mc -arch=hexagon -filetype=asm %s 2>%t; FileCheck %s < %t
.L_:
{
loop0(.L_,r2);
r7=r1;
r5=mpyi(r1,#64);
r6=#0;
nop;
}
# CHECK: rror: invalid instruction packet: out of slots