Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1027)

Side by Side Diff: src/compiler/machine-operator-reducer.cc

Issue 2073123002: [builtins] Introduce proper Float64Cos and Float64Sin. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix missing breaks Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/compiler/machine-operator.cc ('k') | src/compiler/mips/code-generator-mips.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
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
OLDNEW
« no previous file with comments | « src/compiler/machine-operator.cc ('k') | src/compiler/mips/code-generator-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698