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

Unified Diff: src/compiler/representation-change.cc

Issue 2421193002: [turbofan] Add missing Float32 -> TaggedSigned conversion. (Closed)
Patch Set: Created 4 years, 2 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 | test/mjsunit/regress/regress-crbug-656275.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/representation-change.cc
diff --git a/src/compiler/representation-change.cc b/src/compiler/representation-change.cc
index 6169c8071f9d0a369cbf9b5ee2c2e204cf66fe5a..c564b9957b2c2769b6675a46bf30ab476432a5a0 100644
--- a/src/compiler/representation-change.cc
+++ b/src/compiler/representation-change.cc
@@ -250,6 +250,24 @@ Node* RepresentationChanger::GetTaggedSignedRepresentationFor(
return TypeError(node, output_rep, output_type,
MachineRepresentation::kTaggedSigned);
}
+ } else if (output_rep == MachineRepresentation::kFloat32) {
+ if (use_info.type_check() == TypeCheckKind::kSignedSmall) {
+ op = machine()->ChangeFloat32ToFloat64();
+ node = InsertConversion(node, op, use_node);
+ op = simplified()->CheckedFloat64ToInt32(
+ output_type->Maybe(Type::MinusZero())
+ ? CheckForMinusZeroMode::kCheckForMinusZero
+ : CheckForMinusZeroMode::kDontCheckForMinusZero);
+ node = InsertConversion(node, op, use_node);
+ if (SmiValuesAre32Bits()) {
+ op = simplified()->ChangeInt32ToTagged();
+ } else {
+ op = simplified()->CheckedInt32ToTaggedSigned();
+ }
+ } else {
+ return TypeError(node, output_rep, output_type,
+ MachineRepresentation::kTaggedSigned);
+ }
} else if (CanBeTaggedPointer(output_rep) &&
use_info.type_check() == TypeCheckKind::kSignedSmall) {
op = simplified()->CheckedTaggedToTaggedSigned();
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-crbug-656275.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698