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

Side by Side Diff: src/compiler/ppc/instruction-selector-ppc.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/opcodes.h ('k') | src/compiler/raw-machine-assembler.h » ('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/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/ppc/frames-ppc.h" 9 #include "src/ppc/frames-ppc.h"
10 10
(...skipping 1208 matching lines...) Expand 10 before | Expand all | Expand 10 after
1219 PPCOperandGenerator g(this); 1219 PPCOperandGenerator g(this);
1220 Float32BinopMatcher m(node); 1220 Float32BinopMatcher m(node);
1221 if (m.left().IsMinusZero()) { 1221 if (m.left().IsMinusZero()) {
1222 Emit(kPPC_NegDouble | MiscField::encode(1), g.DefineAsRegister(node), 1222 Emit(kPPC_NegDouble | MiscField::encode(1), g.DefineAsRegister(node),
1223 g.UseRegister(m.right().node())); 1223 g.UseRegister(m.right().node()));
1224 return; 1224 return;
1225 } 1225 }
1226 VisitRRR(this, kPPC_SubDouble | MiscField::encode(1), node); 1226 VisitRRR(this, kPPC_SubDouble | MiscField::encode(1), node);
1227 } 1227 }
1228 1228
1229 void InstructionSelector::VisitFloat32SubPreserveNan(Node* node) {
1230 PPCOperandGenerator g(this);
1231 VisitRRR(this, kPPC_SubDouble | MiscField::encode(1), node);
1232 }
1229 1233
1230 void InstructionSelector::VisitFloat64Sub(Node* node) { 1234 void InstructionSelector::VisitFloat64Sub(Node* node) {
1231 // TODO(mbrandy): detect multiply-subtract 1235 // TODO(mbrandy): detect multiply-subtract
1232 PPCOperandGenerator g(this); 1236 PPCOperandGenerator g(this);
1233 Float64BinopMatcher m(node); 1237 Float64BinopMatcher m(node);
1234 if (m.left().IsMinusZero()) { 1238 if (m.left().IsMinusZero()) {
1235 if (m.right().IsFloat64RoundDown() && 1239 if (m.right().IsFloat64RoundDown() &&
1236 CanCover(m.node(), m.right().node())) { 1240 CanCover(m.node(), m.right().node())) {
1237 if (m.right().InputAt(0)->opcode() == IrOpcode::kFloat64Sub && 1241 if (m.right().InputAt(0)->opcode() == IrOpcode::kFloat64Sub &&
1238 CanCover(m.right().node(), m.right().InputAt(0))) { 1242 CanCover(m.right().node(), m.right().InputAt(0))) {
1239 Float64BinopMatcher mright0(m.right().InputAt(0)); 1243 Float64BinopMatcher mright0(m.right().InputAt(0));
1240 if (mright0.left().IsMinusZero()) { 1244 if (mright0.left().IsMinusZero()) {
1241 // -floor(-x) = ceil(x) 1245 // -floor(-x) = ceil(x)
1242 Emit(kPPC_CeilDouble, g.DefineAsRegister(node), 1246 Emit(kPPC_CeilDouble, g.DefineAsRegister(node),
1243 g.UseRegister(mright0.right().node())); 1247 g.UseRegister(mright0.right().node()));
1244 return; 1248 return;
1245 } 1249 }
1246 } 1250 }
1247 } 1251 }
1248 Emit(kPPC_NegDouble, g.DefineAsRegister(node), 1252 Emit(kPPC_NegDouble, g.DefineAsRegister(node),
1249 g.UseRegister(m.right().node())); 1253 g.UseRegister(m.right().node()));
1250 return; 1254 return;
1251 } 1255 }
1252 VisitRRR(this, kPPC_SubDouble, node); 1256 VisitRRR(this, kPPC_SubDouble, node);
1253 } 1257 }
1254 1258
1259 void InstructionSelector::VisitFloat64SubPreserveNan(Node* node) {
1260 VisitRRR(this, kPPC_SubDouble, node);
1261 }
1255 1262
1256 void InstructionSelector::VisitFloat32Mul(Node* node) { 1263 void InstructionSelector::VisitFloat32Mul(Node* node) {
1257 VisitRRR(this, kPPC_MulDouble | MiscField::encode(1), node); 1264 VisitRRR(this, kPPC_MulDouble | MiscField::encode(1), node);
1258 } 1265 }
1259 1266
1260 1267
1261 void InstructionSelector::VisitFloat64Mul(Node* node) { 1268 void InstructionSelector::VisitFloat64Mul(Node* node) {
1262 // TODO(mbrandy): detect negate 1269 // TODO(mbrandy): detect negate
1263 VisitRRR(this, kPPC_MulDouble, node); 1270 VisitRRR(this, kPPC_MulDouble, node);
1264 } 1271 }
(...skipping 715 matching lines...) Expand 10 before | Expand all | Expand 10 after
1980 MachineOperatorBuilder::kFloat64RoundTruncate | 1987 MachineOperatorBuilder::kFloat64RoundTruncate |
1981 MachineOperatorBuilder::kFloat64RoundTiesAway | 1988 MachineOperatorBuilder::kFloat64RoundTiesAway |
1982 MachineOperatorBuilder::kWord32Popcnt | 1989 MachineOperatorBuilder::kWord32Popcnt |
1983 MachineOperatorBuilder::kWord64Popcnt; 1990 MachineOperatorBuilder::kWord64Popcnt;
1984 // We omit kWord32ShiftIsSafe as s[rl]w use 0x3f as a mask rather than 0x1f. 1991 // We omit kWord32ShiftIsSafe as s[rl]w use 0x3f as a mask rather than 0x1f.
1985 } 1992 }
1986 1993
1987 } // namespace compiler 1994 } // namespace compiler
1988 } // namespace internal 1995 } // namespace internal
1989 } // namespace v8 1996 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/opcodes.h ('k') | src/compiler/raw-machine-assembler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698