Deleted Added
sdiff udiff text old ( 341825 ) new ( 344779 )
full compact
1//===- HexagonShuffler.cpp - Instruction bundle shuffling -----------------===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//

--- 124 unchanged lines hidden (view full) ---

133 (*TUL)[HexagonII::TypeCVI_GATHER] =
134 UnitsAndLanes(CVI_XLANE | CVI_SHIFT | CVI_MPY0 | CVI_MPY1, 1);
135 (*TUL)[HexagonII::TypeCVI_SCATTER] =
136 UnitsAndLanes(CVI_XLANE | CVI_SHIFT | CVI_MPY0 | CVI_MPY1, 1);
137 (*TUL)[HexagonII::TypeCVI_SCATTER_DV] =
138 UnitsAndLanes(CVI_XLANE | CVI_MPY0, 2);
139 (*TUL)[HexagonII::TypeCVI_SCATTER_NEW_ST] =
140 UnitsAndLanes(CVI_XLANE | CVI_SHIFT | CVI_MPY0 | CVI_MPY1, 1);
141}
142
143HexagonCVIResource::HexagonCVIResource(TypeUnitsAndLanes *TUL,
144 MCInstrInfo const &MCII, unsigned s,
145 MCInst const *id)
146 : HexagonResource(s) {
147 unsigned T = HexagonMCInstrInfo::getType(MCII, *id);
148

--- 146 unchanged lines hidden (view full) ---

295 slotThree = 0x8, // slotFirstJump = 0x8,
296 slotFirstLoadStore = 0x2, slotLastLoadStore = 0x1;
297 // Highest slots for branches and stores used to keep their original order.
298 // unsigned slotJump = slotFirstJump;
299 unsigned slotLoadStore = slotFirstLoadStore;
300 // Number of memory operations, loads, solo loads, stores, solo stores, single
301 // stores.
302 unsigned memory = 0, loads = 0, load0 = 0, stores = 0, store0 = 0, store1 = 0;
303 // Number of duplex insns
304 unsigned duplex = 0;
305 unsigned pSlot3Cnt = 0;
306 unsigned memops = 0;
307 iterator slot3ISJ = end();
308 std::vector<iterator> foundBranches;
309 unsigned reservedSlots = 0;
310

--- 15 unchanged lines hidden (view full) ---

326 case HexagonII::TypeJ:
327 foundBranches.push_back(ISJ);
328 break;
329 case HexagonII::TypeCVI_VM_VP_LDU:
330 case HexagonII::TypeCVI_VM_LD:
331 case HexagonII::TypeCVI_VM_TMP_LD:
332 case HexagonII::TypeCVI_GATHER:
333 case HexagonII::TypeCVI_GATHER_RST:
334 case HexagonII::TypeLD:
335 ++loads;
336 ++memory;
337 if (ISJ->Core.getUnits() == slotSingleLoad ||
338 HexagonMCInstrInfo::getType(MCII, ID) == HexagonII::TypeCVI_VM_VP_LDU)
339 ++load0;
340 if (HexagonMCInstrInfo::getDesc(MCII, ID).isReturn())
341 foundBranches.push_back(ISJ);
342 break;
343 case HexagonII::TypeCVI_VM_STU:
344 case HexagonII::TypeCVI_VM_ST:
345 case HexagonII::TypeCVI_VM_NEW_ST:
346 case HexagonII::TypeCVI_SCATTER:
347 case HexagonII::TypeCVI_SCATTER_DV:
348 case HexagonII::TypeCVI_SCATTER_RST:
349 case HexagonII::TypeCVI_SCATTER_NEW_RST:
350 case HexagonII::TypeCVI_SCATTER_NEW_ST:
351 case HexagonII::TypeST:
352 ++stores;
353 ++memory;
354 if (ISJ->Core.getUnits() == slotSingleStore ||
355 HexagonMCInstrInfo::getType(MCII, ID) == HexagonII::TypeCVI_VM_STU)
356 ++store0;
357 break;
358 case HexagonII::TypeV4LDST:

--- 41 unchanged lines hidden (view full) ---

400 foundBranches.push_back(ISJ);
401 break;
402 }
403 }
404 }
405 applySlotRestrictions();
406
407 // Check if the packet is legal.
408 if ((load0 > 1 || store0 > 1) || (duplex > 1 || (duplex && memory))) {
409 reportError(llvm::Twine("invalid instruction packet"));
410 return false;
411 }
412
413 // Modify packet accordingly.
414 // TODO: need to reserve slots #0 and #1 for duplex insns.
415 bool bOnlySlot3 = false;
416 for (iterator ISJ = begin(); ISJ != end(); ++ISJ) {

--- 249 unchanged lines hidden ---