arm: Add branch flags onto macroops
Mark branch flags onto macroops to allow branch prediction before microop decomposition
This commit is contained in:
parent
eab00f4966
commit
f7d80348fa
|
@ -171,6 +171,16 @@ MacroMemOp::MacroMemOp(const char *mnem, ExtMachInst machInst,
|
||||||
|
|
||||||
(*uop)->setLastMicroop();
|
(*uop)->setLastMicroop();
|
||||||
|
|
||||||
|
/* Take the control flags from the last microop for the macroop */
|
||||||
|
if ((*uop)->isControl())
|
||||||
|
setFlag(StaticInst::IsControl);
|
||||||
|
if ((*uop)->isCondCtrl())
|
||||||
|
setFlag(StaticInst::IsCondControl);
|
||||||
|
if ((*uop)->isIndirectCtrl())
|
||||||
|
setFlag(StaticInst::IsIndirectControl);
|
||||||
|
if ((*uop)->isReturn())
|
||||||
|
setFlag(StaticInst::IsReturn);
|
||||||
|
|
||||||
for (StaticInstPtr *curUop = microOps;
|
for (StaticInstPtr *curUop = microOps;
|
||||||
!(*curUop)->isLastMicroop(); curUop++) {
|
!(*curUop)->isLastMicroop(); curUop++) {
|
||||||
MicroOp * uopPtr = dynamic_cast<MicroOp *>(curUop->get());
|
MicroOp * uopPtr = dynamic_cast<MicroOp *>(curUop->get());
|
||||||
|
|
|
@ -1214,12 +1214,21 @@ def template LoadImmConstructor {{
|
||||||
uops[2] = new MicroUopRegMov(machInst, INTREG_PC, INTREG_UREG0);
|
uops[2] = new MicroUopRegMov(machInst, INTREG_PC, INTREG_UREG0);
|
||||||
uops[2]->setFlag(StaticInst::IsControl);
|
uops[2]->setFlag(StaticInst::IsControl);
|
||||||
uops[2]->setFlag(StaticInst::IsIndirectControl);
|
uops[2]->setFlag(StaticInst::IsIndirectControl);
|
||||||
if (conditional)
|
/* Also set flags on the macroop so that pre-microop decomposition
|
||||||
|
branch prediction can work */
|
||||||
|
setFlag(StaticInst::IsControl);
|
||||||
|
setFlag(StaticInst::IsIndirectControl);
|
||||||
|
if (conditional) {
|
||||||
uops[2]->setFlag(StaticInst::IsCondControl);
|
uops[2]->setFlag(StaticInst::IsCondControl);
|
||||||
else
|
setFlag(StaticInst::IsCondControl);
|
||||||
|
} else {
|
||||||
uops[2]->setFlag(StaticInst::IsUncondControl);
|
uops[2]->setFlag(StaticInst::IsUncondControl);
|
||||||
if (_base == INTREG_SP && _add && _imm == 4 && %(is_ras_pop)s)
|
setFlag(StaticInst::IsUncondControl);
|
||||||
|
}
|
||||||
|
if (_base == INTREG_SP && _add && _imm == 4 && %(is_ras_pop)s) {
|
||||||
uops[2]->setFlag(StaticInst::IsReturn);
|
uops[2]->setFlag(StaticInst::IsReturn);
|
||||||
|
setFlag(StaticInst::IsReturn);
|
||||||
|
}
|
||||||
uops[2]->setLastMicroop();
|
uops[2]->setLastMicroop();
|
||||||
} else {
|
} else {
|
||||||
uops[0] = new %(acc_name)s(machInst, _dest, _base, _add, _imm);
|
uops[0] = new %(acc_name)s(machInst, _dest, _base, _add, _imm);
|
||||||
|
|
Loading…
Reference in a new issue