OLD | NEW |
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" |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 return static_cast<uint32_t>(base::bits::CountPopulation(*input)); | 199 return static_cast<uint32_t>(base::bits::CountPopulation(*input)); |
200 } | 200 } |
201 | 201 |
202 uint32_t word64_popcnt_wrapper(uint64_t* input) { | 202 uint32_t word64_popcnt_wrapper(uint64_t* input) { |
203 return static_cast<uint32_t>(base::bits::CountPopulation(*input)); | 203 return static_cast<uint32_t>(base::bits::CountPopulation(*input)); |
204 } | 204 } |
205 | 205 |
206 void float64_pow_wrapper(double* param0, double* param1) { | 206 void float64_pow_wrapper(double* param0, double* param1) { |
207 double x = ReadDoubleValue(param0); | 207 double x = ReadDoubleValue(param0); |
208 double y = ReadDoubleValue(param1); | 208 double y = ReadDoubleValue(param1); |
209 if (std::isnan(y) || ((x == 1 || x == -1) && std::isinf(y))) { | |
210 WriteDoubleValue(param0, std::numeric_limits<double>::quiet_NaN()); | |
211 } | |
212 WriteDoubleValue(param0, Pow(x, y)); | 209 WriteDoubleValue(param0, Pow(x, y)); |
213 } | 210 } |
214 } // namespace wasm | 211 } // namespace wasm |
215 } // namespace internal | 212 } // namespace internal |
216 } // namespace v8 | 213 } // namespace v8 |
OLD | NEW |