Index: src/compiler/machine-operator-reducer.cc |
diff --git a/src/compiler/machine-operator-reducer.cc b/src/compiler/machine-operator-reducer.cc |
index 5630bc8ef0ffae22a16159996867e751e3ab3884..ba0b7a1893b1fa0f6ea1b126c5cf454c905a4fdd 100644 |
--- a/src/compiler/machine-operator-reducer.cc |
+++ b/src/compiler/machine-operator-reducer.cc |
@@ -433,6 +433,10 @@ Reduction MachineOperatorReducer::Reduce(Node* node) { |
if (m.IsChangeFloat32ToFloat64()) return Replace(m.node()->InputAt(0)); |
break; |
} |
+ case IrOpcode::kFloat64InsertLowWord32: |
+ return ReduceFloat64InsertLowWord32(node); |
+ case IrOpcode::kFloat64InsertHighWord32: |
+ return ReduceFloat64InsertHighWord32(node); |
case IrOpcode::kStore: |
return ReduceStore(node); |
default: |
@@ -975,6 +979,32 @@ Reduction MachineOperatorReducer::ReduceWord32Or(Node* node) { |
} |
+Reduction MachineOperatorReducer::ReduceFloat64InsertLowWord32(Node* node) { |
+ DCHECK_EQ(IrOpcode::kFloat64InsertLowWord32, node->opcode()); |
+ Float64Matcher mlhs(node->InputAt(0)); |
+ Uint32Matcher mrhs(node->InputAt(1)); |
+ if (mlhs.HasValue() && mrhs.HasValue()) { |
+ return ReplaceFloat64(bit_cast<double>( |
+ (bit_cast<uint64_t>(mlhs.Value()) & V8_UINT64_C(0xFFFFFFFF00000000)) | |
+ mrhs.Value())); |
+ } |
+ return NoChange(); |
+} |
+ |
+ |
+Reduction MachineOperatorReducer::ReduceFloat64InsertHighWord32(Node* node) { |
+ DCHECK_EQ(IrOpcode::kFloat64InsertHighWord32, node->opcode()); |
+ Float64Matcher mlhs(node->InputAt(0)); |
+ Uint32Matcher mrhs(node->InputAt(1)); |
+ if (mlhs.HasValue() && mrhs.HasValue()) { |
+ return ReplaceFloat64(bit_cast<double>( |
+ (bit_cast<uint64_t>(mlhs.Value()) & V8_UINT64_C(0xFFFFFFFF)) | |
+ (static_cast<uint64_t>(mrhs.Value()) << 32))); |
+ } |
+ return NoChange(); |
+} |
+ |
+ |
CommonOperatorBuilder* MachineOperatorReducer::common() const { |
return jsgraph()->common(); |
} |