OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 24 matching lines...) Expand all Loading... |
35 | 35 |
36 namespace v8 { | 36 namespace v8 { |
37 namespace internal { | 37 namespace internal { |
38 | 38 |
39 #define __ ACCESS_MASM(masm) | 39 #define __ ACCESS_MASM(masm) |
40 | 40 |
41 #if defined(USE_SIMULATOR) | 41 #if defined(USE_SIMULATOR) |
42 byte* fast_exp_a64_machine_code = NULL; | 42 byte* fast_exp_a64_machine_code = NULL; |
43 double fast_exp_simulator(double x) { | 43 double fast_exp_simulator(double x) { |
44 Simulator * simulator = Simulator::current(Isolate::Current()); | 44 Simulator * simulator = Simulator::current(Isolate::Current()); |
45 return simulator->CallDouble(fast_exp_a64_machine_code, | 45 Simulator::CallArgument args[] = { |
46 Simulator::CallArgument(x), | 46 Simulator::CallArgument(x), |
47 Simulator::CallArgument::End()); | 47 Simulator::CallArgument::End() |
| 48 }; |
| 49 return simulator->CallDouble(fast_exp_a64_machine_code, args); |
48 } | 50 } |
49 #endif | 51 #endif |
50 | 52 |
51 | 53 |
52 UnaryMathFunction CreateExpFunction() { | 54 UnaryMathFunction CreateExpFunction() { |
53 if (!FLAG_fast_math) return &std::exp; | 55 if (!FLAG_fast_math) return &std::exp; |
54 | 56 |
55 // Use the Math.exp implemetation in MathExpGenerator::EmitMathExp() to create | 57 // Use the Math.exp implemetation in MathExpGenerator::EmitMathExp() to create |
56 // an AAPCS64-compliant exp() function. This will be faster than the C | 58 // an AAPCS64-compliant exp() function. This will be faster than the C |
57 // library's exp() function, but probably less accurate. | 59 // library's exp() function, but probably less accurate. |
(...skipping 547 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
605 __ Fmul(result, double_temp3, double_temp1); | 607 __ Fmul(result, double_temp3, double_temp1); |
606 | 608 |
607 __ Bind(&done); | 609 __ Bind(&done); |
608 } | 610 } |
609 | 611 |
610 #undef __ | 612 #undef __ |
611 | 613 |
612 } } // namespace v8::internal | 614 } } // namespace v8::internal |
613 | 615 |
614 #endif // V8_TARGET_ARCH_A64 | 616 #endif // V8_TARGET_ARCH_A64 |
OLD | NEW |