Commit fab09bbb authored by mbrandy's avatar mbrandy Committed by Commit bot

PPC: Reland "[turbofan] Instruction scheduler for Turbofan."

Port 89bb66de

Original commit message:
    Original CL: https://codereview.chromium.org/1375253002/

    Implement machine instruction scheduling after instruction selection.

R=baptiste.afsa@arm.com, joransiu@ca.ibm.com, jyan@ca.ibm.com, michael_dawson@ca.ibm.com
BUG=

Review URL: https://codereview.chromium.org/1534433004

Cr-Commit-Position: refs/heads/master@{#32918}
parent 9fc48575
......@@ -8,17 +8,134 @@ namespace v8 {
namespace internal {
namespace compiler {
bool InstructionScheduler::SchedulerSupported() { return false; }
bool InstructionScheduler::SchedulerSupported() { return true; }
int InstructionScheduler::GetTargetInstructionFlags(
const Instruction* instr) const {
UNIMPLEMENTED();
switch (instr->arch_opcode()) {
case kPPC_And:
case kPPC_AndComplement:
case kPPC_Or:
case kPPC_OrComplement:
case kPPC_Xor:
case kPPC_ShiftLeft32:
case kPPC_ShiftLeft64:
case kPPC_ShiftRight32:
case kPPC_ShiftRight64:
case kPPC_ShiftRightAlg32:
case kPPC_ShiftRightAlg64:
case kPPC_RotRight32:
case kPPC_RotRight64:
case kPPC_Not:
case kPPC_RotLeftAndMask32:
case kPPC_RotLeftAndClear64:
case kPPC_RotLeftAndClearLeft64:
case kPPC_RotLeftAndClearRight64:
case kPPC_Add:
case kPPC_AddWithOverflow32:
case kPPC_AddDouble:
case kPPC_Sub:
case kPPC_SubWithOverflow32:
case kPPC_SubDouble:
case kPPC_Mul32:
case kPPC_Mul64:
case kPPC_MulHigh32:
case kPPC_MulHighU32:
case kPPC_MulDouble:
case kPPC_Div32:
case kPPC_Div64:
case kPPC_DivU32:
case kPPC_DivU64:
case kPPC_DivDouble:
case kPPC_Mod32:
case kPPC_Mod64:
case kPPC_ModU32:
case kPPC_ModU64:
case kPPC_ModDouble:
case kPPC_Neg:
case kPPC_NegDouble:
case kPPC_SqrtDouble:
case kPPC_FloorDouble:
case kPPC_CeilDouble:
case kPPC_TruncateDouble:
case kPPC_RoundDouble:
case kPPC_MaxDouble:
case kPPC_MinDouble:
case kPPC_AbsDouble:
case kPPC_Cntlz32:
case kPPC_Cntlz64:
case kPPC_Popcnt32:
case kPPC_Popcnt64:
case kPPC_Cmp32:
case kPPC_Cmp64:
case kPPC_CmpDouble:
case kPPC_Tst32:
case kPPC_Tst64:
case kPPC_ExtendSignWord8:
case kPPC_ExtendSignWord16:
case kPPC_ExtendSignWord32:
case kPPC_Uint32ToUint64:
case kPPC_Int64ToInt32:
case kPPC_Int64ToFloat32:
case kPPC_Int64ToDouble:
case kPPC_Uint64ToFloat32:
case kPPC_Uint64ToDouble:
case kPPC_Int32ToDouble:
case kPPC_Uint32ToDouble:
case kPPC_Float32ToDouble:
case kPPC_DoubleToInt32:
case kPPC_DoubleToUint32:
case kPPC_DoubleToInt64:
case kPPC_DoubleToUint64:
case kPPC_DoubleToFloat32:
case kPPC_DoubleExtractLowWord32:
case kPPC_DoubleExtractHighWord32:
case kPPC_DoubleInsertLowWord32:
case kPPC_DoubleInsertHighWord32:
case kPPC_DoubleConstruct:
case kPPC_BitcastInt32ToFloat32:
case kPPC_BitcastFloat32ToInt32:
case kPPC_BitcastInt64ToDouble:
case kPPC_BitcastDoubleToInt64:
return kNoOpcodeFlags;
case kPPC_LoadWordS8:
case kPPC_LoadWordU8:
case kPPC_LoadWordS16:
case kPPC_LoadWordU16:
case kPPC_LoadWordS32:
case kPPC_LoadWord64:
case kPPC_LoadFloat32:
case kPPC_LoadDouble:
return kIsLoadOperation;
case kPPC_StoreWord8:
case kPPC_StoreWord16:
case kPPC_StoreWord32:
case kPPC_StoreWord64:
case kPPC_StoreFloat32:
case kPPC_StoreDouble:
case kPPC_Push:
case kPPC_PushFrame:
case kPPC_StoreToStackSlot:
return kHasSideEffect;
#define CASE(Name) case k##Name:
COMMON_ARCH_OPCODE_LIST(CASE)
#undef CASE
// Already covered in architecture independent code.
UNREACHABLE();
}
UNREACHABLE();
return kNoOpcodeFlags;
}
int InstructionScheduler::GetInstructionLatency(const Instruction* instr) {
UNIMPLEMENTED();
// TODO(all): Add instruction cost modeling.
return 1;
}
} // namespace compiler
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment