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

Unified Diff: src/assembler.cc

Issue 2053893003: [builtins] Introduce proper base::ieee754::log. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: BUILD.gn 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/assembler.h ('k') | src/base/ieee754.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/assembler.cc
diff --git a/src/assembler.cc b/src/assembler.cc
index 0182a4285243ab894e94cef5eeee7753e0e8b185..ce755f2631ca6dc69d75185b7a55459f1e72bcb4 100644
--- a/src/assembler.cc
+++ b/src/assembler.cc
@@ -39,6 +39,7 @@
#include "src/api.h"
#include "src/base/cpu.h"
#include "src/base/functional.h"
+#include "src/base/ieee754.h"
#include "src/base/lazy-instance.h"
#include "src/base/platform/platform.h"
#include "src/base/utils/random-number-generator.h"
@@ -1027,7 +1028,7 @@ void ExternalReference::InitializeMathExpData() {
// The rest is black magic. Do not attempt to understand it. It is
// loosely based on the "expd" function published at:
// http://herumi.blogspot.com/2011/08/fast-double-precision-exponential.html
- const double constant3 = (1 << kTableSizeBits) / std::log(2.0);
+ const double constant3 = (1 << kTableSizeBits) / base::ieee754::log(2.0);
math_exp_constants_array[3] = constant3;
math_exp_constants_array[4] =
static_cast<double>(static_cast<int64_t>(3) << 51);
@@ -1647,13 +1648,9 @@ ExternalReference ExternalReference::address_of_regexp_stack_memory_size(
#endif // V8_INTERPRETED_REGEXP
-
-ExternalReference ExternalReference::math_log_double_function(
- Isolate* isolate) {
- typedef double (*d2d)(double x);
- return ExternalReference(Redirect(isolate,
- FUNCTION_ADDR(static_cast<d2d>(std::log)),
- BUILTIN_FP_CALL));
+ExternalReference ExternalReference::ieee754_log_function(Isolate* isolate) {
+ return ExternalReference(
+ Redirect(isolate, FUNCTION_ADDR(base::ieee754::log), BUILTIN_FP_CALL));
}
« no previous file with comments | « src/assembler.h ('k') | src/base/ieee754.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698