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

Side by Side Diff: src/compiler/ia32/instruction-selector-ia32.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/ia32/instruction-codes-ia32.h ('k') | src/compiler/instruction-selector.cc » ('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/compiler/instruction-selector-impl.h" 5 #include "src/compiler/instruction-selector-impl.h"
6 #include "src/compiler/node-matchers.h" 6 #include "src/compiler/node-matchers.h"
7 #include "src/compiler/node-properties.h" 7 #include "src/compiler/node-properties.h"
8 8
9 namespace v8 { 9 namespace v8 {
10 namespace internal { 10 namespace internal {
(...skipping 485 matching lines...) Expand 10 before | Expand all | Expand 10 after
496 void InstructionSelector::VisitWord32Sar(Node* node) { 496 void InstructionSelector::VisitWord32Sar(Node* node) {
497 VisitShift(this, node, kIA32Sar); 497 VisitShift(this, node, kIA32Sar);
498 } 498 }
499 499
500 500
501 void InstructionSelector::VisitWord32Ror(Node* node) { 501 void InstructionSelector::VisitWord32Ror(Node* node) {
502 VisitShift(this, node, kIA32Ror); 502 VisitShift(this, node, kIA32Ror);
503 } 503 }
504 504
505 505
506 void InstructionSelector::VisitWord32Clz(Node* node) {
507 IA32OperandGenerator g(this);
508 Emit(kIA32Lzcnt, g.DefineAsRegister(node), g.Use(node->InputAt(0)));
509 }
510
511
506 void InstructionSelector::VisitInt32Add(Node* node) { 512 void InstructionSelector::VisitInt32Add(Node* node) {
507 IA32OperandGenerator g(this); 513 IA32OperandGenerator g(this);
508 514
509 // Try to match the Add to a lea pattern 515 // Try to match the Add to a lea pattern
510 BaseWithIndexAndDisplacement32Matcher m(node); 516 BaseWithIndexAndDisplacement32Matcher m(node);
511 if (m.matches() && 517 if (m.matches() &&
512 (m.displacement() == NULL || g.CanBeImmediate(m.displacement()))) { 518 (m.displacement() == NULL || g.CanBeImmediate(m.displacement()))) {
513 InstructionOperand inputs[4]; 519 InstructionOperand inputs[4];
514 size_t input_count = 0; 520 size_t input_count = 0;
515 AddressingMode mode = g.GenerateMemoryOperandInputs( 521 AddressingMode mode = g.GenerateMemoryOperandInputs(
(...skipping 649 matching lines...) Expand 10 before | Expand all | Expand 10 after
1165 if (CpuFeatures::IsSupported(SSE4_1)) { 1171 if (CpuFeatures::IsSupported(SSE4_1)) {
1166 flags |= MachineOperatorBuilder::kFloat64RoundDown | 1172 flags |= MachineOperatorBuilder::kFloat64RoundDown |
1167 MachineOperatorBuilder::kFloat64RoundTruncate; 1173 MachineOperatorBuilder::kFloat64RoundTruncate;
1168 } 1174 }
1169 return flags; 1175 return flags;
1170 } 1176 }
1171 1177
1172 } // namespace compiler 1178 } // namespace compiler
1173 } // namespace internal 1179 } // namespace internal
1174 } // namespace v8 1180 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/ia32/instruction-codes-ia32.h ('k') | src/compiler/instruction-selector.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698