 Chromium Code Reviews
 Chromium Code Reviews Issue 594493002:
  [turbofan] Add operators for float32 support.  (Closed) 
  Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
    
  
    Issue 594493002:
  [turbofan] Add operators for float32 support.  (Closed) 
  Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge| 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; |