OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/compiler/machine-operator-reducer.h" | 5 #include "src/compiler/machine-operator-reducer.h" |
6 | 6 |
7 #include "src/base/bits.h" | 7 #include "src/base/bits.h" |
8 #include "src/base/division-by-constant.h" | 8 #include "src/base/division-by-constant.h" |
9 #include "src/codegen.h" | 9 #include "src/codegen.h" |
10 #include "src/compiler/diamond.h" | 10 #include "src/compiler/diamond.h" |
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
375 return Replace(m.right().node()); | 375 return Replace(m.right().node()); |
376 } | 376 } |
377 if (m.left().IsNaN()) { // NaN % x => NaN | 377 if (m.left().IsNaN()) { // NaN % x => NaN |
378 return Replace(m.left().node()); | 378 return Replace(m.left().node()); |
379 } | 379 } |
380 if (m.IsFoldable()) { // K % K => K | 380 if (m.IsFoldable()) { // K % K => K |
381 return ReplaceFloat64(modulo(m.left().Value(), m.right().Value())); | 381 return ReplaceFloat64(modulo(m.left().Value(), m.right().Value())); |
382 } | 382 } |
383 break; | 383 break; |
384 } | 384 } |
| 385 case IrOpcode::kFloat64Log: { |
| 386 Float64Matcher m(node->InputAt(0)); |
| 387 if (m.HasValue()) return ReplaceFloat64(std::log(m.Value())); |
| 388 break; |
| 389 } |
385 case IrOpcode::kChangeFloat32ToFloat64: { | 390 case IrOpcode::kChangeFloat32ToFloat64: { |
386 Float32Matcher m(node->InputAt(0)); | 391 Float32Matcher m(node->InputAt(0)); |
387 if (m.HasValue()) return ReplaceFloat64(m.Value()); | 392 if (m.HasValue()) return ReplaceFloat64(m.Value()); |
388 break; | 393 break; |
389 } | 394 } |
390 case IrOpcode::kChangeFloat64ToInt32: { | 395 case IrOpcode::kChangeFloat64ToInt32: { |
391 Float64Matcher m(node->InputAt(0)); | 396 Float64Matcher m(node->InputAt(0)); |
392 if (m.HasValue()) return ReplaceInt32(FastD2I(m.Value())); | 397 if (m.HasValue()) return ReplaceInt32(FastD2I(m.Value())); |
393 if (m.IsChangeInt32ToFloat64()) return Replace(m.node()->InputAt(0)); | 398 if (m.IsChangeInt32ToFloat64()) return Replace(m.node()->InputAt(0)); |
394 break; | 399 break; |
(...skipping 677 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1072 MachineOperatorBuilder* MachineOperatorReducer::machine() const { | 1077 MachineOperatorBuilder* MachineOperatorReducer::machine() const { |
1073 return jsgraph()->machine(); | 1078 return jsgraph()->machine(); |
1074 } | 1079 } |
1075 | 1080 |
1076 | 1081 |
1077 Graph* MachineOperatorReducer::graph() const { return jsgraph()->graph(); } | 1082 Graph* MachineOperatorReducer::graph() const { return jsgraph()->graph(); } |
1078 | 1083 |
1079 } // namespace compiler | 1084 } // namespace compiler |
1080 } // namespace internal | 1085 } // namespace internal |
1081 } // namespace v8 | 1086 } // namespace v8 |
OLD | NEW |