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

Unified Diff: src/compiler/arm/instruction-selector-arm.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/compiler/arm64/instruction-selector-arm64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/arm/instruction-selector-arm.cc
diff --git a/src/compiler/arm/instruction-selector-arm.cc b/src/compiler/arm/instruction-selector-arm.cc
index 9b593a771935c7a84757b03eec04ee7f48f841b3..b2b1a7049d1e5bb2fc7237f3316dd648d5260352 100644
--- a/src/compiler/arm/instruction-selector-arm.cc
+++ b/src/compiler/arm/instruction-selector-arm.cc
@@ -1205,6 +1205,35 @@ void InstructionSelector::VisitFloat64Add(Node* node) {
VisitRRR(this, kArmVaddF64, node);
}
+namespace {
+void VisitFloat32SubHelper(InstructionSelector* selector, Node* node) {
+ ArmOperandGenerator g(selector);
+ Float32BinopMatcher m(node);
+ if (m.right().IsFloat32Mul() && selector->CanCover(node, m.right().node())) {
+ Float32BinopMatcher mright(m.right().node());
+ selector->Emit(kArmVmlsF32, g.DefineSameAsFirst(node),
+ g.UseRegister(m.left().node()),
+ g.UseRegister(mright.left().node()),
+ g.UseRegister(mright.right().node()));
+ return;
+ }
+ VisitRRR(selector, kArmVsubF32, node);
+}
+
+void VisitFloat64SubHelper(InstructionSelector* selector, Node* node) {
+ ArmOperandGenerator g(selector);
+ Float64BinopMatcher m(node);
+ if (m.right().IsFloat64Mul() && selector->CanCover(node, m.right().node())) {
+ Float64BinopMatcher mright(m.right().node());
+ selector->Emit(kArmVmlsF64, g.DefineSameAsFirst(node),
+ g.UseRegister(m.left().node()),
+ g.UseRegister(mright.left().node()),
+ g.UseRegister(mright.right().node()));
+ return;
+ }
+ VisitRRR(selector, kArmVsubF64, node);
+}
+} // namespace
void InstructionSelector::VisitFloat32Sub(Node* node) {
ArmOperandGenerator g(this);
@@ -1214,16 +1243,12 @@ void InstructionSelector::VisitFloat32Sub(Node* node) {
g.UseRegister(m.right().node()));
return;
}
- if (m.right().IsFloat32Mul() && CanCover(node, m.right().node())) {
- Float32BinopMatcher mright(m.right().node());
- Emit(kArmVmlsF32, g.DefineSameAsFirst(node), g.UseRegister(m.left().node()),
- g.UseRegister(mright.left().node()),
- g.UseRegister(mright.right().node()));
- return;
- }
- VisitRRR(this, kArmVsubF32, node);
+ VisitFloat32SubHelper(this, node);
}
+void InstructionSelector::VisitFloat32SubPreserveNan(Node* node) {
+ VisitFloat32SubHelper(this, node);
+}
void InstructionSelector::VisitFloat64Sub(Node* node) {
ArmOperandGenerator g(this);
@@ -1245,16 +1270,12 @@ void InstructionSelector::VisitFloat64Sub(Node* node) {
g.UseRegister(m.right().node()));
return;
}
- if (m.right().IsFloat64Mul() && CanCover(node, m.right().node())) {
- Float64BinopMatcher mright(m.right().node());
- Emit(kArmVmlsF64, g.DefineSameAsFirst(node), g.UseRegister(m.left().node()),
- g.UseRegister(mright.left().node()),
- g.UseRegister(mright.right().node()));
- return;
- }
- VisitRRR(this, kArmVsubF64, node);
+ VisitFloat64SubHelper(this, node);
}
+void InstructionSelector::VisitFloat64SubPreserveNan(Node* node) {
+ VisitFloat64SubHelper(this, node);
+}
void InstructionSelector::VisitFloat32Mul(Node* node) {
VisitRRR(this, kArmVmulF32, node);
« no previous file with comments | « no previous file | src/compiler/arm64/instruction-selector-arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698