29 #define GET_INSTRINFO_CTOR_DTOR
30 #define GET_INSTRMAP_INFO
31 #include "HexagonGenInstrInfo.inc"
32 #include "HexagonGenDFAPacketizer.inc"
59 void HexagonInstrInfo::anchor() {}
63 RI(ST), Subtarget(ST) {
124 int BOpc = Hexagon::JMP;
125 int BccOpc = Hexagon::JMP_t;
127 assert(TBB &&
"InsertBranch must not be told to insert a fallthrough");
133 if (!Cond.
empty() && Cond[0].isImm() && Cond[0].getImm() == 0) {
134 BccOpc = Hexagon::JMP_f;
151 if (NewTBB == NextBB) {
176 bool AllowModify)
const {
206 while (I->isDebugValue()) {
213 if (AllowModify && I->getOpcode() == Hexagon::JMP &&
215 DEBUG(
dbgs()<<
"\nErasing the jump to successor block\n";);
216 I->eraseFromParent();
222 if (!isUnpredicatedTerminator(I))
230 if (&*I != LastInst && !I->
isBundle() && isUnpredicatedTerminator(I)) {
248 if (LastInst && !SecondLastInst) {
249 if (LastOpcode == Hexagon::JMP) {
253 if (LastOpcode == Hexagon::ENDLOOP0) {
258 if (LastOpcodeHasJMP_c) {
260 if (LastOpcodeHasNot) {
270 int SecLastOpcode = SecondLastInst->
getOpcode();
274 if (SecLastOpcodeHasJMP_c && (LastOpcode == Hexagon::JMP)) {
276 if (SecLastOpcodeHasNot)
285 if (SecLastOpcode == Hexagon::JMP && LastOpcode == Hexagon::JMP) {
294 if (SecLastOpcode == Hexagon::ENDLOOP0 &&
295 LastOpcode == Hexagon::JMP) {
308 int BOpc = Hexagon::JMP;
309 int BccOpc = Hexagon::JMP_t;
310 int BccOpcNot = Hexagon::JMP_f;
313 if (I == MBB.
begin())
return 0;
315 if (I->getOpcode() != BOpc && I->getOpcode() != BccOpc &&
316 I->getOpcode() != BccOpcNot)
320 I->eraseFromParent();
324 if (I == MBB.
begin())
return 1;
326 if (I->getOpcode() != BccOpc && I->getOpcode() != BccOpcNot)
330 I->eraseFromParent();
340 unsigned &SrcReg,
unsigned &SrcReg2,
341 int &Mask,
int &
Value)
const {
346 case Hexagon::CMPEHexagon4rr:
347 case Hexagon::CMPEQri:
348 case Hexagon::CMPEQrr:
349 case Hexagon::CMPGT64rr:
350 case Hexagon::CMPGTU64rr:
351 case Hexagon::CMPGTUri:
352 case Hexagon::CMPGTUrr:
353 case Hexagon::CMPGTri:
354 case Hexagon::CMPGTrr:
358 case Hexagon::CMPbEQri_V4:
359 case Hexagon::CMPbEQrr_sbsb_V4:
360 case Hexagon::CMPbEQrr_ubub_V4:
361 case Hexagon::CMPbGTUri_V4:
362 case Hexagon::CMPbGTUrr_V4:
363 case Hexagon::CMPbGTrr_V4:
367 case Hexagon::CMPhEQri_V4:
368 case Hexagon::CMPhEQrr_shl_V4:
369 case Hexagon::CMPhEQrr_xor_V4:
370 case Hexagon::CMPhGTUri_V4:
371 case Hexagon::CMPhGTUrr_V4:
372 case Hexagon::CMPhGTrr_shl_V4:
380 case Hexagon::CMPEHexagon4rr:
381 case Hexagon::CMPEQrr:
382 case Hexagon::CMPGT64rr:
383 case Hexagon::CMPGTU64rr:
384 case Hexagon::CMPGTUrr:
385 case Hexagon::CMPGTrr:
386 case Hexagon::CMPbEQrr_sbsb_V4:
387 case Hexagon::CMPbEQrr_ubub_V4:
388 case Hexagon::CMPbGTUrr_V4:
389 case Hexagon::CMPbGTrr_V4:
390 case Hexagon::CMPhEQrr_shl_V4:
391 case Hexagon::CMPhEQrr_xor_V4:
392 case Hexagon::CMPhGTUrr_V4:
393 case Hexagon::CMPhGTrr_shl_V4:
397 case Hexagon::CMPEQri:
398 case Hexagon::CMPGTUri:
399 case Hexagon::CMPGTri:
400 case Hexagon::CMPbEQri_V4:
401 case Hexagon::CMPbGTUri_V4:
402 case Hexagon::CMPhEQri_V4:
403 case Hexagon::CMPhGTUri_V4:
415 unsigned DestReg,
unsigned SrcReg,
416 bool KillSrc)
const {
417 if (Hexagon::IntRegsRegClass.contains(SrcReg, DestReg)) {
418 BuildMI(MBB, I, DL,
get(Hexagon::TFR), DestReg).
addReg(SrcReg);
421 if (Hexagon::DoubleRegsRegClass.contains(SrcReg, DestReg)) {
422 BuildMI(MBB, I, DL,
get(Hexagon::TFR64), DestReg).
addReg(SrcReg);
425 if (Hexagon::PredRegsRegClass.contains(SrcReg, DestReg)) {
427 BuildMI(MBB, I, DL,
get(Hexagon::OR_pp),
431 if (Hexagon::DoubleRegsRegClass.contains(DestReg) &&
432 Hexagon::IntRegsRegClass.contains(SrcReg)) {
434 if(SrcReg == RI.getSubReg(DestReg, Hexagon::subreg_loreg)) {
436 BuildMI(MBB, I, DL,
get(Hexagon::TFRI), (RI.getSubReg(DestReg,
437 Hexagon::subreg_hireg))).
addImm(0);
440 BuildMI(MBB, I, DL,
get(Hexagon::TFR), (RI.getSubReg(DestReg,
441 Hexagon::subreg_loreg))).
addReg(SrcReg);
442 BuildMI(MBB, I, DL,
get(Hexagon::TFRI), (RI.getSubReg(DestReg,
443 Hexagon::subreg_hireg))).
addImm(0);
447 if (Hexagon::CRRegsRegClass.contains(DestReg) &&
448 Hexagon::IntRegsRegClass.contains(SrcReg)) {
449 BuildMI(MBB, I, DL,
get(Hexagon::TFCR), DestReg).
addReg(SrcReg);
452 if (Hexagon::PredRegsRegClass.contains(SrcReg) &&
453 Hexagon::IntRegsRegClass.contains(DestReg)) {
454 BuildMI(MBB, I, DL,
get(Hexagon::TFR_RsPd), DestReg).
458 if (Hexagon::IntRegsRegClass.contains(SrcReg) &&
459 Hexagon::PredRegsRegClass.contains(DestReg)) {
460 BuildMI(MBB, I, DL,
get(Hexagon::TFR_PdRs), DestReg).
471 unsigned SrcReg,
bool isKill,
int FI,
487 if (Hexagon::IntRegsRegClass.hasSubClassEq(RC)) {
488 BuildMI(MBB, I, DL,
get(Hexagon::STriw))
491 }
else if (Hexagon::DoubleRegsRegClass.hasSubClassEq(RC)) {
492 BuildMI(MBB, I, DL,
get(Hexagon::STrid))
495 }
else if (Hexagon::PredRegsRegClass.hasSubClassEq(RC)) {
496 BuildMI(MBB, I, DL,
get(Hexagon::STriw_pred))
518 unsigned DestReg,
int FI,
532 if (RC == &Hexagon::IntRegsRegClass) {
533 BuildMI(MBB, I, DL,
get(Hexagon::LDriw), DestReg)
535 }
else if (RC == &Hexagon::DoubleRegsRegClass) {
536 BuildMI(MBB, I, DL,
get(Hexagon::LDrid), DestReg)
538 }
else if (RC == &Hexagon::PredRegsRegClass) {
539 BuildMI(MBB, I, DL,
get(Hexagon::LDriw_pred), DestReg)
568 TRC = &Hexagon::PredRegsRegClass;
570 TRC = &Hexagon::IntRegsRegClass;
572 TRC = &Hexagon::DoubleRegsRegClass;
595 case Hexagon::TFR_FI:
636 return MI->
getOpcode() == Hexagon::SAVE_REGISTERS_CALL_V4;
652 case Hexagon::STrid_indexed:
656 case Hexagon::STriw_indexed:
657 case Hexagon::STriw_nv_V4:
661 case Hexagon::STrih_indexed:
662 case Hexagon::STrih_nv_V4:
666 case Hexagon::STrib_indexed:
667 case Hexagon::STrib_nv_V4:
671 case Hexagon::LDrid_indexed:
675 case Hexagon::LDriw_indexed:
679 case Hexagon::LDriuh:
680 case Hexagon::LDrih_indexed:
681 case Hexagon::LDriuh_indexed:
685 case Hexagon::LDriub:
686 case Hexagon::LDrib_indexed:
687 case Hexagon::LDriub_indexed:
690 case Hexagon::POST_LDrid:
693 case Hexagon::POST_LDriw:
696 case Hexagon::POST_LDrih:
697 case Hexagon::POST_LDriuh:
700 case Hexagon::POST_LDrib:
701 case Hexagon::POST_LDriub:
704 case Hexagon::STrib_imm_V4:
705 case Hexagon::STrih_imm_V4:
706 case Hexagon::STriw_imm_V4:
710 case Hexagon::ADD_ri:
733 : Hexagon::getTruePredOpcode(Opc);
734 if (InvPredOpcode >= 0)
735 return InvPredOpcode;
739 case Hexagon::COMBINE_rr_cPt:
740 return Hexagon::COMBINE_rr_cNotPt;
741 case Hexagon::COMBINE_rr_cNotPt:
742 return Hexagon::COMBINE_rr_cPt;
745 case Hexagon::DEALLOC_RET_cPt_V4:
746 return Hexagon::DEALLOC_RET_cNotPt_V4;
747 case Hexagon::DEALLOC_RET_cNotPt_V4:
748 return Hexagon::DEALLOC_RET_cPt_V4;
760 const uint64_t
F =
get(Opcode).TSFlags;
765 int HexagonInstrInfo::
766 getMatchingCondBranchOpcode(
int Opc,
bool invertPredicate)
const {
767 enum Hexagon::PredSense inPredSense;
768 inPredSense = invertPredicate ? Hexagon::PredSense_false :
769 Hexagon::PredSense_true;
770 int CondOpcode = Hexagon::getPredOpcode(Opc, inPredSense);
777 case Hexagon::TFRI_f:
778 return !invertPredicate ? Hexagon::TFRI_cPt_f :
779 Hexagon::TFRI_cNotPt_f;
780 case Hexagon::COMBINE_rr:
781 return !invertPredicate ? Hexagon::COMBINE_rr_cPt :
782 Hexagon::COMBINE_rr_cNotPt;
785 case Hexagon::STriw_f:
786 return !invertPredicate ? Hexagon::STriw_cPt :
787 Hexagon::STriw_cNotPt;
788 case Hexagon::STriw_indexed_f:
789 return !invertPredicate ? Hexagon::STriw_indexed_cPt :
790 Hexagon::STriw_indexed_cNotPt;
793 case Hexagon::DEALLOC_RET_V4:
794 return !invertPredicate ? Hexagon::DEALLOC_RET_cPt_V4 :
795 Hexagon::DEALLOC_RET_cNotPt_V4;
805 assert (
isPredicable(MI) &&
"Expected predicable instruction");
806 bool invertJump = (!Cond.
empty() && Cond[0].isImm() &&
807 (Cond[0].getImm() == 0));
812 MI->
setDesc(
get(getMatchingCondBranchOpcode(Opc, invertJump)));
815 unsigned int GAIdx = 0;
818 bool hasGAOpnd =
false;
819 std::vector<MachineOperand> tmpOpnds;
822 bool needShift =
true;
879 else if (MO.
isImm()) {
884 assert(hasGAOpnd ==
false &&
"MI can only have one GlobalAddress opnd");
892 tmpOpnds.push_back(MO);
901 assert(
false &&
"Unexpected operand type");
906 int regPos = invertJump ? 1 : 0;
915 if (oper < -1) oper = -1;
943 for (i = 0; i < tmpOpnds.size(); ++i)
955 unsigned ExtraPredCycles,
965 unsigned ExtraTCycles,
968 unsigned ExtraFCycles,
986 const uint64_t
F =
get(Opcode).TSFlags;
1000 const uint64_t
F =
get(Opcode).TSFlags;
1016 const uint64_t
F =
get(Opcode).TSFlags;
1034 std::vector<MachineOperand> &Pred)
const {
1039 if (RC == &Hexagon::PredRegsRegClass) {
1064 if (!Cond.
empty() && Cond[0].isImm() && Cond[0].getImm() == 0) {
1076 return (NumInstrs <= 4);
1081 default:
return false;
1082 case Hexagon::DEALLOC_RET_V4 :
1083 case Hexagon::DEALLOC_RET_cPt_V4 :
1084 case Hexagon::DEALLOC_RET_cNotPt_V4 :
1085 case Hexagon::DEALLOC_RET_cdnPnt_V4 :
1086 case Hexagon::DEALLOC_RET_cNotdnPnt_V4 :
1087 case Hexagon::DEALLOC_RET_cdnPt_V4 :
1088 case Hexagon::DEALLOC_RET_cNotdnPt_V4 :
1107 case Hexagon::LDriw:
1108 case Hexagon::LDriw_indexed:
1109 case Hexagon::LDriw_f:
1110 case Hexagon::STriw_indexed:
1111 case Hexagon::STriw:
1112 case Hexagon::STriw_f:
1116 case Hexagon::LDrid:
1117 case Hexagon::LDrid_indexed:
1118 case Hexagon::LDrid_f:
1119 case Hexagon::STrid:
1120 case Hexagon::STrid_indexed:
1121 case Hexagon::STrid_f:
1125 case Hexagon::LDrih:
1126 case Hexagon::LDriuh:
1127 case Hexagon::STrih:
1131 case Hexagon::LDrib:
1132 case Hexagon::STrib:
1133 case Hexagon::LDriub:
1137 case Hexagon::ADD_ri:
1138 case Hexagon::TFR_FI:
1142 case Hexagon::MemOPw_ADDi_V4 :
1143 case Hexagon::MemOPw_SUBi_V4 :
1144 case Hexagon::MemOPw_ADDr_V4 :
1145 case Hexagon::MemOPw_SUBr_V4 :
1146 case Hexagon::MemOPw_ANDr_V4 :
1147 case Hexagon::MemOPw_ORr_V4 :
1148 return (0 <= Offset && Offset <= 255);
1150 case Hexagon::MemOPh_ADDi_V4 :
1151 case Hexagon::MemOPh_SUBi_V4 :
1152 case Hexagon::MemOPh_ADDr_V4 :
1153 case Hexagon::MemOPh_SUBr_V4 :
1154 case Hexagon::MemOPh_ANDr_V4 :
1155 case Hexagon::MemOPh_ORr_V4 :
1156 return (0 <= Offset && Offset <= 127);
1158 case Hexagon::MemOPb_ADDi_V4 :
1159 case Hexagon::MemOPb_SUBi_V4 :
1160 case Hexagon::MemOPb_ADDr_V4 :
1161 case Hexagon::MemOPb_SUBr_V4 :
1162 case Hexagon::MemOPb_ANDr_V4 :
1163 case Hexagon::MemOPb_ORr_V4 :
1164 return (0 <= Offset && Offset <= 63);
1168 case Hexagon::STriw_pred:
1169 case Hexagon::LDriw_pred:
1172 case Hexagon::LOOP0_i:
1173 return isUInt<10>(Offset);
1181 "Please define it in the above switch statement!");
1194 (Offset & 0x7) == 0);
1199 (Offset & 0x3) == 0);
1204 (Offset & 0x1) == 0);
1220 default:
return false;
1221 case Hexagon::MemOPw_ADDi_V4 :
1222 case Hexagon::MemOPw_SUBi_V4 :
1223 case Hexagon::MemOPw_ADDr_V4 :
1224 case Hexagon::MemOPw_SUBr_V4 :
1225 case Hexagon::MemOPw_ANDr_V4 :
1226 case Hexagon::MemOPw_ORr_V4 :
1227 case Hexagon::MemOPh_ADDi_V4 :
1228 case Hexagon::MemOPh_SUBi_V4 :
1229 case Hexagon::MemOPh_ADDr_V4 :
1230 case Hexagon::MemOPh_SUBr_V4 :
1231 case Hexagon::MemOPh_ANDr_V4 :
1232 case Hexagon::MemOPh_ORr_V4 :
1233 case Hexagon::MemOPb_ADDi_V4 :
1234 case Hexagon::MemOPb_SUBi_V4 :
1235 case Hexagon::MemOPb_ADDr_V4 :
1236 case Hexagon::MemOPb_SUBr_V4 :
1237 case Hexagon::MemOPb_ANDr_V4 :
1238 case Hexagon::MemOPb_ORr_V4 :
1239 case Hexagon::MemOPb_SETBITi_V4:
1240 case Hexagon::MemOPh_SETBITi_V4:
1241 case Hexagon::MemOPw_SETBITi_V4:
1242 case Hexagon::MemOPb_CLRBITi_V4:
1243 case Hexagon::MemOPh_CLRBITi_V4:
1244 case Hexagon::MemOPw_CLRBITi_V4:
1254 default:
return false;
1255 case Hexagon::STriw_pred :
1256 case Hexagon::LDriw_pred :
1263 default:
return false;
1264 case Hexagon::CMPEQrr:
1265 case Hexagon::CMPEQri:
1266 case Hexagon::CMPGTrr:
1267 case Hexagon::CMPGTri:
1268 case Hexagon::CMPGTUrr:
1269 case Hexagon::CMPGTUri:
1277 default:
return false;
1278 case Hexagon::TFR_cPt:
1279 case Hexagon::TFR_cNotPt:
1280 case Hexagon::TFRI_cPt:
1281 case Hexagon::TFRI_cNotPt:
1282 case Hexagon::TFR_cdnPt:
1283 case Hexagon::TFR_cdnNotPt:
1284 case Hexagon::TFRI_cdnPt:
1285 case Hexagon::TFRI_cdnNotPt:
1294 default:
return false;
1295 case Hexagon::ADD_ri_cPt:
1296 case Hexagon::ADD_ri_cNotPt:
1297 case Hexagon::ADD_rr_cPt:
1298 case Hexagon::ADD_rr_cNotPt:
1299 case Hexagon::XOR_rr_cPt:
1300 case Hexagon::XOR_rr_cNotPt:
1301 case Hexagon::AND_rr_cPt:
1302 case Hexagon::AND_rr_cNotPt:
1303 case Hexagon::OR_rr_cPt:
1304 case Hexagon::OR_rr_cNotPt:
1305 case Hexagon::SUB_rr_cPt:
1306 case Hexagon::SUB_rr_cNotPt:
1307 case Hexagon::COMBINE_rr_cPt:
1308 case Hexagon::COMBINE_rr_cNotPt:
1310 case Hexagon::ASLH_cPt_V4:
1311 case Hexagon::ASLH_cNotPt_V4:
1312 case Hexagon::ASRH_cPt_V4:
1313 case Hexagon::ASRH_cNotPt_V4:
1314 case Hexagon::SXTB_cPt_V4:
1315 case Hexagon::SXTB_cNotPt_V4:
1316 case Hexagon::SXTH_cPt_V4:
1317 case Hexagon::SXTH_cNotPt_V4:
1318 case Hexagon::ZXTB_cPt_V4:
1319 case Hexagon::ZXTB_cNotPt_V4:
1320 case Hexagon::ZXTH_cPt_V4:
1321 case Hexagon::ZXTH_cNotPt_V4:
1331 default:
return false;
1332 case Hexagon::LDrid_cPt :
1333 case Hexagon::LDrid_cNotPt :
1334 case Hexagon::LDrid_indexed_cPt :
1335 case Hexagon::LDrid_indexed_cNotPt :
1336 case Hexagon::LDriw_cPt :
1337 case Hexagon::LDriw_cNotPt :
1338 case Hexagon::LDriw_indexed_cPt :
1339 case Hexagon::LDriw_indexed_cNotPt :
1340 case Hexagon::LDrih_cPt :
1341 case Hexagon::LDrih_cNotPt :
1342 case Hexagon::LDrih_indexed_cPt :
1343 case Hexagon::LDrih_indexed_cNotPt :
1344 case Hexagon::LDrib_cPt :
1345 case Hexagon::LDrib_cNotPt :
1346 case Hexagon::LDrib_indexed_cPt :
1347 case Hexagon::LDrib_indexed_cNotPt :
1348 case Hexagon::LDriuh_cPt :
1349 case Hexagon::LDriuh_cNotPt :
1350 case Hexagon::LDriuh_indexed_cPt :
1351 case Hexagon::LDriuh_indexed_cNotPt :
1352 case Hexagon::LDriub_cPt :
1353 case Hexagon::LDriub_cNotPt :
1354 case Hexagon::LDriub_indexed_cPt :
1355 case Hexagon::LDriub_indexed_cNotPt :
1357 case Hexagon::POST_LDrid_cPt :
1358 case Hexagon::POST_LDrid_cNotPt :
1359 case Hexagon::POST_LDriw_cPt :
1360 case Hexagon::POST_LDriw_cNotPt :
1361 case Hexagon::POST_LDrih_cPt :
1362 case Hexagon::POST_LDrih_cNotPt :
1363 case Hexagon::POST_LDrib_cPt :
1364 case Hexagon::POST_LDrib_cNotPt :
1365 case Hexagon::POST_LDriuh_cPt :
1366 case Hexagon::POST_LDriuh_cNotPt :
1367 case Hexagon::POST_LDriub_cPt :
1368 case Hexagon::POST_LDriub_cNotPt :
1370 case Hexagon::LDrid_indexed_shl_cPt_V4 :
1371 case Hexagon::LDrid_indexed_shl_cNotPt_V4 :
1372 case Hexagon::LDrib_indexed_shl_cPt_V4 :
1373 case Hexagon::LDrib_indexed_shl_cNotPt_V4 :
1374 case Hexagon::LDriub_indexed_shl_cPt_V4 :
1375 case Hexagon::LDriub_indexed_shl_cNotPt_V4 :
1376 case Hexagon::LDrih_indexed_shl_cPt_V4 :
1377 case Hexagon::LDrih_indexed_shl_cNotPt_V4 :
1378 case Hexagon::LDriuh_indexed_shl_cPt_V4 :
1379 case Hexagon::LDriuh_indexed_shl_cNotPt_V4 :
1380 case Hexagon::LDriw_indexed_shl_cPt_V4 :
1381 case Hexagon::LDriw_indexed_shl_cNotPt_V4 :
1425 default:
return false;
1426 case Hexagon::STrib_imm_cPt_V4 :
1427 case Hexagon::STrib_imm_cNotPt_V4 :
1428 case Hexagon::STrib_indexed_shl_cPt_V4 :
1429 case Hexagon::STrib_indexed_shl_cNotPt_V4 :
1430 case Hexagon::STrib_cPt :
1431 case Hexagon::STrib_cNotPt :
1432 case Hexagon::POST_STbri_cPt :
1433 case Hexagon::POST_STbri_cNotPt :
1434 case Hexagon::STrid_indexed_cPt :
1435 case Hexagon::STrid_indexed_cNotPt :
1436 case Hexagon::STrid_indexed_shl_cPt_V4 :
1437 case Hexagon::POST_STdri_cPt :
1438 case Hexagon::POST_STdri_cNotPt :
1439 case Hexagon::STrih_cPt :
1440 case Hexagon::STrih_cNotPt :
1441 case Hexagon::STrih_indexed_cPt :
1442 case Hexagon::STrih_indexed_cNotPt :
1443 case Hexagon::STrih_imm_cPt_V4 :
1444 case Hexagon::STrih_imm_cNotPt_V4 :
1445 case Hexagon::STrih_indexed_shl_cPt_V4 :
1446 case Hexagon::STrih_indexed_shl_cNotPt_V4 :
1447 case Hexagon::POST_SThri_cPt :
1448 case Hexagon::POST_SThri_cNotPt :
1449 case Hexagon::STriw_cPt :
1450 case Hexagon::STriw_cNotPt :
1451 case Hexagon::STriw_indexed_cPt :
1452 case Hexagon::STriw_indexed_cNotPt :
1453 case Hexagon::STriw_imm_cPt_V4 :
1454 case Hexagon::STriw_imm_cNotPt_V4 :
1455 case Hexagon::STriw_indexed_shl_cPt_V4 :
1456 case Hexagon::STriw_indexed_shl_cNotPt_V4 :
1457 case Hexagon::POST_STwri_cPt :
1458 case Hexagon::POST_STwri_cNotPt :
1462 case Hexagon::STd_GP_cPt_V4 :
1463 case Hexagon::STd_GP_cNotPt_V4 :
1464 case Hexagon::STb_GP_cPt_V4 :
1465 case Hexagon::STb_GP_cNotPt_V4 :
1466 case Hexagon::STh_GP_cPt_V4 :
1467 case Hexagon::STh_GP_cNotPt_V4 :
1468 case Hexagon::STw_GP_cPt_V4 :
1469 case Hexagon::STw_GP_cNotPt_V4 :
1537 NewOp = Hexagon::getPredOldOpcode(NewOp);
1539 assert(0 &&
"Couldn't change predicate new instruction to its old form.");
1543 NewOp = Hexagon::getNonNVStore(NewOp);
1545 assert(0 &&
"Couldn't change new-value store to its old form.");
1552 int NVOpcode = Hexagon::getNewValueOpcode(MI->
getOpcode());
1559 case Hexagon::STrib_shl_V4:
1560 return Hexagon::STrib_shl_nv_V4;
1562 case Hexagon::STrih_shl_V4:
1563 return Hexagon::STrih_shl_nv_V4;
1565 case Hexagon::STriw_f:
1566 return Hexagon::STriw_nv_V4;
1568 case Hexagon::STriw_indexed_f:
1569 return Hexagon::STriw_indexed_nv_V4;
1571 case Hexagon::STriw_shl_V4:
1572 return Hexagon::STriw_shl_nv_V4;
1583 int NewOpcode = Hexagon::getPredNewOpcode(MI->
getOpcode());
1590 case Hexagon::JMP_t:
1591 case Hexagon::JMP_f:
1594 case Hexagon::JMPR_t:
1595 return Hexagon::JMPR_tnew_tV3;
1597 case Hexagon::JMPR_f:
1598 return Hexagon::JMPR_fnew_tV3;
1600 case Hexagon::JMPret_t:
1601 return Hexagon::JMPret_tnew_tV3;
1603 case Hexagon::JMPret_f:
1604 return Hexagon::JMPret_fnew_tV3;
1608 case Hexagon::COMBINE_rr_cPt :
1609 return Hexagon::COMBINE_rr_cdnPt;
1610 case Hexagon::COMBINE_rr_cNotPt :
1611 return Hexagon::COMBINE_rr_cdnNotPt;
1626 "Instruction must be extendable");
1632 "Branch with unknown extendable field type");
1701 assert(MO.
isImm() &&
"Extendable operand must be Immediate type");
1705 int ImmValue = MO.
getImm();
1707 return (ImmValue < MinValue || ImmValue > MaxValue);
1729 case Hexagon::JMP_t:
1730 return taken ? Hexagon::JMP_tnew_t : Hexagon::JMP_tnew_nt;
1731 case Hexagon::JMP_f:
1732 return taken ? Hexagon::JMP_fnew_t : Hexagon::JMP_fnew_nt;
1740 unsigned short OperandNum)
const {
1766 return -1 << (bits - 1);
1780 return ~(-1 << (bits - 1));
1782 return ~(-1 << bits);
1792 if (Hexagon::getRegForm(MI->
getOpcode()) >= 0)
1802 NonExtOpcode = Hexagon::getBasedWithImmOffset(MI->
getOpcode());
1808 NonExtOpcode = Hexagon::getBaseWithRegOffset(MI->
getOpcode());
1813 if (NonExtOpcode < 0)
1825 short NonExtOpcode = Hexagon::getRegForm(MI->
getOpcode());
1826 if (NonExtOpcode >= 0)
1827 return NonExtOpcode;
1833 return Hexagon::getBasedWithImmOffset(MI->
getOpcode());
1835 return Hexagon::getBaseWithRegOffset(MI->
getOpcode());
1844 return (Opcode == Hexagon::JMP_t) ||
1845 (Opcode == Hexagon::JMP_f) ||
1846 (Opcode == Hexagon::JMP_tnew_t) ||
1847 (Opcode == Hexagon::JMP_fnew_t) ||
1848 (Opcode == Hexagon::JMP_tnew_nt) ||
1849 (Opcode == Hexagon::JMP_fnew_nt);
1853 return (Opcode == Hexagon::JMP_f) ||
1854 (Opcode == Hexagon::JMP_fnew_t) ||
1855 (Opcode == Hexagon::JMP_fnew_nt);
static bool isReg(const MCInst &MI, unsigned OpNo)
virtual bool ReverseBranchCondition(SmallVectorImpl< MachineOperand > &Cond) const
bool isSpillPredRegOp(const MachineInstr *MI) const
void push_back(const T &Elt)
bool isConditionalLoad(const MachineInstr *MI) const
The memory access reads data.
const MachineFunction * getParent() const
mop_iterator operands_end()
virtual unsigned RemoveBranch(MachineBasicBlock &MBB) const
The memory access writes data.
virtual void copyPhysReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator I, DebugLoc DL, unsigned DestReg, unsigned SrcReg, bool KillSrc) const
instr_iterator instr_begin()
const int Hexagon_MEMH_OFFSET_MAX
instr_iterator instr_end()
const int Hexagon_ADDI_OFFSET_MAX
virtual bool AnalyzeBranch(MachineBasicBlock &MBB, MachineBasicBlock *&TBB, MachineBasicBlock *&FBB, SmallVectorImpl< MachineOperand > &Cond, bool AllowModify) const
const int Hexagon_MEMH_OFFSET_MIN
virtual bool isBranch(const MachineInstr *MI) const
bool isExtendable(const MachineInstr *MI) const
void ChangeToRegister(unsigned Reg, bool isDef, bool isImp=false, bool isKill=false, bool isDead=false, bool isUndef=false, bool isDebug=false)
MachineBasicBlock * getMBB() const
unsigned createVirtualRegister(const TargetRegisterClass *RegClass)
bool mayStore() const
Return true if this instruction could possibly modify memory. Instructions with this flag set are not...
MachineMemOperand * getMachineMemOperand(MachinePointerInfo PtrInfo, unsigned f, uint64_t s, unsigned base_alignment, const MDNode *TBAAInfo=0, const MDNode *Ranges=0)
iterator getFirstTerminator()
int getMaxValue(const MachineInstr *MI) const
int getDotNewPredJumpOp(MachineInstr *MI, const MachineBranchProbabilityInfo *MBPI) const
const int Hexagon_ADDI_OFFSET_MIN
iterator insert(iterator I, const T &Elt)
const MCInstrDesc & getDesc() const
virtual bool isPredicated(const MachineInstr *MI) const
int getMinValue(const MachineInstr *MI) const
bool isConstExtended(MachineInstr *MI) const
const int Hexagon_MEMD_OFFSET_MAX
Instructions::iterator instr_iterator
unsigned short getCExtOpNum(const MachineInstr *MI) const
bool isPostIncrement(const MachineInstr *MI) const
bool isConditionalTransfer(const MachineInstr *MI) const
virtual bool isPredicatedNew(const MachineInstr *MI) const
bool isMemOp(const MachineInstr *MI) const
int GetDotOldOp(const int opc) const
bool isImm() const
isImm - Tests if this is a MO_Immediate operand.
#define llvm_unreachable(msg)
bool isBranch() const
Returns true if this is a conditional, unconditional, or indirect branch. Predicates below can be use...
bool isReg() const
isReg - Tests if this is a MO_Register operand.
bool isInt< 8 >(int64_t x)
bool isNewValueJumpCandidate(const MachineInstr *MI) const
Abstract Stack Frame Information.
bool isTerminator() const
Returns true if this instruction part of the terminator for a basic block. Typically this is things l...
const int Hexagon_MEMH_AUTOINC_MIN
static const PseudoSourceValue * getFixedStack(int FI)
BranchProbability getEdgeProbability(MachineBasicBlock *Src, MachineBasicBlock *Dst) const
const int Hexagon_MEMB_AUTOINC_MAX
virtual const InstrItineraryData * getInstrItineraryData() const
const MachineInstrBuilder & addImm(int64_t Val) const
unsigned getNumOperands() const
bool isPredicable() const
Return true if this instruction has a predicate operand that controls execution. It may be set to 'al...
bool isGlobal() const
isGlobal - Tests if this is a MO_GlobalAddress operand.
void RemoveOperand(unsigned i)
bool isValidOffset(const int Opcode, const int Offset) const
bool isFI() const
isFI - Tests if this is a MO_FrameIndex operand.
bool LLVM_ATTRIBUTE_UNUSED_RESULT empty() const
const int Hexagon_MEMD_AUTOINC_MIN
virtual bool isSchedulingBoundary(const MachineInstr *MI, const MachineBasicBlock *MBB, const MachineFunction &MF) const
unsigned getInvertedPredicatedOpcode(const int Opc) const
bool PredOpcodeHasNot(Opcode_t Opcode) const
const int Hexagon_MEMW_AUTOINC_MAX
unsigned getAddrMode(const MachineInstr *MI) const
unsigned getKillRegState(bool B)
const int Hexagon_MEMD_OFFSET_MIN
void ChangeToImmediate(int64_t ImmVal)
const MachineBasicBlock * getParent() const
bool isDebugValue() const
virtual MachineInstr * foldMemoryOperandImpl(MachineFunction &MF, MachineInstr *MI, const SmallVectorImpl< unsigned > &Ops, int FrameIndex) const
bundle_iterator< MachineInstr, instr_iterator > iterator
unsigned getTargetFlags() const
virtual bool isProfitableToDupForIfCvt(MachineBasicBlock &MBB, unsigned NumCycles, const BranchProbability &Probability) const
const int Hexagon_MEMW_OFFSET_MAX
const int Hexagon_MEMH_AUTOINC_MAX
virtual DFAPacketizer * CreateTargetScheduleState(const TargetMachine *TM, const ScheduleDAG *DAG) const
bool isNewValueStore(const MachineInstr *MI) const
const MachineOperand & getOperand(unsigned i) const
virtual void storeRegToStackSlot(MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI, unsigned SrcReg, bool isKill, int FrameIndex, const TargetRegisterClass *RC, const TargetRegisterInfo *TRI) const
bool isSaveCalleeSavedRegsCall(const MachineInstr *MI) const
bool isDeallocRet(const MachineInstr *MI) const
ItTy next(ItTy it, Dist n)
bool isSymbol() const
isSymbol - Tests if this is a MO_ExternalSymbol operand.
virtual unsigned InsertBranch(MachineBasicBlock &MBB, MachineBasicBlock *TBB, MachineBasicBlock *FBB, const SmallVectorImpl< MachineOperand > &Cond, DebugLoc DL) const
bool isNewValueInst(const MachineInstr *MI) const
unsigned createVR(MachineFunction *MF, MVT VT) const
virtual bool isPredicatedTrue(const MachineInstr *MI) const
virtual bool analyzeCompare(const MachineInstr *MI, unsigned &SrcReg, unsigned &SrcReg2, int &Mask, int &Value) const
For a comparison instruction, return the source registers in SrcReg and SrcReg2 if having two registe...
virtual void loadRegFromAddr(MachineFunction &MF, unsigned DestReg, SmallVectorImpl< MachineOperand > &Addr, const TargetRegisterClass *RC, SmallVectorImpl< MachineInstr * > &NewMIs) const
bool isConditionalStore(const MachineInstr *MI) const
MachineInstrBuilder BuildMI(MachineFunction &MF, DebugLoc DL, const MCInstrDesc &MCID)
int GetDotNewOp(const MachineInstr *MI) const
iterator erase(iterator I)
DebugLoc findDebugLoc(instr_iterator MBBI)
void setDesc(const MCInstrDesc &tid)
const STC & getSubtarget() const
const int Hexagon_MEMW_AUTOINC_MIN
HexagonInstrInfo(HexagonSubtarget &ST)
void addOperand(MachineFunction &MF, const MachineOperand &Op)
virtual bool PredicateInstruction(MachineInstr *MI, const SmallVectorImpl< MachineOperand > &Cond) const
unsigned getObjectAlignment(int ObjectIdx) const
getObjectAlignment - Return the alignment of the specified stack object.
bool mayLoad() const
Return true if this instruction could possibly read memory. Instructions with this flag set are not n...
bool isMBB() const
isMBB - Tests if this is a MO_MachineBasicBlock operand.
MachineFrameInfo * getFrameInfo()
const MachineInstrBuilder & addFrameIndex(int Idx) const
raw_ostream & dbgs()
dbgs - Return a circular-buffered debug stream.
virtual void loadRegFromStackSlot(MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI, unsigned DestReg, int FrameIndex, const TargetRegisterClass *RC, const TargetRegisterInfo *TRI) const
static cl::opt< AlignMode > Align(cl::desc("Load/store alignment support"), cl::Hidden, cl::init(DefaultAlign), cl::values(clEnumValN(DefaultAlign,"arm-default-align","Generate unaligned accesses only on hardware/OS ""combinations that are known to support them"), clEnumValN(StrictAlign,"arm-strict-align","Disallow all unaligned memory accesses"), clEnumValN(NoStrictAlign,"arm-no-strict-align","Allow unaligned memory accesses"), clEnumValEnd))
int GetDotNewPredOp(MachineInstr *MI, const MachineBranchProbabilityInfo *MBPI) const
bool isExtended(const MachineInstr *MI) const
void addTargetFlag(unsigned F)
const int Hexagon_MEMB_OFFSET_MAX
MachineRegisterInfo & getRegInfo()
bool isValidAutoIncImm(const EVT VT, const int Offset) const
const MachineInstrBuilder & addMemOperand(MachineMemOperand *MMO) const
static MachineOperand CreateImm(int64_t Val)
void clearKillFlags(unsigned Reg) const
bool isConditionalALU32(const MachineInstr *MI) const
static unsigned getReg(const void *D, unsigned RC, unsigned RegNo)
virtual unsigned isStoreToStackSlot(const MachineInstr *MI, int &FrameIndex) const
const int Hexagon_MEMW_OFFSET_MIN
bool isOperandExtended(const MachineInstr *MI, unsigned short OperandNum) const
short getNonExtOpcode(const MachineInstr *MI) const
virtual bool isPredicable(MachineInstr *MI) const
HexagonSubtarget & Subtarget
unsigned getReg() const
getReg - Returns the register number.
virtual const HexagonRegisterInfo & getRegisterInfo() const
virtual unsigned isLoadFromStackSlot(const MachineInstr *MI, int &FrameIndex) const
LLVM Value Representation.
mop_iterator operands_begin()
const MachineInstrBuilder & addMBB(MachineBasicBlock *MBB, unsigned char TargetFlags=0) const
void immediateExtend(MachineInstr *MI) const
bool isNewValueJump(const MachineInstr *MI) const
BasicBlockListType::iterator iterator
virtual bool SubsumesPredicate(const SmallVectorImpl< MachineOperand > &Pred1, const SmallVectorImpl< MachineOperand > &Pred2) const
virtual void storeRegToAddr(MachineFunction &MF, unsigned SrcReg, bool isKill, SmallVectorImpl< MachineOperand > &Addr, const TargetRegisterClass *RC, SmallVectorImpl< MachineInstr * > &NewMIs) const
bool isNewValue(const MachineInstr *MI) const
bool PredOpcodeHasJMP_c(Opcode_t Opcode) const
const int Hexagon_MEMD_AUTOINC_MAX
virtual bool DefinesPredicate(MachineInstr *MI, std::vector< MachineOperand > &Pred) const
bool isLayoutSuccessor(const MachineBasicBlock *MBB) const
virtual bool isProfitableToIfCvt(MachineBasicBlock &MBB, unsigned NumCycles, unsigned ExtraPredCycles, const BranchProbability &Probability) const
const MachineInstrBuilder & addReg(unsigned RegNo, unsigned flags=0, unsigned SubReg=0) const
const int Hexagon_MEMB_AUTOINC_MIN
bool NonExtEquivalentExists(const MachineInstr *MI) const
bool isDotNewInst(const MachineInstr *MI) const
int64_t getObjectSize(int ObjectIdx) const
const int Hexagon_MEMB_OFFSET_MIN
bool mayBeNewStore(const MachineInstr *MI) const