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

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

Issue 1040053002: Reland "Match fneg for -0.0 - x pattern." (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 8 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/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 1042 matching lines...) Expand 10 before | Expand all | Expand 10 after
1053 1053
1054 1054
1055 void InstructionSelector::VisitFloat32Sub(Node* node) { 1055 void InstructionSelector::VisitFloat32Sub(Node* node) {
1056 VisitRRR(this, kArm64Float32Sub, node); 1056 VisitRRR(this, kArm64Float32Sub, node);
1057 } 1057 }
1058 1058
1059 1059
1060 void InstructionSelector::VisitFloat64Sub(Node* node) { 1060 void InstructionSelector::VisitFloat64Sub(Node* node) {
1061 Arm64OperandGenerator g(this); 1061 Arm64OperandGenerator g(this);
1062 Float64BinopMatcher m(node); 1062 Float64BinopMatcher m(node);
1063 if (m.left().IsMinusZero() && m.right().IsFloat64RoundDown() && 1063 if (m.left().IsMinusZero()) {
1064 CanCover(m.node(), m.right().node())) { 1064 if (m.right().IsFloat64RoundDown() &&
1065 if (m.right().InputAt(0)->opcode() == IrOpcode::kFloat64Sub && 1065 CanCover(m.node(), m.right().node())) {
1066 CanCover(m.right().node(), m.right().InputAt(0))) { 1066 if (m.right().InputAt(0)->opcode() == IrOpcode::kFloat64Sub &&
1067 Float64BinopMatcher mright0(m.right().InputAt(0)); 1067 CanCover(m.right().node(), m.right().InputAt(0))) {
1068 if (mright0.left().IsMinusZero()) { 1068 Float64BinopMatcher mright0(m.right().InputAt(0));
1069 Emit(kArm64Float64RoundUp, g.DefineAsRegister(node), 1069 if (mright0.left().IsMinusZero()) {
1070 g.UseRegister(mright0.right().node())); 1070 Emit(kArm64Float64RoundUp, g.DefineAsRegister(node),
1071 return; 1071 g.UseRegister(mright0.right().node()));
1072 return;
1073 }
1072 } 1074 }
1073 } 1075 }
1076 Emit(kArm64Float64Neg, g.DefineAsRegister(node),
1077 g.UseRegister(m.right().node()));
1078 return;
1074 } 1079 }
1075 VisitRRR(this, kArm64Float64Sub, node); 1080 VisitRRR(this, kArm64Float64Sub, node);
1076 } 1081 }
1077 1082
1078 1083
1079 void InstructionSelector::VisitFloat32Mul(Node* node) { 1084 void InstructionSelector::VisitFloat32Mul(Node* node) {
1080 VisitRRR(this, kArm64Float32Mul, node); 1085 VisitRRR(this, kArm64Float32Mul, node);
1081 } 1086 }
1082 1087
1083 1088
(...skipping 632 matching lines...) Expand 10 before | Expand all | Expand 10 after
1716 MachineOperatorBuilder::kFloat64RoundTruncate | 1721 MachineOperatorBuilder::kFloat64RoundTruncate |
1717 MachineOperatorBuilder::kFloat64RoundTiesAway | 1722 MachineOperatorBuilder::kFloat64RoundTiesAway |
1718 MachineOperatorBuilder::kWord32ShiftIsSafe | 1723 MachineOperatorBuilder::kWord32ShiftIsSafe |
1719 MachineOperatorBuilder::kInt32DivIsSafe | 1724 MachineOperatorBuilder::kInt32DivIsSafe |
1720 MachineOperatorBuilder::kUint32DivIsSafe; 1725 MachineOperatorBuilder::kUint32DivIsSafe;
1721 } 1726 }
1722 1727
1723 } // namespace compiler 1728 } // namespace compiler
1724 } // namespace internal 1729 } // namespace internal
1725 } // namespace v8 1730 } // 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