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

Unified Diff: src/compiler/effect-control-linearizer.cc

Issue 2473923003: [turbofan][x64] Improve code generation for Float64LessThan with Float64Abs. (Closed)
Patch Set: Fix for realz. Created 4 years, 1 month 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 | « src/code-stub-assembler.cc ('k') | src/compiler/x64/instruction-selector-x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/effect-control-linearizer.cc
diff --git a/src/compiler/effect-control-linearizer.cc b/src/compiler/effect-control-linearizer.cc
index 7d18f0591c0be7eac3f301dc4cf301b5eda4ca50..351382ebf4320c2896dbf0665612787ab18b9242 100644
--- a/src/compiler/effect-control-linearizer.cc
+++ b/src/compiler/effect-control-linearizer.cc
@@ -913,15 +913,14 @@ EffectControlLinearizer::ValueEffectControl
EffectControlLinearizer::LowerTruncateTaggedToBit(Node* node, Node* effect,
Node* control) {
Node* value = node->InputAt(0);
- Node* one = jsgraph()->Int32Constant(1);
Node* zero = jsgraph()->Int32Constant(0);
Node* fzero = jsgraph()->Float64Constant(0.0);
// Collect effect/control/value triples.
int count = 0;
- Node* values[7];
- Node* effects[7];
- Node* controls[6];
+ Node* values[6];
+ Node* effects[6];
+ Node* controls[5];
// Check if {value} is a Smi.
Node* check_smi = ObjectIsSmi(value);
@@ -1012,20 +1011,12 @@ EffectControlLinearizer::LowerTruncateTaggedToBit(Node* node, Node* effect,
simplified()->LoadField(AccessBuilder::ForHeapNumberValue()), value,
eheapnumber, if_heapnumber);
- // Check if {value} is either less than 0.0 or greater than 0.0.
- Node* check =
- graph()->NewNode(machine()->Float64LessThan(), fzero, value_value);
- Node* branch = graph()->NewNode(common()->Branch(), check, if_heapnumber);
-
- controls[count] = graph()->NewNode(common()->IfTrue(), branch);
+ // Check if {value} is not one of 0, -0, or NaN.
+ controls[count] = if_heapnumber;
effects[count] = eheapnumber;
- values[count] = one;
- count++;
-
- controls[count] = graph()->NewNode(common()->IfFalse(), branch);
- effects[count] = eheapnumber;
- values[count] =
- graph()->NewNode(machine()->Float64LessThan(), value_value, fzero);
+ values[count] = graph()->NewNode(
+ machine()->Float64LessThan(), fzero,
+ graph()->NewNode(machine()->Float64Abs(), value_value));
count++;
}
control = graph()->NewNode(common()->IfFalse(), branch_heapnumber);
« no previous file with comments | « src/code-stub-assembler.cc ('k') | src/compiler/x64/instruction-selector-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698