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

Unified Diff: src/compiler/js-typed-lowering.cc

Issue 596703004: [turbofan] Add backend support for float32. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: REBASE Created 6 years, 3 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 | « src/compiler/instruction-selector.cc ('k') | src/compiler/raw-machine-assembler.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/js-typed-lowering.cc
diff --git a/src/compiler/js-typed-lowering.cc b/src/compiler/js-typed-lowering.cc
index be125342eaed0cc683322c7ccf19ecb3bc4bd79f..8fe899cd2fd3ef14a46d6e859d33db022b6e566c 100644
--- a/src/compiler/js-typed-lowering.cc
+++ b/src/compiler/js-typed-lowering.cc
@@ -559,6 +559,14 @@ Reduction JSTypedLowering::ReduceJSLoadProperty(Node* node) {
graph()->NewNode(simplified()->LoadElement(element_access), elements,
key, jsgraph()->Uint32Constant(length),
NodeProperties::GetEffectInput(node));
+ // TODO(titzer): Remove this hack once float32 is properly supported in
+ // simplified lowering.
+ if (element_access.machine_type == kRepFloat32) {
+ Node* change =
+ graph()->NewNode(machine()->ChangeFloat32ToFloat64(), value);
+ NodeProperties::ReplaceWithValue(node, change, value);
+ return Changed(value);
+ }
return ReplaceEagerly(node, value);
}
return NoChange();
@@ -602,6 +610,11 @@ Reduction JSTypedLowering::ReduceJSStoreProperty(Node* node) {
NodeProperties::GetControlInput(node));
Node* if_true = graph()->NewNode(common()->IfTrue(), branch);
+ // TODO(titzer): Remove this hack once float32 is properly supported in
+ // simplified lowering.
+ if (element_access.machine_type == kRepFloat32) {
+ value = graph()->NewNode(machine()->TruncateFloat64ToFloat32(), value);
+ }
Node* store =
graph()->NewNode(simplified()->StoreElement(element_access), elements,
key, jsgraph()->Uint32Constant(length), value,
« no previous file with comments | « src/compiler/instruction-selector.cc ('k') | src/compiler/raw-machine-assembler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698