Commit 3219b29d authored by Ng Zhi An's avatar Ng Zhi An Committed by Commit Bot

[liftoff][wasm-simd] Check SIMD support for more operations

We need to also check SIMD support for v128.const and i8x16.shuffle,
these are separate functions, not part of the SimdOp or SimdLaneOp.

This was discovered while running some JS tests when trying to stage
SIMD.

Bug: v8:10835
Change-Id: I51c6e65cc9397058e0be83cf4116ab4bfe4c4ec9
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2391332Reviewed-by: 's avatarClemens Backes <clemensb@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#69751}
parent 1e39d196
...@@ -2904,6 +2904,9 @@ class LiftoffCompiler { ...@@ -2904,6 +2904,9 @@ class LiftoffCompiler {
void S128Const(FullDecoder* decoder, const Simd128Immediate<validate>& imm, void S128Const(FullDecoder* decoder, const Simd128Immediate<validate>& imm,
Value* result) { Value* result) {
if (!CpuFeatures::SupportsWasmSimd128()) {
return unsupported(decoder, kSimd, "simd");
}
constexpr RegClass result_rc = reg_class_for(ValueType::kS128); constexpr RegClass result_rc = reg_class_for(ValueType::kS128);
LiftoffRegister dst = __ GetUnusedRegister(result_rc, {}); LiftoffRegister dst = __ GetUnusedRegister(result_rc, {});
bool all_zeroes = std::all_of(std::begin(imm.value), std::end(imm.value), bool all_zeroes = std::all_of(std::begin(imm.value), std::end(imm.value),
...@@ -2925,6 +2928,9 @@ class LiftoffCompiler { ...@@ -2925,6 +2928,9 @@ class LiftoffCompiler {
const Simd128Immediate<validate>& imm, const Simd128Immediate<validate>& imm,
const Value& input0, const Value& input1, const Value& input0, const Value& input1,
Value* result) { Value* result) {
if (!CpuFeatures::SupportsWasmSimd128()) {
return unsupported(decoder, kSimd, "simd");
}
static constexpr RegClass result_rc = reg_class_for(ValueType::kS128); static constexpr RegClass result_rc = reg_class_for(ValueType::kS128);
LiftoffRegister rhs = __ PopToRegister(); LiftoffRegister rhs = __ PopToRegister();
LiftoffRegister lhs = __ PopToRegister(LiftoffRegList::ForRegs(rhs)); LiftoffRegister lhs = __ PopToRegister(LiftoffRegList::ForRegs(rhs));
......
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