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

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

Issue 1405453003: CTZ instruction implemented as optional operator. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fixed a bug when bmi1=false 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
« no previous file with comments | « src/compiler/x64/instruction-selector-x64.cc ('k') | src/ia32/assembler-ia32.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 "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 496 matching lines...) Expand 10 before | Expand all | Expand 10 after
507 VisitShift(this, node, kX87Ror); 507 VisitShift(this, node, kX87Ror);
508 } 508 }
509 509
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(); }
518
519
517 void InstructionSelector::VisitInt32Add(Node* node) { 520 void InstructionSelector::VisitInt32Add(Node* node) {
518 X87OperandGenerator g(this); 521 X87OperandGenerator g(this);
519 522
520 // Try to match the Add to a lea pattern 523 // Try to match the Add to a lea pattern
521 BaseWithIndexAndDisplacement32Matcher m(node); 524 BaseWithIndexAndDisplacement32Matcher m(node);
522 if (m.matches() && 525 if (m.matches() &&
523 (m.displacement() == NULL || g.CanBeImmediate(m.displacement()))) { 526 (m.displacement() == NULL || g.CanBeImmediate(m.displacement()))) {
524 InstructionOperand inputs[4]; 527 InstructionOperand inputs[4];
525 size_t input_count = 0; 528 size_t input_count = 0;
526 AddressingMode mode = g.GenerateMemoryOperandInputs( 529 AddressingMode mode = g.GenerateMemoryOperandInputs(
(...skipping 837 matching lines...) Expand 10 before | Expand all | Expand 10 after
1364 MachineOperatorBuilder::kFloat32Min | 1367 MachineOperatorBuilder::kFloat32Min |
1365 MachineOperatorBuilder::kFloat64Max | 1368 MachineOperatorBuilder::kFloat64Max |
1366 MachineOperatorBuilder::kFloat64Min | 1369 MachineOperatorBuilder::kFloat64Min |
1367 MachineOperatorBuilder::kWord32ShiftIsSafe; 1370 MachineOperatorBuilder::kWord32ShiftIsSafe;
1368 return flags; 1371 return flags;
1369 } 1372 }
1370 1373
1371 } // namespace compiler 1374 } // namespace compiler
1372 } // namespace internal 1375 } // namespace internal
1373 } // namespace v8 1376 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/x64/instruction-selector-x64.cc ('k') | src/ia32/assembler-ia32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698