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

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

Issue 1021183002: [turbofan] Turn Math.clz32 into an inlinable builtin. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 9 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 unified diff | Download patch
« no previous file with comments | « src/compiler/x64/instruction-codes-x64.h ('k') | src/counters.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/compiler/instruction-selector-impl.h" 7 #include "src/compiler/instruction-selector-impl.h"
8 #include "src/compiler/node-matchers.h" 8 #include "src/compiler/node-matchers.h"
9 #include "src/compiler/node-properties.h" 9 #include "src/compiler/node-properties.h"
10 10
(...skipping 537 matching lines...) Expand 10 before | Expand all | Expand 10 after
548 void InstructionSelector::VisitWord32Ror(Node* node) { 548 void InstructionSelector::VisitWord32Ror(Node* node) {
549 VisitWord32Shift(this, node, kX64Ror32); 549 VisitWord32Shift(this, node, kX64Ror32);
550 } 550 }
551 551
552 552
553 void InstructionSelector::VisitWord64Ror(Node* node) { 553 void InstructionSelector::VisitWord64Ror(Node* node) {
554 VisitWord64Shift(this, node, kX64Ror); 554 VisitWord64Shift(this, node, kX64Ror);
555 } 555 }
556 556
557 557
558 void InstructionSelector::VisitWord32Clz(Node* node) {
559 X64OperandGenerator g(this);
560 Emit(kX64Lzcnt32, g.DefineAsRegister(node), g.Use(node->InputAt(0)));
561 }
562
563
558 void InstructionSelector::VisitInt32Add(Node* node) { 564 void InstructionSelector::VisitInt32Add(Node* node) {
559 X64OperandGenerator g(this); 565 X64OperandGenerator g(this);
560 566
561 // Try to match the Add to a leal pattern 567 // Try to match the Add to a leal pattern
562 BaseWithIndexAndDisplacement32Matcher m(node); 568 BaseWithIndexAndDisplacement32Matcher m(node);
563 if (m.matches() && 569 if (m.matches() &&
564 (m.displacement() == NULL || g.CanBeImmediate(m.displacement()))) { 570 (m.displacement() == NULL || g.CanBeImmediate(m.displacement()))) {
565 EmitLea(this, kX64Lea32, node, m.index(), m.scale(), m.base(), 571 EmitLea(this, kX64Lea32, node, m.index(), m.scale(), m.base(),
566 m.displacement()); 572 m.displacement());
567 return; 573 return;
(...skipping 911 matching lines...) Expand 10 before | Expand all | Expand 10 after
1479 if (CpuFeatures::IsSupported(SSE4_1)) { 1485 if (CpuFeatures::IsSupported(SSE4_1)) {
1480 flags |= MachineOperatorBuilder::kFloat64RoundDown | 1486 flags |= MachineOperatorBuilder::kFloat64RoundDown |
1481 MachineOperatorBuilder::kFloat64RoundTruncate; 1487 MachineOperatorBuilder::kFloat64RoundTruncate;
1482 } 1488 }
1483 return flags; 1489 return flags;
1484 } 1490 }
1485 1491
1486 } // namespace compiler 1492 } // namespace compiler
1487 } // namespace internal 1493 } // namespace internal
1488 } // namespace v8 1494 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/x64/instruction-codes-x64.h ('k') | src/counters.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698