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

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

Issue 1973493003: [turbofan] Introduce new operators Float32SubPreserveNan and Float64SubPreserveNan for wasm. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 7 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/raw-machine-assembler.h ('k') | src/compiler/typer.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 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 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 #include "src/s390/frames-s390.h" 9 #include "src/s390/frames-s390.h"
10 10
(...skipping 1099 matching lines...) Expand 10 before | Expand all | Expand 10 after
1110 S390OperandGenerator g(this); 1110 S390OperandGenerator g(this);
1111 Float32BinopMatcher m(node); 1111 Float32BinopMatcher m(node);
1112 if (m.left().IsMinusZero()) { 1112 if (m.left().IsMinusZero()) {
1113 Emit(kS390_NegDouble, g.DefineAsRegister(node), 1113 Emit(kS390_NegDouble, g.DefineAsRegister(node),
1114 g.UseRegister(m.right().node())); 1114 g.UseRegister(m.right().node()));
1115 return; 1115 return;
1116 } 1116 }
1117 VisitRRR(this, kS390_SubFloat, node); 1117 VisitRRR(this, kS390_SubFloat, node);
1118 } 1118 }
1119 1119
1120 void InstructionSelector::VisitFloat32SubPreserveNan(Node* node) {
1121 S390OperandGenerator g(this);
1122 VisitRRR(this, kS390_SubFloat, node);
1123 }
1124
1120 void InstructionSelector::VisitFloat64Sub(Node* node) { 1125 void InstructionSelector::VisitFloat64Sub(Node* node) {
1121 // TODO(mbrandy): detect multiply-subtract 1126 // TODO(mbrandy): detect multiply-subtract
1122 S390OperandGenerator g(this); 1127 S390OperandGenerator g(this);
1123 Float64BinopMatcher m(node); 1128 Float64BinopMatcher m(node);
1124 if (m.left().IsMinusZero()) { 1129 if (m.left().IsMinusZero()) {
1125 if (m.right().IsFloat64RoundDown() && 1130 if (m.right().IsFloat64RoundDown() &&
1126 CanCover(m.node(), m.right().node())) { 1131 CanCover(m.node(), m.right().node())) {
1127 if (m.right().InputAt(0)->opcode() == IrOpcode::kFloat64Sub && 1132 if (m.right().InputAt(0)->opcode() == IrOpcode::kFloat64Sub &&
1128 CanCover(m.right().node(), m.right().InputAt(0))) { 1133 CanCover(m.right().node(), m.right().InputAt(0))) {
1129 Float64BinopMatcher mright0(m.right().InputAt(0)); 1134 Float64BinopMatcher mright0(m.right().InputAt(0));
1130 if (mright0.left().IsMinusZero()) { 1135 if (mright0.left().IsMinusZero()) {
1131 // -floor(-x) = ceil(x) 1136 // -floor(-x) = ceil(x)
1132 Emit(kS390_CeilDouble, g.DefineAsRegister(node), 1137 Emit(kS390_CeilDouble, g.DefineAsRegister(node),
1133 g.UseRegister(mright0.right().node())); 1138 g.UseRegister(mright0.right().node()));
1134 return; 1139 return;
1135 } 1140 }
1136 } 1141 }
1137 } 1142 }
1138 Emit(kS390_NegDouble, g.DefineAsRegister(node), 1143 Emit(kS390_NegDouble, g.DefineAsRegister(node),
1139 g.UseRegister(m.right().node())); 1144 g.UseRegister(m.right().node()));
1140 return; 1145 return;
1141 } 1146 }
1142 VisitRRR(this, kS390_SubDouble, node); 1147 VisitRRR(this, kS390_SubDouble, node);
1143 } 1148 }
1144 1149
1150 void InstructionSelector::VisitFloat64SubPreserveNan(Node* node) {
1151 VisitRRR(this, kS390_SubDouble, node);
1152 }
1153
1145 void InstructionSelector::VisitFloat32Mul(Node* node) { 1154 void InstructionSelector::VisitFloat32Mul(Node* node) {
1146 VisitRRR(this, kS390_MulFloat, node); 1155 VisitRRR(this, kS390_MulFloat, node);
1147 } 1156 }
1148 1157
1149 void InstructionSelector::VisitFloat64Mul(Node* node) { 1158 void InstructionSelector::VisitFloat64Mul(Node* node) {
1150 // TODO(mbrandy): detect negate 1159 // TODO(mbrandy): detect negate
1151 VisitRRR(this, kS390_MulDouble, node); 1160 VisitRRR(this, kS390_MulDouble, node);
1152 } 1161 }
1153 1162
1154 void InstructionSelector::VisitFloat32Div(Node* node) { 1163 void InstructionSelector::VisitFloat32Div(Node* node) {
(...skipping 654 matching lines...) Expand 10 before | Expand all | Expand 10 after
1809 MachineOperatorBuilder::kFloat32RoundTruncate | 1818 MachineOperatorBuilder::kFloat32RoundTruncate |
1810 MachineOperatorBuilder::kFloat64RoundTruncate | 1819 MachineOperatorBuilder::kFloat64RoundTruncate |
1811 MachineOperatorBuilder::kFloat64RoundTiesAway | 1820 MachineOperatorBuilder::kFloat64RoundTiesAway |
1812 MachineOperatorBuilder::kWord32Popcnt | 1821 MachineOperatorBuilder::kWord32Popcnt |
1813 MachineOperatorBuilder::kWord64Popcnt; 1822 MachineOperatorBuilder::kWord64Popcnt;
1814 } 1823 }
1815 1824
1816 } // namespace compiler 1825 } // namespace compiler
1817 } // namespace internal 1826 } // namespace internal
1818 } // namespace v8 1827 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/raw-machine-assembler.h ('k') | src/compiler/typer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698