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

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

Issue 1008003004: [ARM64] [turbofan] Improve construction of doubles. (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/arm64/instruction-codes-arm64.h ('k') | no next file » | 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 1588 matching lines...) Expand 10 before | Expand all | Expand 10 after
1599 1599
1600 1600
1601 void InstructionSelector::VisitFloat64ExtractHighWord32(Node* node) { 1601 void InstructionSelector::VisitFloat64ExtractHighWord32(Node* node) {
1602 Arm64OperandGenerator g(this); 1602 Arm64OperandGenerator g(this);
1603 Emit(kArm64Float64ExtractHighWord32, g.DefineAsRegister(node), 1603 Emit(kArm64Float64ExtractHighWord32, g.DefineAsRegister(node),
1604 g.UseRegister(node->InputAt(0))); 1604 g.UseRegister(node->InputAt(0)));
1605 } 1605 }
1606 1606
1607 1607
1608 void InstructionSelector::VisitFloat64InsertLowWord32(Node* node) { 1608 void InstructionSelector::VisitFloat64InsertLowWord32(Node* node) {
1609 // TODO(arm64): Some AArch64 specialist should be able to improve this.
1610 Arm64OperandGenerator g(this); 1609 Arm64OperandGenerator g(this);
1611 Node* left = node->InputAt(0); 1610 Node* left = node->InputAt(0);
1612 Node* right = node->InputAt(1); 1611 Node* right = node->InputAt(1);
1612 if (left->opcode() == IrOpcode::kFloat64InsertHighWord32 &&
1613 CanCover(node, left)) {
1614 Node* right_of_left = left->InputAt(1);
1615 Emit(kArm64Bfi, g.DefineSameAsFirst(right), g.UseRegister(right),
1616 g.UseRegister(right_of_left), g.TempImmediate(32),
1617 g.TempImmediate(32));
1618 Emit(kArm64Float64MoveU64, g.DefineAsRegister(node), g.UseRegister(right));
1619 return;
1620 }
1613 Emit(kArm64Float64InsertLowWord32, g.DefineAsRegister(node), 1621 Emit(kArm64Float64InsertLowWord32, g.DefineAsRegister(node),
1614 g.UseRegister(left), g.UseRegister(right)); 1622 g.UseRegister(left), g.UseRegister(right));
1615 } 1623 }
1616 1624
1617 1625
1618 void InstructionSelector::VisitFloat64InsertHighWord32(Node* node) { 1626 void InstructionSelector::VisitFloat64InsertHighWord32(Node* node) {
1619 // TODO(arm64): Some AArch64 specialist should be able to improve this.
1620 Arm64OperandGenerator g(this); 1627 Arm64OperandGenerator g(this);
1621 Node* left = node->InputAt(0); 1628 Node* left = node->InputAt(0);
1622 Node* right = node->InputAt(1); 1629 Node* right = node->InputAt(1);
1630 if (left->opcode() == IrOpcode::kFloat64InsertLowWord32 &&
1631 CanCover(node, left)) {
1632 Node* right_of_left = left->InputAt(1);
1633 Emit(kArm64Bfi, g.DefineSameAsFirst(left), g.UseRegister(right_of_left),
1634 g.UseRegister(right), g.TempImmediate(32), g.TempImmediate(32));
1635 Emit(kArm64Float64MoveU64, g.DefineAsRegister(node), g.UseRegister(left));
1636 return;
1637 }
1623 Emit(kArm64Float64InsertHighWord32, g.DefineAsRegister(node), 1638 Emit(kArm64Float64InsertHighWord32, g.DefineAsRegister(node),
1624 g.UseRegister(left), g.UseRegister(right)); 1639 g.UseRegister(left), g.UseRegister(right));
1625 } 1640 }
1626 1641
1627 1642
1628 // static 1643 // static
1629 MachineOperatorBuilder::Flags 1644 MachineOperatorBuilder::Flags
1630 InstructionSelector::SupportedMachineOperatorFlags() { 1645 InstructionSelector::SupportedMachineOperatorFlags() {
1631 return MachineOperatorBuilder::kFloat64RoundDown | 1646 return MachineOperatorBuilder::kFloat64RoundDown |
1632 MachineOperatorBuilder::kFloat64RoundTruncate | 1647 MachineOperatorBuilder::kFloat64RoundTruncate |
1633 MachineOperatorBuilder::kFloat64RoundTiesAway | 1648 MachineOperatorBuilder::kFloat64RoundTiesAway |
1634 MachineOperatorBuilder::kWord32ShiftIsSafe | 1649 MachineOperatorBuilder::kWord32ShiftIsSafe |
1635 MachineOperatorBuilder::kInt32DivIsSafe | 1650 MachineOperatorBuilder::kInt32DivIsSafe |
1636 MachineOperatorBuilder::kUint32DivIsSafe; 1651 MachineOperatorBuilder::kUint32DivIsSafe;
1637 } 1652 }
1638 1653
1639 } // namespace compiler 1654 } // namespace compiler
1640 } // namespace internal 1655 } // namespace internal
1641 } // namespace v8 1656 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/arm64/instruction-codes-arm64.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698