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/base/adapters.h" | 5 #include "src/base/adapters.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 #include "src/compiler/node-properties.h" | 8 #include "src/compiler/node-properties.h" |
9 | 9 |
10 namespace v8 { | 10 namespace v8 { |
(...skipping 499 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
510 | 510 |
511 void InstructionSelector::VisitWord32Clz(Node* node) { | 511 void InstructionSelector::VisitWord32Clz(Node* node) { |
512 X87OperandGenerator g(this); | 512 X87OperandGenerator g(this); |
513 Emit(kX87Lzcnt, g.DefineAsRegister(node), g.Use(node->InputAt(0))); | 513 Emit(kX87Lzcnt, g.DefineAsRegister(node), g.Use(node->InputAt(0))); |
514 } | 514 } |
515 | 515 |
516 | 516 |
517 void InstructionSelector::VisitWord32Ctz(Node* node) { UNREACHABLE(); } | 517 void InstructionSelector::VisitWord32Ctz(Node* node) { UNREACHABLE(); } |
518 | 518 |
519 | 519 |
520 void InstructionSelector::VisitWord32Popcnt(Node* node) { UNREACHABLE(); } | 520 void InstructionSelector::VisitWord32Popcnt(Node* node) { |
| 521 X87OperandGenerator g(this); |
| 522 Emit(kX87Popcnt, g.DefineAsRegister(node), g.Use(node->InputAt(0))); |
| 523 } |
521 | 524 |
522 | 525 |
523 void InstructionSelector::VisitInt32Add(Node* node) { | 526 void InstructionSelector::VisitInt32Add(Node* node) { |
524 X87OperandGenerator g(this); | 527 X87OperandGenerator g(this); |
525 | 528 |
526 // Try to match the Add to a lea pattern | 529 // Try to match the Add to a lea pattern |
527 BaseWithIndexAndDisplacement32Matcher m(node); | 530 BaseWithIndexAndDisplacement32Matcher m(node); |
528 if (m.matches() && | 531 if (m.matches() && |
529 (m.displacement() == NULL || g.CanBeImmediate(m.displacement()))) { | 532 (m.displacement() == NULL || g.CanBeImmediate(m.displacement()))) { |
530 InstructionOperand inputs[4]; | 533 InstructionOperand inputs[4]; |
(...skipping 833 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1364 | 1367 |
1365 // static | 1368 // static |
1366 MachineOperatorBuilder::Flags | 1369 MachineOperatorBuilder::Flags |
1367 InstructionSelector::SupportedMachineOperatorFlags() { | 1370 InstructionSelector::SupportedMachineOperatorFlags() { |
1368 MachineOperatorBuilder::Flags flags = | 1371 MachineOperatorBuilder::Flags flags = |
1369 MachineOperatorBuilder::kFloat32Max | | 1372 MachineOperatorBuilder::kFloat32Max | |
1370 MachineOperatorBuilder::kFloat32Min | | 1373 MachineOperatorBuilder::kFloat32Min | |
1371 MachineOperatorBuilder::kFloat64Max | | 1374 MachineOperatorBuilder::kFloat64Max | |
1372 MachineOperatorBuilder::kFloat64Min | | 1375 MachineOperatorBuilder::kFloat64Min | |
1373 MachineOperatorBuilder::kWord32ShiftIsSafe; | 1376 MachineOperatorBuilder::kWord32ShiftIsSafe; |
| 1377 if (CpuFeatures::IsSupported(POPCNT)) { |
| 1378 flags |= MachineOperatorBuilder::kWord32Popcnt; |
| 1379 } |
1374 return flags; | 1380 return flags; |
1375 } | 1381 } |
1376 | 1382 |
1377 } // namespace compiler | 1383 } // namespace compiler |
1378 } // namespace internal | 1384 } // namespace internal |
1379 } // namespace v8 | 1385 } // namespace v8 |
OLD | NEW |