summaryrefslogtreecommitdiff
path: root/src/tools/fuzzing.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools/fuzzing.h')
-rw-r--r--src/tools/fuzzing.h27
1 files changed, 26 insertions, 1 deletions
diff --git a/src/tools/fuzzing.h b/src/tools/fuzzing.h
index bc2f54ecd..2f0c5d315 100644
--- a/src/tools/fuzzing.h
+++ b/src/tools/fuzzing.h
@@ -2338,7 +2338,7 @@ private:
if (type != v128) {
return makeSIMDExtract(type);
}
- switch (upTo(6)) {
+ switch (upTo(7)) {
case 0:
return makeUnary(v128);
case 1:
@@ -2351,6 +2351,8 @@ private:
return makeSIMDTernary();
case 5:
return makeSIMDShift();
+ case 6:
+ return makeSIMDLoad();
}
WASM_UNREACHABLE();
}
@@ -2488,6 +2490,29 @@ private:
return builder.makeSIMDShift(op, vec, shift);
}
+ Expression* makeSIMDLoad() {
+ SIMDLoadOp op = pick(
+ LoadSplatVec8x16, LoadSplatVec16x8, LoadSplatVec32x4, LoadSplatVec64x2);
+ Address offset = logify(get());
+ Address align;
+ switch (op) {
+ case LoadSplatVec8x16:
+ align = 1;
+ break;
+ case LoadSplatVec16x8:
+ align = pick(1, 2);
+ break;
+ case LoadSplatVec32x4:
+ align = pick(1, 2, 4);
+ break;
+ case LoadSplatVec64x2:
+ align = pick(1, 2, 4, 8);
+ break;
+ }
+ Expression* ptr = makePointer();
+ return builder.makeSIMDLoad(op, offset, align, ptr);
+ }
+
Expression* makeBulkMemory(Type type) {
if (!allowMemory) {
return makeTrivial(type);