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

Unified Diff: src/compiler/machine-operator-reducer.cc

Issue 594493002: [turbofan] Add operators for float32 support. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed comments 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/machine-operator-reducer.h ('k') | src/compiler/machine-operator-reducer-unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/machine-operator-reducer.cc
diff --git a/src/compiler/machine-operator-reducer.cc b/src/compiler/machine-operator-reducer.cc
index 936deca8b636deb3e1121cfb9cb360c6a23fc842..53ee81075e960875e0a9d94de8dc0247744e732d 100644
--- a/src/compiler/machine-operator-reducer.cc
+++ b/src/compiler/machine-operator-reducer.cc
@@ -21,6 +21,11 @@ MachineOperatorReducer::MachineOperatorReducer(JSGraph* jsgraph)
MachineOperatorReducer::~MachineOperatorReducer() {}
+Node* MachineOperatorReducer::Float32Constant(volatile float value) {
+ return graph()->NewNode(common()->Float32Constant(value));
+}
+
+
Node* MachineOperatorReducer::Float64Constant(volatile double value) {
return jsgraph()->Float64Constant(value);
}
@@ -383,6 +388,11 @@ Reduction MachineOperatorReducer::Reduce(Node* node) {
}
break;
}
+ case IrOpcode::kChangeFloat32ToFloat64: {
+ Float32Matcher m(node->InputAt(0));
+ if (m.HasValue()) return ReplaceFloat64(m.Value());
+ break;
+ }
case IrOpcode::kChangeFloat64ToInt32: {
Float64Matcher m(node->InputAt(0));
if (m.HasValue()) return ReplaceInt32(FastD2I(m.Value()));
@@ -427,6 +437,12 @@ Reduction MachineOperatorReducer::Reduce(Node* node) {
if (m.IsChangeInt32ToInt64()) return Replace(m.node()->InputAt(0));
break;
}
+ case IrOpcode::kTruncateFloat64ToFloat32: {
+ Float64Matcher m(node->InputAt(0));
+ if (m.HasValue()) return ReplaceFloat32(DoubleToFloat32(m.Value()));
+ if (m.IsChangeFloat32ToFloat64()) return Replace(m.node()->InputAt(0));
+ break;
+ }
// TODO(turbofan): strength-reduce and fold floating point operations.
default:
break;
« no previous file with comments | « src/compiler/machine-operator-reducer.h ('k') | src/compiler/machine-operator-reducer-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698