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

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

Issue 1405453003: CTZ instruction implemented as optional operator. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 2 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
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 "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 535 matching lines...) Expand 10 before | Expand all | Expand 10 after
546 VisitShift(this, node, kIA32Ror); 546 VisitShift(this, node, kIA32Ror);
547 } 547 }
548 548
549 549
550 void InstructionSelector::VisitWord32Clz(Node* node) { 550 void InstructionSelector::VisitWord32Clz(Node* node) {
551 IA32OperandGenerator g(this); 551 IA32OperandGenerator g(this);
552 Emit(kIA32Lzcnt, g.DefineAsRegister(node), g.Use(node->InputAt(0))); 552 Emit(kIA32Lzcnt, g.DefineAsRegister(node), g.Use(node->InputAt(0)));
553 } 553 }
554 554
555 555
556 void InstructionSelector::VisitWord32Ctz(Node* node) { UNREACHABLE(); }
557
558
556 void InstructionSelector::VisitInt32Add(Node* node) { 559 void InstructionSelector::VisitInt32Add(Node* node) {
557 IA32OperandGenerator g(this); 560 IA32OperandGenerator g(this);
558 561
559 // Try to match the Add to a lea pattern 562 // Try to match the Add to a lea pattern
560 BaseWithIndexAndDisplacement32Matcher m(node); 563 BaseWithIndexAndDisplacement32Matcher m(node);
561 if (m.matches() && 564 if (m.matches() &&
562 (m.displacement() == NULL || g.CanBeImmediate(m.displacement()))) { 565 (m.displacement() == NULL || g.CanBeImmediate(m.displacement()))) {
563 InstructionOperand inputs[4]; 566 InstructionOperand inputs[4];
564 size_t input_count = 0; 567 size_t input_count = 0;
565 AddressingMode mode = g.GenerateMemoryOperandInputs( 568 AddressingMode mode = g.GenerateMemoryOperandInputs(
(...skipping 795 matching lines...) Expand 10 before | Expand all | Expand 10 after
1361 if (CpuFeatures::IsSupported(SSE4_1)) { 1364 if (CpuFeatures::IsSupported(SSE4_1)) {
1362 flags |= MachineOperatorBuilder::kFloat64RoundDown | 1365 flags |= MachineOperatorBuilder::kFloat64RoundDown |
1363 MachineOperatorBuilder::kFloat64RoundTruncate; 1366 MachineOperatorBuilder::kFloat64RoundTruncate;
1364 } 1367 }
1365 return flags; 1368 return flags;
1366 } 1369 }
1367 1370
1368 } // namespace compiler 1371 } // namespace compiler
1369 } // namespace internal 1372 } // namespace internal
1370 } // namespace v8 1373 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698