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

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: Updates 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
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..76fe65833a22c658c70539899851d153951c31be 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);
}
@@ -427,6 +432,12 @@ Reduction MachineOperatorReducer::Reduce(Node* node) {
if (m.IsChangeInt32ToInt64()) return Replace(m.node()->InputAt(0));
break;
}
+ case IrOpcode::kTruncateFloat64ToFloat32: {
titzer 2014/09/22 11:24:54 What about reducing ChangeFloat32ToFloat64 as well
Benedikt Meurer 2014/09/22 11:37:53 Done.
+ 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;

Powered by Google App Engine
This is Rietveld 408576698