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

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

Issue 2063693002: [builtins] Introduce proper Float64Log2 and Float64Log10 operators. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: More precise log10. 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 394 matching lines...) Expand 10 before | Expand all | Expand 10 after
405 case IrOpcode::kFloat64Log: { 405 case IrOpcode::kFloat64Log: {
406 Float64Matcher m(node->InputAt(0)); 406 Float64Matcher m(node->InputAt(0));
407 if (m.HasValue()) return ReplaceFloat64(base::ieee754::log(m.Value())); 407 if (m.HasValue()) return ReplaceFloat64(base::ieee754::log(m.Value()));
408 break; 408 break;
409 } 409 }
410 case IrOpcode::kFloat64Log1p: { 410 case IrOpcode::kFloat64Log1p: {
411 Float64Matcher m(node->InputAt(0)); 411 Float64Matcher m(node->InputAt(0));
412 if (m.HasValue()) return ReplaceFloat64(base::ieee754::log1p(m.Value())); 412 if (m.HasValue()) return ReplaceFloat64(base::ieee754::log1p(m.Value()));
413 break; 413 break;
414 } 414 }
415 case IrOpcode::kFloat64Log2: {
416 Float64Matcher m(node->InputAt(0));
417 if (m.HasValue()) return ReplaceFloat64(base::ieee754::log2(m.Value()));
418 break;
419 }
420 case IrOpcode::kFloat64Log10: {
421 Float64Matcher m(node->InputAt(0));
422 if (m.HasValue()) return ReplaceFloat64(base::ieee754::log10(m.Value()));
423 break;
424 }
415 case IrOpcode::kChangeFloat32ToFloat64: { 425 case IrOpcode::kChangeFloat32ToFloat64: {
416 Float32Matcher m(node->InputAt(0)); 426 Float32Matcher m(node->InputAt(0));
417 if (m.HasValue()) return ReplaceFloat64(m.Value()); 427 if (m.HasValue()) return ReplaceFloat64(m.Value());
418 break; 428 break;
419 } 429 }
420 case IrOpcode::kChangeFloat64ToInt32: { 430 case IrOpcode::kChangeFloat64ToInt32: {
421 Float64Matcher m(node->InputAt(0)); 431 Float64Matcher m(node->InputAt(0));
422 if (m.HasValue()) return ReplaceInt32(FastD2I(m.Value())); 432 if (m.HasValue()) return ReplaceInt32(FastD2I(m.Value()));
423 if (m.IsChangeInt32ToFloat64()) return Replace(m.node()->InputAt(0)); 433 if (m.IsChangeInt32ToFloat64()) return Replace(m.node()->InputAt(0));
424 break; 434 break;
(...skipping 677 matching lines...) Expand 10 before | Expand all | Expand 10 after
1102 MachineOperatorBuilder* MachineOperatorReducer::machine() const { 1112 MachineOperatorBuilder* MachineOperatorReducer::machine() const {
1103 return jsgraph()->machine(); 1113 return jsgraph()->machine();
1104 } 1114 }
1105 1115
1106 1116
1107 Graph* MachineOperatorReducer::graph() const { return jsgraph()->graph(); } 1117 Graph* MachineOperatorReducer::graph() const { return jsgraph()->graph(); }
1108 1118
1109 } // namespace compiler 1119 } // namespace compiler
1110 } // namespace internal 1120 } // namespace internal
1111 } // namespace v8 1121 } // 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