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

Side by Side Diff: src/compiler/x64/instruction-selector-x64.cc

Issue 1421163005: Implemented the ctz Turbo Fan operator for x64. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fixed the comments Created 5 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « src/compiler/x64/instruction-codes-x64.h ('k') | src/x64/assembler-x64.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <algorithm> 5 #include <algorithm>
6 6
7 #include "src/base/adapters.h" 7 #include "src/base/adapters.h"
8 #include "src/compiler/instruction-selector-impl.h" 8 #include "src/compiler/instruction-selector-impl.h"
9 #include "src/compiler/node-matchers.h" 9 #include "src/compiler/node-matchers.h"
10 #include "src/compiler/node-properties.h" 10 #include "src/compiler/node-properties.h"
(...skipping 566 matching lines...) Expand 10 before | Expand all | Expand 10 after
577 Emit(kX64Lzcnt, g.DefineAsRegister(node), g.Use(node->InputAt(0))); 577 Emit(kX64Lzcnt, g.DefineAsRegister(node), g.Use(node->InputAt(0)));
578 } 578 }
579 579
580 580
581 void InstructionSelector::VisitWord32Clz(Node* node) { 581 void InstructionSelector::VisitWord32Clz(Node* node) {
582 X64OperandGenerator g(this); 582 X64OperandGenerator g(this);
583 Emit(kX64Lzcnt32, g.DefineAsRegister(node), g.Use(node->InputAt(0))); 583 Emit(kX64Lzcnt32, g.DefineAsRegister(node), g.Use(node->InputAt(0)));
584 } 584 }
585 585
586 586
587 void InstructionSelector::VisitWord64Ctz(Node* node) {
588 X64OperandGenerator g(this);
589 Emit(kX64Tzcnt, g.DefineAsRegister(node), g.Use(node->InputAt(0)));
590 }
591
592
587 void InstructionSelector::VisitWord32Ctz(Node* node) { 593 void InstructionSelector::VisitWord32Ctz(Node* node) {
588 X64OperandGenerator g(this); 594 X64OperandGenerator g(this);
589 Emit(kX64Tzcnt32, g.DefineAsRegister(node), g.Use(node->InputAt(0))); 595 Emit(kX64Tzcnt32, g.DefineAsRegister(node), g.Use(node->InputAt(0)));
590 } 596 }
591 597
592 598
593 void InstructionSelector::VisitWord32Popcnt(Node* node) { 599 void InstructionSelector::VisitWord32Popcnt(Node* node) {
594 X64OperandGenerator g(this); 600 X64OperandGenerator g(this);
595 Emit(kX64Popcnt32, g.DefineAsRegister(node), g.Use(node->InputAt(0))); 601 Emit(kX64Popcnt32, g.DefineAsRegister(node), g.Use(node->InputAt(0)));
596 } 602 }
(...skipping 1002 matching lines...) Expand 10 before | Expand all | Expand 10 after
1599 1605
1600 // static 1606 // static
1601 MachineOperatorBuilder::Flags 1607 MachineOperatorBuilder::Flags
1602 InstructionSelector::SupportedMachineOperatorFlags() { 1608 InstructionSelector::SupportedMachineOperatorFlags() {
1603 MachineOperatorBuilder::Flags flags = 1609 MachineOperatorBuilder::Flags flags =
1604 MachineOperatorBuilder::kFloat32Max | 1610 MachineOperatorBuilder::kFloat32Max |
1605 MachineOperatorBuilder::kFloat32Min | 1611 MachineOperatorBuilder::kFloat32Min |
1606 MachineOperatorBuilder::kFloat64Max | 1612 MachineOperatorBuilder::kFloat64Max |
1607 MachineOperatorBuilder::kFloat64Min | 1613 MachineOperatorBuilder::kFloat64Min |
1608 MachineOperatorBuilder::kWord32ShiftIsSafe | 1614 MachineOperatorBuilder::kWord32ShiftIsSafe |
1609 MachineOperatorBuilder::kWord32Ctz; 1615 MachineOperatorBuilder::kWord32Ctz | MachineOperatorBuilder::kWord64Ctz;
1610 if (CpuFeatures::IsSupported(POPCNT)) { 1616 if (CpuFeatures::IsSupported(POPCNT)) {
1611 flags |= MachineOperatorBuilder::kWord32Popcnt; 1617 flags |= MachineOperatorBuilder::kWord32Popcnt;
1612 } 1618 }
1613 if (CpuFeatures::IsSupported(SSE4_1)) { 1619 if (CpuFeatures::IsSupported(SSE4_1)) {
1614 flags |= MachineOperatorBuilder::kFloat64RoundDown | 1620 flags |= MachineOperatorBuilder::kFloat64RoundDown |
1615 MachineOperatorBuilder::kFloat64RoundTruncate; 1621 MachineOperatorBuilder::kFloat64RoundTruncate;
1616 } 1622 }
1617 return flags; 1623 return flags;
1618 } 1624 }
1619 1625
1620 } // namespace compiler 1626 } // namespace compiler
1621 } // namespace internal 1627 } // namespace internal
1622 } // namespace v8 1628 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/x64/instruction-codes-x64.h ('k') | src/x64/assembler-x64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698