| 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..6ae15976736333c8cebb8be76d3225960c9fdd74 100644
|
| --- a/src/wasm/wasm-external-refs.cc
|
| +++ b/src/wasm/wasm-external-refs.cc
|
| @@ -194,6 +194,26 @@ uint32_t word64_popcnt_wrapper(uint64_t* input) {
|
| return static_cast<uint32_t>(base::bits::CountPopulation(*input));
|
| }
|
|
|
| +uint32_t word32_to_little_endianness(const uint32_t* input) {
|
| +#if defined(V8_TARGET_LITTLE_ENDIAN)
|
| + return *input;
|
| +#elif defined(V8_TARGET_BIG_ENDIAN)
|
| + return base::bits::ChangeEndianness(*input);
|
| +#else
|
| +#error Unknown endianness
|
| +#endif
|
| +}
|
| +
|
| +uint32_t word32_to_natural_endianness(const uint32_t* input) {
|
| +#if defined(V8_TARGET_LITTLE_ENDIAN)
|
| + return *input;
|
| +#elif defined(V8_TARGET_BIG_ENDIAN)
|
| + return base::bits::ChangeEndianness(*input);
|
| +#else
|
| +#error Unknown endianness
|
| +#endif
|
| +}
|
| +
|
| } // namespace wasm
|
| } // namespace internal
|
| } // namespace v8
|
|
|