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/generic-node-inl.h" | 5 #include "src/compiler/generic-node-inl.h" |
6 #include "src/compiler/instruction-selector-impl.h" | 6 #include "src/compiler/instruction-selector-impl.h" |
7 #include "src/compiler/node-matchers.h" | 7 #include "src/compiler/node-matchers.h" |
8 | 8 |
9 namespace v8 { | 9 namespace v8 { |
10 namespace internal { | 10 namespace internal { |
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
339 VisitWord32Shift(this, node, kX64Shr32); | 339 VisitWord32Shift(this, node, kX64Shr32); |
340 } | 340 } |
341 | 341 |
342 | 342 |
343 void InstructionSelector::VisitWord64Shr(Node* node) { | 343 void InstructionSelector::VisitWord64Shr(Node* node) { |
344 VisitWord64Shift(this, node, kX64Shr); | 344 VisitWord64Shift(this, node, kX64Shr); |
345 } | 345 } |
346 | 346 |
347 | 347 |
348 void InstructionSelector::VisitWord32Sar(Node* node) { | 348 void InstructionSelector::VisitWord32Sar(Node* node) { |
| 349 X64OperandGenerator g(this); |
| 350 Int32BinopMatcher m(node); |
| 351 if (CanCover(m.node(), m.left().node()) && m.left().IsWord32Shl()) { |
| 352 Int32BinopMatcher mleft(m.left().node()); |
| 353 if (mleft.right().Is(16) && m.right().Is(16)) { |
| 354 Emit(kX64Movsxwl, g.DefineAsRegister(node), g.Use(mleft.left().node())); |
| 355 return; |
| 356 } |
| 357 } |
349 VisitWord32Shift(this, node, kX64Sar32); | 358 VisitWord32Shift(this, node, kX64Sar32); |
350 } | 359 } |
351 | 360 |
352 | 361 |
353 void InstructionSelector::VisitWord64Sar(Node* node) { | 362 void InstructionSelector::VisitWord64Sar(Node* node) { |
354 VisitWord64Shift(this, node, kX64Sar); | 363 VisitWord64Shift(this, node, kX64Sar); |
355 } | 364 } |
356 | 365 |
357 | 366 |
358 void InstructionSelector::VisitWord32Ror(Node* node) { | 367 void InstructionSelector::VisitWord32Ror(Node* node) { |
359 VisitWord32Shift(this, node, kX64Ror32); | 368 VisitWord32Shift(this, node, kX64Ror32); |
360 } | 369 } |
361 | 370 |
362 | 371 |
363 void InstructionSelector::VisitWord64Ror(Node* node) { | 372 void InstructionSelector::VisitWord64Ror(Node* node) { |
364 VisitWord64Shift(this, node, kX64Ror); | 373 VisitWord64Shift(this, node, kX64Ror); |
365 } | 374 } |
366 | 375 |
| 376 |
367 namespace { | 377 namespace { |
368 | 378 |
369 AddressingMode GenerateMemoryOperandInputs(X64OperandGenerator* g, Node* scaled, | 379 AddressingMode GenerateMemoryOperandInputs(X64OperandGenerator* g, Node* scaled, |
370 int scale_exponent, Node* offset, | 380 int scale_exponent, Node* offset, |
371 Node* constant, | 381 Node* constant, |
372 InstructionOperand* inputs[], | 382 InstructionOperand* inputs[], |
373 size_t* input_count) { | 383 size_t* input_count) { |
374 AddressingMode mode = kMode_MRI; | 384 AddressingMode mode = kMode_MRI; |
375 if (offset != NULL) { | 385 if (offset != NULL) { |
376 inputs[(*input_count)++] = g->UseRegister(offset); | 386 inputs[(*input_count)++] = g->UseRegister(offset); |
(...skipping 777 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1154 // static | 1164 // static |
1155 MachineOperatorBuilder::Flags | 1165 MachineOperatorBuilder::Flags |
1156 InstructionSelector::SupportedMachineOperatorFlags() { | 1166 InstructionSelector::SupportedMachineOperatorFlags() { |
1157 if (CpuFeatures::IsSupported(SSE4_1)) { | 1167 if (CpuFeatures::IsSupported(SSE4_1)) { |
1158 return MachineOperatorBuilder::kFloat64Floor | | 1168 return MachineOperatorBuilder::kFloat64Floor | |
1159 MachineOperatorBuilder::kFloat64Ceil | | 1169 MachineOperatorBuilder::kFloat64Ceil | |
1160 MachineOperatorBuilder::kFloat64RoundTruncate; | 1170 MachineOperatorBuilder::kFloat64RoundTruncate; |
1161 } | 1171 } |
1162 return MachineOperatorBuilder::kNoFlags; | 1172 return MachineOperatorBuilder::kNoFlags; |
1163 } | 1173 } |
| 1174 |
1164 } // namespace compiler | 1175 } // namespace compiler |
1165 } // namespace internal | 1176 } // namespace internal |
1166 } // namespace v8 | 1177 } // namespace v8 |
OLD | NEW |