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

Side by Side Diff: src/builtins.cc

Issue 2083573002: [builtins] Unify Cosh, Sinh and Tanh as exports from flibm (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: REBASE and windows fix. Created 4 years, 5 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/builtins.h ('k') | src/compiler/arm/code-generator-arm.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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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/builtins.h" 5 #include "src/builtins.h"
6 6
7 #include "src/api-arguments.h" 7 #include "src/api-arguments.h"
8 #include "src/api-natives.h" 8 #include "src/api-natives.h"
9 #include "src/api.h" 9 #include "src/api.h"
10 #include "src/base/ieee754.h" 10 #include "src/base/ieee754.h"
(...skipping 2439 matching lines...) Expand 10 before | Expand all | Expand 10 after
2450 using compiler::Node; 2450 using compiler::Node;
2451 2451
2452 Node* x = assembler->Parameter(1); 2452 Node* x = assembler->Parameter(1);
2453 Node* context = assembler->Parameter(4); 2453 Node* context = assembler->Parameter(4);
2454 Node* x_value = assembler->TruncateTaggedToFloat64(context, x); 2454 Node* x_value = assembler->TruncateTaggedToFloat64(context, x);
2455 Node* value = assembler->Float64Cos(x_value); 2455 Node* value = assembler->Float64Cos(x_value);
2456 Node* result = assembler->ChangeFloat64ToTagged(value); 2456 Node* result = assembler->ChangeFloat64ToTagged(value);
2457 assembler->Return(result); 2457 assembler->Return(result);
2458 } 2458 }
2459 2459
2460 // ES6 section 20.2.2.13 Math.cosh ( x )
2461 void Builtins::Generate_MathCosh(CodeStubAssembler* assembler) {
2462 using compiler::Node;
2463
2464 Node* x = assembler->Parameter(1);
2465 Node* context = assembler->Parameter(4);
2466 Node* x_value = assembler->TruncateTaggedToFloat64(context, x);
2467 Node* value = assembler->Float64Cosh(x_value);
2468 Node* result = assembler->ChangeFloat64ToTagged(value);
2469 assembler->Return(result);
2470 }
2471
2460 // ES6 section 20.2.2.14 Math.exp ( x ) 2472 // ES6 section 20.2.2.14 Math.exp ( x )
2461 void Builtins::Generate_MathExp(CodeStubAssembler* assembler) { 2473 void Builtins::Generate_MathExp(CodeStubAssembler* assembler) {
2462 using compiler::Node; 2474 using compiler::Node;
2463 2475
2464 Node* x = assembler->Parameter(1); 2476 Node* x = assembler->Parameter(1);
2465 Node* context = assembler->Parameter(4); 2477 Node* context = assembler->Parameter(4);
2466 Node* x_value = assembler->TruncateTaggedToFloat64(context, x); 2478 Node* x_value = assembler->TruncateTaggedToFloat64(context, x);
2467 Node* value = assembler->Float64Exp(x_value); 2479 Node* value = assembler->Float64Exp(x_value);
2468 Node* result = assembler->ChangeFloat64ToTagged(value); 2480 Node* result = assembler->ChangeFloat64ToTagged(value);
2469 assembler->Return(result); 2481 assembler->Return(result);
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
2580 using compiler::Node; 2592 using compiler::Node;
2581 2593
2582 Node* x = assembler->Parameter(1); 2594 Node* x = assembler->Parameter(1);
2583 Node* context = assembler->Parameter(4); 2595 Node* context = assembler->Parameter(4);
2584 Node* x_value = assembler->TruncateTaggedToFloat64(context, x); 2596 Node* x_value = assembler->TruncateTaggedToFloat64(context, x);
2585 Node* value = assembler->Float64Sin(x_value); 2597 Node* value = assembler->Float64Sin(x_value);
2586 Node* result = assembler->ChangeFloat64ToTagged(value); 2598 Node* result = assembler->ChangeFloat64ToTagged(value);
2587 assembler->Return(result); 2599 assembler->Return(result);
2588 } 2600 }
2589 2601
2602 // ES6 section 20.2.2.31 Math.sinh ( x )
2603 void Builtins::Generate_MathSinh(CodeStubAssembler* assembler) {
2604 using compiler::Node;
2605
2606 Node* x = assembler->Parameter(1);
2607 Node* context = assembler->Parameter(4);
2608 Node* x_value = assembler->TruncateTaggedToFloat64(context, x);
2609 Node* value = assembler->Float64Sinh(x_value);
2610 Node* result = assembler->ChangeFloat64ToTagged(value);
2611 assembler->Return(result);
2612 }
2613
2590 // ES6 section 20.2.2.32 Math.sqrt ( x ) 2614 // ES6 section 20.2.2.32 Math.sqrt ( x )
2591 void Builtins::Generate_MathSqrt(CodeStubAssembler* assembler) { 2615 void Builtins::Generate_MathSqrt(CodeStubAssembler* assembler) {
2592 using compiler::Node; 2616 using compiler::Node;
2593 2617
2594 Node* x = assembler->Parameter(1); 2618 Node* x = assembler->Parameter(1);
2595 Node* context = assembler->Parameter(4); 2619 Node* context = assembler->Parameter(4);
2596 Node* x_value = assembler->TruncateTaggedToFloat64(context, x); 2620 Node* x_value = assembler->TruncateTaggedToFloat64(context, x);
2597 Node* value = assembler->Float64Sqrt(x_value); 2621 Node* value = assembler->Float64Sqrt(x_value);
2598 Node* result = assembler->ChangeFloat64ToTagged(value); 2622 Node* result = assembler->ChangeFloat64ToTagged(value);
2599 assembler->Return(result); 2623 assembler->Return(result);
2600 } 2624 }
2601 2625
2602 // ES6 section 20.2.2.33 Math.tan ( x ) 2626 // ES6 section 20.2.2.33 Math.tan ( x )
2603 void Builtins::Generate_MathTan(CodeStubAssembler* assembler) { 2627 void Builtins::Generate_MathTan(CodeStubAssembler* assembler) {
2604 using compiler::Node; 2628 using compiler::Node;
2605 2629
2606 Node* x = assembler->Parameter(1); 2630 Node* x = assembler->Parameter(1);
2607 Node* context = assembler->Parameter(4); 2631 Node* context = assembler->Parameter(4);
2608 Node* x_value = assembler->TruncateTaggedToFloat64(context, x); 2632 Node* x_value = assembler->TruncateTaggedToFloat64(context, x);
2609 Node* value = assembler->Float64Tan(x_value); 2633 Node* value = assembler->Float64Tan(x_value);
2610 Node* result = assembler->ChangeFloat64ToTagged(value); 2634 Node* result = assembler->ChangeFloat64ToTagged(value);
2611 assembler->Return(result); 2635 assembler->Return(result);
2612 } 2636 }
2613 2637
2638 // ES6 section 20.2.2.34 Math.tanh ( x )
2639 void Builtins::Generate_MathTanh(CodeStubAssembler* assembler) {
2640 using compiler::Node;
2641
2642 Node* x = assembler->Parameter(1);
2643 Node* context = assembler->Parameter(4);
2644 Node* x_value = assembler->TruncateTaggedToFloat64(context, x);
2645 Node* value = assembler->Float64Tanh(x_value);
2646 Node* result = assembler->ChangeFloat64ToTagged(value);
2647 assembler->Return(result);
2648 }
2649
2614 // ES6 section 20.2.2.35 Math.trunc ( x ) 2650 // ES6 section 20.2.2.35 Math.trunc ( x )
2615 void Builtins::Generate_MathTrunc(CodeStubAssembler* assembler) { 2651 void Builtins::Generate_MathTrunc(CodeStubAssembler* assembler) {
2616 Generate_MathRoundingOperation(assembler, &CodeStubAssembler::Float64Trunc); 2652 Generate_MathRoundingOperation(assembler, &CodeStubAssembler::Float64Trunc);
2617 } 2653 }
2618 2654
2619 // ----------------------------------------------------------------------------- 2655 // -----------------------------------------------------------------------------
2620 // ES6 section 19.2 Function Objects 2656 // ES6 section 19.2 Function Objects
2621 2657
2622 // ES6 section 19.2.3.6 Function.prototype [ @@hasInstance ] ( V ) 2658 // ES6 section 19.2.3.6 Function.prototype [ @@hasInstance ] ( V )
2623 void Builtins::Generate_FunctionPrototypeHasInstance( 2659 void Builtins::Generate_FunctionPrototypeHasInstance(
(...skipping 3633 matching lines...) Expand 10 before | Expand all | Expand 10 after
6257 BUILTIN_LIST_H(DEFINE_BUILTIN_ACCESSOR_H) 6293 BUILTIN_LIST_H(DEFINE_BUILTIN_ACCESSOR_H)
6258 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A) 6294 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A)
6259 #undef DEFINE_BUILTIN_ACCESSOR_C 6295 #undef DEFINE_BUILTIN_ACCESSOR_C
6260 #undef DEFINE_BUILTIN_ACCESSOR_A 6296 #undef DEFINE_BUILTIN_ACCESSOR_A
6261 #undef DEFINE_BUILTIN_ACCESSOR_T 6297 #undef DEFINE_BUILTIN_ACCESSOR_T
6262 #undef DEFINE_BUILTIN_ACCESSOR_S 6298 #undef DEFINE_BUILTIN_ACCESSOR_S
6263 #undef DEFINE_BUILTIN_ACCESSOR_H 6299 #undef DEFINE_BUILTIN_ACCESSOR_H
6264 6300
6265 } // namespace internal 6301 } // namespace internal
6266 } // namespace v8 6302 } // namespace v8
OLDNEW
« no previous file with comments | « src/builtins.h ('k') | src/compiler/arm/code-generator-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698