Commit 19a2b86c authored by Thibaud Michaud's avatar Thibaud Michaud Committed by Commit Bot

[wasm][liftoff][eh] Encode S128 values in exceptions

R=clemensb@chromium.org

Bug: v8:11453
Change-Id: I0d02162e1a6974b550ec23ebb93c2478112a704d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2767023
Commit-Queue: Thibaud Michaud <thibaudm@chromium.org>
Reviewed-by: 's avatarClemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#73478}
parent 28050fee
...@@ -3954,6 +3954,16 @@ class LiftoffCompiler { ...@@ -3954,6 +3954,16 @@ class LiftoffCompiler {
Store64BitExceptionValue(values_array, index_in_array, tmp_reg, pinned); Store64BitExceptionValue(values_array, index_in_array, tmp_reg, pinned);
break; break;
} }
case kS128: {
LiftoffRegister tmp_reg =
pinned.set(__ GetUnusedRegister(kGpReg, pinned));
for (int i : {3, 2, 1, 0}) {
__ emit_i32x4_extract_lane(tmp_reg, value, i);
Store32BitExceptionValue(values_array, index_in_array, tmp_reg.gp(),
pinned);
}
break;
}
default: default:
UNREACHABLE(); UNREACHABLE();
} }
...@@ -3986,6 +3996,17 @@ class LiftoffCompiler { ...@@ -3986,6 +3996,17 @@ class LiftoffCompiler {
nullptr); nullptr);
break; break;
} }
case kS128: {
LiftoffRegister tmp_reg =
pinned.set(__ GetUnusedRegister(kGpReg, pinned));
Load32BitExceptionValue(tmp_reg.gp(), values_array, index, pinned);
__ emit_i32x4_splat(value, tmp_reg);
for (int lane : {1, 2, 3}) {
Load32BitExceptionValue(tmp_reg.gp(), values_array, index, pinned);
__ emit_i32x4_replace_lane(value, value, tmp_reg, lane);
}
break;
}
default: default:
UNREACHABLE(); UNREACHABLE();
} }
...@@ -4004,7 +4025,7 @@ class LiftoffCompiler { ...@@ -4004,7 +4025,7 @@ class LiftoffCompiler {
const WasmExceptionSig* sig = exception->sig; const WasmExceptionSig* sig = exception->sig;
for (ValueType param : sig->parameters()) { for (ValueType param : sig->parameters()) {
if (param != kWasmI32 && param != kWasmI64 && param != kWasmF32 && if (param != kWasmI32 && param != kWasmI64 && param != kWasmF32 &&
param != kWasmF64) { param != kWasmF64 && param != kWasmS128) {
unsupported(decoder, kExceptionHandling, unsupported(decoder, kExceptionHandling,
"unsupported type in exception payload"); "unsupported type in exception payload");
return; return;
...@@ -4087,7 +4108,7 @@ class LiftoffCompiler { ...@@ -4087,7 +4108,7 @@ class LiftoffCompiler {
--param_idx) { --param_idx) {
ValueType type = sig->GetParam(param_idx - 1); ValueType type = sig->GetParam(param_idx - 1);
if (type != kWasmI32 && type != kWasmI64 && type != kWasmF32 && if (type != kWasmI32 && type != kWasmI64 && type != kWasmF32 &&
type != kWasmF64) { type != kWasmF64 && type != kWasmS128) {
unsupported(decoder, kExceptionHandling, unsupported(decoder, kExceptionHandling,
"unsupported type in exception payload"); "unsupported type in exception payload");
return; return;
......
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