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/base/ieee754.h" | 9 #include "src/base/ieee754.h" |
10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
(...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
394 return ReplaceFloat64( | 394 return ReplaceFloat64( |
395 base::ieee754::atan2(m.left().Value(), m.right().Value())); | 395 base::ieee754::atan2(m.left().Value(), m.right().Value())); |
396 } | 396 } |
397 break; | 397 break; |
398 } | 398 } |
399 case IrOpcode::kFloat64Atanh: { | 399 case IrOpcode::kFloat64Atanh: { |
400 Float64Matcher m(node->InputAt(0)); | 400 Float64Matcher m(node->InputAt(0)); |
401 if (m.HasValue()) return ReplaceFloat64(base::ieee754::atanh(m.Value())); | 401 if (m.HasValue()) return ReplaceFloat64(base::ieee754::atanh(m.Value())); |
402 break; | 402 break; |
403 } | 403 } |
| 404 case IrOpcode::kFloat64Cos: { |
| 405 Float64Matcher m(node->InputAt(0)); |
| 406 if (m.HasValue()) return ReplaceFloat64(base::ieee754::cos(m.Value())); |
| 407 break; |
| 408 } |
404 case IrOpcode::kFloat64Exp: { | 409 case IrOpcode::kFloat64Exp: { |
405 Float64Matcher m(node->InputAt(0)); | 410 Float64Matcher m(node->InputAt(0)); |
406 if (m.HasValue()) return ReplaceFloat64(base::ieee754::exp(m.Value())); | 411 if (m.HasValue()) return ReplaceFloat64(base::ieee754::exp(m.Value())); |
407 break; | 412 break; |
408 } | 413 } |
409 case IrOpcode::kFloat64Expm1: { | 414 case IrOpcode::kFloat64Expm1: { |
410 Float64Matcher m(node->InputAt(0)); | 415 Float64Matcher m(node->InputAt(0)); |
411 if (m.HasValue()) return ReplaceFloat64(base::ieee754::expm1(m.Value())); | 416 if (m.HasValue()) return ReplaceFloat64(base::ieee754::expm1(m.Value())); |
412 break; | 417 break; |
413 } | 418 } |
(...skipping 15 matching lines...) Expand all Loading... |
429 case IrOpcode::kFloat64Log10: { | 434 case IrOpcode::kFloat64Log10: { |
430 Float64Matcher m(node->InputAt(0)); | 435 Float64Matcher m(node->InputAt(0)); |
431 if (m.HasValue()) return ReplaceFloat64(base::ieee754::log10(m.Value())); | 436 if (m.HasValue()) return ReplaceFloat64(base::ieee754::log10(m.Value())); |
432 break; | 437 break; |
433 } | 438 } |
434 case IrOpcode::kFloat64Cbrt: { | 439 case IrOpcode::kFloat64Cbrt: { |
435 Float64Matcher m(node->InputAt(0)); | 440 Float64Matcher m(node->InputAt(0)); |
436 if (m.HasValue()) return ReplaceFloat64(base::ieee754::cbrt(m.Value())); | 441 if (m.HasValue()) return ReplaceFloat64(base::ieee754::cbrt(m.Value())); |
437 break; | 442 break; |
438 } | 443 } |
| 444 case IrOpcode::kFloat64Sin: { |
| 445 Float64Matcher m(node->InputAt(0)); |
| 446 if (m.HasValue()) return ReplaceFloat64(base::ieee754::sin(m.Value())); |
| 447 break; |
| 448 } |
439 case IrOpcode::kChangeFloat32ToFloat64: { | 449 case IrOpcode::kChangeFloat32ToFloat64: { |
440 Float32Matcher m(node->InputAt(0)); | 450 Float32Matcher m(node->InputAt(0)); |
441 if (m.HasValue()) return ReplaceFloat64(m.Value()); | 451 if (m.HasValue()) return ReplaceFloat64(m.Value()); |
442 break; | 452 break; |
443 } | 453 } |
444 case IrOpcode::kChangeFloat64ToInt32: { | 454 case IrOpcode::kChangeFloat64ToInt32: { |
445 Float64Matcher m(node->InputAt(0)); | 455 Float64Matcher m(node->InputAt(0)); |
446 if (m.HasValue()) return ReplaceInt32(FastD2I(m.Value())); | 456 if (m.HasValue()) return ReplaceInt32(FastD2I(m.Value())); |
447 if (m.IsChangeInt32ToFloat64()) return Replace(m.node()->InputAt(0)); | 457 if (m.IsChangeInt32ToFloat64()) return Replace(m.node()->InputAt(0)); |
448 break; | 458 break; |
(...skipping 696 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1145 MachineOperatorBuilder* MachineOperatorReducer::machine() const { | 1155 MachineOperatorBuilder* MachineOperatorReducer::machine() const { |
1146 return jsgraph()->machine(); | 1156 return jsgraph()->machine(); |
1147 } | 1157 } |
1148 | 1158 |
1149 | 1159 |
1150 Graph* MachineOperatorReducer::graph() const { return jsgraph()->graph(); } | 1160 Graph* MachineOperatorReducer::graph() const { return jsgraph()->graph(); } |
1151 | 1161 |
1152 } // namespace compiler | 1162 } // namespace compiler |
1153 } // namespace internal | 1163 } // namespace internal |
1154 } // namespace v8 | 1164 } // namespace v8 |
OLD | NEW |