1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 11:42:57 +01:00

Hexagon: Use MO operand flags to mark constant extended instructions.

llvm-svn: 176500
This commit is contained in:
Jyotsna Verma 2013-03-05 18:51:42 +00:00
parent c096fbaa7d
commit ce778f77cd
3 changed files with 44 additions and 472 deletions

View File

@ -557,218 +557,43 @@ unsigned HexagonInstrInfo::createVR(MachineFunction* MF, MVT VT) const {
} }
bool HexagonInstrInfo::isExtendable(const MachineInstr *MI) const { bool HexagonInstrInfo::isExtendable(const MachineInstr *MI) const {
// Constant extenders are allowed only for V4 and above.
if (!Subtarget.hasV4TOps())
return false;
const MCInstrDesc &MID = MI->getDesc();
const uint64_t F = MID.TSFlags;
if ((F >> HexagonII::ExtendablePos) & HexagonII::ExtendableMask)
return true;
// TODO: This is largely obsolete now. Will need to be removed
// in consecutive patches.
switch(MI->getOpcode()) { switch(MI->getOpcode()) {
default: return false; // TFR_FI Remains a special case.
// JMP_EQri
case Hexagon::JMP_EQriPt_nv_V4:
case Hexagon::JMP_EQriPnt_nv_V4:
case Hexagon::JMP_EQriNotPt_nv_V4:
case Hexagon::JMP_EQriNotPnt_nv_V4:
// JMP_EQri - with -1
case Hexagon::JMP_EQriPtneg_nv_V4:
case Hexagon::JMP_EQriPntneg_nv_V4:
case Hexagon::JMP_EQriNotPtneg_nv_V4:
case Hexagon::JMP_EQriNotPntneg_nv_V4:
// JMP_EQrr
case Hexagon::JMP_EQrrPt_nv_V4:
case Hexagon::JMP_EQrrPnt_nv_V4:
case Hexagon::JMP_EQrrNotPt_nv_V4:
case Hexagon::JMP_EQrrNotPnt_nv_V4:
// JMP_GTri
case Hexagon::JMP_GTriPt_nv_V4:
case Hexagon::JMP_GTriPnt_nv_V4:
case Hexagon::JMP_GTriNotPt_nv_V4:
case Hexagon::JMP_GTriNotPnt_nv_V4:
// JMP_GTri - with -1
case Hexagon::JMP_GTriPtneg_nv_V4:
case Hexagon::JMP_GTriPntneg_nv_V4:
case Hexagon::JMP_GTriNotPtneg_nv_V4:
case Hexagon::JMP_GTriNotPntneg_nv_V4:
// JMP_GTrr
case Hexagon::JMP_GTrrPt_nv_V4:
case Hexagon::JMP_GTrrPnt_nv_V4:
case Hexagon::JMP_GTrrNotPt_nv_V4:
case Hexagon::JMP_GTrrNotPnt_nv_V4:
// JMP_GTrrdn
case Hexagon::JMP_GTrrdnPt_nv_V4:
case Hexagon::JMP_GTrrdnPnt_nv_V4:
case Hexagon::JMP_GTrrdnNotPt_nv_V4:
case Hexagon::JMP_GTrrdnNotPnt_nv_V4:
// JMP_GTUri
case Hexagon::JMP_GTUriPt_nv_V4:
case Hexagon::JMP_GTUriPnt_nv_V4:
case Hexagon::JMP_GTUriNotPt_nv_V4:
case Hexagon::JMP_GTUriNotPnt_nv_V4:
// JMP_GTUrr
case Hexagon::JMP_GTUrrPt_nv_V4:
case Hexagon::JMP_GTUrrPnt_nv_V4:
case Hexagon::JMP_GTUrrNotPt_nv_V4:
case Hexagon::JMP_GTUrrNotPnt_nv_V4:
// JMP_GTUrrdn
case Hexagon::JMP_GTUrrdnPt_nv_V4:
case Hexagon::JMP_GTUrrdnPnt_nv_V4:
case Hexagon::JMP_GTUrrdnNotPt_nv_V4:
case Hexagon::JMP_GTUrrdnNotPnt_nv_V4:
// TFR_FI
case Hexagon::TFR_FI: case Hexagon::TFR_FI:
return true; return true;
default:
return false;
} }
return false;
} }
// This returns true in two cases:
// - The OP code itself indicates that this is an extended instruction.
// - One of MOs has been marked with HMOTF_ConstExtended flag.
bool HexagonInstrInfo::isExtended(const MachineInstr *MI) const { bool HexagonInstrInfo::isExtended(const MachineInstr *MI) const {
switch(MI->getOpcode()) { // First check if this is permanently extended op code.
default: return false; const uint64_t F = MI->getDesc().TSFlags;
// JMP_EQri if ((F >> HexagonII::ExtendedPos) & HexagonII::ExtendedMask)
case Hexagon::JMP_EQriPt_ie_nv_V4: return true;
case Hexagon::JMP_EQriPnt_ie_nv_V4: // Use MO operand flags to determine if one of MI's operands
case Hexagon::JMP_EQriNotPt_ie_nv_V4: // has HMOTF_ConstExtended flag set.
case Hexagon::JMP_EQriNotPnt_ie_nv_V4: for (MachineInstr::const_mop_iterator I = MI->operands_begin(),
E = MI->operands_end(); I != E; ++I) {
// JMP_EQri - with -1 if (I->getTargetFlags() && HexagonII::HMOTF_ConstExtended)
case Hexagon::JMP_EQriPtneg_ie_nv_V4:
case Hexagon::JMP_EQriPntneg_ie_nv_V4:
case Hexagon::JMP_EQriNotPtneg_ie_nv_V4:
case Hexagon::JMP_EQriNotPntneg_ie_nv_V4:
// JMP_EQrr
case Hexagon::JMP_EQrrPt_ie_nv_V4:
case Hexagon::JMP_EQrrPnt_ie_nv_V4:
case Hexagon::JMP_EQrrNotPt_ie_nv_V4:
case Hexagon::JMP_EQrrNotPnt_ie_nv_V4:
// JMP_GTri
case Hexagon::JMP_GTriPt_ie_nv_V4:
case Hexagon::JMP_GTriPnt_ie_nv_V4:
case Hexagon::JMP_GTriNotPt_ie_nv_V4:
case Hexagon::JMP_GTriNotPnt_ie_nv_V4:
// JMP_GTri - with -1
case Hexagon::JMP_GTriPtneg_ie_nv_V4:
case Hexagon::JMP_GTriPntneg_ie_nv_V4:
case Hexagon::JMP_GTriNotPtneg_ie_nv_V4:
case Hexagon::JMP_GTriNotPntneg_ie_nv_V4:
// JMP_GTrr
case Hexagon::JMP_GTrrPt_ie_nv_V4:
case Hexagon::JMP_GTrrPnt_ie_nv_V4:
case Hexagon::JMP_GTrrNotPt_ie_nv_V4:
case Hexagon::JMP_GTrrNotPnt_ie_nv_V4:
// JMP_GTrrdn
case Hexagon::JMP_GTrrdnPt_ie_nv_V4:
case Hexagon::JMP_GTrrdnPnt_ie_nv_V4:
case Hexagon::JMP_GTrrdnNotPt_ie_nv_V4:
case Hexagon::JMP_GTrrdnNotPnt_ie_nv_V4:
// JMP_GTUri
case Hexagon::JMP_GTUriPt_ie_nv_V4:
case Hexagon::JMP_GTUriPnt_ie_nv_V4:
case Hexagon::JMP_GTUriNotPt_ie_nv_V4:
case Hexagon::JMP_GTUriNotPnt_ie_nv_V4:
// JMP_GTUrr
case Hexagon::JMP_GTUrrPt_ie_nv_V4:
case Hexagon::JMP_GTUrrPnt_ie_nv_V4:
case Hexagon::JMP_GTUrrNotPt_ie_nv_V4:
case Hexagon::JMP_GTUrrNotPnt_ie_nv_V4:
// JMP_GTUrrdn
case Hexagon::JMP_GTUrrdnPt_ie_nv_V4:
case Hexagon::JMP_GTUrrdnPnt_ie_nv_V4:
case Hexagon::JMP_GTUrrdnNotPt_ie_nv_V4:
case Hexagon::JMP_GTUrrdnNotPnt_ie_nv_V4:
// V4 absolute set addressing.
case Hexagon::LDrid_abs_setimm_V4:
case Hexagon::LDriw_abs_setimm_V4:
case Hexagon::LDrih_abs_setimm_V4:
case Hexagon::LDrib_abs_setimm_V4:
case Hexagon::LDriuh_abs_setimm_V4:
case Hexagon::LDriub_abs_setimm_V4:
case Hexagon::STrid_abs_setimm_V4:
case Hexagon::STrib_abs_setimm_V4:
case Hexagon::STrih_abs_setimm_V4:
case Hexagon::STriw_abs_setimm_V4:
// V4 global address load.
case Hexagon::LDd_GP_cPt_V4 :
case Hexagon::LDd_GP_cNotPt_V4 :
case Hexagon::LDd_GP_cdnPt_V4 :
case Hexagon::LDd_GP_cdnNotPt_V4 :
case Hexagon::LDb_GP_cPt_V4 :
case Hexagon::LDb_GP_cNotPt_V4 :
case Hexagon::LDb_GP_cdnPt_V4 :
case Hexagon::LDb_GP_cdnNotPt_V4 :
case Hexagon::LDub_GP_cPt_V4 :
case Hexagon::LDub_GP_cNotPt_V4 :
case Hexagon::LDub_GP_cdnPt_V4 :
case Hexagon::LDub_GP_cdnNotPt_V4 :
case Hexagon::LDh_GP_cPt_V4 :
case Hexagon::LDh_GP_cNotPt_V4 :
case Hexagon::LDh_GP_cdnPt_V4 :
case Hexagon::LDh_GP_cdnNotPt_V4 :
case Hexagon::LDuh_GP_cPt_V4 :
case Hexagon::LDuh_GP_cNotPt_V4 :
case Hexagon::LDuh_GP_cdnPt_V4 :
case Hexagon::LDuh_GP_cdnNotPt_V4 :
case Hexagon::LDw_GP_cPt_V4 :
case Hexagon::LDw_GP_cNotPt_V4 :
case Hexagon::LDw_GP_cdnPt_V4 :
case Hexagon::LDw_GP_cdnNotPt_V4 :
// V4 global address store.
case Hexagon::STd_GP_cPt_V4 :
case Hexagon::STd_GP_cNotPt_V4 :
case Hexagon::STd_GP_cdnPt_V4 :
case Hexagon::STd_GP_cdnNotPt_V4 :
case Hexagon::STb_GP_cPt_V4 :
case Hexagon::STb_GP_cNotPt_V4 :
case Hexagon::STb_GP_cdnPt_V4 :
case Hexagon::STb_GP_cdnNotPt_V4 :
case Hexagon::STh_GP_cPt_V4 :
case Hexagon::STh_GP_cNotPt_V4 :
case Hexagon::STh_GP_cdnPt_V4 :
case Hexagon::STh_GP_cdnNotPt_V4 :
case Hexagon::STw_GP_cPt_V4 :
case Hexagon::STw_GP_cNotPt_V4 :
case Hexagon::STw_GP_cdnPt_V4 :
case Hexagon::STw_GP_cdnNotPt_V4 :
// V4 predicated global address new value store.
case Hexagon::STb_GP_cPt_nv_V4 :
case Hexagon::STb_GP_cNotPt_nv_V4 :
case Hexagon::STb_GP_cdnPt_nv_V4 :
case Hexagon::STb_GP_cdnNotPt_nv_V4 :
case Hexagon::STh_GP_cPt_nv_V4 :
case Hexagon::STh_GP_cNotPt_nv_V4 :
case Hexagon::STh_GP_cdnPt_nv_V4 :
case Hexagon::STh_GP_cdnNotPt_nv_V4 :
case Hexagon::STw_GP_cPt_nv_V4 :
case Hexagon::STw_GP_cNotPt_nv_V4 :
case Hexagon::STw_GP_cdnPt_nv_V4 :
case Hexagon::STw_GP_cdnNotPt_nv_V4 :
// TFR_FI
case Hexagon::TFR_FI_immext_V4:
// TFRI_F
case Hexagon::TFRI_f:
case Hexagon::TFRI_cPt_f:
case Hexagon::TFRI_cNotPt_f:
case Hexagon::CONST64_Float_Real:
return true; return true;
} }
return false;
} }
bool HexagonInstrInfo::isNewValueJump(const MachineInstr *MI) const { bool HexagonInstrInfo::isNewValueJump(const MachineInstr *MI) const {
@ -877,258 +702,6 @@ bool HexagonInstrInfo::isNewValueJump(const MachineInstr *MI) const {
} }
} }
unsigned HexagonInstrInfo::getImmExtForm(const MachineInstr* MI) const {
switch(MI->getOpcode()) {
default: llvm_unreachable("Unknown type of instruction.");
// JMP_EQri
case Hexagon::JMP_EQriPt_nv_V4:
return Hexagon::JMP_EQriPt_ie_nv_V4;
case Hexagon::JMP_EQriNotPt_nv_V4:
return Hexagon::JMP_EQriNotPt_ie_nv_V4;
case Hexagon::JMP_EQriPnt_nv_V4:
return Hexagon::JMP_EQriPnt_ie_nv_V4;
case Hexagon::JMP_EQriNotPnt_nv_V4:
return Hexagon::JMP_EQriNotPnt_ie_nv_V4;
// JMP_EQri -- with -1
case Hexagon::JMP_EQriPtneg_nv_V4:
return Hexagon::JMP_EQriPtneg_ie_nv_V4;
case Hexagon::JMP_EQriNotPtneg_nv_V4:
return Hexagon::JMP_EQriNotPtneg_ie_nv_V4;
case Hexagon::JMP_EQriPntneg_nv_V4:
return Hexagon::JMP_EQriPntneg_ie_nv_V4;
case Hexagon::JMP_EQriNotPntneg_nv_V4:
return Hexagon::JMP_EQriNotPntneg_ie_nv_V4;
// JMP_EQrr
case Hexagon::JMP_EQrrPt_nv_V4:
return Hexagon::JMP_EQrrPt_ie_nv_V4;
case Hexagon::JMP_EQrrNotPt_nv_V4:
return Hexagon::JMP_EQrrNotPt_ie_nv_V4;
case Hexagon::JMP_EQrrPnt_nv_V4:
return Hexagon::JMP_EQrrPnt_ie_nv_V4;
case Hexagon::JMP_EQrrNotPnt_nv_V4:
return Hexagon::JMP_EQrrNotPnt_ie_nv_V4;
// JMP_GTri
case Hexagon::JMP_GTriPt_nv_V4:
return Hexagon::JMP_GTriPt_ie_nv_V4;
case Hexagon::JMP_GTriNotPt_nv_V4:
return Hexagon::JMP_GTriNotPt_ie_nv_V4;
case Hexagon::JMP_GTriPnt_nv_V4:
return Hexagon::JMP_GTriPnt_ie_nv_V4;
case Hexagon::JMP_GTriNotPnt_nv_V4:
return Hexagon::JMP_GTriNotPnt_ie_nv_V4;
// JMP_GTri -- with -1
case Hexagon::JMP_GTriPtneg_nv_V4:
return Hexagon::JMP_GTriPtneg_ie_nv_V4;
case Hexagon::JMP_GTriNotPtneg_nv_V4:
return Hexagon::JMP_GTriNotPtneg_ie_nv_V4;
case Hexagon::JMP_GTriPntneg_nv_V4:
return Hexagon::JMP_GTriPntneg_ie_nv_V4;
case Hexagon::JMP_GTriNotPntneg_nv_V4:
return Hexagon::JMP_GTriNotPntneg_ie_nv_V4;
// JMP_GTrr
case Hexagon::JMP_GTrrPt_nv_V4:
return Hexagon::JMP_GTrrPt_ie_nv_V4;
case Hexagon::JMP_GTrrNotPt_nv_V4:
return Hexagon::JMP_GTrrNotPt_ie_nv_V4;
case Hexagon::JMP_GTrrPnt_nv_V4:
return Hexagon::JMP_GTrrPnt_ie_nv_V4;
case Hexagon::JMP_GTrrNotPnt_nv_V4:
return Hexagon::JMP_GTrrNotPnt_ie_nv_V4;
// JMP_GTrrdn
case Hexagon::JMP_GTrrdnPt_nv_V4:
return Hexagon::JMP_GTrrdnPt_ie_nv_V4;
case Hexagon::JMP_GTrrdnNotPt_nv_V4:
return Hexagon::JMP_GTrrdnNotPt_ie_nv_V4;
case Hexagon::JMP_GTrrdnPnt_nv_V4:
return Hexagon::JMP_GTrrdnPnt_ie_nv_V4;
case Hexagon::JMP_GTrrdnNotPnt_nv_V4:
return Hexagon::JMP_GTrrdnNotPnt_ie_nv_V4;
// JMP_GTUri
case Hexagon::JMP_GTUriPt_nv_V4:
return Hexagon::JMP_GTUriPt_ie_nv_V4;
case Hexagon::JMP_GTUriNotPt_nv_V4:
return Hexagon::JMP_GTUriNotPt_ie_nv_V4;
case Hexagon::JMP_GTUriPnt_nv_V4:
return Hexagon::JMP_GTUriPnt_ie_nv_V4;
case Hexagon::JMP_GTUriNotPnt_nv_V4:
return Hexagon::JMP_GTUriNotPnt_ie_nv_V4;
// JMP_GTUrr
case Hexagon::JMP_GTUrrPt_nv_V4:
return Hexagon::JMP_GTUrrPt_ie_nv_V4;
case Hexagon::JMP_GTUrrNotPt_nv_V4:
return Hexagon::JMP_GTUrrNotPt_ie_nv_V4;
case Hexagon::JMP_GTUrrPnt_nv_V4:
return Hexagon::JMP_GTUrrPnt_ie_nv_V4;
case Hexagon::JMP_GTUrrNotPnt_nv_V4:
return Hexagon::JMP_GTUrrNotPnt_ie_nv_V4;
// JMP_GTUrrdn
case Hexagon::JMP_GTUrrdnPt_nv_V4:
return Hexagon::JMP_GTUrrdnPt_ie_nv_V4;
case Hexagon::JMP_GTUrrdnNotPt_nv_V4:
return Hexagon::JMP_GTUrrdnNotPt_ie_nv_V4;
case Hexagon::JMP_GTUrrdnPnt_nv_V4:
return Hexagon::JMP_GTUrrdnPnt_ie_nv_V4;
case Hexagon::JMP_GTUrrdnNotPnt_nv_V4:
return Hexagon::JMP_GTUrrdnNotPnt_ie_nv_V4;
case Hexagon::TFR_FI:
return Hexagon::TFR_FI_immext_V4;
case Hexagon::MEMw_ADDi_indexed_MEM_V4 :
case Hexagon::MEMw_SUBi_indexed_MEM_V4 :
case Hexagon::MEMw_ADDr_indexed_MEM_V4 :
case Hexagon::MEMw_SUBr_indexed_MEM_V4 :
case Hexagon::MEMw_ANDr_indexed_MEM_V4 :
case Hexagon::MEMw_ORr_indexed_MEM_V4 :
case Hexagon::MEMw_ADDi_MEM_V4 :
case Hexagon::MEMw_SUBi_MEM_V4 :
case Hexagon::MEMw_ADDr_MEM_V4 :
case Hexagon::MEMw_SUBr_MEM_V4 :
case Hexagon::MEMw_ANDr_MEM_V4 :
case Hexagon::MEMw_ORr_MEM_V4 :
case Hexagon::MEMh_ADDi_indexed_MEM_V4 :
case Hexagon::MEMh_SUBi_indexed_MEM_V4 :
case Hexagon::MEMh_ADDr_indexed_MEM_V4 :
case Hexagon::MEMh_SUBr_indexed_MEM_V4 :
case Hexagon::MEMh_ANDr_indexed_MEM_V4 :
case Hexagon::MEMh_ORr_indexed_MEM_V4 :
case Hexagon::MEMh_ADDi_MEM_V4 :
case Hexagon::MEMh_SUBi_MEM_V4 :
case Hexagon::MEMh_ADDr_MEM_V4 :
case Hexagon::MEMh_SUBr_MEM_V4 :
case Hexagon::MEMh_ANDr_MEM_V4 :
case Hexagon::MEMh_ORr_MEM_V4 :
case Hexagon::MEMb_ADDi_indexed_MEM_V4 :
case Hexagon::MEMb_SUBi_indexed_MEM_V4 :
case Hexagon::MEMb_ADDr_indexed_MEM_V4 :
case Hexagon::MEMb_SUBr_indexed_MEM_V4 :
case Hexagon::MEMb_ANDr_indexed_MEM_V4 :
case Hexagon::MEMb_ORr_indexed_MEM_V4 :
case Hexagon::MEMb_ADDi_MEM_V4 :
case Hexagon::MEMb_SUBi_MEM_V4 :
case Hexagon::MEMb_ADDr_MEM_V4 :
case Hexagon::MEMb_SUBr_MEM_V4 :
case Hexagon::MEMb_ANDr_MEM_V4 :
case Hexagon::MEMb_ORr_MEM_V4 :
llvm_unreachable("Needs implementing.");
}
}
unsigned HexagonInstrInfo::getNormalBranchForm(const MachineInstr* MI) const {
switch(MI->getOpcode()) {
default: llvm_unreachable("Unknown type of jump instruction.");
// JMP_EQri
case Hexagon::JMP_EQriPt_ie_nv_V4:
return Hexagon::JMP_EQriPt_nv_V4;
case Hexagon::JMP_EQriNotPt_ie_nv_V4:
return Hexagon::JMP_EQriNotPt_nv_V4;
case Hexagon::JMP_EQriPnt_ie_nv_V4:
return Hexagon::JMP_EQriPnt_nv_V4;
case Hexagon::JMP_EQriNotPnt_ie_nv_V4:
return Hexagon::JMP_EQriNotPnt_nv_V4;
// JMP_EQri -- with -1
case Hexagon::JMP_EQriPtneg_ie_nv_V4:
return Hexagon::JMP_EQriPtneg_nv_V4;
case Hexagon::JMP_EQriNotPtneg_ie_nv_V4:
return Hexagon::JMP_EQriNotPtneg_nv_V4;
case Hexagon::JMP_EQriPntneg_ie_nv_V4:
return Hexagon::JMP_EQriPntneg_nv_V4;
case Hexagon::JMP_EQriNotPntneg_ie_nv_V4:
return Hexagon::JMP_EQriNotPntneg_nv_V4;
// JMP_EQrr
case Hexagon::JMP_EQrrPt_ie_nv_V4:
return Hexagon::JMP_EQrrPt_nv_V4;
case Hexagon::JMP_EQrrNotPt_ie_nv_V4:
return Hexagon::JMP_EQrrNotPt_nv_V4;
case Hexagon::JMP_EQrrPnt_ie_nv_V4:
return Hexagon::JMP_EQrrPnt_nv_V4;
case Hexagon::JMP_EQrrNotPnt_ie_nv_V4:
return Hexagon::JMP_EQrrNotPnt_nv_V4;
// JMP_GTri
case Hexagon::JMP_GTriPt_ie_nv_V4:
return Hexagon::JMP_GTriPt_nv_V4;
case Hexagon::JMP_GTriNotPt_ie_nv_V4:
return Hexagon::JMP_GTriNotPt_nv_V4;
case Hexagon::JMP_GTriPnt_ie_nv_V4:
return Hexagon::JMP_GTriPnt_nv_V4;
case Hexagon::JMP_GTriNotPnt_ie_nv_V4:
return Hexagon::JMP_GTriNotPnt_nv_V4;
// JMP_GTri -- with -1
case Hexagon::JMP_GTriPtneg_ie_nv_V4:
return Hexagon::JMP_GTriPtneg_nv_V4;
case Hexagon::JMP_GTriNotPtneg_ie_nv_V4:
return Hexagon::JMP_GTriNotPtneg_nv_V4;
case Hexagon::JMP_GTriPntneg_ie_nv_V4:
return Hexagon::JMP_GTriPntneg_nv_V4;
case Hexagon::JMP_GTriNotPntneg_ie_nv_V4:
return Hexagon::JMP_GTriNotPntneg_nv_V4;
// JMP_GTrr
case Hexagon::JMP_GTrrPt_ie_nv_V4:
return Hexagon::JMP_GTrrPt_nv_V4;
case Hexagon::JMP_GTrrNotPt_ie_nv_V4:
return Hexagon::JMP_GTrrNotPt_nv_V4;
case Hexagon::JMP_GTrrPnt_ie_nv_V4:
return Hexagon::JMP_GTrrPnt_nv_V4;
case Hexagon::JMP_GTrrNotPnt_ie_nv_V4:
return Hexagon::JMP_GTrrNotPnt_nv_V4;
// JMP_GTrrdn
case Hexagon::JMP_GTrrdnPt_ie_nv_V4:
return Hexagon::JMP_GTrrdnPt_nv_V4;
case Hexagon::JMP_GTrrdnNotPt_ie_nv_V4:
return Hexagon::JMP_GTrrdnNotPt_nv_V4;
case Hexagon::JMP_GTrrdnPnt_ie_nv_V4:
return Hexagon::JMP_GTrrdnPnt_nv_V4;
case Hexagon::JMP_GTrrdnNotPnt_ie_nv_V4:
return Hexagon::JMP_GTrrdnNotPnt_nv_V4;
// JMP_GTUri
case Hexagon::JMP_GTUriPt_ie_nv_V4:
return Hexagon::JMP_GTUriPt_nv_V4;
case Hexagon::JMP_GTUriNotPt_ie_nv_V4:
return Hexagon::JMP_GTUriNotPt_nv_V4;
case Hexagon::JMP_GTUriPnt_ie_nv_V4:
return Hexagon::JMP_GTUriPnt_nv_V4;
case Hexagon::JMP_GTUriNotPnt_ie_nv_V4:
return Hexagon::JMP_GTUriNotPnt_nv_V4;
// JMP_GTUrr
case Hexagon::JMP_GTUrrPt_ie_nv_V4:
return Hexagon::JMP_GTUrrPt_nv_V4;
case Hexagon::JMP_GTUrrNotPt_ie_nv_V4:
return Hexagon::JMP_GTUrrNotPt_nv_V4;
case Hexagon::JMP_GTUrrPnt_ie_nv_V4:
return Hexagon::JMP_GTUrrPnt_nv_V4;
case Hexagon::JMP_GTUrrNotPnt_ie_nv_V4:
return Hexagon::JMP_GTUrrNotPnt_nv_V4;
// JMP_GTUrrdn
case Hexagon::JMP_GTUrrdnPt_ie_nv_V4:
return Hexagon::JMP_GTUrrdnPt_nv_V4;
case Hexagon::JMP_GTUrrdnNotPt_ie_nv_V4:
return Hexagon::JMP_GTUrrdnNotPt_nv_V4;
case Hexagon::JMP_GTUrrdnPnt_ie_nv_V4:
return Hexagon::JMP_GTUrrdnPnt_nv_V4;
case Hexagon::JMP_GTUrrdnNotPnt_ie_nv_V4:
return Hexagon::JMP_GTUrrdnNotPnt_nv_V4;
}
}
bool HexagonInstrInfo::isNewValueStore(const MachineInstr *MI) const { bool HexagonInstrInfo::isNewValueStore(const MachineInstr *MI) const {
switch (MI->getOpcode()) { switch (MI->getOpcode()) {
default: return false; default: return false;
@ -1326,6 +899,16 @@ bool HexagonInstrInfo::isPostIncrement (const MachineInstr* MI) const {
} }
} }
bool HexagonInstrInfo::isNewValueInst(const MachineInstr *MI) const {
if (isNewValueJump(MI))
return true;
if (isNewValueStore(MI))
return true;
return false;
}
bool HexagonInstrInfo::isSaveCalleeSavedRegsCall(const MachineInstr *MI) const { bool HexagonInstrInfo::isSaveCalleeSavedRegsCall(const MachineInstr *MI) const {
return MI->getOpcode() == Hexagon::SAVE_REGISTERS_CALL_V4; return MI->getOpcode() == Hexagon::SAVE_REGISTERS_CALL_V4;
} }

View File

@ -169,6 +169,7 @@ public:
bool isConditionalALU32 (const MachineInstr* MI) const; bool isConditionalALU32 (const MachineInstr* MI) const;
bool isConditionalLoad (const MachineInstr* MI) const; bool isConditionalLoad (const MachineInstr* MI) const;
bool isConditionalStore(const MachineInstr* MI) const; bool isConditionalStore(const MachineInstr* MI) const;
bool isNewValueInst(const MachineInstr* MI) const;
bool isDeallocRet(const MachineInstr *MI) const; bool isDeallocRet(const MachineInstr *MI) const;
unsigned getInvertedPredicatedOpcode(const int Opc) const; unsigned getInvertedPredicatedOpcode(const int Opc) const;
bool isExtendable(const MachineInstr* MI) const; bool isExtendable(const MachineInstr* MI) const;
@ -177,8 +178,6 @@ public:
bool isNewValueStore(const MachineInstr* MI) const; bool isNewValueStore(const MachineInstr* MI) const;
bool isNewValueJump(const MachineInstr* MI) const; bool isNewValueJump(const MachineInstr* MI) const;
bool isNewValueJumpCandidate(const MachineInstr *MI) const; bool isNewValueJumpCandidate(const MachineInstr *MI) const;
unsigned getImmExtForm(const MachineInstr* MI) const;
unsigned getNormalBranchForm(const MachineInstr* MI) const;
void immediateExtend(MachineInstr *MI) const; void immediateExtend(MachineInstr *MI) const;

View File

@ -351,17 +351,6 @@ static bool IsControlFlow(MachineInstr* MI) {
return (MI->getDesc().isTerminator() || MI->getDesc().isCall()); return (MI->getDesc().isTerminator() || MI->getDesc().isCall());
} }
bool HexagonPacketizerList::isNewValueInst(MachineInstr* MI) {
const HexagonInstrInfo *QII = (const HexagonInstrInfo *) TII;
if (QII->isNewValueJump(MI))
return true;
if (QII->isNewValueStore(MI))
return true;
return false;
}
// Function returns true if an instruction can be promoted to the new-value // Function returns true if an instruction can be promoted to the new-value
// store. It will always return false for v2 and v3. // store. It will always return false for v2 and v3.
// It lists all the conditional and unconditional stores that can be promoted // It lists all the conditional and unconditional stores that can be promoted
@ -2166,7 +2155,8 @@ static bool GetPredicateSense(MachineInstr* MI,
} }
bool HexagonPacketizerList::isDotNewInst(MachineInstr* MI) { bool HexagonPacketizerList::isDotNewInst(MachineInstr* MI) {
if (isNewValueInst(MI)) const HexagonInstrInfo *QII = (const HexagonInstrInfo *) TII;
if (QII->isNewValueInst(MI))
return true; return true;
switch (MI->getOpcode()) { switch (MI->getOpcode()) {
@ -2894,13 +2884,13 @@ bool HexagonPacketizerList::isLegalToPacketizeTogether(SUnit *SUI, SUnit *SUJ) {
// dealloc_return and memop always take SLOT0. // dealloc_return and memop always take SLOT0.
// Arch spec 3.4.4.2 // Arch spec 3.4.4.2
if (QRI->Subtarget.hasV4TOps()) { if (QRI->Subtarget.hasV4TOps()) {
if (MCIDI.mayStore() && MCIDJ.mayStore() &&
if (MCIDI.mayStore() && MCIDJ.mayStore() && isNewValueInst(J)) { (QII->isNewValueInst(J) || QII->isMemOp(J) || QII->isMemOp(I))) {
Dependence = true; Dependence = true;
return false; return false;
} }
if ( (QII->isMemOp(J) && MCIDI.mayStore()) if ((QII->isMemOp(J) && MCIDI.mayStore())
|| (MCIDJ.mayStore() && QII->isMemOp(I)) || (MCIDJ.mayStore() && QII->isMemOp(I))
|| (QII->isMemOp(J) && QII->isMemOp(I))) { || (QII->isMemOp(J) && QII->isMemOp(I))) {
Dependence = true; Dependence = true;