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

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

Issue 730183005: [turbofan] Recognize sign extension of 8-bit and 16-bit values on arm64. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 6 years 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/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 7
8 namespace v8 { 8 namespace v8 {
9 namespace internal { 9 namespace internal {
10 namespace compiler { 10 namespace compiler {
(...skipping 590 matching lines...) Expand 10 before | Expand all | Expand 10 after
601 g.TempImmediate(mask_width)); 601 g.TempImmediate(mask_width));
602 return; 602 return;
603 } 603 }
604 } 604 }
605 } 605 }
606 VisitRRO(this, kArm64Lsr, node, kShift64Imm); 606 VisitRRO(this, kArm64Lsr, node, kShift64Imm);
607 } 607 }
608 608
609 609
610 void InstructionSelector::VisitWord32Sar(Node* node) { 610 void InstructionSelector::VisitWord32Sar(Node* node) {
611 Arm64OperandGenerator g(this);
612 Int32BinopMatcher m(node);
613 // Select Sxth/Sxtb for (x << K) >> K where K is 16 or 24.
614 if (CanCover(node, m.left().node()) && m.left().IsWord32Shl()) {
615 Int32BinopMatcher mleft(m.left().node());
616 if (mleft.right().Is(16) && m.right().Is(16)) {
617 Emit(kArm64Sxth32, g.DefineAsRegister(node),
618 g.UseRegister(mleft.left().node()));
619 return;
620 } else if (mleft.right().Is(24) && m.right().Is(24)) {
621 Emit(kArm64Sxtb32, g.DefineAsRegister(node),
622 g.UseRegister(mleft.left().node()));
623 return;
624 }
625 }
611 VisitRRO(this, kArm64Asr32, node, kShift32Imm); 626 VisitRRO(this, kArm64Asr32, node, kShift32Imm);
612 } 627 }
613 628
614 629
615 void InstructionSelector::VisitWord64Sar(Node* node) { 630 void InstructionSelector::VisitWord64Sar(Node* node) {
616 VisitRRO(this, kArm64Asr, node, kShift64Imm); 631 VisitRRO(this, kArm64Asr, node, kShift64Imm);
617 } 632 }
618 633
619 634
620 void InstructionSelector::VisitWord32Ror(Node* node) { 635 void InstructionSelector::VisitWord32Ror(Node* node) {
(...skipping 820 matching lines...) Expand 10 before | Expand all | Expand 10 after
1441 InstructionSelector::SupportedMachineOperatorFlags() { 1456 InstructionSelector::SupportedMachineOperatorFlags() {
1442 return MachineOperatorBuilder::kFloat64Floor | 1457 return MachineOperatorBuilder::kFloat64Floor |
1443 MachineOperatorBuilder::kFloat64Ceil | 1458 MachineOperatorBuilder::kFloat64Ceil |
1444 MachineOperatorBuilder::kFloat64RoundTruncate | 1459 MachineOperatorBuilder::kFloat64RoundTruncate |
1445 MachineOperatorBuilder::kFloat64RoundTiesAway | 1460 MachineOperatorBuilder::kFloat64RoundTiesAway |
1446 MachineOperatorBuilder::kWord32ShiftIsSafe; 1461 MachineOperatorBuilder::kWord32ShiftIsSafe;
1447 } 1462 }
1448 } // namespace compiler 1463 } // namespace compiler
1449 } // namespace internal 1464 } // namespace internal
1450 } // namespace v8 1465 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/arm64/instruction-codes-arm64.h ('k') | test/unittests/compiler/arm64/instruction-selector-arm64-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698