OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/compiler/instruction-scheduler.h" | 5 #include "src/compiler/instruction-scheduler.h" |
6 | 6 |
7 namespace v8 { | 7 namespace v8 { |
8 namespace internal { | 8 namespace internal { |
9 namespace compiler { | 9 namespace compiler { |
10 | 10 |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 | 169 |
170 UNREACHABLE(); | 170 UNREACHABLE(); |
171 return kNoOpcodeFlags; | 171 return kNoOpcodeFlags; |
172 } | 172 } |
173 | 173 |
174 | 174 |
175 int InstructionScheduler::GetInstructionLatency(const Instruction* instr) { | 175 int InstructionScheduler::GetInstructionLatency(const Instruction* instr) { |
176 // Basic latency modeling for arm64 instructions. They have been determined | 176 // Basic latency modeling for arm64 instructions. They have been determined |
177 // in an empirical way. | 177 // in an empirical way. |
178 switch (instr->arch_opcode()) { | 178 switch (instr->arch_opcode()) { |
179 case kArm64Float32ToFloat64: | 179 case kArm64Add: |
180 case kArm64Float64ToFloat32: | 180 case kArm64Add32: |
181 case kArm64Float64ToInt32: | 181 case kArm64And: |
182 case kArm64Float64ToUint32: | 182 case kArm64And32: |
183 case kArm64Int32ToFloat64: | 183 case kArm64Bic: |
184 case kArm64Uint32ToFloat64: | 184 case kArm64Bic32: |
185 return 3; | 185 case kArm64Cmn: |
| 186 case kArm64Cmn32: |
| 187 case kArm64Cmp: |
| 188 case kArm64Cmp32: |
| 189 case kArm64Eon: |
| 190 case kArm64Eon32: |
| 191 case kArm64Eor: |
| 192 case kArm64Eor32: |
| 193 case kArm64Not: |
| 194 case kArm64Not32: |
| 195 case kArm64Or: |
| 196 case kArm64Or32: |
| 197 case kArm64Orn: |
| 198 case kArm64Orn32: |
| 199 case kArm64Sub: |
| 200 case kArm64Sub32: |
| 201 case kArm64Tst: |
| 202 case kArm64Tst32: |
| 203 if (instr->addressing_mode() != kMode_None) { |
| 204 return 3; |
| 205 } else { |
| 206 return 1; |
| 207 } |
186 | 208 |
187 case kArm64Float64Add: | 209 case kArm64Clz: |
188 case kArm64Float64Sub: | 210 case kArm64Clz32: |
189 return 2; | 211 case kArm64Sbfx32: |
190 | 212 case kArm64Sxtb32: |
191 case kArm64Float64Mul: | 213 case kArm64Sxth32: |
192 return 3; | 214 case kArm64Sxtw: |
193 | 215 case kArm64Ubfiz32: |
194 case kArm64Float64Div: | 216 case kArm64Ubfx: |
195 return 6; | 217 case kArm64Ubfx32: |
| 218 return 1; |
196 | 219 |
197 case kArm64Lsl: | 220 case kArm64Lsl: |
198 case kArm64Lsl32: | 221 case kArm64Lsl32: |
199 case kArm64Lsr: | 222 case kArm64Lsr: |
200 case kArm64Lsr32: | 223 case kArm64Lsr32: |
201 case kArm64Asr: | 224 case kArm64Asr: |
202 case kArm64Asr32: | 225 case kArm64Asr32: |
203 case kArm64Ror: | 226 case kArm64Ror: |
204 case kArm64Ror32: | 227 case kArm64Ror32: |
205 return 3; | 228 return 1; |
| 229 |
| 230 case kArm64Ldr: |
| 231 case kArm64LdrD: |
| 232 case kArm64LdrS: |
| 233 case kArm64LdrW: |
| 234 case kArm64Ldrb: |
| 235 case kArm64Ldrh: |
| 236 case kArm64Ldrsb: |
| 237 case kArm64Ldrsh: |
| 238 return 11; |
206 | 239 |
207 case kCheckedLoadInt8: | 240 case kCheckedLoadInt8: |
208 case kCheckedLoadUint8: | 241 case kCheckedLoadUint8: |
209 case kCheckedLoadInt16: | 242 case kCheckedLoadInt16: |
210 case kCheckedLoadUint16: | 243 case kCheckedLoadUint16: |
211 case kCheckedLoadWord32: | 244 case kCheckedLoadWord32: |
212 case kCheckedLoadWord64: | 245 case kCheckedLoadWord64: |
213 case kCheckedLoadFloat32: | 246 case kCheckedLoadFloat32: |
214 case kCheckedLoadFloat64: | 247 case kCheckedLoadFloat64: |
215 case kArm64LdrS: | 248 return 5; |
216 case kArm64LdrD: | 249 |
217 case kArm64Ldrb: | 250 case kArm64Str: |
218 case kArm64Ldrsb: | 251 case kArm64StrD: |
219 case kArm64Ldrh: | 252 case kArm64StrS: |
220 case kArm64Ldrsh: | 253 case kArm64StrW: |
221 case kArm64LdrW: | 254 case kArm64Strb: |
222 case kArm64Ldr: | 255 case kArm64Strh: |
| 256 return 1; |
| 257 |
| 258 case kCheckedStoreWord8: |
| 259 case kCheckedStoreWord16: |
| 260 case kCheckedStoreWord32: |
| 261 case kCheckedStoreWord64: |
| 262 case kCheckedStoreFloat32: |
| 263 case kCheckedStoreFloat64: |
| 264 return 1; |
| 265 |
| 266 case kArm64Madd32: |
| 267 case kArm64Mneg32: |
| 268 case kArm64Msub32: |
| 269 case kArm64Mul32: |
| 270 return 3; |
| 271 |
| 272 case kArm64Madd: |
| 273 case kArm64Mneg: |
| 274 case kArm64Msub: |
| 275 case kArm64Mul: |
| 276 return 5; |
| 277 |
| 278 case kArm64Idiv32: |
| 279 case kArm64Udiv32: |
| 280 return 12; |
| 281 |
| 282 case kArm64Idiv: |
| 283 case kArm64Udiv: |
| 284 return 20; |
| 285 |
| 286 case kArm64Float32Add: |
| 287 case kArm64Float32Sub: |
| 288 case kArm64Float64Add: |
| 289 case kArm64Float64Sub: |
| 290 return 5; |
| 291 |
| 292 case kArm64Float32Abs: |
| 293 case kArm64Float32Cmp: |
| 294 case kArm64Float64Abs: |
| 295 case kArm64Float64Cmp: |
| 296 case kArm64Float64Neg: |
| 297 return 3; |
| 298 |
| 299 case kArm64Float32Div: |
| 300 case kArm64Float32Sqrt: |
| 301 return 12; |
| 302 |
| 303 case kArm64Float64Div: |
| 304 case kArm64Float64Sqrt: |
| 305 return 19; |
| 306 |
| 307 case kArm64Float32RoundDown: |
| 308 case kArm64Float32RoundTiesEven: |
| 309 case kArm64Float32RoundTruncate: |
| 310 case kArm64Float32RoundUp: |
| 311 case kArm64Float64RoundDown: |
| 312 case kArm64Float64RoundTiesAway: |
| 313 case kArm64Float64RoundTiesEven: |
| 314 case kArm64Float64RoundTruncate: |
| 315 case kArm64Float64RoundUp: |
| 316 return 5; |
| 317 |
| 318 case kArm64Float32ToFloat64: |
| 319 case kArm64Float64ToFloat32: |
| 320 case kArm64Float64ToInt32: |
| 321 case kArm64Float64ToUint32: |
| 322 case kArm64Float32ToInt64: |
| 323 case kArm64Float64ToInt64: |
| 324 case kArm64Float32ToUint64: |
| 325 case kArm64Float64ToUint64: |
| 326 case kArm64Int32ToFloat64: |
| 327 case kArm64Int64ToFloat32: |
| 328 case kArm64Int64ToFloat64: |
| 329 case kArm64Uint32ToFloat64: |
| 330 case kArm64Uint64ToFloat32: |
| 331 case kArm64Uint64ToFloat64: |
223 return 5; | 332 return 5; |
224 | 333 |
225 default: | 334 default: |
226 return 1; | 335 return 2; |
227 } | 336 } |
228 } | 337 } |
229 | 338 |
230 } // namespace compiler | 339 } // namespace compiler |
231 } // namespace internal | 340 } // namespace internal |
232 } // namespace v8 | 341 } // namespace v8 |
OLD | NEW |