| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent bc265aa commit 180c150
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -40,7 +40,17 @@ void ConstantExpressionInterface::S128Const(FullDecoder* decoder, | |||
| 40 | 40 | const Simd128Immediate& imm, | |
| 41 | 41 | Value* result) { | |
| 42 | 42 | if (!generate_value()) return; | |
| 43 | + #if V8_TARGET_BIG_ENDIAN | ||
| 44 | + // Globals are not little endian enforced, they use native byte order and we | ||
| 45 | + // need to reverse the bytes on big endian platforms. | ||
| 46 | + uint8_t value[kSimd128Size]; | ||
| 47 | + for (int i = 0; i < kSimd128Size; i++) { | ||
| 48 | + value[i] = imm.value[kSimd128Size - 1 - i]; | ||
| 49 | + } | ||
| 50 | + result->runtime_value = WasmValue(value, kWasmS128); | ||
| 51 | + #else | ||
| 43 | 52 | result->runtime_value = WasmValue(imm.value, kWasmS128); | |
| 53 | + #endif | ||
| 44 | 54 | } | |
| 45 | 55 | ||
| 46 | 56 | void ConstantExpressionInterface::UnOp(FullDecoder* decoder, WasmOpcode opcode, | |
| Back | FazBrowse Home | New Git URL |
0 commit comments