Skip to content

Commit 7c32fa0

Browse files
ngzhianCommit Bot
authored andcommitted
[wasm-simd][liftoff] Check CpuFeatures for SIMD support
If Wasm simd128 is not supported on this particular hardware, we bail out to TurboFan. Bug: v8:9909 Change-Id: Ie46e154426783ba099b7c0facc906670cda1bdd0 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2029427 Reviewed-by: Clemens Backes <[email protected]> Commit-Queue: Zhi An Ng <[email protected]> Cr-Commit-Position: refs/heads/master@{#66055}
1 parent fb96381 commit 7c32fa0

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

src/wasm/baseline/liftoff-compiler.cc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,11 @@ class LiftoffCompiler {
357357
bool CheckSupportedType(FullDecoder* decoder,
358358
Vector<const ValueType> supported_types,
359359
ValueType type, const char* context) {
360+
// Special case for kWasm128 which requires specific hardware support.
361+
if (type == kWasmS128 && (!CpuFeatures::SupportsWasmSimd128())) {
362+
unsupported(decoder, kSimd, "simd");
363+
return false;
364+
}
360365
// Check supported types.
361366
for (ValueType supported : supported_types) {
362367
if (type == supported) return true;
@@ -2198,6 +2203,9 @@ class LiftoffCompiler {
21982203

21992204
void SimdOp(FullDecoder* decoder, WasmOpcode opcode, Vector<Value> args,
22002205
Value* result) {
2206+
if (!CpuFeatures::SupportsWasmSimd128()) {
2207+
return unsupported(decoder, kSimd, "simd");
2208+
}
22012209
switch (opcode) {
22022210
case wasm::kExprF32x4Splat:
22032211
EmitUnOp<kWasmF32, kWasmS128>(

0 commit comments

Comments
 (0)