Commit b4e15595 authored by Milad Fa's avatar Milad Fa Committed by V8 LUCI CQ

[wasm-simd] Fix endianness issue when generating constants

value must be written to memory in LE order on BE machines
as they will be loaded in reverse when emitting S128Const.

Change-Id: Ia1d6c784505abe499fb71a6d86daea2721615da4
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3151956Reviewed-by: 's avatarZhi An Ng <zhin@chromium.org>
Commit-Queue: Milad Fa <mfarazma@redhat.com>
Cr-Commit-Position: refs/heads/main@{#76758}
parent 0c045963
......@@ -367,7 +367,8 @@ void RunF128CompareOpConstImmTest(
byte temp = r.AllocateLocal(kWasmS128);
uint8_t const_buffer[kSimd128Size];
for (size_t i = 0; i < kSimd128Size / sizeof(FloatType); i++) {
memcpy(&const_buffer[i * sizeof(FloatType)], &x, sizeof(FloatType));
WriteLittleEndianValue<FloatType>(
bit_cast<FloatType*>(&const_buffer[0]) + i, x);
}
BUILD(r,
WASM_LOCAL_SET(temp,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment