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

Side by Side 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 the V8 project authors. All rights reserved. 1 // Copyright 2016 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 <math.h> 5 #include <math.h>
6 #include <stdint.h> 6 #include <stdint.h>
7 #include <stdlib.h> 7 #include <stdlib.h>
8 #include <limits> 8 #include <limits>
9 9
10 #include "include/v8config.h" 10 #include "include/v8config.h"
11 11
12 #include "src/base/bits.h" 12 #include "src/base/bits.h"
13 #include "src/utils.h"
13 #include "src/wasm/wasm-external-refs.h" 14 #include "src/wasm/wasm-external-refs.h"
14 15
15 namespace v8 { 16 namespace v8 {
16 namespace internal { 17 namespace internal {
17 namespace wasm { 18 namespace wasm {
18 19
19 void f32_trunc_wrapper(float* param) { *param = truncf(*param); } 20 void f32_trunc_wrapper(float* param) { *param = truncf(*param); }
20 21
21 void f32_floor_wrapper(float* param) { *param = floorf(*param); } 22 void f32_floor_wrapper(float* param) { *param = floorf(*param); }
22 23
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 } 188 }
188 189
189 uint32_t word32_popcnt_wrapper(uint32_t* input) { 190 uint32_t word32_popcnt_wrapper(uint32_t* input) {
190 return static_cast<uint32_t>(base::bits::CountPopulation(*input)); 191 return static_cast<uint32_t>(base::bits::CountPopulation(*input));
191 } 192 }
192 193
193 uint32_t word64_popcnt_wrapper(uint64_t* input) { 194 uint32_t word64_popcnt_wrapper(uint64_t* input) {
194 return static_cast<uint32_t>(base::bits::CountPopulation(*input)); 195 return static_cast<uint32_t>(base::bits::CountPopulation(*input));
195 } 196 }
196 197
198 void float64_pow_wrapper(double* param0, double* param1) {
199 double x = ReadDoubleValue(param0);
200 double y = ReadDoubleValue(param1);
201 if (std::isnan(y) || ((x == 1 || x == -1) && std::isinf(y))) {
202 WriteDoubleValue(param0, std::numeric_limits<double>::quiet_NaN());
203 }
204 WriteDoubleValue(param0, Pow(x, y));
205 }
197 } // namespace wasm 206 } // namespace wasm
198 } // namespace internal 207 } // namespace internal
199 } // namespace v8 208 } // namespace v8
OLDNEW
« 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