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

Unified Diff: src/wasm/wasm-external-refs.cc

Issue 2166793002: [wasm] Use a C wrapper function to calculate F64Pow. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/wasm/wasm-external-refs.h ('k') | test/cctest/compiler/test-run-calls-to-external-references.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/wasm/wasm-external-refs.cc
diff --git a/src/wasm/wasm-external-refs.cc b/src/wasm/wasm-external-refs.cc
index e155f3c8ba64fb0f0c321e8f307bcf384533426b..52a96959b16cdb4c16cfc77aa4ba9a310161c0eb 100644
--- a/src/wasm/wasm-external-refs.cc
+++ b/src/wasm/wasm-external-refs.cc
@@ -10,6 +10,7 @@
#include "include/v8config.h"
#include "src/base/bits.h"
+#include "src/utils.h"
#include "src/wasm/wasm-external-refs.h"
namespace v8 {
@@ -194,6 +195,14 @@ uint32_t word64_popcnt_wrapper(uint64_t* input) {
return static_cast<uint32_t>(base::bits::CountPopulation(*input));
}
+void float64_pow_wrapper(double* param0, double* param1) {
+ double x = ReadDoubleValue(param0);
+ double y = ReadDoubleValue(param1);
+ if (std::isnan(y) || ((x == 1 || x == -1) && std::isinf(y))) {
+ WriteDoubleValue(param0, std::numeric_limits<double>::quiet_NaN());
+ }
+ WriteDoubleValue(param0, Pow(x, y));
+}
} // namespace wasm
} // namespace internal
} // namespace v8
« no previous file with comments | « src/wasm/wasm-external-refs.h ('k') | test/cctest/compiler/test-run-calls-to-external-references.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698