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

Unified Diff: src/compiler/simplified-lowering.cc

Issue 1044793002: [turbofan] Add backend support for float32 operations. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Add MachineOperator unit tests. Created 5 years, 9 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
Index: src/compiler/simplified-lowering.cc
diff --git a/src/compiler/simplified-lowering.cc b/src/compiler/simplified-lowering.cc
index d216009e4e563d68b2c1b84aee3776c832c36a53..b4080a916e63f83a3842472214082bc939da66c7 100644
--- a/src/compiler/simplified-lowering.cc
+++ b/src/compiler/simplified-lowering.cc
@@ -319,15 +319,18 @@ class RepresentationSelector {
MachineType GetRepresentationForPhi(Node* node, MachineTypeUnion use) {
// Phis adapt to the output representation their uses demand.
Type* upper = NodeProperties::GetBounds(node).upper;
- if ((use & kRepMask) == kRepTagged) {
+ if ((use & kRepMask) == kRepFloat32) {
+ // only float32 uses.
+ return kRepFloat32;
+ } else if ((use & kRepMask) == kRepFloat64) {
+ // only float64 uses.
+ return kRepFloat64;
+ } else if ((use & kRepMask) == kRepTagged) {
// only tagged uses.
return kRepTagged;
} else if (upper->Is(Type::Integral32())) {
// Integer within [-2^31, 2^32[ range.
- if ((use & kRepMask) == kRepFloat64) {
- // only float64 uses.
- return kRepFloat64;
- } else if (upper->Is(Type::Signed32()) || upper->Is(Type::Unsigned32())) {
+ if (upper->Is(Type::Signed32()) || upper->Is(Type::Unsigned32())) {
// multiple uses, but we are within 32 bits range => pick kRepWord32.
return kRepWord32;
} else if (((use & kRepMask) == kRepWord32 &&
@@ -507,6 +510,8 @@ class RepresentationSelector {
return VisitLeaf(node, kRepWord32);
case IrOpcode::kInt64Constant:
return VisitLeaf(node, kRepWord64);
+ case IrOpcode::kFloat32Constant:
+ return VisitLeaf(node, kRepFloat32);
case IrOpcode::kFloat64Constant:
return VisitLeaf(node, kRepFloat64);
case IrOpcode::kExternalConstant:

Powered by Google App Engine
This is Rietveld 408576698