Commit 90258718 authored by Ng Zhi An's avatar Ng Zhi An Committed by Commit Bot

[wasm-simd][fuzzer] Add v128.const

This rounds up all SIMD instructions as included in the proposal as of
https://github.com/WebAssembly/simd/commit/9f1295a494b4db98ad7e93cd6368239218233b3e.

Bug: v8:10180
Change-Id: Icd4cb0aeddede6a611de6f8f3916dc036977c499
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2285789
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Reviewed-by: 's avatarBill Budge <bbudge@chromium.org>
Cr-Commit-Position: refs/heads/master@{#68746}
parent d0e6ff15
......@@ -402,6 +402,13 @@ class WasmGenerator {
builder_->EmitWithPrefix(Op);
}
void simd_const(DataRange* data) {
builder_->EmitWithPrefix(kExprS128Const);
for (int i = 0; i < kSimd128Size; i++) {
builder_->EmitByte(data->get<byte>());
}
}
template <WasmOpcode Op, int lanes, ValueType::Kind... Args>
void simd_lane_op(DataRange* data) {
Generate<Args...>(data);
......@@ -1192,6 +1199,7 @@ void WasmGenerator::Generate<ValueType::kS128>(DataRange* data) {
}
constexpr GenerateFn alternatives[] = {
&WasmGenerator::simd_const,
&WasmGenerator::simd_lane_op<kExprI8x16ReplaceLane, 16, ValueType::kS128,
ValueType::kI32>,
&WasmGenerator::simd_lane_op<kExprI16x8ReplaceLane, 8, ValueType::kS128,
......
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