Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(560)

Unified Diff: src/compiler/ia32/instruction-scheduler-ia32.cc

Issue 2130153003: [turbofan] Add instruction latency modeling for ia32 and x64 platform (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase on Oct. 8 Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/compiler/x64/instruction-scheduler-x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/ia32/instruction-scheduler-ia32.cc
diff --git a/src/compiler/ia32/instruction-scheduler-ia32.cc b/src/compiler/ia32/instruction-scheduler-ia32.cc
index ad7535c7c7a9bba52b754d7c6a810aec7eb2ba35..3216b1de0bf657e66bf56f67f2be8a5f35a51dcb 100644
--- a/src/compiler/ia32/instruction-scheduler-ia32.cc
+++ b/src/compiler/ia32/instruction-scheduler-ia32.cc
@@ -146,8 +146,72 @@ int InstructionScheduler::GetTargetInstructionFlags(
int InstructionScheduler::GetInstructionLatency(const Instruction* instr) {
- // TODO(all): Add instruction cost modeling.
- return 1;
+ // Basic latency modeling for ia32 instructions. They have been determined
+ // in an empirical way.
+ switch (instr->arch_opcode()) {
+ case kCheckedLoadInt8:
+ case kCheckedLoadUint8:
+ case kCheckedLoadInt16:
+ case kCheckedLoadUint16:
+ case kCheckedLoadWord32:
+ case kCheckedLoadFloat32:
+ case kCheckedLoadFloat64:
+ case kCheckedStoreWord8:
+ case kCheckedStoreWord16:
+ case kCheckedStoreWord32:
+ case kCheckedStoreFloat32:
+ case kCheckedStoreFloat64:
+ case kSSEFloat64Mul:
+ return 5;
+ case kIA32Imul:
+ case kIA32ImulHigh:
+ return 5;
+ case kSSEFloat32Cmp:
+ case kSSEFloat64Cmp:
+ return 9;
+ case kSSEFloat32Add:
+ case kSSEFloat32Sub:
+ case kSSEFloat32Abs:
+ case kSSEFloat32Neg:
+ case kSSEFloat64Add:
+ case kSSEFloat64Sub:
+ case kSSEFloat64Max:
+ case kSSEFloat64Min:
+ case kSSEFloat64Abs:
+ case kSSEFloat64Neg:
+ return 5;
+ case kSSEFloat32Mul:
+ return 4;
+ case kSSEFloat32ToFloat64:
+ case kSSEFloat64ToFloat32:
+ return 6;
+ case kSSEFloat32Round:
+ case kSSEFloat64Round:
+ case kSSEFloat32ToInt32:
+ case kSSEFloat64ToInt32:
+ return 8;
+ case kSSEFloat32ToUint32:
+ return 21;
+ case kSSEFloat64ToUint32:
+ return 15;
+ case kIA32Idiv:
+ return 33;
+ case kIA32Udiv:
+ return 26;
+ case kSSEFloat32Div:
+ return 35;
+ case kSSEFloat64Div:
+ return 63;
+ case kSSEFloat32Sqrt:
+ case kSSEFloat64Sqrt:
+ return 25;
+ case kSSEFloat64Mod:
+ return 50;
+ case kArchTruncateDoubleToI:
+ return 9;
+ default:
+ return 1;
+ }
}
} // namespace compiler
« no previous file with comments | « no previous file | src/compiler/x64/instruction-scheduler-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698