| 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;
|
|
|