summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Lively <7121787+tlively@users.noreply.github.com>2019-09-24 16:57:57 -0700
committerGitHub <noreply@github.com>2019-09-24 16:57:57 -0700
commited2c3cd0892be8a1380a6c6bfddfa3492c16f91c (patch)
tree32e5f1499f69caa359c130c92e1d28153e7506d3
parent034ed383a968204427befda3f9fb8bb5d2f63f75 (diff)
downloadbinaryen-ed2c3cd0892be8a1380a6c6bfddfa3492c16f91c.tar.gz
binaryen-ed2c3cd0892be8a1380a6c6bfddfa3492c16f91c.tar.bz2
binaryen-ed2c3cd0892be8a1380a6c6bfddfa3492c16f91c.zip
SIMD load and extend instructions (#2353)
Adds support for the new load and extend instructions. Also updates from C++11 to C++17 in order to use generic lambdas in the interpreter implementation.
-rw-r--r--CMakeLists.txt22
-rw-r--r--Contributing.md1
-rwxr-xr-xbuild-js.sh8
-rwxr-xr-xscripts/gen-s-parser.py6
-rw-r--r--src/binaryen-c.cpp18
-rw-r--r--src/binaryen-c.h6
-rw-r--r--src/emscripten-optimizer/istring.h7
-rw-r--r--src/gen-s-parser.inc33
-rw-r--r--src/js/binaryen.js-post.js24
-rw-r--r--src/passes/Print.cpp18
-rw-r--r--src/tools/fuzzing.h18
-rw-r--r--src/wasm-binary.h6
-rw-r--r--src/wasm-interpreter.h76
-rw-r--r--src/wasm.h8
-rw-r--r--src/wasm/wasm-binary.cpp24
-rw-r--r--src/wasm/wasm-s-parser.cpp6
-rw-r--r--src/wasm/wasm-stack.cpp18
-rw-r--r--src/wasm/wasm-validator.cpp20
-rw-r--r--src/wasm/wasm.cpp6
-rw-r--r--test/binaryen.js/kitchen-sink.js6
-rw-r--r--test/binaryen.js/kitchen-sink.js.txt527
-rw-r--r--test/example/c-api-kitchen-sink.c24
-rw-r--r--test/example/c-api-kitchen-sink.txt315
-rw-r--r--test/example/c-api-kitchen-sink.txt.txt30
-rw-r--r--test/simd.wast50
-rw-r--r--test/simd.wast.from-wast74
-rw-r--r--test/simd.wast.fromBinary74
-rw-r--r--test/simd.wast.fromBinary.noDebugInfo74
-rw-r--r--test/spec/simd.wast13
29 files changed, 1136 insertions, 376 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a03024b7f..aec321448 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -131,7 +131,7 @@ ELSE()
SET(THREADS_PREFER_PTHREAD_FLAG ON)
SET(CMAKE_THREAD_PREFER_PTHREAD ON)
FIND_PACKAGE(Threads REQUIRED)
- ADD_CXX_FLAG("-std=c++11")
+ ADD_CXX_FLAG("-std=c++17")
if (NOT EMSCRIPTEN)
if (CMAKE_SYSTEM_PROCESSOR MATCHES "^i.86$")
# wasm doesn't allow for x87 floating point math
@@ -213,7 +213,7 @@ SET(wasm-shell_SOURCES
ADD_EXECUTABLE(wasm-shell
${wasm-shell_SOURCES})
TARGET_LINK_LIBRARIES(wasm-shell wasm asmjs emscripten-optimizer passes ir cfg support wasm)
-SET_PROPERTY(TARGET wasm-shell PROPERTY CXX_STANDARD 11)
+SET_PROPERTY(TARGET wasm-shell PROPERTY CXX_STANDARD 17)
SET_PROPERTY(TARGET wasm-shell PROPERTY CXX_STANDARD_REQUIRED ON)
INSTALL(TARGETS wasm-shell DESTINATION ${CMAKE_INSTALL_BINDIR})
@@ -223,7 +223,7 @@ SET(wasm-opt_SOURCES
ADD_EXECUTABLE(wasm-opt
${wasm-opt_SOURCES})
TARGET_LINK_LIBRARIES(wasm-opt wasm asmjs emscripten-optimizer passes ir cfg support wasm)
-SET_PROPERTY(TARGET wasm-opt PROPERTY CXX_STANDARD 11)
+SET_PROPERTY(TARGET wasm-opt PROPERTY CXX_STANDARD 17)
SET_PROPERTY(TARGET wasm-opt PROPERTY CXX_STANDARD_REQUIRED ON)
INSTALL(TARGETS wasm-opt DESTINATION ${CMAKE_INSTALL_BINDIR})
@@ -233,7 +233,7 @@ SET(wasm-metadce_SOURCES
ADD_EXECUTABLE(wasm-metadce
${wasm-metadce_SOURCES})
TARGET_LINK_LIBRARIES(wasm-metadce wasm asmjs emscripten-optimizer passes ir cfg support wasm)
-SET_PROPERTY(TARGET wasm-metadce PROPERTY CXX_STANDARD 11)
+SET_PROPERTY(TARGET wasm-metadce PROPERTY CXX_STANDARD 17)
SET_PROPERTY(TARGET wasm-metadce PROPERTY CXX_STANDARD_REQUIRED ON)
INSTALL(TARGETS wasm-metadce DESTINATION bin)
@@ -243,7 +243,7 @@ SET(asm2wasm_SOURCES
ADD_EXECUTABLE(asm2wasm
${asm2wasm_SOURCES})
TARGET_LINK_LIBRARIES(asm2wasm emscripten-optimizer passes wasm asmjs ir cfg support)
-SET_PROPERTY(TARGET asm2wasm PROPERTY CXX_STANDARD 11)
+SET_PROPERTY(TARGET asm2wasm PROPERTY CXX_STANDARD 17)
SET_PROPERTY(TARGET asm2wasm PROPERTY CXX_STANDARD_REQUIRED ON)
INSTALL(TARGETS asm2wasm DESTINATION ${CMAKE_INSTALL_BINDIR})
@@ -253,7 +253,7 @@ SET(wasm2js_SOURCES
ADD_EXECUTABLE(wasm2js
${wasm2js_SOURCES})
TARGET_LINK_LIBRARIES(wasm2js passes wasm asmjs emscripten-optimizer ir cfg support)
-SET_PROPERTY(TARGET wasm2js PROPERTY CXX_STANDARD 11)
+SET_PROPERTY(TARGET wasm2js PROPERTY CXX_STANDARD 17)
SET_PROPERTY(TARGET wasm2js PROPERTY CXX_STANDARD_REQUIRED ON)
INSTALL(TARGETS wasm2js DESTINATION ${CMAKE_INSTALL_BINDIR})
@@ -263,7 +263,7 @@ SET(wasm-emscripten-finalize_SOURCES
ADD_EXECUTABLE(wasm-emscripten-finalize
${wasm-emscripten-finalize_SOURCES})
TARGET_LINK_LIBRARIES(wasm-emscripten-finalize passes wasm asmjs ir cfg support)
-SET_PROPERTY(TARGET wasm-emscripten-finalize PROPERTY CXX_STANDARD 11)
+SET_PROPERTY(TARGET wasm-emscripten-finalize PROPERTY CXX_STANDARD 17)
SET_PROPERTY(TARGET wasm-emscripten-finalize PROPERTY CXX_STANDARD_REQUIRED ON)
INSTALL(TARGETS wasm-emscripten-finalize DESTINATION ${CMAKE_INSTALL_BINDIR})
@@ -273,7 +273,7 @@ SET(wasm_as_SOURCES
ADD_EXECUTABLE(wasm-as
${wasm_as_SOURCES})
TARGET_LINK_LIBRARIES(wasm-as wasm asmjs passes ir cfg support wasm)
-SET_PROPERTY(TARGET wasm-as PROPERTY CXX_STANDARD 11)
+SET_PROPERTY(TARGET wasm-as PROPERTY CXX_STANDARD 17)
SET_PROPERTY(TARGET wasm-as PROPERTY CXX_STANDARD_REQUIRED ON)
INSTALL(TARGETS wasm-as DESTINATION ${CMAKE_INSTALL_BINDIR})
@@ -283,7 +283,7 @@ SET(wasm_dis_SOURCES
ADD_EXECUTABLE(wasm-dis
${wasm_dis_SOURCES})
TARGET_LINK_LIBRARIES(wasm-dis passes wasm asmjs ir cfg support)
-SET_PROPERTY(TARGET wasm-dis PROPERTY CXX_STANDARD 11)
+SET_PROPERTY(TARGET wasm-dis PROPERTY CXX_STANDARD 17)
SET_PROPERTY(TARGET wasm-dis PROPERTY CXX_STANDARD_REQUIRED ON)
INSTALL(TARGETS wasm-dis DESTINATION ${CMAKE_INSTALL_BINDIR})
@@ -293,7 +293,7 @@ SET(wasm-ctor-eval_SOURCES
ADD_EXECUTABLE(wasm-ctor-eval
${wasm-ctor-eval_SOURCES})
TARGET_LINK_LIBRARIES(wasm-ctor-eval emscripten-optimizer passes wasm asmjs ir cfg support)
-SET_PROPERTY(TARGET wasm-ctor-eval PROPERTY CXX_STANDARD 11)
+SET_PROPERTY(TARGET wasm-ctor-eval PROPERTY CXX_STANDARD 17)
SET_PROPERTY(TARGET wasm-ctor-eval PROPERTY CXX_STANDARD_REQUIRED ON)
INSTALL(TARGETS wasm-ctor-eval DESTINATION bin)
@@ -303,7 +303,7 @@ SET(wasm-reduce_SOURCES
ADD_EXECUTABLE(wasm-reduce
${wasm-reduce_SOURCES})
TARGET_LINK_LIBRARIES(wasm-reduce wasm asmjs passes wasm ir cfg support)
-SET_PROPERTY(TARGET wasm-reduce PROPERTY CXX_STANDARD 11)
+SET_PROPERTY(TARGET wasm-reduce PROPERTY CXX_STANDARD 17)
SET_PROPERTY(TARGET wasm-reduce PROPERTY CXX_STANDARD_REQUIRED ON)
INSTALL(TARGETS wasm-reduce DESTINATION ${CMAKE_INSTALL_BINDIR})
diff --git a/Contributing.md b/Contributing.md
index 3fafe57f7..3e836eb15 100644
--- a/Contributing.md
+++ b/Contributing.md
@@ -28,3 +28,4 @@ Use this handy checklist to make sure your new instructions are fully supported:
- [ ] C API tested in test/example/c-api-kitchen-sink.c
- [ ] JS API tested in test/binaryen.js/kitchen-sink.js
- [ ] Tests added in test/spec
+ - [ ] Tests added in top-level test/
diff --git a/build-js.sh b/build-js.sh
index 77fa0a1a8..2ad96e221 100755
--- a/build-js.sh
+++ b/build-js.sh
@@ -37,7 +37,7 @@ elif [ ! -d "$EMSCRIPTEN" ]; then
exit 1
fi
-EMCC_ARGS="-std=c++11 --memory-init-file 0"
+EMCC_ARGS="-std=gnu++17 --memory-init-file 0"
EMCC_ARGS="$EMCC_ARGS -s ALLOW_MEMORY_GROWTH=1"
EMCC_ARGS="$EMCC_ARGS -s DEMANGLE_SUPPORT=1"
EMCC_ARGS="$EMCC_ARGS -s NO_FILESYSTEM=0"
@@ -556,6 +556,12 @@ export_function "_BinaryenLoadSplatVec8x16"
export_function "_BinaryenLoadSplatVec16x8"
export_function "_BinaryenLoadSplatVec32x4"
export_function "_BinaryenLoadSplatVec64x2"
+export_function "_BinaryenLoadExtSVec8x8ToVecI16x8"
+export_function "_BinaryenLoadExtUVec8x8ToVecI16x8"
+export_function "_BinaryenLoadExtSVec16x4ToVecI32x4"
+export_function "_BinaryenLoadExtUVec16x4ToVecI32x4"
+export_function "_BinaryenLoadExtSVec32x2ToVecI64x2"
+export_function "_BinaryenLoadExtUVec32x2ToVecI64x2"
export_function "_BinaryenNarrowSVecI16x8ToVecI8x16"
export_function "_BinaryenNarrowUVecI16x8ToVecI8x16"
export_function "_BinaryenNarrowSVecI32x4ToVecI16x8"
diff --git a/scripts/gen-s-parser.py b/scripts/gen-s-parser.py
index acb76a176..ccc641c52 100755
--- a/scripts/gen-s-parser.py
+++ b/scripts/gen-s-parser.py
@@ -434,6 +434,12 @@ instructions = [
("v16x8.load_splat", "makeSIMDLoad(s, SIMDLoadOp::LoadSplatVec16x8)"),
("v32x4.load_splat", "makeSIMDLoad(s, SIMDLoadOp::LoadSplatVec32x4)"),
("v64x2.load_splat", "makeSIMDLoad(s, SIMDLoadOp::LoadSplatVec64x2)"),
+ ("i16x8.load8x8_s", "makeSIMDLoad(s, SIMDLoadOp::LoadExtSVec8x8ToVecI16x8)"),
+ ("i16x8.load8x8_u", "makeSIMDLoad(s, SIMDLoadOp::LoadExtUVec8x8ToVecI16x8)"),
+ ("i32x4.load16x4_s", "makeSIMDLoad(s, SIMDLoadOp::LoadExtSVec16x4ToVecI32x4)"),
+ ("i32x4.load16x4_u", "makeSIMDLoad(s, SIMDLoadOp::LoadExtUVec16x4ToVecI32x4)"),
+ ("i64x2.load32x2_s", "makeSIMDLoad(s, SIMDLoadOp::LoadExtSVec32x2ToVecI64x2)"),
+ ("i64x2.load32x2_u", "makeSIMDLoad(s, SIMDLoadOp::LoadExtUVec32x2ToVecI64x2)"),
("i8x16.narrow_i16x8_s", "makeBinary(s, BinaryOp::NarrowSVecI16x8ToVecI8x16)"),
("i8x16.narrow_i16x8_u", "makeBinary(s, BinaryOp::NarrowUVecI16x8ToVecI8x16)"),
("i16x8.narrow_i32x4_s", "makeBinary(s, BinaryOp::NarrowSVecI32x4ToVecI16x8)"),
diff --git a/src/binaryen-c.cpp b/src/binaryen-c.cpp
index 23f67874f..a4b3e9b5b 100644
--- a/src/binaryen-c.cpp
+++ b/src/binaryen-c.cpp
@@ -888,6 +888,24 @@ BinaryenOp BinaryenLoadSplatVec8x16(void) { return LoadSplatVec8x16; }
BinaryenOp BinaryenLoadSplatVec16x8(void) { return LoadSplatVec16x8; }
BinaryenOp BinaryenLoadSplatVec32x4(void) { return LoadSplatVec32x4; }
BinaryenOp BinaryenLoadSplatVec64x2(void) { return LoadSplatVec64x2; }
+BinaryenOp BinaryenLoadExtSVec8x8ToVecI16x8(void) {
+ return LoadExtSVec8x8ToVecI16x8;
+}
+BinaryenOp BinaryenLoadExtUVec8x8ToVecI16x8(void) {
+ return LoadExtUVec8x8ToVecI16x8;
+}
+BinaryenOp BinaryenLoadExtSVec16x4ToVecI32x4(void) {
+ return LoadExtSVec16x4ToVecI32x4;
+}
+BinaryenOp BinaryenLoadExtUVec16x4ToVecI32x4(void) {
+ return LoadExtUVec16x4ToVecI32x4;
+}
+BinaryenOp BinaryenLoadExtSVec32x2ToVecI64x2(void) {
+ return LoadExtSVec32x2ToVecI64x2;
+}
+BinaryenOp BinaryenLoadExtUVec32x2ToVecI64x2(void) {
+ return LoadExtUVec32x2ToVecI64x2;
+}
BinaryenOp BinaryenNarrowSVecI16x8ToVecI8x16(void) {
return NarrowSVecI16x8ToVecI8x16;
}
diff --git a/src/binaryen-c.h b/src/binaryen-c.h
index d6531fae0..a31df8cae 100644
--- a/src/binaryen-c.h
+++ b/src/binaryen-c.h
@@ -528,6 +528,12 @@ BINARYEN_API BinaryenOp BinaryenLoadSplatVec8x16(void);
BINARYEN_API BinaryenOp BinaryenLoadSplatVec16x8(void);
BINARYEN_API BinaryenOp BinaryenLoadSplatVec32x4(void);
BINARYEN_API BinaryenOp BinaryenLoadSplatVec64x2(void);
+BINARYEN_API BinaryenOp BinaryenLoadExtSVec8x8ToVecI16x8(void);
+BINARYEN_API BinaryenOp BinaryenLoadExtUVec8x8ToVecI16x8(void);
+BINARYEN_API BinaryenOp BinaryenLoadExtSVec16x4ToVecI32x4(void);
+BINARYEN_API BinaryenOp BinaryenLoadExtUVec16x4ToVecI32x4(void);
+BINARYEN_API BinaryenOp BinaryenLoadExtSVec32x2ToVecI64x2(void);
+BINARYEN_API BinaryenOp BinaryenLoadExtUVec32x2ToVecI64x2(void);
BINARYEN_API BinaryenOp BinaryenNarrowSVecI16x8ToVecI8x16(void);
BINARYEN_API BinaryenOp BinaryenNarrowUVecI16x8ToVecI8x16(void);
BINARYEN_API BinaryenOp BinaryenNarrowSVecI32x4ToVecI16x8(void);
diff --git a/src/emscripten-optimizer/istring.h b/src/emscripten-optimizer/istring.h
index 21f94fcb9..ccb08bf4b 100644
--- a/src/emscripten-optimizer/istring.h
+++ b/src/emscripten-optimizer/istring.h
@@ -161,16 +161,13 @@ struct IString {
namespace std {
-template<>
-struct hash<cashew::IString> : public unary_function<cashew::IString, size_t> {
+template<> struct hash<cashew::IString> {
size_t operator()(const cashew::IString& str) const {
return std::hash<size_t>{}(size_t(str.str));
}
};
-template<>
-struct equal_to<cashew::IString>
- : public binary_function<cashew::IString, cashew::IString, bool> {
+template<> struct equal_to<cashew::IString> {
bool operator()(const cashew::IString& x, const cashew::IString& y) const {
return x == y;
}
diff --git a/src/gen-s-parser.inc b/src/gen-s-parser.inc
index e9da45a18..bab468e2a 100644
--- a/src/gen-s-parser.inc
+++ b/src/gen-s-parser.inc
@@ -760,6 +760,17 @@ switch (op[0]) {
default: goto parse_error;
}
}
+ case 'o': {
+ switch (op[14]) {
+ case 's':
+ if (strcmp(op, "i16x8.load8x8_s") == 0) { return makeSIMDLoad(s, SIMDLoadOp::LoadExtSVec8x8ToVecI16x8); }
+ goto parse_error;
+ case 'u':
+ if (strcmp(op, "i16x8.load8x8_u") == 0) { return makeSIMDLoad(s, SIMDLoadOp::LoadExtUVec8x8ToVecI16x8); }
+ goto parse_error;
+ default: goto parse_error;
+ }
+ }
case 't': {
switch (op[9]) {
case 's':
@@ -1414,6 +1425,17 @@ switch (op[0]) {
default: goto parse_error;
}
}
+ case 'o': {
+ switch (op[15]) {
+ case 's':
+ if (strcmp(op, "i32x4.load16x4_s") == 0) { return makeSIMDLoad(s, SIMDLoadOp::LoadExtSVec16x4ToVecI32x4); }
+ goto parse_error;
+ case 'u':
+ if (strcmp(op, "i32x4.load16x4_u") == 0) { return makeSIMDLoad(s, SIMDLoadOp::LoadExtUVec16x4ToVecI32x4); }
+ goto parse_error;
+ default: goto parse_error;
+ }
+ }
case 't': {
switch (op[9]) {
case 's':
@@ -2069,6 +2091,17 @@ switch (op[0]) {
case 'e':
if (strcmp(op, "i64x2.extract_lane") == 0) { return makeSIMDExtract(s, SIMDExtractOp::ExtractLaneVecI64x2, 2); }
goto parse_error;
+ case 'l': {
+ switch (op[15]) {
+ case 's':
+ if (strcmp(op, "i64x2.load32x2_s") == 0) { return makeSIMDLoad(s, SIMDLoadOp::LoadExtSVec32x2ToVecI64x2); }
+ goto parse_error;
+ case 'u':
+ if (strcmp(op, "i64x2.load32x2_u") == 0) { return makeSIMDLoad(s, SIMDLoadOp::LoadExtUVec32x2ToVecI64x2); }
+ goto parse_error;
+ default: goto parse_error;
+ }
+ }
case 'n':
if (strcmp(op, "i64x2.neg") == 0) { return makeUnary(s, UnaryOp::NegVecI64x2); }
goto parse_error;
diff --git a/src/js/binaryen.js-post.js b/src/js/binaryen.js-post.js
index 3e1ccd2f8..8769e1c9e 100644
--- a/src/js/binaryen.js-post.js
+++ b/src/js/binaryen.js-post.js
@@ -400,6 +400,12 @@ Module['LoadSplatVec8x16'] = Module['_BinaryenLoadSplatVec8x16']();
Module['LoadSplatVec16x8'] = Module['_BinaryenLoadSplatVec16x8']();
Module['LoadSplatVec32x4'] = Module['_BinaryenLoadSplatVec32x4']();
Module['LoadSplatVec64x2'] = Module['_BinaryenLoadSplatVec64x2']();
+Module['LoadExtSVec8x8ToVecI16x8'] = Module['_BinaryenLoadExtSVec8x8ToVecI16x8']();
+Module['LoadExtUVec8x8ToVecI16x8'] = Module['_BinaryenLoadExtUVec8x8ToVecI16x8']();
+Module['LoadExtSVec16x4ToVecI32x4'] = Module['_BinaryenLoadExtSVec16x4ToVecI32x4']();
+Module['LoadExtUVec16x4ToVecI32x4'] = Module['_BinaryenLoadExtUVec16x4ToVecI32x4']();
+Module['LoadExtSVec32x2ToVecI64x2'] = Module['_BinaryenLoadExtSVec32x2ToVecI64x2']();
+Module['LoadExtUVec32x2ToVecI64x2'] = Module['_BinaryenLoadExtUVec32x2ToVecI64x2']();
Module['NarrowSVecI16x8ToVecI8x16'] = Module['_BinaryenNarrowSVecI16x8ToVecI8x16']();
Module['NarrowUVecI16x8ToVecI8x16'] = Module['_BinaryenNarrowUVecI16x8ToVecI8x16']();
Module['NarrowSVecI32x4ToVecI16x8'] = Module['_BinaryenNarrowSVecI32x4ToVecI16x8']();
@@ -1546,6 +1552,12 @@ function wrapModule(module, self) {
'widen_high_i8x16_u': function(value) {
return Module['_BinaryenUnary'](module, Module['WidenHighUVecI8x16ToVecI16x8'], value);
},
+ 'load8x8_s': function(offset, align, ptr) {
+ return Module['_BinaryenSIMDLoad'](module, Module['LoadExtSVec8x8ToVecI16x8'], offset, align, ptr);
+ },
+ 'load8x8_u': function(offset, align, ptr) {
+ return Module['_BinaryenSIMDLoad'](module, Module['LoadExtUVec8x8ToVecI16x8'], offset, align, ptr);
+ },
};
self['i32x4'] = {
@@ -1633,6 +1645,12 @@ function wrapModule(module, self) {
'widen_high_i16x8_u': function(value) {
return Module['_BinaryenUnary'](module, Module['WidenHighUVecI16x8ToVecI32x4'], value);
},
+ 'load16x4_s': function(offset, align, ptr) {
+ return Module['_BinaryenSIMDLoad'](module, Module['LoadExtSVec16x4ToVecI32x4'], offset, align, ptr);
+ },
+ 'load16x4_u': function(offset, align, ptr) {
+ return Module['_BinaryenSIMDLoad'](module, Module['LoadExtUVec16x4ToVecI32x4'], offset, align, ptr);
+ },
};
self['i64x2'] = {
@@ -1675,6 +1693,12 @@ function wrapModule(module, self) {
'trunc_sat_f64x2_u': function(value) {
return Module['_BinaryenUnary'](module, Module['TruncSatUVecF64x2ToVecI64x2'], value);
},
+ 'load32x2_s': function(offset, align, ptr) {
+ return Module['_BinaryenSIMDLoad'](module, Module['LoadExtSVec32x2ToVecI64x2'], offset, align, ptr);
+ },
+ 'load32x2_u': function(offset, align, ptr) {
+ return Module['_BinaryenSIMDLoad'](module, Module['LoadExtUVec32x2ToVecI64x2'], offset, align, ptr);
+ },
};
self['f32x4'] = {
diff --git a/src/passes/Print.cpp b/src/passes/Print.cpp
index e73747a4f..b856b2000 100644
--- a/src/passes/Print.cpp
+++ b/src/passes/Print.cpp
@@ -406,6 +406,24 @@ struct PrintExpressionContents
case LoadSplatVec64x2:
o << "v64x2.load_splat";
break;
+ case LoadExtSVec8x8ToVecI16x8:
+ o << "i16x8.load8x8_s";
+ break;
+ case LoadExtUVec8x8ToVecI16x8:
+ o << "i16x8.load8x8_u";
+ break;
+ case LoadExtSVec16x4ToVecI32x4:
+ o << "i32x4.load16x4_s";
+ break;
+ case LoadExtUVec16x4ToVecI32x4:
+ o << "i32x4.load16x4_u";
+ break;
+ case LoadExtSVec32x2ToVecI64x2:
+ o << "i64x2.load32x2_s";
+ break;
+ case LoadExtUVec32x2ToVecI64x2:
+ o << "i64x2.load32x2_u";
+ break;
}
restoreNormalColor(o);
if (curr->offset) {
diff --git a/src/tools/fuzzing.h b/src/tools/fuzzing.h
index 39cff56d5..45ddc59b1 100644
--- a/src/tools/fuzzing.h
+++ b/src/tools/fuzzing.h
@@ -2492,8 +2492,16 @@ private:
}
Expression* makeSIMDLoad() {
- SIMDLoadOp op = pick(
- LoadSplatVec8x16, LoadSplatVec16x8, LoadSplatVec32x4, LoadSplatVec64x2);
+ SIMDLoadOp op = pick(LoadSplatVec8x16,
+ LoadSplatVec16x8,
+ LoadSplatVec32x4,
+ LoadSplatVec64x2,
+ LoadExtSVec8x8ToVecI16x8,
+ LoadExtUVec8x8ToVecI16x8,
+ LoadExtSVec16x4ToVecI32x4,
+ LoadExtUVec16x4ToVecI32x4,
+ LoadExtSVec32x2ToVecI64x2,
+ LoadExtUVec32x2ToVecI64x2);
Address offset = logify(get());
Address align;
switch (op) {
@@ -2507,6 +2515,12 @@ private:
align = pick(1, 2, 4);
break;
case LoadSplatVec64x2:
+ case LoadExtSVec8x8ToVecI16x8:
+ case LoadExtUVec8x8ToVecI16x8:
+ case LoadExtSVec16x4ToVecI32x4:
+ case LoadExtUVec16x4ToVecI32x4:
+ case LoadExtSVec32x2ToVecI64x2:
+ case LoadExtUVec32x2ToVecI64x2:
align = pick(1, 2, 4, 8);
break;
}
diff --git a/src/wasm-binary.h b/src/wasm-binary.h
index 8de833a79..f299099b2 100644
--- a/src/wasm-binary.h
+++ b/src/wasm-binary.h
@@ -873,6 +873,12 @@ enum ASTNodes {
I32x4WidenHighSI16x8 = 0xcf,
I32x4WidenLowUI16x8 = 0xd0,
I32x4WidenHighUI16x8 = 0xd1,
+ I16x8LoadExtSVec8x8 = 0xd2,
+ I16x8LoadExtUVec8x8 = 0xd3,
+ I32x4LoadExtSVec16x4 = 0xd4,
+ I32x4LoadExtUVec16x4 = 0xd5,
+ I64x2LoadExtSVec32x2 = 0xd6,
+ I64x2LoadExtUVec32x2 = 0xd7,
// bulk memory opcodes
diff --git a/src/wasm-interpreter.h b/src/wasm-interpreter.h
index 94a3f0d54..8c429caa9 100644
--- a/src/wasm-interpreter.h
+++ b/src/wasm-interpreter.h
@@ -1086,6 +1086,8 @@ public:
Flow visitAtomicWait(AtomicWait*) { WASM_UNREACHABLE(); }
Flow visitAtomicNotify(AtomicNotify*) { WASM_UNREACHABLE(); }
Flow visitSIMDLoad(SIMDLoad*) { WASM_UNREACHABLE(); }
+ Flow visitSIMDLoadSplat(SIMDLoad*) { WASM_UNREACHABLE(); }
+ Flow visitSIMDLoadExtend(SIMDLoad*) { WASM_UNREACHABLE(); }
Flow visitPush(Push*) { WASM_UNREACHABLE(); }
Flow visitPop(Pop*) { WASM_UNREACHABLE(); }
Flow visitTry(Try*) { WASM_UNREACHABLE(); }
@@ -1702,6 +1704,23 @@ private:
}
Flow visitSIMDLoad(SIMDLoad* curr) {
NOTE_ENTER("SIMDLoad");
+ switch (curr->op) {
+ case LoadSplatVec8x16:
+ case LoadSplatVec16x8:
+ case LoadSplatVec32x4:
+ case LoadSplatVec64x2:
+ return visitSIMDLoadSplat(curr);
+ case LoadExtSVec8x8ToVecI16x8:
+ case LoadExtUVec8x8ToVecI16x8:
+ case LoadExtSVec16x4ToVecI32x4:
+ case LoadExtUVec16x4ToVecI32x4:
+ case LoadExtSVec32x2ToVecI64x2:
+ case LoadExtUVec32x2ToVecI64x2:
+ return visitSIMDLoadExtend(curr);
+ }
+ WASM_UNREACHABLE();
+ }
+ Flow visitSIMDLoadSplat(SIMDLoad* curr) {
Load load;
load.type = i32;
load.bytes = curr->getMemBytes();
@@ -1725,6 +1744,8 @@ private:
load.type = i64;
splat = &Literal::splatI64x2;
break;
+ default:
+ WASM_UNREACHABLE();
}
load.finalize();
Flow flow = this->visit(&load);
@@ -1733,6 +1754,61 @@ private:
}
return (flow.value.*splat)();
}
+ Flow visitSIMDLoadExtend(SIMDLoad* curr) {
+ Flow flow = this->visit(curr->ptr);
+ if (flow.breaking()) {
+ return flow;
+ }
+ NOTE_EVAL1(flow);
+ Address src(uint32_t(flow.value.geti32()));
+ auto loadLane = [&](Address addr) {
+ switch (curr->op) {
+ case LoadExtSVec8x8ToVecI16x8:
+ return Literal(int32_t(instance.externalInterface->load8s(addr)));
+ case LoadExtUVec8x8ToVecI16x8:
+ return Literal(int32_t(instance.externalInterface->load8u(addr)));
+ case LoadExtSVec16x4ToVecI32x4:
+ return Literal(int32_t(instance.externalInterface->load16s(addr)));
+ case LoadExtUVec16x4ToVecI32x4:
+ return Literal(int32_t(instance.externalInterface->load16u(addr)));
+ case LoadExtSVec32x2ToVecI64x2:
+ return Literal(int64_t(instance.externalInterface->load32s(addr)));
+ case LoadExtUVec32x2ToVecI64x2:
+ return Literal(int64_t(instance.externalInterface->load32u(addr)));
+ default:
+ WASM_UNREACHABLE();
+ }
+ WASM_UNREACHABLE();
+ };
+ auto fillLanes = [&](auto lanes, size_t laneBytes) {
+ for (auto& lane : lanes) {
+ lane = loadLane(
+ instance.getFinalAddress(Literal(uint32_t(src)), laneBytes));
+ src = Address(uint32_t(src) + laneBytes);
+ }
+ return Literal(lanes);
+ };
+ switch (curr->op) {
+ case LoadExtSVec8x8ToVecI16x8:
+ case LoadExtUVec8x8ToVecI16x8: {
+ std::array<Literal, 8> lanes;
+ return fillLanes(lanes, 1);
+ }
+ case LoadExtSVec16x4ToVecI32x4:
+ case LoadExtUVec16x4ToVecI32x4: {
+ std::array<Literal, 4> lanes;
+ return fillLanes(lanes, 2);
+ }
+ case LoadExtSVec32x2ToVecI64x2:
+ case LoadExtUVec32x2ToVecI64x2: {
+ std::array<Literal, 2> lanes;
+ return fillLanes(lanes, 4);
+ }
+ default:
+ WASM_UNREACHABLE();
+ }
+ WASM_UNREACHABLE();
+ }
Flow visitHost(Host* curr) {
NOTE_ENTER("Host");
switch (curr->op) {
diff --git a/src/wasm.h b/src/wasm.h
index 7aa3ecea3..8006bd319 100644
--- a/src/wasm.h
+++ b/src/wasm.h
@@ -438,7 +438,13 @@ enum SIMDLoadOp {
LoadSplatVec8x16,
LoadSplatVec16x8,
LoadSplatVec32x4,
- LoadSplatVec64x2
+ LoadSplatVec64x2,
+ LoadExtSVec8x8ToVecI16x8,
+ LoadExtUVec8x8ToVecI16x8,
+ LoadExtSVec16x4ToVecI32x4,
+ LoadExtUVec16x4ToVecI32x4,
+ LoadExtSVec32x2ToVecI64x2,
+ LoadExtUVec32x2ToVecI64x2
};
enum SIMDTernaryOp { Bitselect, QFMAF32x4, QFMSF32x4, QFMAF64x2, QFMSF64x2 };
diff --git a/src/wasm/wasm-binary.cpp b/src/wasm/wasm-binary.cpp
index 6f10df8f5..1606d74a1 100644
--- a/src/wasm/wasm-binary.cpp
+++ b/src/wasm/wasm-binary.cpp
@@ -4413,6 +4413,30 @@ bool WasmBinaryBuilder::maybeVisitSIMDLoad(Expression*& out, uint32_t code) {
curr = allocator.alloc<SIMDLoad>();
curr->op = LoadSplatVec64x2;
break;
+ case BinaryConsts::I16x8LoadExtSVec8x8:
+ curr = allocator.alloc<SIMDLoad>();
+ curr->op = LoadExtSVec8x8ToVecI16x8;
+ break;
+ case BinaryConsts::I16x8LoadExtUVec8x8:
+ curr = allocator.alloc<SIMDLoad>();
+ curr->op = LoadExtUVec8x8ToVecI16x8;
+ break;
+ case BinaryConsts::I32x4LoadExtSVec16x4:
+ curr = allocator.alloc<SIMDLoad>();
+ curr->op = LoadExtSVec16x4ToVecI32x4;
+ break;
+ case BinaryConsts::I32x4LoadExtUVec16x4:
+ curr = allocator.alloc<SIMDLoad>();
+ curr->op = LoadExtUVec16x4ToVecI32x4;
+ break;
+ case BinaryConsts::I64x2LoadExtSVec32x2:
+ curr = allocator.alloc<SIMDLoad>();
+ curr->op = LoadExtSVec32x2ToVecI64x2;
+ break;
+ case BinaryConsts::I64x2LoadExtUVec32x2:
+ curr = allocator.alloc<SIMDLoad>();
+ curr->op = LoadExtUVec32x2ToVecI64x2;
+ break;
default:
return false;
}
diff --git a/src/wasm/wasm-s-parser.cpp b/src/wasm/wasm-s-parser.cpp
index 9f1fe0044..72d262e63 100644
--- a/src/wasm/wasm-s-parser.cpp
+++ b/src/wasm/wasm-s-parser.cpp
@@ -1508,6 +1508,12 @@ Expression* SExpressionWasmBuilder::makeSIMDLoad(Element& s, SIMDLoadOp op) {
defaultAlign = 4;
break;
case LoadSplatVec64x2:
+ case LoadExtSVec8x8ToVecI16x8:
+ case LoadExtUVec8x8ToVecI16x8:
+ case LoadExtSVec16x4ToVecI32x4:
+ case LoadExtUVec16x4ToVecI32x4:
+ case LoadExtSVec32x2ToVecI64x2:
+ case LoadExtUVec32x2ToVecI64x2:
defaultAlign = 8;
break;
}
diff --git a/src/wasm/wasm-stack.cpp b/src/wasm/wasm-stack.cpp
index cbe5ba881..8b7ccfb2e 100644
--- a/src/wasm/wasm-stack.cpp
+++ b/src/wasm/wasm-stack.cpp
@@ -569,6 +569,24 @@ void BinaryInstWriter::visitSIMDLoad(SIMDLoad* curr) {
case LoadSplatVec64x2:
o << U32LEB(BinaryConsts::V64x2LoadSplat);
break;
+ case LoadExtSVec8x8ToVecI16x8:
+ o << U32LEB(BinaryConsts::I16x8LoadExtSVec8x8);
+ break;
+ case LoadExtUVec8x8ToVecI16x8:
+ o << U32LEB(BinaryConsts::I16x8LoadExtUVec8x8);
+ break;
+ case LoadExtSVec16x4ToVecI32x4:
+ o << U32LEB(BinaryConsts::I32x4LoadExtSVec16x4);
+ break;
+ case LoadExtUVec16x4ToVecI32x4:
+ o << U32LEB(BinaryConsts::I32x4LoadExtUVec16x4);
+ break;
+ case LoadExtSVec32x2ToVecI64x2:
+ o << U32LEB(BinaryConsts::I64x2LoadExtSVec32x2);
+ break;
+ case LoadExtUVec32x2ToVecI64x2:
+ o << U32LEB(BinaryConsts::I64x2LoadExtUVec32x2);
+ break;
}
assert(curr->align);
emitMemoryAccess(curr->align, /*(unused) bytes=*/0, curr->offset);
diff --git a/src/wasm/wasm-validator.cpp b/src/wasm/wasm-validator.cpp
index 78c8d3289..1c30d0d2a 100644
--- a/src/wasm/wasm-validator.cpp
+++ b/src/wasm/wasm-validator.cpp
@@ -1064,9 +1064,25 @@ void FunctionValidator::visitSIMDLoad(SIMDLoad* curr) {
curr->type, v128, curr, "load_splat must have type v128");
shouldBeEqualOrFirstIsUnreachable(
curr->ptr->type, i32, curr, "load_splat address must have type i32");
- Type lane_t = curr->op == LoadSplatVec64x2 ? i64 : i32;
+ Type memAlignType = none;
+ switch (curr->op) {
+ case LoadSplatVec8x16:
+ case LoadSplatVec16x8:
+ case LoadSplatVec32x4:
+ memAlignType = i32;
+ break;
+ case LoadSplatVec64x2:
+ case LoadExtSVec8x8ToVecI16x8:
+ case LoadExtUVec8x8ToVecI16x8:
+ case LoadExtSVec16x4ToVecI32x4:
+ case LoadExtUVec16x4ToVecI32x4:
+ case LoadExtSVec32x2ToVecI64x2:
+ case LoadExtUVec32x2ToVecI64x2:
+ memAlignType = i64;
+ break;
+ }
Index bytes = curr->getMemBytes();
- validateAlignment(curr->align, lane_t, bytes, /*isAtomic=*/false, curr);
+ validateAlignment(curr->align, memAlignType, bytes, /*isAtomic=*/false, curr);
}
void FunctionValidator::visitMemoryInit(MemoryInit* curr) {
diff --git a/src/wasm/wasm.cpp b/src/wasm/wasm.cpp
index 58510cc8f..72fed6c7b 100644
--- a/src/wasm/wasm.cpp
+++ b/src/wasm/wasm.cpp
@@ -645,6 +645,12 @@ Index SIMDLoad::getMemBytes() {
case LoadSplatVec32x4:
return 4;
case LoadSplatVec64x2:
+ case LoadExtSVec8x8ToVecI16x8:
+ case LoadExtUVec8x8ToVecI16x8:
+ case LoadExtSVec16x4ToVecI32x4:
+ case LoadExtUVec16x4ToVecI32x4:
+ case LoadExtSVec32x2ToVecI64x2:
+ case LoadExtUVec32x2ToVecI64x2:
return 8;
}
WASM_UNREACHABLE();
diff --git a/test/binaryen.js/kitchen-sink.js b/test/binaryen.js/kitchen-sink.js
index 4cdfaf2a3..23c50b87f 100644
--- a/test/binaryen.js/kitchen-sink.js
+++ b/test/binaryen.js/kitchen-sink.js
@@ -386,6 +386,12 @@ function test_core() {
module.v16x8.load_splat(16, 1, module.i32.const(128)),
module.v32x4.load_splat(16, 4, module.i32.const(128)),
module.v64x2.load_splat(0, 4, module.i32.const(128)),
+ module.i16x8.load8x8_s(0, 8, module.i32.const(128)),
+ module.i16x8.load8x8_u(0, 8, module.i32.const(128)),
+ module.i32x4.load16x4_s(0, 8, module.i32.const(128)),
+ module.i32x4.load16x4_u(0, 8, module.i32.const(128)),
+ module.i64x2.load32x2_s(0, 8, module.i32.const(128)),
+ module.i64x2.load32x2_u(0, 8, module.i32.const(128)),
// Other SIMD
module.v8x16.shuffle(module.v128.const(v128_bytes), module.v128.const(v128_bytes), v128_bytes),
module.v128.bitselect(module.v128.const(v128_bytes), module.v128.const(v128_bytes), module.v128.const(v128_bytes)),
diff --git a/test/binaryen.js/kitchen-sink.js.txt b/test/binaryen.js/kitchen-sink.js.txt
index edcfd98b1..ee2b9bf82 100644
--- a/test/binaryen.js/kitchen-sink.js.txt
+++ b/test/binaryen.js/kitchen-sink.js.txt
@@ -1372,6 +1372,36 @@ getExpressionInfo(f64.const)={"id":14,"type":4,"value":9.5}
)
)
(drop
+ (i16x8.load8x8_s
+ (i32.const 128)
+ )
+ )
+ (drop
+ (i16x8.load8x8_u
+ (i32.const 128)
+ )
+ )
+ (drop
+ (i32x4.load16x4_s
+ (i32.const 128)
+ )
+ )
+ (drop
+ (i32x4.load16x4_u
+ (i32.const 128)
+ )
+ )
+ (drop
+ (i64x2.load32x2_s
+ (i32.const 128)
+ )
+ )
+ (drop
+ (i64x2.load32x2_u
+ (i32.const 128)
+ )
+ )
+ (drop
(v8x16.shuffle 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
(v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d)
(v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d)
@@ -2939,6 +2969,36 @@ getExpressionInfo(f64.const)={"id":14,"type":4,"value":9.5}
)
)
(drop
+ (i16x8.load8x8_s
+ (i32.const 128)
+ )
+ )
+ (drop
+ (i16x8.load8x8_u
+ (i32.const 128)
+ )
+ )
+ (drop
+ (i32x4.load16x4_s
+ (i32.const 128)
+ )
+ )
+ (drop
+ (i32x4.load16x4_u
+ (i32.const 128)
+ )
+ )
+ (drop
+ (i64x2.load32x2_s
+ (i32.const 128)
+ )
+ )
+ (drop
+ (i64x2.load32x2_u
+ (i32.const 128)
+ )
+ )
+ (drop
(v8x16.shuffle 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
(v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d)
(v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d)
@@ -5020,233 +5080,245 @@ int main() {
expressions[607] = BinaryenSIMDLoad(the_module, 2, 16, 4, expressions[606]);
expressions[608] = BinaryenConst(the_module, BinaryenLiteralInt32(128));
expressions[609] = BinaryenSIMDLoad(the_module, 3, 0, 4, expressions[608]);
+ expressions[610] = BinaryenConst(the_module, BinaryenLiteralInt32(128));
+ expressions[611] = BinaryenSIMDLoad(the_module, 4, 0, 8, expressions[610]);
+ expressions[612] = BinaryenConst(the_module, BinaryenLiteralInt32(128));
+ expressions[613] = BinaryenSIMDLoad(the_module, 5, 0, 8, expressions[612]);
+ expressions[614] = BinaryenConst(the_module, BinaryenLiteralInt32(128));
+ expressions[615] = BinaryenSIMDLoad(the_module, 6, 0, 8, expressions[614]);
+ expressions[616] = BinaryenConst(the_module, BinaryenLiteralInt32(128));
+ expressions[617] = BinaryenSIMDLoad(the_module, 7, 0, 8, expressions[616]);
+ expressions[618] = BinaryenConst(the_module, BinaryenLiteralInt32(128));
+ expressions[619] = BinaryenSIMDLoad(the_module, 8, 0, 8, expressions[618]);
+ expressions[620] = BinaryenConst(the_module, BinaryenLiteralInt32(128));
+ expressions[621] = BinaryenSIMDLoad(the_module, 9, 0, 8, expressions[620]);
{
uint8_t t223[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[610] = BinaryenConst(the_module, BinaryenLiteralVec128(t223));
+ expressions[622] = BinaryenConst(the_module, BinaryenLiteralVec128(t223));
}
{
uint8_t t224[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[611] = BinaryenConst(the_module, BinaryenLiteralVec128(t224));
+ expressions[623] = BinaryenConst(the_module, BinaryenLiteralVec128(t224));
}
{
uint8_t mask[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[612] = BinaryenSIMDShuffle(the_module, expressions[610], expressions[611], mask);
+ expressions[624] = BinaryenSIMDShuffle(the_module, expressions[622], expressions[623], mask);
}
{
uint8_t t225[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[613] = BinaryenConst(the_module, BinaryenLiteralVec128(t225));
+ expressions[625] = BinaryenConst(the_module, BinaryenLiteralVec128(t225));
}
{
uint8_t t226[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[614] = BinaryenConst(the_module, BinaryenLiteralVec128(t226));
+ expressions[626] = BinaryenConst(the_module, BinaryenLiteralVec128(t226));
}
{
uint8_t t227[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[615] = BinaryenConst(the_module, BinaryenLiteralVec128(t227));
+ expressions[627] = BinaryenConst(the_module, BinaryenLiteralVec128(t227));
}
- expressions[616] = BinaryenSIMDTernary(the_module, 0, expressions[613], expressions[614], expressions[615]);
+ expressions[628] = BinaryenSIMDTernary(the_module, 0, expressions[625], expressions[626], expressions[627]);
{
uint8_t t228[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[617] = BinaryenConst(the_module, BinaryenLiteralVec128(t228));
+ expressions[629] = BinaryenConst(the_module, BinaryenLiteralVec128(t228));
}
{
uint8_t t229[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[618] = BinaryenConst(the_module, BinaryenLiteralVec128(t229));
+ expressions[630] = BinaryenConst(the_module, BinaryenLiteralVec128(t229));
}
{
uint8_t t230[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[619] = BinaryenConst(the_module, BinaryenLiteralVec128(t230));
+ expressions[631] = BinaryenConst(the_module, BinaryenLiteralVec128(t230));
}
- expressions[620] = BinaryenSIMDTernary(the_module, 1, expressions[617], expressions[618], expressions[619]);
+ expressions[632] = BinaryenSIMDTernary(the_module, 1, expressions[629], expressions[630], expressions[631]);
{
uint8_t t231[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[621] = BinaryenConst(the_module, BinaryenLiteralVec128(t231));
+ expressions[633] = BinaryenConst(the_module, BinaryenLiteralVec128(t231));
}
{
uint8_t t232[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[622] = BinaryenConst(the_module, BinaryenLiteralVec128(t232));
+ expressions[634] = BinaryenConst(the_module, BinaryenLiteralVec128(t232));
}
{
uint8_t t233[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[623] = BinaryenConst(the_module, BinaryenLiteralVec128(t233));
+ expressions[635] = BinaryenConst(the_module, BinaryenLiteralVec128(t233));
}
- expressions[624] = BinaryenSIMDTernary(the_module, 2, expressions[621], expressions[622], expressions[623]);
+ expressions[636] = BinaryenSIMDTernary(the_module, 2, expressions[633], expressions[634], expressions[635]);
{
uint8_t t234[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[625] = BinaryenConst(the_module, BinaryenLiteralVec128(t234));
+ expressions[637] = BinaryenConst(the_module, BinaryenLiteralVec128(t234));
}
{
uint8_t t235[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[626] = BinaryenConst(the_module, BinaryenLiteralVec128(t235));
+ expressions[638] = BinaryenConst(the_module, BinaryenLiteralVec128(t235));
}
{
uint8_t t236[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[627] = BinaryenConst(the_module, BinaryenLiteralVec128(t236));
+ expressions[639] = BinaryenConst(the_module, BinaryenLiteralVec128(t236));
}
- expressions[628] = BinaryenSIMDTernary(the_module, 3, expressions[625], expressions[626], expressions[627]);
+ expressions[640] = BinaryenSIMDTernary(the_module, 3, expressions[637], expressions[638], expressions[639]);
{
uint8_t t237[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[629] = BinaryenConst(the_module, BinaryenLiteralVec128(t237));
+ expressions[641] = BinaryenConst(the_module, BinaryenLiteralVec128(t237));
}
{
uint8_t t238[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[630] = BinaryenConst(the_module, BinaryenLiteralVec128(t238));
+ expressions[642] = BinaryenConst(the_module, BinaryenLiteralVec128(t238));
}
{
uint8_t t239[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[631] = BinaryenConst(the_module, BinaryenLiteralVec128(t239));
- }
- expressions[632] = BinaryenSIMDTernary(the_module, 4, expressions[629], expressions[630], expressions[631]);
- expressions[633] = BinaryenConst(the_module, BinaryenLiteralInt32(1024));
- expressions[634] = BinaryenConst(the_module, BinaryenLiteralInt32(0));
- expressions[635] = BinaryenConst(the_module, BinaryenLiteralInt32(12));
- expressions[636] = BinaryenMemoryInit(the_module, 0, expressions[633], expressions[634], expressions[635]);
- expressions[637] = BinaryenDataDrop(the_module, 0);
- expressions[638] = BinaryenConst(the_module, BinaryenLiteralInt32(2048));
- expressions[639] = BinaryenConst(the_module, BinaryenLiteralInt32(1024));
- expressions[640] = BinaryenConst(the_module, BinaryenLiteralInt32(12));
- expressions[641] = BinaryenMemoryCopy(the_module, expressions[638], expressions[639], expressions[640]);
- expressions[642] = BinaryenConst(the_module, BinaryenLiteralInt32(0));
- expressions[643] = BinaryenConst(the_module, BinaryenLiteralInt32(42));
- expressions[644] = BinaryenConst(the_module, BinaryenLiteralInt32(1024));
- expressions[645] = BinaryenMemoryFill(the_module, expressions[642], expressions[643], expressions[644]);
+ expressions[643] = BinaryenConst(the_module, BinaryenLiteralVec128(t239));
+ }
+ expressions[644] = BinaryenSIMDTernary(the_module, 4, expressions[641], expressions[642], expressions[643]);
+ expressions[645] = BinaryenConst(the_module, BinaryenLiteralInt32(1024));
+ expressions[646] = BinaryenConst(the_module, BinaryenLiteralInt32(0));
+ expressions[647] = BinaryenConst(the_module, BinaryenLiteralInt32(12));
+ expressions[648] = BinaryenMemoryInit(the_module, 0, expressions[645], expressions[646], expressions[647]);
+ expressions[649] = BinaryenDataDrop(the_module, 0);
+ expressions[650] = BinaryenConst(the_module, BinaryenLiteralInt32(2048));
+ expressions[651] = BinaryenConst(the_module, BinaryenLiteralInt32(1024));
+ expressions[652] = BinaryenConst(the_module, BinaryenLiteralInt32(12));
+ expressions[653] = BinaryenMemoryCopy(the_module, expressions[650], expressions[651], expressions[652]);
+ expressions[654] = BinaryenConst(the_module, BinaryenLiteralInt32(0));
+ expressions[655] = BinaryenConst(the_module, BinaryenLiteralInt32(42));
+ expressions[656] = BinaryenConst(the_module, BinaryenLiteralInt32(1024));
+ expressions[657] = BinaryenMemoryFill(the_module, expressions[654], expressions[655], expressions[656]);
{
BinaryenExpressionRef children[] = { 0 };
- expressions[646] = BinaryenBlock(the_module, NULL, children, 0, 0);
- }
- expressions[647] = BinaryenIf(the_module, expressions[7], expressions[8], expressions[9]);
- expressions[648] = BinaryenIf(the_module, expressions[10], expressions[11], expressions[0]);
- expressions[649] = BinaryenConst(the_module, BinaryenLiteralInt32(0));
- expressions[650] = BinaryenLoop(the_module, "in", expressions[649]);
- expressions[651] = BinaryenConst(the_module, BinaryenLiteralInt32(0));
- expressions[652] = BinaryenLoop(the_module, NULL, expressions[651]);
- expressions[653] = BinaryenBreak(the_module, "the-value", expressions[12], expressions[13]);
- expressions[654] = BinaryenConst(the_module, BinaryenLiteralInt32(2));
- expressions[655] = BinaryenBreak(the_module, "the-nothing", expressions[654], expressions[0]);
- expressions[656] = BinaryenConst(the_module, BinaryenLiteralInt32(3));
- expressions[657] = BinaryenBreak(the_module, "the-value", expressions[0], expressions[656]);
- expressions[658] = BinaryenBreak(the_module, "the-nothing", expressions[0], expressions[0]);
+ expressions[658] = BinaryenBlock(the_module, NULL, children, 0, 0);
+ }
+ expressions[659] = BinaryenIf(the_module, expressions[7], expressions[8], expressions[9]);
+ expressions[660] = BinaryenIf(the_module, expressions[10], expressions[11], expressions[0]);
+ expressions[661] = BinaryenConst(the_module, BinaryenLiteralInt32(0));
+ expressions[662] = BinaryenLoop(the_module, "in", expressions[661]);
+ expressions[663] = BinaryenConst(the_module, BinaryenLiteralInt32(0));
+ expressions[664] = BinaryenLoop(the_module, NULL, expressions[663]);
+ expressions[665] = BinaryenBreak(the_module, "the-value", expressions[12], expressions[13]);
+ expressions[666] = BinaryenConst(the_module, BinaryenLiteralInt32(2));
+ expressions[667] = BinaryenBreak(the_module, "the-nothing", expressions[666], expressions[0]);
+ expressions[668] = BinaryenConst(the_module, BinaryenLiteralInt32(3));
+ expressions[669] = BinaryenBreak(the_module, "the-value", expressions[0], expressions[668]);
+ expressions[670] = BinaryenBreak(the_module, "the-nothing", expressions[0], expressions[0]);
{
const char* names[] = { "the-value" };
- expressions[659] = BinaryenSwitch(the_module, names, 1, "the-value", expressions[14], expressions[15]);
+ expressions[671] = BinaryenSwitch(the_module, names, 1, "the-value", expressions[14], expressions[15]);
}
- expressions[660] = BinaryenConst(the_module, BinaryenLiteralInt32(2));
+ expressions[672] = BinaryenConst(the_module, BinaryenLiteralInt32(2));
{
const char* names[] = { "the-nothing" };
- expressions[661] = BinaryenSwitch(the_module, names, 1, "the-nothing", expressions[660], expressions[0]);
- }
- expressions[662] = BinaryenConst(the_module, BinaryenLiteralInt32(13));
- expressions[663] = BinaryenConst(the_module, BinaryenLiteralInt64(37));
- expressions[664] = BinaryenConst(the_module, BinaryenLiteralFloat32(1.3));
- expressions[665] = BinaryenConst(the_module, BinaryenLiteralFloat64(3.7));
- {
- BinaryenExpressionRef operands[] = { expressions[662], expressions[663], expressions[664], expressions[665] };
- expressions[666] = BinaryenCall(the_module, "kitchen()sinker", operands, 4, 1);
- }
- expressions[667] = BinaryenUnary(the_module, 20, expressions[666]);
- expressions[668] = BinaryenConst(the_module, BinaryenLiteralInt32(13));
- expressions[669] = BinaryenConst(the_module, BinaryenLiteralFloat64(3.7));
- {
- BinaryenExpressionRef operands[] = { expressions[668], expressions[669] };
- expressions[670] = BinaryenCall(the_module, "an-imported", operands, 2, 3);
+ expressions[673] = BinaryenSwitch(the_module, names, 1, "the-nothing", expressions[672], expressions[0]);
}
- expressions[671] = BinaryenUnary(the_module, 25, expressions[670]);
- expressions[672] = BinaryenUnary(the_module, 20, expressions[671]);
- expressions[673] = BinaryenConst(the_module, BinaryenLiteralInt32(2449));
expressions[674] = BinaryenConst(the_module, BinaryenLiteralInt32(13));
expressions[675] = BinaryenConst(the_module, BinaryenLiteralInt64(37));
expressions[676] = BinaryenConst(the_module, BinaryenLiteralFloat32(1.3));
expressions[677] = BinaryenConst(the_module, BinaryenLiteralFloat64(3.7));
{
BinaryenExpressionRef operands[] = { expressions[674], expressions[675], expressions[676], expressions[677] };
- expressions[678] = BinaryenCallIndirect(the_module, expressions[673], operands, 4, "iiIfF");
+ expressions[678] = BinaryenCall(the_module, "kitchen()sinker", operands, 4, 1);
}
expressions[679] = BinaryenUnary(the_module, 20, expressions[678]);
- expressions[680] = BinaryenLocalGet(the_module, 0, 1);
- expressions[681] = BinaryenDrop(the_module, expressions[680]);
- expressions[682] = BinaryenConst(the_module, BinaryenLiteralInt32(101));
- expressions[683] = BinaryenLocalSet(the_module, 0, expressions[682]);
- expressions[684] = BinaryenConst(the_module, BinaryenLiteralInt32(102));
- expressions[685] = BinaryenLocalTee(the_module, 0, expressions[684]);
- expressions[686] = BinaryenDrop(the_module, expressions[685]);
- expressions[687] = BinaryenConst(the_module, BinaryenLiteralInt32(1));
- expressions[688] = BinaryenLoad(the_module, 4, 1, 0, 0, 1, expressions[687]);
- expressions[689] = BinaryenConst(the_module, BinaryenLiteralInt32(8));
- expressions[690] = BinaryenLoad(the_module, 2, 1, 2, 1, 2, expressions[689]);
- expressions[691] = BinaryenConst(the_module, BinaryenLiteralInt32(2));
- expressions[692] = BinaryenLoad(the_module, 4, 1, 0, 0, 3, expressions[691]);
- expressions[693] = BinaryenConst(the_module, BinaryenLiteralInt32(9));
- expressions[694] = BinaryenLoad(the_module, 8, 1, 2, 8, 4, expressions[693]);
- expressions[695] = BinaryenStore(the_module, 4, 0, 0, expressions[19], expressions[20], 1);
- expressions[696] = BinaryenStore(the_module, 8, 2, 4, expressions[21], expressions[22], 2);
- expressions[697] = BinaryenSelect(the_module, expressions[16], expressions[17], expressions[18]);
- expressions[698] = BinaryenConst(the_module, BinaryenLiteralInt32(1337));
- expressions[699] = BinaryenReturn(the_module, expressions[698]);
- expressions[700] = BinaryenConst(the_module, BinaryenLiteralInt32(13));
- expressions[701] = BinaryenConst(the_module, BinaryenLiteralInt64(37));
- expressions[702] = BinaryenConst(the_module, BinaryenLiteralFloat32(1.3));
- expressions[703] = BinaryenConst(the_module, BinaryenLiteralFloat64(3.7));
- {
- BinaryenExpressionRef operands[] = { expressions[700], expressions[701], expressions[702], expressions[703] };
- expressions[704] = BinaryenReturnCall(the_module, "kitchen()sinker", operands, 4, 1);
- }
- expressions[705] = BinaryenConst(the_module, BinaryenLiteralInt32(2449));
- expressions[706] = BinaryenConst(the_module, BinaryenLiteralInt32(13));
- expressions[707] = BinaryenConst(the_module, BinaryenLiteralInt64(37));
- expressions[708] = BinaryenConst(the_module, BinaryenLiteralFloat32(1.3));
- expressions[709] = BinaryenConst(the_module, BinaryenLiteralFloat64(3.7));
- {
- BinaryenExpressionRef operands[] = { expressions[706], expressions[707], expressions[708], expressions[709] };
- expressions[710] = BinaryenReturnCallIndirect(the_module, expressions[705], operands, 4, "iiIfF");
- }
- expressions[711] = BinaryenConst(the_module, BinaryenLiteralInt32(0));
- {
- BinaryenExpressionRef operands[] = { expressions[711] };
- expressions[712] = BinaryenThrow(the_module, "a-event", operands, 1);
- }
- expressions[713] = BinaryenPop(the_module, 7);
- expressions[714] = BinaryenLocalSet(the_module, 5, expressions[713]);
- expressions[715] = BinaryenLocalGet(the_module, 5, 7);
- expressions[716] = BinaryenBrOnExn(the_module, "try-block", "a-event", expressions[715]);
- expressions[717] = BinaryenRethrow(the_module, expressions[716]);
- {
- BinaryenExpressionRef children[] = { expressions[717] };
- expressions[718] = BinaryenBlock(the_module, "try-block", children, 1, 1);
- }
- expressions[719] = BinaryenDrop(the_module, expressions[718]);
- {
- BinaryenExpressionRef children[] = { expressions[714], expressions[719] };
- expressions[720] = BinaryenBlock(the_module, NULL, children, 2, 0);
- }
- expressions[721] = BinaryenTry(the_module, expressions[712], expressions[720]);
- expressions[722] = BinaryenConst(the_module, BinaryenLiteralInt32(0));
+ expressions[680] = BinaryenConst(the_module, BinaryenLiteralInt32(13));
+ expressions[681] = BinaryenConst(the_module, BinaryenLiteralFloat64(3.7));
+ {
+ BinaryenExpressionRef operands[] = { expressions[680], expressions[681] };
+ expressions[682] = BinaryenCall(the_module, "an-imported", operands, 2, 3);
+ }
+ expressions[683] = BinaryenUnary(the_module, 25, expressions[682]);
+ expressions[684] = BinaryenUnary(the_module, 20, expressions[683]);
+ expressions[685] = BinaryenConst(the_module, BinaryenLiteralInt32(2449));
+ expressions[686] = BinaryenConst(the_module, BinaryenLiteralInt32(13));
+ expressions[687] = BinaryenConst(the_module, BinaryenLiteralInt64(37));
+ expressions[688] = BinaryenConst(the_module, BinaryenLiteralFloat32(1.3));
+ expressions[689] = BinaryenConst(the_module, BinaryenLiteralFloat64(3.7));
+ {
+ BinaryenExpressionRef operands[] = { expressions[686], expressions[687], expressions[688], expressions[689] };
+ expressions[690] = BinaryenCallIndirect(the_module, expressions[685], operands, 4, "iiIfF");
+ }
+ expressions[691] = BinaryenUnary(the_module, 20, expressions[690]);
+ expressions[692] = BinaryenLocalGet(the_module, 0, 1);
+ expressions[693] = BinaryenDrop(the_module, expressions[692]);
+ expressions[694] = BinaryenConst(the_module, BinaryenLiteralInt32(101));
+ expressions[695] = BinaryenLocalSet(the_module, 0, expressions[694]);
+ expressions[696] = BinaryenConst(the_module, BinaryenLiteralInt32(102));
+ expressions[697] = BinaryenLocalTee(the_module, 0, expressions[696]);
+ expressions[698] = BinaryenDrop(the_module, expressions[697]);
+ expressions[699] = BinaryenConst(the_module, BinaryenLiteralInt32(1));
+ expressions[700] = BinaryenLoad(the_module, 4, 1, 0, 0, 1, expressions[699]);
+ expressions[701] = BinaryenConst(the_module, BinaryenLiteralInt32(8));
+ expressions[702] = BinaryenLoad(the_module, 2, 1, 2, 1, 2, expressions[701]);
+ expressions[703] = BinaryenConst(the_module, BinaryenLiteralInt32(2));
+ expressions[704] = BinaryenLoad(the_module, 4, 1, 0, 0, 3, expressions[703]);
+ expressions[705] = BinaryenConst(the_module, BinaryenLiteralInt32(9));
+ expressions[706] = BinaryenLoad(the_module, 8, 1, 2, 8, 4, expressions[705]);
+ expressions[707] = BinaryenStore(the_module, 4, 0, 0, expressions[19], expressions[20], 1);
+ expressions[708] = BinaryenStore(the_module, 8, 2, 4, expressions[21], expressions[22], 2);
+ expressions[709] = BinaryenSelect(the_module, expressions[16], expressions[17], expressions[18]);
+ expressions[710] = BinaryenConst(the_module, BinaryenLiteralInt32(1337));
+ expressions[711] = BinaryenReturn(the_module, expressions[710]);
+ expressions[712] = BinaryenConst(the_module, BinaryenLiteralInt32(13));
+ expressions[713] = BinaryenConst(the_module, BinaryenLiteralInt64(37));
+ expressions[714] = BinaryenConst(the_module, BinaryenLiteralFloat32(1.3));
+ expressions[715] = BinaryenConst(the_module, BinaryenLiteralFloat64(3.7));
+ {
+ BinaryenExpressionRef operands[] = { expressions[712], expressions[713], expressions[714], expressions[715] };
+ expressions[716] = BinaryenReturnCall(the_module, "kitchen()sinker", operands, 4, 1);
+ }
+ expressions[717] = BinaryenConst(the_module, BinaryenLiteralInt32(2449));
+ expressions[718] = BinaryenConst(the_module, BinaryenLiteralInt32(13));
+ expressions[719] = BinaryenConst(the_module, BinaryenLiteralInt64(37));
+ expressions[720] = BinaryenConst(the_module, BinaryenLiteralFloat32(1.3));
+ expressions[721] = BinaryenConst(the_module, BinaryenLiteralFloat64(3.7));
+ {
+ BinaryenExpressionRef operands[] = { expressions[718], expressions[719], expressions[720], expressions[721] };
+ expressions[722] = BinaryenReturnCallIndirect(the_module, expressions[717], operands, 4, "iiIfF");
+ }
expressions[723] = BinaryenConst(the_module, BinaryenLiteralInt32(0));
- expressions[724] = BinaryenAtomicLoad(the_module, 4, 0, 1, expressions[723]);
- expressions[725] = BinaryenAtomicStore(the_module, 4, 0, expressions[722], expressions[724], 1);
- expressions[726] = BinaryenConst(the_module, BinaryenLiteralInt32(0));
- expressions[727] = BinaryenConst(the_module, BinaryenLiteralInt32(0));
- expressions[728] = BinaryenConst(the_module, BinaryenLiteralInt64(0));
- expressions[729] = BinaryenAtomicWait(the_module, expressions[726], expressions[727], expressions[728], 1);
- expressions[730] = BinaryenDrop(the_module, expressions[729]);
- expressions[731] = BinaryenConst(the_module, BinaryenLiteralInt32(0));
- expressions[732] = BinaryenConst(the_module, BinaryenLiteralInt32(0));
- expressions[733] = BinaryenAtomicNotify(the_module, expressions[731], expressions[732]);
- expressions[734] = BinaryenDrop(the_module, expressions[733]);
- expressions[735] = BinaryenAtomicFence(the_module);
- expressions[736] = BinaryenPop(the_module, 1);
- expressions[737] = BinaryenPush(the_module, expressions[736]);
- expressions[738] = BinaryenPop(the_module, 2);
- expressions[739] = BinaryenPush(the_module, expressions[738]);
- expressions[740] = BinaryenPop(the_module, 3);
- expressions[741] = BinaryenPush(the_module, expressions[740]);
- expressions[742] = BinaryenPop(the_module, 4);
- expressions[743] = BinaryenPush(the_module, expressions[742]);
- expressions[744] = BinaryenPop(the_module, 5);
- expressions[745] = BinaryenPush(the_module, expressions[744]);
- expressions[746] = BinaryenPop(the_module, 7);
- expressions[747] = BinaryenPush(the_module, expressions[746]);
- expressions[748] = BinaryenNop(the_module);
- expressions[749] = BinaryenUnreachable(the_module);
+ {
+ BinaryenExpressionRef operands[] = { expressions[723] };
+ expressions[724] = BinaryenThrow(the_module, "a-event", operands, 1);
+ }
+ expressions[725] = BinaryenPop(the_module, 7);
+ expressions[726] = BinaryenLocalSet(the_module, 5, expressions[725]);
+ expressions[727] = BinaryenLocalGet(the_module, 5, 7);
+ expressions[728] = BinaryenBrOnExn(the_module, "try-block", "a-event", expressions[727]);
+ expressions[729] = BinaryenRethrow(the_module, expressions[728]);
+ {
+ BinaryenExpressionRef children[] = { expressions[729] };
+ expressions[730] = BinaryenBlock(the_module, "try-block", children, 1, 1);
+ }
+ expressions[731] = BinaryenDrop(the_module, expressions[730]);
+ {
+ BinaryenExpressionRef children[] = { expressions[726], expressions[731] };
+ expressions[732] = BinaryenBlock(the_module, NULL, children, 2, 0);
+ }
+ expressions[733] = BinaryenTry(the_module, expressions[724], expressions[732]);
+ expressions[734] = BinaryenConst(the_module, BinaryenLiteralInt32(0));
+ expressions[735] = BinaryenConst(the_module, BinaryenLiteralInt32(0));
+ expressions[736] = BinaryenAtomicLoad(the_module, 4, 0, 1, expressions[735]);
+ expressions[737] = BinaryenAtomicStore(the_module, 4, 0, expressions[734], expressions[736], 1);
+ expressions[738] = BinaryenConst(the_module, BinaryenLiteralInt32(0));
+ expressions[739] = BinaryenConst(the_module, BinaryenLiteralInt32(0));
+ expressions[740] = BinaryenConst(the_module, BinaryenLiteralInt64(0));
+ expressions[741] = BinaryenAtomicWait(the_module, expressions[738], expressions[739], expressions[740], 1);
+ expressions[742] = BinaryenDrop(the_module, expressions[741]);
+ expressions[743] = BinaryenConst(the_module, BinaryenLiteralInt32(0));
+ expressions[744] = BinaryenConst(the_module, BinaryenLiteralInt32(0));
+ expressions[745] = BinaryenAtomicNotify(the_module, expressions[743], expressions[744]);
+ expressions[746] = BinaryenDrop(the_module, expressions[745]);
+ expressions[747] = BinaryenAtomicFence(the_module);
+ expressions[748] = BinaryenPop(the_module, 1);
+ expressions[749] = BinaryenPush(the_module, expressions[748]);
+ expressions[750] = BinaryenPop(the_module, 2);
+ expressions[751] = BinaryenPush(the_module, expressions[750]);
+ expressions[752] = BinaryenPop(the_module, 3);
+ expressions[753] = BinaryenPush(the_module, expressions[752]);
+ expressions[754] = BinaryenPop(the_module, 4);
+ expressions[755] = BinaryenPush(the_module, expressions[754]);
+ expressions[756] = BinaryenPop(the_module, 5);
+ expressions[757] = BinaryenPush(the_module, expressions[756]);
+ expressions[758] = BinaryenPop(the_module, 7);
+ expressions[759] = BinaryenPush(the_module, expressions[758]);
+ expressions[760] = BinaryenNop(the_module);
+ expressions[761] = BinaryenUnreachable(the_module);
BinaryenExpressionGetId(expressions[30]);
BinaryenExpressionGetType(expressions[30]);
BinaryenUnaryGetOp(expressions[30]);
@@ -5257,26 +5329,26 @@ getExpressionInfo={"id":15,"type":3,"op":6}
(f32.const -33.61199951171875)
)
- expressions[750] = BinaryenConst(the_module, BinaryenLiteralInt32(5));
- BinaryenExpressionGetId(expressions[750]);
- BinaryenExpressionGetType(expressions[750]);
- BinaryenConstGetValueI32(expressions[750]);
+ expressions[762] = BinaryenConst(the_module, BinaryenLiteralInt32(5));
+ BinaryenExpressionGetId(expressions[762]);
+ BinaryenExpressionGetType(expressions[762]);
+ BinaryenConstGetValueI32(expressions[762]);
getExpressionInfo(i32.const)={"id":14,"type":1,"value":5}
- expressions[751] = BinaryenConst(the_module, BinaryenLiteralInt64(30064771078));
- BinaryenExpressionGetId(expressions[751]);
- BinaryenExpressionGetType(expressions[751]);
- BinaryenConstGetValueI64Low(expressions[751]);
- BinaryenConstGetValueI64High(expressions[751]);
+ expressions[763] = BinaryenConst(the_module, BinaryenLiteralInt64(30064771078));
+ BinaryenExpressionGetId(expressions[763]);
+ BinaryenExpressionGetType(expressions[763]);
+ BinaryenConstGetValueI64Low(expressions[763]);
+ BinaryenConstGetValueI64High(expressions[763]);
getExpressionInfo(i64.const)={"id":14,"type":2,"value":{"low":6,"high":7}}
- expressions[752] = BinaryenConst(the_module, BinaryenLiteralFloat32(8.5));
- BinaryenExpressionGetId(expressions[752]);
- BinaryenExpressionGetType(expressions[752]);
- BinaryenConstGetValueF32(expressions[752]);
+ expressions[764] = BinaryenConst(the_module, BinaryenLiteralFloat32(8.5));
+ BinaryenExpressionGetId(expressions[764]);
+ BinaryenExpressionGetType(expressions[764]);
+ BinaryenConstGetValueF32(expressions[764]);
getExpressionInfo(f32.const)={"id":14,"type":3,"value":8.5}
- expressions[753] = BinaryenConst(the_module, BinaryenLiteralFloat64(9.5));
- BinaryenExpressionGetId(expressions[753]);
- BinaryenExpressionGetType(expressions[753]);
- BinaryenConstGetValueF64(expressions[753]);
+ expressions[765] = BinaryenConst(the_module, BinaryenLiteralFloat64(9.5));
+ BinaryenExpressionGetId(expressions[765]);
+ BinaryenExpressionGetType(expressions[765]);
+ BinaryenConstGetValueF64(expressions[765]);
getExpressionInfo(f64.const)={"id":14,"type":4,"value":9.5}
{
BinaryenExpressionRef children[] = { expressions[24], expressions[26], expressions[28], expressions[30], expressions[32],
@@ -5317,33 +5389,34 @@ getExpressionInfo(f64.const)={"id":14,"type":4,"value":9.5}
expressions[559], expressions[562], expressions[565], expressions[568], expressions[571], expressions[574],
expressions[577], expressions[580], expressions[583], expressions[586], expressions[589], expressions[592],
expressions[595], expressions[598], expressions[601], expressions[603], expressions[605], expressions[607],
- expressions[609], expressions[612], expressions[616], expressions[620], expressions[624], expressions[628],
- expressions[632], expressions[636], expressions[637], expressions[641], expressions[645], expressions[646],
- expressions[647], expressions[648], expressions[650], expressions[652], expressions[653], expressions[655],
- expressions[657], expressions[658], expressions[659], expressions[661], expressions[667], expressions[672],
- expressions[679], expressions[681], expressions[683], expressions[686], expressions[688], expressions[690],
- expressions[692], expressions[694], expressions[695], expressions[696], expressions[697], expressions[699],
- expressions[704], expressions[710], expressions[721], expressions[725], expressions[730], expressions[734],
- expressions[735], expressions[737], expressions[739], expressions[741], expressions[743], expressions[745],
- expressions[747], expressions[748], expressions[749] };
- expressions[754] = BinaryenBlock(the_module, "the-value", children, 278, 0);
+ expressions[609], expressions[611], expressions[613], expressions[615], expressions[617], expressions[619],
+ expressions[621], expressions[624], expressions[628], expressions[632], expressions[636], expressions[640],
+ expressions[644], expressions[648], expressions[649], expressions[653], expressions[657], expressions[658],
+ expressions[659], expressions[660], expressions[662], expressions[664], expressions[665], expressions[667],
+ expressions[669], expressions[670], expressions[671], expressions[673], expressions[679], expressions[684],
+ expressions[691], expressions[693], expressions[695], expressions[698], expressions[700], expressions[702],
+ expressions[704], expressions[706], expressions[707], expressions[708], expressions[709], expressions[711],
+ expressions[716], expressions[722], expressions[733], expressions[737], expressions[742], expressions[746],
+ expressions[747], expressions[749], expressions[751], expressions[753], expressions[755], expressions[757],
+ expressions[759], expressions[760], expressions[761] };
+ expressions[766] = BinaryenBlock(the_module, "the-value", children, 284, 0);
}
- expressions[755] = BinaryenDrop(the_module, expressions[754]);
+ expressions[767] = BinaryenDrop(the_module, expressions[766]);
{
- BinaryenExpressionRef children[] = { expressions[755] };
- expressions[756] = BinaryenBlock(the_module, "the-nothing", children, 1, 0);
+ BinaryenExpressionRef children[] = { expressions[767] };
+ expressions[768] = BinaryenBlock(the_module, "the-nothing", children, 1, 0);
}
- expressions[757] = BinaryenConst(the_module, BinaryenLiteralInt32(42));
+ expressions[769] = BinaryenConst(the_module, BinaryenLiteralInt32(42));
{
- BinaryenExpressionRef children[] = { expressions[756], expressions[757] };
- expressions[758] = BinaryenBlock(the_module, "the-body", children, 2, 0);
+ BinaryenExpressionRef children[] = { expressions[768], expressions[769] };
+ expressions[770] = BinaryenBlock(the_module, "the-body", children, 2, 0);
}
{
BinaryenType varTypes[] = { 1, 7 };
- functions[0] = BinaryenAddFunction(the_module, "kitchen()sinker", functionTypes[1], varTypes, 2, expressions[758]);
+ functions[0] = BinaryenAddFunction(the_module, "kitchen()sinker", functionTypes[1], varTypes, 2, expressions[770]);
}
- expressions[759] = BinaryenConst(the_module, BinaryenLiteralInt32(1));
- globals[0] = BinaryenAddGlobal(the_module, "a-global", 1, 0, expressions[759]);
+ expressions[771] = BinaryenConst(the_module, BinaryenLiteralInt32(1));
+ globals[0] = BinaryenAddGlobal(the_module, "a-global", 1, 0, expressions[771]);
{
BinaryenType paramTypes[] = { 1, 4 };
functionTypes[2] = BinaryenAddFunctionType(the_module, "fiF", 3, paramTypes, 2);
@@ -5373,13 +5446,13 @@ getExpressionInfo(f64.const)={"id":14,"type":4,"value":9.5}
const char* funcNames[] = { "kitchen()sinker" };
BinaryenSetFunctionTable(the_module, 1, 4294967295, funcNames, 1);
}
- expressions[760] = BinaryenConst(the_module, BinaryenLiteralInt32(10));
+ expressions[772] = BinaryenConst(the_module, BinaryenLiteralInt32(10));
{
const char segment0[] = { 104, 101, 108, 108, 111, 44, 32, 119, 111, 114, 108, 100 };
const char segment1[] = { 73, 32, 97, 109, 32, 112, 97, 115, 115, 105, 118, 101 };
const char* segments[] = { segment0, segment1 };
int8_t segmentPassive[] = { 0, 1 };
- BinaryenExpressionRef segmentOffsets[] = { expressions[760], expressions[0] };
+ BinaryenExpressionRef segmentOffsets[] = { expressions[772], expressions[0] };
BinaryenIndex segmentSizes[] = { 12, 12 };
BinaryenSetMemory(the_module, 1, 256, "mem", segments, segmentPassive, segmentOffsets, segmentSizes, 2, 1);
}
@@ -5387,10 +5460,10 @@ getExpressionInfo(f64.const)={"id":14,"type":4,"value":9.5}
BinaryenType paramTypes[] = { 0 };
functionTypes[3] = BinaryenAddFunctionType(the_module, "v", 0, paramTypes, 0);
}
- expressions[761] = BinaryenNop(the_module);
+ expressions[773] = BinaryenNop(the_module);
{
BinaryenType varTypes[] = { 0 };
- functions[1] = BinaryenAddFunction(the_module, "starter", functionTypes[3], varTypes, 0, expressions[761]);
+ functions[1] = BinaryenAddFunction(the_module, "starter", functionTypes[3], varTypes, 0, expressions[773]);
}
BinaryenSetStart(the_module, functions[1]);
{
@@ -6702,6 +6775,36 @@ getExpressionInfo(f64.const)={"id":14,"type":4,"value":9.5}
)
)
(drop
+ (i16x8.load8x8_s
+ (i32.const 128)
+ )
+ )
+ (drop
+ (i16x8.load8x8_u
+ (i32.const 128)
+ )
+ )
+ (drop
+ (i32x4.load16x4_s
+ (i32.const 128)
+ )
+ )
+ (drop
+ (i32x4.load16x4_u
+ (i32.const 128)
+ )
+ )
+ (drop
+ (i64x2.load32x2_s
+ (i32.const 128)
+ )
+ )
+ (drop
+ (i64x2.load32x2_u
+ (i32.const 128)
+ )
+ )
+ (drop
(v8x16.shuffle 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
(v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d)
(v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d)
@@ -8271,6 +8374,36 @@ getExpressionInfo(f64.const)={"id":14,"type":4,"value":9.5}
)
)
(drop
+ (i16x8.load8x8_s
+ (i32.const 128)
+ )
+ )
+ (drop
+ (i16x8.load8x8_u
+ (i32.const 128)
+ )
+ )
+ (drop
+ (i32x4.load16x4_s
+ (i32.const 128)
+ )
+ )
+ (drop
+ (i32x4.load16x4_u
+ (i32.const 128)
+ )
+ )
+ (drop
+ (i64x2.load32x2_s
+ (i32.const 128)
+ )
+ )
+ (drop
+ (i64x2.load32x2_u
+ (i32.const 128)
+ )
+ )
+ (drop
(v8x16.shuffle 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
(v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d)
(v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d)
diff --git a/test/example/c-api-kitchen-sink.c b/test/example/c-api-kitchen-sink.c
index a321290f2..689adcae0 100644
--- a/test/example/c-api-kitchen-sink.c
+++ b/test/example/c-api-kitchen-sink.c
@@ -491,6 +491,30 @@ void test_core() {
module, BinaryenLoadSplatVec32x4(), 16, 4, makeInt32(module, 128)),
BinaryenSIMDLoad(
module, BinaryenLoadSplatVec64x2(), 0, 4, makeInt32(module, 128)),
+ BinaryenSIMDLoad(
+ module, BinaryenLoadExtSVec8x8ToVecI16x8(), 0, 8, makeInt32(module, 128)),
+ BinaryenSIMDLoad(
+ module, BinaryenLoadExtUVec8x8ToVecI16x8(), 0, 8, makeInt32(module, 128)),
+ BinaryenSIMDLoad(module,
+ BinaryenLoadExtSVec16x4ToVecI32x4(),
+ 0,
+ 8,
+ makeInt32(module, 128)),
+ BinaryenSIMDLoad(module,
+ BinaryenLoadExtUVec16x4ToVecI32x4(),
+ 0,
+ 8,
+ makeInt32(module, 128)),
+ BinaryenSIMDLoad(module,
+ BinaryenLoadExtSVec32x2ToVecI64x2(),
+ 0,
+ 8,
+ makeInt32(module, 128)),
+ BinaryenSIMDLoad(module,
+ BinaryenLoadExtUVec32x2ToVecI64x2(),
+ 0,
+ 8,
+ makeInt32(module, 128)),
// Other SIMD
makeSIMDShuffle(module),
makeSIMDTernary(module, BinaryenBitselectVec128()),
diff --git a/test/example/c-api-kitchen-sink.txt b/test/example/c-api-kitchen-sink.txt
index 417c33077..4848ec3bf 100644
--- a/test/example/c-api-kitchen-sink.txt
+++ b/test/example/c-api-kitchen-sink.txt
@@ -1319,6 +1319,36 @@ BinaryenFeatureAll: 511
)
)
(drop
+ (i16x8.load8x8_s
+ (i32.const 128)
+ )
+ )
+ (drop
+ (i16x8.load8x8_u
+ (i32.const 128)
+ )
+ )
+ (drop
+ (i32x4.load16x4_s
+ (i32.const 128)
+ )
+ )
+ (drop
+ (i32x4.load16x4_u
+ (i32.const 128)
+ )
+ )
+ (drop
+ (i64x2.load32x2_s
+ (i32.const 128)
+ )
+ )
+ (drop
+ (i64x2.load32x2_u
+ (i32.const 128)
+ )
+ )
+ (drop
(v8x16.shuffle 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
(v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d)
(v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d)
@@ -3433,177 +3463,189 @@ int main() {
expressions[628] = BinaryenSIMDLoad(the_module, 2, 16, 4, expressions[627]);
expressions[629] = BinaryenConst(the_module, BinaryenLiteralInt32(128));
expressions[630] = BinaryenSIMDLoad(the_module, 3, 0, 4, expressions[629]);
+ expressions[631] = BinaryenConst(the_module, BinaryenLiteralInt32(128));
+ expressions[632] = BinaryenSIMDLoad(the_module, 4, 0, 8, expressions[631]);
+ expressions[633] = BinaryenConst(the_module, BinaryenLiteralInt32(128));
+ expressions[634] = BinaryenSIMDLoad(the_module, 5, 0, 8, expressions[633]);
+ expressions[635] = BinaryenConst(the_module, BinaryenLiteralInt32(128));
+ expressions[636] = BinaryenSIMDLoad(the_module, 6, 0, 8, expressions[635]);
+ expressions[637] = BinaryenConst(the_module, BinaryenLiteralInt32(128));
+ expressions[638] = BinaryenSIMDLoad(the_module, 7, 0, 8, expressions[637]);
+ expressions[639] = BinaryenConst(the_module, BinaryenLiteralInt32(128));
+ expressions[640] = BinaryenSIMDLoad(the_module, 8, 0, 8, expressions[639]);
+ expressions[641] = BinaryenConst(the_module, BinaryenLiteralInt32(128));
+ expressions[642] = BinaryenSIMDLoad(the_module, 9, 0, 8, expressions[641]);
{
uint8_t t224[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[631] = BinaryenConst(the_module, BinaryenLiteralVec128(t224));
+ expressions[643] = BinaryenConst(the_module, BinaryenLiteralVec128(t224));
}
{
uint8_t t225[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[632] = BinaryenConst(the_module, BinaryenLiteralVec128(t225));
+ expressions[644] = BinaryenConst(the_module, BinaryenLiteralVec128(t225));
}
{
uint8_t mask[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
- expressions[633] = BinaryenSIMDShuffle(the_module, expressions[631], expressions[632], mask);
+ expressions[645] = BinaryenSIMDShuffle(the_module, expressions[643], expressions[644], mask);
}
{
uint8_t t226[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[634] = BinaryenConst(the_module, BinaryenLiteralVec128(t226));
+ expressions[646] = BinaryenConst(the_module, BinaryenLiteralVec128(t226));
}
{
uint8_t t227[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[635] = BinaryenConst(the_module, BinaryenLiteralVec128(t227));
+ expressions[647] = BinaryenConst(the_module, BinaryenLiteralVec128(t227));
}
{
uint8_t t228[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[636] = BinaryenConst(the_module, BinaryenLiteralVec128(t228));
+ expressions[648] = BinaryenConst(the_module, BinaryenLiteralVec128(t228));
}
- expressions[637] = BinaryenSIMDTernary(the_module, 0, expressions[634], expressions[635], expressions[636]);
+ expressions[649] = BinaryenSIMDTernary(the_module, 0, expressions[646], expressions[647], expressions[648]);
{
uint8_t t229[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[638] = BinaryenConst(the_module, BinaryenLiteralVec128(t229));
+ expressions[650] = BinaryenConst(the_module, BinaryenLiteralVec128(t229));
}
{
uint8_t t230[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[639] = BinaryenConst(the_module, BinaryenLiteralVec128(t230));
+ expressions[651] = BinaryenConst(the_module, BinaryenLiteralVec128(t230));
}
{
uint8_t t231[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[640] = BinaryenConst(the_module, BinaryenLiteralVec128(t231));
+ expressions[652] = BinaryenConst(the_module, BinaryenLiteralVec128(t231));
}
- expressions[641] = BinaryenSIMDTernary(the_module, 1, expressions[638], expressions[639], expressions[640]);
+ expressions[653] = BinaryenSIMDTernary(the_module, 1, expressions[650], expressions[651], expressions[652]);
{
uint8_t t232[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[642] = BinaryenConst(the_module, BinaryenLiteralVec128(t232));
+ expressions[654] = BinaryenConst(the_module, BinaryenLiteralVec128(t232));
}
{
uint8_t t233[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[643] = BinaryenConst(the_module, BinaryenLiteralVec128(t233));
+ expressions[655] = BinaryenConst(the_module, BinaryenLiteralVec128(t233));
}
{
uint8_t t234[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[644] = BinaryenConst(the_module, BinaryenLiteralVec128(t234));
+ expressions[656] = BinaryenConst(the_module, BinaryenLiteralVec128(t234));
}
- expressions[645] = BinaryenSIMDTernary(the_module, 2, expressions[642], expressions[643], expressions[644]);
+ expressions[657] = BinaryenSIMDTernary(the_module, 2, expressions[654], expressions[655], expressions[656]);
{
uint8_t t235[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[646] = BinaryenConst(the_module, BinaryenLiteralVec128(t235));
+ expressions[658] = BinaryenConst(the_module, BinaryenLiteralVec128(t235));
}
{
uint8_t t236[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[647] = BinaryenConst(the_module, BinaryenLiteralVec128(t236));
+ expressions[659] = BinaryenConst(the_module, BinaryenLiteralVec128(t236));
}
{
uint8_t t237[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[648] = BinaryenConst(the_module, BinaryenLiteralVec128(t237));
+ expressions[660] = BinaryenConst(the_module, BinaryenLiteralVec128(t237));
}
- expressions[649] = BinaryenSIMDTernary(the_module, 3, expressions[646], expressions[647], expressions[648]);
+ expressions[661] = BinaryenSIMDTernary(the_module, 3, expressions[658], expressions[659], expressions[660]);
{
uint8_t t238[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[650] = BinaryenConst(the_module, BinaryenLiteralVec128(t238));
+ expressions[662] = BinaryenConst(the_module, BinaryenLiteralVec128(t238));
}
{
uint8_t t239[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[651] = BinaryenConst(the_module, BinaryenLiteralVec128(t239));
+ expressions[663] = BinaryenConst(the_module, BinaryenLiteralVec128(t239));
}
{
uint8_t t240[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
- expressions[652] = BinaryenConst(the_module, BinaryenLiteralVec128(t240));
- }
- expressions[653] = BinaryenSIMDTernary(the_module, 4, expressions[650], expressions[651], expressions[652]);
- expressions[654] = BinaryenConst(the_module, BinaryenLiteralInt32(1024));
- expressions[655] = BinaryenConst(the_module, BinaryenLiteralInt32(0));
- expressions[656] = BinaryenConst(the_module, BinaryenLiteralInt32(12));
- expressions[657] = BinaryenMemoryInit(the_module, 0, expressions[654], expressions[655], expressions[656]);
- expressions[658] = BinaryenDataDrop(the_module, 0);
- expressions[659] = BinaryenConst(the_module, BinaryenLiteralInt32(2048));
- expressions[660] = BinaryenConst(the_module, BinaryenLiteralInt32(1024));
- expressions[661] = BinaryenConst(the_module, BinaryenLiteralInt32(12));
- expressions[662] = BinaryenMemoryCopy(the_module, expressions[659], expressions[660], expressions[661]);
- expressions[663] = BinaryenConst(the_module, BinaryenLiteralInt32(0));
- expressions[664] = BinaryenConst(the_module, BinaryenLiteralInt32(42));
- expressions[665] = BinaryenConst(the_module, BinaryenLiteralInt32(1024));
- expressions[666] = BinaryenMemoryFill(the_module, expressions[663], expressions[664], expressions[665]);
+ expressions[664] = BinaryenConst(the_module, BinaryenLiteralVec128(t240));
+ }
+ expressions[665] = BinaryenSIMDTernary(the_module, 4, expressions[662], expressions[663], expressions[664]);
+ expressions[666] = BinaryenConst(the_module, BinaryenLiteralInt32(1024));
+ expressions[667] = BinaryenConst(the_module, BinaryenLiteralInt32(0));
+ expressions[668] = BinaryenConst(the_module, BinaryenLiteralInt32(12));
+ expressions[669] = BinaryenMemoryInit(the_module, 0, expressions[666], expressions[667], expressions[668]);
+ expressions[670] = BinaryenDataDrop(the_module, 0);
+ expressions[671] = BinaryenConst(the_module, BinaryenLiteralInt32(2048));
+ expressions[672] = BinaryenConst(the_module, BinaryenLiteralInt32(1024));
+ expressions[673] = BinaryenConst(the_module, BinaryenLiteralInt32(12));
+ expressions[674] = BinaryenMemoryCopy(the_module, expressions[671], expressions[672], expressions[673]);
+ expressions[675] = BinaryenConst(the_module, BinaryenLiteralInt32(0));
+ expressions[676] = BinaryenConst(the_module, BinaryenLiteralInt32(42));
+ expressions[677] = BinaryenConst(the_module, BinaryenLiteralInt32(1024));
+ expressions[678] = BinaryenMemoryFill(the_module, expressions[675], expressions[676], expressions[677]);
{
BinaryenExpressionRef children[] = { 0 };
- expressions[667] = BinaryenBlock(the_module, NULL, children, 0, BinaryenTypeAuto());
- }
- expressions[668] = BinaryenIf(the_module, expressions[18], expressions[19], expressions[20]);
- expressions[669] = BinaryenIf(the_module, expressions[21], expressions[22], expressions[0]);
- expressions[670] = BinaryenConst(the_module, BinaryenLiteralInt32(0));
- expressions[671] = BinaryenLoop(the_module, "in", expressions[670]);
- expressions[672] = BinaryenConst(the_module, BinaryenLiteralInt32(0));
- expressions[673] = BinaryenLoop(the_module, NULL, expressions[672]);
- expressions[674] = BinaryenBreak(the_module, "the-value", expressions[23], expressions[24]);
- expressions[675] = BinaryenConst(the_module, BinaryenLiteralInt32(2));
- expressions[676] = BinaryenBreak(the_module, "the-nothing", expressions[675], expressions[0]);
- expressions[677] = BinaryenConst(the_module, BinaryenLiteralInt32(3));
- expressions[678] = BinaryenBreak(the_module, "the-value", expressions[0], expressions[677]);
- expressions[679] = BinaryenBreak(the_module, "the-nothing", expressions[0], expressions[0]);
+ expressions[679] = BinaryenBlock(the_module, NULL, children, 0, BinaryenTypeAuto());
+ }
+ expressions[680] = BinaryenIf(the_module, expressions[18], expressions[19], expressions[20]);
+ expressions[681] = BinaryenIf(the_module, expressions[21], expressions[22], expressions[0]);
+ expressions[682] = BinaryenConst(the_module, BinaryenLiteralInt32(0));
+ expressions[683] = BinaryenLoop(the_module, "in", expressions[682]);
+ expressions[684] = BinaryenConst(the_module, BinaryenLiteralInt32(0));
+ expressions[685] = BinaryenLoop(the_module, NULL, expressions[684]);
+ expressions[686] = BinaryenBreak(the_module, "the-value", expressions[23], expressions[24]);
+ expressions[687] = BinaryenConst(the_module, BinaryenLiteralInt32(2));
+ expressions[688] = BinaryenBreak(the_module, "the-nothing", expressions[687], expressions[0]);
+ expressions[689] = BinaryenConst(the_module, BinaryenLiteralInt32(3));
+ expressions[690] = BinaryenBreak(the_module, "the-value", expressions[0], expressions[689]);
+ expressions[691] = BinaryenBreak(the_module, "the-nothing", expressions[0], expressions[0]);
{
const char* names[] = { "the-value" };
- expressions[680] = BinaryenSwitch(the_module, names, 1, "the-value", expressions[25], expressions[26]);
+ expressions[692] = BinaryenSwitch(the_module, names, 1, "the-value", expressions[25], expressions[26]);
}
- expressions[681] = BinaryenConst(the_module, BinaryenLiteralInt32(2));
+ expressions[693] = BinaryenConst(the_module, BinaryenLiteralInt32(2));
{
const char* names[] = { "the-nothing" };
- expressions[682] = BinaryenSwitch(the_module, names, 1, "the-nothing", expressions[681], expressions[0]);
+ expressions[694] = BinaryenSwitch(the_module, names, 1, "the-nothing", expressions[693], expressions[0]);
}
{
BinaryenExpressionRef operands[] = { expressions[10], expressions[11], expressions[12], expressions[13] };
- expressions[683] = BinaryenCall(the_module, "kitchen()sinker", operands, 4, 1);
+ expressions[695] = BinaryenCall(the_module, "kitchen()sinker", operands, 4, 1);
}
- expressions[684] = BinaryenUnary(the_module, 20, expressions[683]);
+ expressions[696] = BinaryenUnary(the_module, 20, expressions[695]);
{
BinaryenExpressionRef operands[] = { expressions[8], expressions[9] };
- expressions[685] = BinaryenCall(the_module, "an-imported", operands, 2, 3);
+ expressions[697] = BinaryenCall(the_module, "an-imported", operands, 2, 3);
}
- expressions[686] = BinaryenUnary(the_module, 25, expressions[685]);
- expressions[687] = BinaryenUnary(the_module, 20, expressions[686]);
- expressions[688] = BinaryenConst(the_module, BinaryenLiteralInt32(2449));
+ expressions[698] = BinaryenUnary(the_module, 25, expressions[697]);
+ expressions[699] = BinaryenUnary(the_module, 20, expressions[698]);
+ expressions[700] = BinaryenConst(the_module, BinaryenLiteralInt32(2449));
{
BinaryenExpressionRef operands[] = { expressions[14], expressions[15], expressions[16], expressions[17] };
- expressions[689] = BinaryenCallIndirect(the_module, expressions[688], operands, 4, "iiIfF");
- }
- expressions[690] = BinaryenUnary(the_module, 20, expressions[689]);
- expressions[691] = BinaryenLocalGet(the_module, 0, 1);
- expressions[692] = BinaryenDrop(the_module, expressions[691]);
- expressions[693] = BinaryenConst(the_module, BinaryenLiteralInt32(101));
- expressions[694] = BinaryenLocalSet(the_module, 0, expressions[693]);
- expressions[695] = BinaryenConst(the_module, BinaryenLiteralInt32(102));
- expressions[696] = BinaryenLocalTee(the_module, 0, expressions[695]);
- expressions[697] = BinaryenDrop(the_module, expressions[696]);
- expressions[698] = BinaryenConst(the_module, BinaryenLiteralInt32(1));
- expressions[699] = BinaryenLoad(the_module, 4, 0, 0, 0, 1, expressions[698]);
- expressions[700] = BinaryenConst(the_module, BinaryenLiteralInt32(8));
- expressions[701] = BinaryenLoad(the_module, 2, 1, 2, 1, 2, expressions[700]);
- expressions[702] = BinaryenConst(the_module, BinaryenLiteralInt32(2));
- expressions[703] = BinaryenLoad(the_module, 4, 0, 0, 0, 3, expressions[702]);
- expressions[704] = BinaryenConst(the_module, BinaryenLiteralInt32(9));
- expressions[705] = BinaryenLoad(the_module, 8, 0, 2, 8, 4, expressions[704]);
- expressions[706] = BinaryenStore(the_module, 4, 0, 0, expressions[30], expressions[31], 1);
- expressions[707] = BinaryenStore(the_module, 8, 2, 4, expressions[32], expressions[33], 2);
- expressions[708] = BinaryenSelect(the_module, expressions[27], expressions[28], expressions[29]);
- expressions[709] = BinaryenConst(the_module, BinaryenLiteralInt32(1337));
- expressions[710] = BinaryenReturn(the_module, expressions[709]);
+ expressions[701] = BinaryenCallIndirect(the_module, expressions[700], operands, 4, "iiIfF");
+ }
+ expressions[702] = BinaryenUnary(the_module, 20, expressions[701]);
+ expressions[703] = BinaryenLocalGet(the_module, 0, 1);
+ expressions[704] = BinaryenDrop(the_module, expressions[703]);
+ expressions[705] = BinaryenConst(the_module, BinaryenLiteralInt32(101));
+ expressions[706] = BinaryenLocalSet(the_module, 0, expressions[705]);
+ expressions[707] = BinaryenConst(the_module, BinaryenLiteralInt32(102));
+ expressions[708] = BinaryenLocalTee(the_module, 0, expressions[707]);
+ expressions[709] = BinaryenDrop(the_module, expressions[708]);
+ expressions[710] = BinaryenConst(the_module, BinaryenLiteralInt32(1));
+ expressions[711] = BinaryenLoad(the_module, 4, 0, 0, 0, 1, expressions[710]);
+ expressions[712] = BinaryenConst(the_module, BinaryenLiteralInt32(8));
+ expressions[713] = BinaryenLoad(the_module, 2, 1, 2, 1, 2, expressions[712]);
+ expressions[714] = BinaryenConst(the_module, BinaryenLiteralInt32(2));
+ expressions[715] = BinaryenLoad(the_module, 4, 0, 0, 0, 3, expressions[714]);
+ expressions[716] = BinaryenConst(the_module, BinaryenLiteralInt32(9));
+ expressions[717] = BinaryenLoad(the_module, 8, 0, 2, 8, 4, expressions[716]);
+ expressions[718] = BinaryenStore(the_module, 4, 0, 0, expressions[30], expressions[31], 1);
+ expressions[719] = BinaryenStore(the_module, 8, 2, 4, expressions[32], expressions[33], 2);
+ expressions[720] = BinaryenSelect(the_module, expressions[27], expressions[28], expressions[29]);
+ expressions[721] = BinaryenConst(the_module, BinaryenLiteralInt32(1337));
+ expressions[722] = BinaryenReturn(the_module, expressions[721]);
{
BinaryenExpressionRef operands[] = { expressions[10], expressions[11], expressions[12], expressions[13] };
- expressions[711] = BinaryenReturnCall(the_module, "kitchen()sinker", operands, 4, 1);
+ expressions[723] = BinaryenReturnCall(the_module, "kitchen()sinker", operands, 4, 1);
}
- expressions[712] = BinaryenConst(the_module, BinaryenLiteralInt32(2449));
+ expressions[724] = BinaryenConst(the_module, BinaryenLiteralInt32(2449));
{
BinaryenExpressionRef operands[] = { expressions[14], expressions[15], expressions[16], expressions[17] };
- expressions[713] = BinaryenReturnCallIndirect(the_module, expressions[712], operands, 4, "iiIfF");
- }
- expressions[714] = BinaryenTry(the_module, expressions[35], expressions[43]);
- expressions[715] = BinaryenAtomicLoad(the_module, 4, 0, 1, expressions[23]);
- expressions[716] = BinaryenAtomicStore(the_module, 4, 0, expressions[23], expressions[715], 1);
- expressions[717] = BinaryenAtomicWait(the_module, expressions[23], expressions[23], expressions[33], 1);
- expressions[718] = BinaryenDrop(the_module, expressions[717]);
- expressions[719] = BinaryenAtomicNotify(the_module, expressions[23], expressions[23]);
- expressions[720] = BinaryenDrop(the_module, expressions[719]);
- expressions[721] = BinaryenAtomicFence(the_module);
- expressions[722] = BinaryenNop(the_module);
- expressions[723] = BinaryenUnreachable(the_module);
+ expressions[725] = BinaryenReturnCallIndirect(the_module, expressions[724], operands, 4, "iiIfF");
+ }
+ expressions[726] = BinaryenTry(the_module, expressions[35], expressions[43]);
+ expressions[727] = BinaryenAtomicLoad(the_module, 4, 0, 1, expressions[23]);
+ expressions[728] = BinaryenAtomicStore(the_module, 4, 0, expressions[23], expressions[727], 1);
+ expressions[729] = BinaryenAtomicWait(the_module, expressions[23], expressions[23], expressions[33], 1);
+ expressions[730] = BinaryenDrop(the_module, expressions[729]);
+ expressions[731] = BinaryenAtomicNotify(the_module, expressions[23], expressions[23]);
+ expressions[732] = BinaryenDrop(the_module, expressions[731]);
+ expressions[733] = BinaryenAtomicFence(the_module);
+ expressions[734] = BinaryenNop(the_module);
+ expressions[735] = BinaryenUnreachable(the_module);
BinaryenExpressionPrint(expressions[51]);
(f32.neg
(f32.const -33.61199951171875)
@@ -3647,34 +3689,35 @@ int main() {
expressions[580], expressions[583], expressions[586], expressions[589], expressions[592], expressions[595],
expressions[598], expressions[601], expressions[604], expressions[607], expressions[610], expressions[613],
expressions[616], expressions[619], expressions[622], expressions[624], expressions[626], expressions[628],
- expressions[630], expressions[633], expressions[637], expressions[641], expressions[645], expressions[649],
- expressions[653], expressions[657], expressions[658], expressions[662], expressions[666], expressions[667],
- expressions[668], expressions[669], expressions[671], expressions[673], expressions[674], expressions[676],
- expressions[678], expressions[679], expressions[680], expressions[682], expressions[684], expressions[687],
- expressions[690], expressions[692], expressions[694], expressions[697], expressions[699], expressions[701],
- expressions[703], expressions[705], expressions[706], expressions[707], expressions[708], expressions[710],
- expressions[711], expressions[713], expressions[714], expressions[716], expressions[718], expressions[720],
- expressions[721], expressions[722], expressions[723] };
- expressions[724] = BinaryenBlock(the_module, "the-value", children, 272, BinaryenTypeAuto());
+ expressions[630], expressions[632], expressions[634], expressions[636], expressions[638], expressions[640],
+ expressions[642], expressions[645], expressions[649], expressions[653], expressions[657], expressions[661],
+ expressions[665], expressions[669], expressions[670], expressions[674], expressions[678], expressions[679],
+ expressions[680], expressions[681], expressions[683], expressions[685], expressions[686], expressions[688],
+ expressions[690], expressions[691], expressions[692], expressions[694], expressions[696], expressions[699],
+ expressions[702], expressions[704], expressions[706], expressions[709], expressions[711], expressions[713],
+ expressions[715], expressions[717], expressions[718], expressions[719], expressions[720], expressions[722],
+ expressions[723], expressions[725], expressions[726], expressions[728], expressions[730], expressions[732],
+ expressions[733], expressions[734], expressions[735] };
+ expressions[736] = BinaryenBlock(the_module, "the-value", children, 278, BinaryenTypeAuto());
}
- expressions[725] = BinaryenDrop(the_module, expressions[724]);
+ expressions[737] = BinaryenDrop(the_module, expressions[736]);
{
- BinaryenExpressionRef children[] = { expressions[725] };
- expressions[726] = BinaryenBlock(the_module, "the-nothing", children, 1, BinaryenTypeAuto());
+ BinaryenExpressionRef children[] = { expressions[737] };
+ expressions[738] = BinaryenBlock(the_module, "the-nothing", children, 1, BinaryenTypeAuto());
}
- expressions[727] = BinaryenConst(the_module, BinaryenLiteralInt32(42));
+ expressions[739] = BinaryenConst(the_module, BinaryenLiteralInt32(42));
{
- BinaryenExpressionRef children[] = { expressions[726], expressions[727] };
- expressions[728] = BinaryenBlock(the_module, "the-body", children, 2, BinaryenTypeAuto());
+ BinaryenExpressionRef children[] = { expressions[738], expressions[739] };
+ expressions[740] = BinaryenBlock(the_module, "the-body", children, 2, BinaryenTypeAuto());
}
{
BinaryenType varTypes[] = { 1, 7 };
- functions[0] = BinaryenAddFunction(the_module, "kitchen()sinker", functionTypes[0], varTypes, 2, expressions[728]);
+ functions[0] = BinaryenAddFunction(the_module, "kitchen()sinker", functionTypes[0], varTypes, 2, expressions[740]);
}
- expressions[729] = BinaryenConst(the_module, BinaryenLiteralInt32(7));
- globals[0] = BinaryenAddGlobal(the_module, "a-global", 1, 0, expressions[729]);
- expressions[730] = BinaryenConst(the_module, BinaryenLiteralFloat32(7.5));
- globals[1] = BinaryenAddGlobal(the_module, "a-mutable-global", 3, 1, expressions[730]);
+ expressions[741] = BinaryenConst(the_module, BinaryenLiteralInt32(7));
+ globals[0] = BinaryenAddGlobal(the_module, "a-global", 1, 0, expressions[741]);
+ expressions[742] = BinaryenConst(the_module, BinaryenLiteralFloat32(7.5));
+ globals[1] = BinaryenAddGlobal(the_module, "a-mutable-global", 3, 1, expressions[742]);
{
BinaryenType paramTypes[] = { 1, 4 };
functionTypes[2] = BinaryenAddFunctionType(the_module, "fiF", 3, paramTypes, 2);
@@ -3686,13 +3729,13 @@ int main() {
const char* funcNames[] = { "kitchen()sinker" };
BinaryenSetFunctionTable(the_module, 1, 1, funcNames, 1);
}
- expressions[731] = BinaryenConst(the_module, BinaryenLiteralInt32(10));
+ expressions[743] = BinaryenConst(the_module, BinaryenLiteralInt32(10));
{
const char segment0[] = { 104, 101, 108, 108, 111, 44, 32, 119, 111, 114, 108, 100 };
const char segment1[] = { 73, 32, 97, 109, 32, 112, 97, 115, 115, 105, 118, 101 };
const char* segments[] = { segment0, segment1 };
int8_t segmentPassive[] = { 0, 1 };
- BinaryenExpressionRef segmentOffsets[] = { expressions[731], expressions[0] };
+ BinaryenExpressionRef segmentOffsets[] = { expressions[743], expressions[0] };
BinaryenIndex segmentSizes[] = { 12, 12 };
BinaryenSetMemory(the_module, 1, 256, "mem", segments, segmentPassive, segmentOffsets, segmentSizes, 2, 1);
}
@@ -3700,10 +3743,10 @@ int main() {
BinaryenType paramTypes[] = { 0 };
functionTypes[3] = BinaryenAddFunctionType(the_module, "v", 0, paramTypes, 0);
}
- expressions[732] = BinaryenNop(the_module);
+ expressions[744] = BinaryenNop(the_module);
{
BinaryenType varTypes[] = { 0 };
- functions[1] = BinaryenAddFunction(the_module, "starter", functionTypes[3], varTypes, 0, expressions[732]);
+ functions[1] = BinaryenAddFunction(the_module, "starter", functionTypes[3], varTypes, 0, expressions[744]);
}
BinaryenSetStart(the_module, functions[1]);
{
@@ -5012,6 +5055,36 @@ int main() {
)
)
(drop
+ (i16x8.load8x8_s
+ (i32.const 128)
+ )
+ )
+ (drop
+ (i16x8.load8x8_u
+ (i32.const 128)
+ )
+ )
+ (drop
+ (i32x4.load16x4_s
+ (i32.const 128)
+ )
+ )
+ (drop
+ (i32x4.load16x4_u
+ (i32.const 128)
+ )
+ )
+ (drop
+ (i64x2.load32x2_s
+ (i32.const 128)
+ )
+ )
+ (drop
+ (i64x2.load32x2_u
+ (i32.const 128)
+ )
+ )
+ (drop
(v8x16.shuffle 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
(v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d)
(v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d)
diff --git a/test/example/c-api-kitchen-sink.txt.txt b/test/example/c-api-kitchen-sink.txt.txt
index f8a1a1c4a..56602ef13 100644
--- a/test/example/c-api-kitchen-sink.txt.txt
+++ b/test/example/c-api-kitchen-sink.txt.txt
@@ -1298,6 +1298,36 @@
)
)
(drop
+ (i16x8.load8x8_s
+ (i32.const 128)
+ )
+ )
+ (drop
+ (i16x8.load8x8_u
+ (i32.const 128)
+ )
+ )
+ (drop
+ (i32x4.load16x4_s
+ (i32.const 128)
+ )
+ )
+ (drop
+ (i32x4.load16x4_u
+ (i32.const 128)
+ )
+ )
+ (drop
+ (i64x2.load32x2_s
+ (i32.const 128)
+ )
+ )
+ (drop
+ (i64x2.load32x2_u
+ (i32.const 128)
+ )
+ )
+ (drop
(v8x16.shuffle 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
(v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d)
(v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d)
diff --git a/test/simd.wast b/test/simd.wast
index 1b0b33f4c..facaf0e83 100644
--- a/test/simd.wast
+++ b/test/simd.wast
@@ -840,6 +840,26 @@
(local.get $0)
)
)
+ (func $v8x16.load_splat (param $0 i32) (result v128)
+ (v8x16.load_splat
+ (local.get $0)
+ )
+ )
+ (func $v16x8.load_splat (param $0 i32) (result v128)
+ (v16x8.load_splat
+ (local.get $0)
+ )
+ )
+ (func $v32x4.load_splat (param $0 i32) (result v128)
+ (v32x4.load_splat
+ (local.get $0)
+ )
+ )
+ (func $v64x2.load_splat (param $0 i32) (result v128)
+ (v64x2.load_splat
+ (local.get $0)
+ )
+ )
(func $i8x16.narrow_i16x8_s (param $0 v128) (param $1 v128) (result v128)
(i8x16.narrow_i16x8_s
(local.get $0)
@@ -904,4 +924,34 @@
(local.get $0)
)
)
+ (func $i16x8.load8x8_u (param $0 i32) (result v128)
+ (i16x8.load8x8_u
+ (local.get $0)
+ )
+ )
+ (func $i16x8.load8x8_s (param $0 i32) (result v128)
+ (i16x8.load8x8_s
+ (local.get $0)
+ )
+ )
+ (func $i32x4.load16x4_s (param $0 i32) (result v128)
+ (i32x4.load16x4_s
+ (local.get $0)
+ )
+ )
+ (func $i32x4.load16x4_u (param $0 i32) (result v128)
+ (i32x4.load16x4_u
+ (local.get $0)
+ )
+ )
+ (func $i64x2.load32x2_s (param $0 i32) (result v128)
+ (i64x2.load32x2_s
+ (local.get $0)
+ )
+ )
+ (func $i64x2.load32x2_u (param $0 i32) (result v128)
+ (i64x2.load32x2_u
+ (local.get $0)
+ )
+ )
)
diff --git a/test/simd.wast.from-wast b/test/simd.wast.from-wast
index a05ddbf32..b02b77c4e 100644
--- a/test/simd.wast.from-wast
+++ b/test/simd.wast.from-wast
@@ -856,68 +856,118 @@
(local.get $0)
)
)
- (func $i8x16.narrow_i16x8_s (; 149 ;) (type $FUNCSIG$VVV) (param $0 v128) (param $1 v128) (result v128)
+ (func $v8x16.load_splat (; 149 ;) (type $FUNCSIG$Vi) (param $0 i32) (result v128)
+ (v8x16.load_splat
+ (local.get $0)
+ )
+ )
+ (func $v16x8.load_splat (; 150 ;) (type $FUNCSIG$Vi) (param $0 i32) (result v128)
+ (v16x8.load_splat
+ (local.get $0)
+ )
+ )
+ (func $v32x4.load_splat (; 151 ;) (type $FUNCSIG$Vi) (param $0 i32) (result v128)
+ (v32x4.load_splat
+ (local.get $0)
+ )
+ )
+ (func $v64x2.load_splat (; 152 ;) (type $FUNCSIG$Vi) (param $0 i32) (result v128)
+ (v64x2.load_splat
+ (local.get $0)
+ )
+ )
+ (func $i8x16.narrow_i16x8_s (; 153 ;) (type $FUNCSIG$VVV) (param $0 v128) (param $1 v128) (result v128)
(i8x16.narrow_i16x8_s
(local.get $0)
(local.get $1)
)
)
- (func $i8x16.narrow_i16x8_u (; 150 ;) (type $FUNCSIG$VVV) (param $0 v128) (param $1 v128) (result v128)
+ (func $i8x16.narrow_i16x8_u (; 154 ;) (type $FUNCSIG$VVV) (param $0 v128) (param $1 v128) (result v128)
(i8x16.narrow_i16x8_u
(local.get $0)
(local.get $1)
)
)
- (func $i16x8.narrow_i32x4_s (; 151 ;) (type $FUNCSIG$VVV) (param $0 v128) (param $1 v128) (result v128)
+ (func $i16x8.narrow_i32x4_s (; 155 ;) (type $FUNCSIG$VVV) (param $0 v128) (param $1 v128) (result v128)
(i16x8.narrow_i32x4_s
(local.get $0)
(local.get $1)
)
)
- (func $i16x8.narrow_i32x4_u (; 152 ;) (type $FUNCSIG$VVV) (param $0 v128) (param $1 v128) (result v128)
+ (func $i16x8.narrow_i32x4_u (; 156 ;) (type $FUNCSIG$VVV) (param $0 v128) (param $1 v128) (result v128)
(i16x8.narrow_i32x4_u
(local.get $0)
(local.get $1)
)
)
- (func $i16x8.widen_low_i8x16_s (; 153 ;) (type $FUNCSIG$VV) (param $0 v128) (result v128)
+ (func $i16x8.widen_low_i8x16_s (; 157 ;) (type $FUNCSIG$VV) (param $0 v128) (result v128)
(i16x8.widen_low_i8x16_s
(local.get $0)
)
)
- (func $i16x8.widen_high_i8x16_s (; 154 ;) (type $FUNCSIG$VV) (param $0 v128) (result v128)
+ (func $i16x8.widen_high_i8x16_s (; 158 ;) (type $FUNCSIG$VV) (param $0 v128) (result v128)
(i16x8.widen_high_i8x16_s
(local.get $0)
)
)
- (func $i16x8.widen_low_i8x16_u (; 155 ;) (type $FUNCSIG$VV) (param $0 v128) (result v128)
+ (func $i16x8.widen_low_i8x16_u (; 159 ;) (type $FUNCSIG$VV) (param $0 v128) (result v128)
(i16x8.widen_low_i8x16_u
(local.get $0)
)
)
- (func $i16x8.widen_high_i8x16_u (; 156 ;) (type $FUNCSIG$VV) (param $0 v128) (result v128)
+ (func $i16x8.widen_high_i8x16_u (; 160 ;) (type $FUNCSIG$VV) (param $0 v128) (result v128)
(i16x8.widen_high_i8x16_u
(local.get $0)
)
)
- (func $i32x4.widen_low_i16x8_s (; 157 ;) (type $FUNCSIG$VV) (param $0 v128) (result v128)
+ (func $i32x4.widen_low_i16x8_s (; 161 ;) (type $FUNCSIG$VV) (param $0 v128) (result v128)
(i32x4.widen_low_i16x8_s
(local.get $0)
)
)
- (func $i32x4.widen_high_i16x8_s (; 158 ;) (type $FUNCSIG$VV) (param $0 v128) (result v128)
+ (func $i32x4.widen_high_i16x8_s (; 162 ;) (type $FUNCSIG$VV) (param $0 v128) (result v128)
(i32x4.widen_high_i16x8_s
(local.get $0)
)
)
- (func $i32x4.widen_low_i16x8_u (; 159 ;) (type $FUNCSIG$VV) (param $0 v128) (result v128)
+ (func $i32x4.widen_low_i16x8_u (; 163 ;) (type $FUNCSIG$VV) (param $0 v128) (result v128)
(i32x4.widen_low_i16x8_u
(local.get $0)
)
)
- (func $i32x4.widen_high_i16x8_u (; 160 ;) (type $FUNCSIG$VV) (param $0 v128) (result v128)
+ (func $i32x4.widen_high_i16x8_u (; 164 ;) (type $FUNCSIG$VV) (param $0 v128) (result v128)
(i32x4.widen_high_i16x8_u
(local.get $0)
)
)
+ (func $i16x8.load8x8_u (; 165 ;) (type $FUNCSIG$Vi) (param $0 i32) (result v128)
+ (i16x8.load8x8_u
+ (local.get $0)
+ )
+ )
+ (func $i16x8.load8x8_s (; 166 ;) (type $FUNCSIG$Vi) (param $0 i32) (result v128)
+ (i16x8.load8x8_s
+ (local.get $0)
+ )
+ )
+ (func $i32x4.load16x4_s (; 167 ;) (type $FUNCSIG$Vi) (param $0 i32) (result v128)
+ (i32x4.load16x4_s
+ (local.get $0)
+ )
+ )
+ (func $i32x4.load16x4_u (; 168 ;) (type $FUNCSIG$Vi) (param $0 i32) (result v128)
+ (i32x4.load16x4_u
+ (local.get $0)
+ )
+ )
+ (func $i64x2.load32x2_s (; 169 ;) (type $FUNCSIG$Vi) (param $0 i32) (result v128)
+ (i64x2.load32x2_s
+ (local.get $0)
+ )
+ )
+ (func $i64x2.load32x2_u (; 170 ;) (type $FUNCSIG$Vi) (param $0 i32) (result v128)
+ (i64x2.load32x2_u
+ (local.get $0)
+ )
+ )
)
diff --git a/test/simd.wast.fromBinary b/test/simd.wast.fromBinary
index fb53bf003..ae0c9828c 100644
--- a/test/simd.wast.fromBinary
+++ b/test/simd.wast.fromBinary
@@ -856,69 +856,119 @@
(local.get $0)
)
)
- (func $i8x16.narrow_i16x8_s (; 149 ;) (type $3) (param $0 v128) (param $1 v128) (result v128)
+ (func $v8x16.load_splat (; 149 ;) (type $0) (param $0 i32) (result v128)
+ (v8x16.load_splat
+ (local.get $0)
+ )
+ )
+ (func $v16x8.load_splat (; 150 ;) (type $0) (param $0 i32) (result v128)
+ (v16x8.load_splat
+ (local.get $0)
+ )
+ )
+ (func $v32x4.load_splat (; 151 ;) (type $0) (param $0 i32) (result v128)
+ (v32x4.load_splat
+ (local.get $0)
+ )
+ )
+ (func $v64x2.load_splat (; 152 ;) (type $0) (param $0 i32) (result v128)
+ (v64x2.load_splat
+ (local.get $0)
+ )
+ )
+ (func $i8x16.narrow_i16x8_s (; 153 ;) (type $3) (param $0 v128) (param $1 v128) (result v128)
(i8x16.narrow_i16x8_s
(local.get $0)
(local.get $1)
)
)
- (func $i8x16.narrow_i16x8_u (; 150 ;) (type $3) (param $0 v128) (param $1 v128) (result v128)
+ (func $i8x16.narrow_i16x8_u (; 154 ;) (type $3) (param $0 v128) (param $1 v128) (result v128)
(i8x16.narrow_i16x8_u
(local.get $0)
(local.get $1)
)
)
- (func $i16x8.narrow_i32x4_s (; 151 ;) (type $3) (param $0 v128) (param $1 v128) (result v128)
+ (func $i16x8.narrow_i32x4_s (; 155 ;) (type $3) (param $0 v128) (param $1 v128) (result v128)
(i16x8.narrow_i32x4_s
(local.get $0)
(local.get $1)
)
)
- (func $i16x8.narrow_i32x4_u (; 152 ;) (type $3) (param $0 v128) (param $1 v128) (result v128)
+ (func $i16x8.narrow_i32x4_u (; 156 ;) (type $3) (param $0 v128) (param $1 v128) (result v128)
(i16x8.narrow_i32x4_u
(local.get $0)
(local.get $1)
)
)
- (func $i16x8.widen_low_i8x16_s (; 153 ;) (type $14) (param $0 v128) (result v128)
+ (func $i16x8.widen_low_i8x16_s (; 157 ;) (type $14) (param $0 v128) (result v128)
(i16x8.widen_low_i8x16_s
(local.get $0)
)
)
- (func $i16x8.widen_high_i8x16_s (; 154 ;) (type $14) (param $0 v128) (result v128)
+ (func $i16x8.widen_high_i8x16_s (; 158 ;) (type $14) (param $0 v128) (result v128)
(i16x8.widen_high_i8x16_s
(local.get $0)
)
)
- (func $i16x8.widen_low_i8x16_u (; 155 ;) (type $14) (param $0 v128) (result v128)
+ (func $i16x8.widen_low_i8x16_u (; 159 ;) (type $14) (param $0 v128) (result v128)
(i16x8.widen_low_i8x16_u
(local.get $0)
)
)
- (func $i16x8.widen_high_i8x16_u (; 156 ;) (type $14) (param $0 v128) (result v128)
+ (func $i16x8.widen_high_i8x16_u (; 160 ;) (type $14) (param $0 v128) (result v128)
(i16x8.widen_high_i8x16_u
(local.get $0)
)
)
- (func $i32x4.widen_low_i16x8_s (; 157 ;) (type $14) (param $0 v128) (result v128)
+ (func $i32x4.widen_low_i16x8_s (; 161 ;) (type $14) (param $0 v128) (result v128)
(i32x4.widen_low_i16x8_s
(local.get $0)
)
)
- (func $i32x4.widen_high_i16x8_s (; 158 ;) (type $14) (param $0 v128) (result v128)
+ (func $i32x4.widen_high_i16x8_s (; 162 ;) (type $14) (param $0 v128) (result v128)
(i32x4.widen_high_i16x8_s
(local.get $0)
)
)
- (func $i32x4.widen_low_i16x8_u (; 159 ;) (type $14) (param $0 v128) (result v128)
+ (func $i32x4.widen_low_i16x8_u (; 163 ;) (type $14) (param $0 v128) (result v128)
(i32x4.widen_low_i16x8_u
(local.get $0)
)
)
- (func $i32x4.widen_high_i16x8_u (; 160 ;) (type $14) (param $0 v128) (result v128)
+ (func $i32x4.widen_high_i16x8_u (; 164 ;) (type $14) (param $0 v128) (result v128)
(i32x4.widen_high_i16x8_u
(local.get $0)
)
)
+ (func $i16x8.load8x8_u (; 165 ;) (type $0) (param $0 i32) (result v128)
+ (i16x8.load8x8_u
+ (local.get $0)
+ )
+ )
+ (func $i16x8.load8x8_s (; 166 ;) (type $0) (param $0 i32) (result v128)
+ (i16x8.load8x8_s
+ (local.get $0)
+ )
+ )
+ (func $i32x4.load16x4_s (; 167 ;) (type $0) (param $0 i32) (result v128)
+ (i32x4.load16x4_s
+ (local.get $0)
+ )
+ )
+ (func $i32x4.load16x4_u (; 168 ;) (type $0) (param $0 i32) (result v128)
+ (i32x4.load16x4_u
+ (local.get $0)
+ )
+ )
+ (func $i64x2.load32x2_s (; 169 ;) (type $0) (param $0 i32) (result v128)
+ (i64x2.load32x2_s
+ (local.get $0)
+ )
+ )
+ (func $i64x2.load32x2_u (; 170 ;) (type $0) (param $0 i32) (result v128)
+ (i64x2.load32x2_u
+ (local.get $0)
+ )
+ )
)
diff --git a/test/simd.wast.fromBinary.noDebugInfo b/test/simd.wast.fromBinary.noDebugInfo
index 032d7a250..a59ca2e5d 100644
--- a/test/simd.wast.fromBinary.noDebugInfo
+++ b/test/simd.wast.fromBinary.noDebugInfo
@@ -856,69 +856,119 @@
(local.get $0)
)
)
- (func $149 (; 149 ;) (type $3) (param $0 v128) (param $1 v128) (result v128)
+ (func $149 (; 149 ;) (type $0) (param $0 i32) (result v128)
+ (v8x16.load_splat
+ (local.get $0)
+ )
+ )
+ (func $150 (; 150 ;) (type $0) (param $0 i32) (result v128)
+ (v16x8.load_splat
+ (local.get $0)
+ )
+ )
+ (func $151 (; 151 ;) (type $0) (param $0 i32) (result v128)
+ (v32x4.load_splat
+ (local.get $0)
+ )
+ )
+ (func $152 (; 152 ;) (type $0) (param $0 i32) (result v128)
+ (v64x2.load_splat
+ (local.get $0)
+ )
+ )
+ (func $153 (; 153 ;) (type $3) (param $0 v128) (param $1 v128) (result v128)
(i8x16.narrow_i16x8_s
(local.get $0)
(local.get $1)
)
)
- (func $150 (; 150 ;) (type $3) (param $0 v128) (param $1 v128) (result v128)
+ (func $154 (; 154 ;) (type $3) (param $0 v128) (param $1 v128) (result v128)
(i8x16.narrow_i16x8_u
(local.get $0)
(local.get $1)
)
)
- (func $151 (; 151 ;) (type $3) (param $0 v128) (param $1 v128) (result v128)
+ (func $155 (; 155 ;) (type $3) (param $0 v128) (param $1 v128) (result v128)
(i16x8.narrow_i32x4_s
(local.get $0)
(local.get $1)
)
)
- (func $152 (; 152 ;) (type $3) (param $0 v128) (param $1 v128) (result v128)
+ (func $156 (; 156 ;) (type $3) (param $0 v128) (param $1 v128) (result v128)
(i16x8.narrow_i32x4_u
(local.get $0)
(local.get $1)
)
)
- (func $153 (; 153 ;) (type $14) (param $0 v128) (result v128)
+ (func $157 (; 157 ;) (type $14) (param $0 v128) (result v128)
(i16x8.widen_low_i8x16_s
(local.get $0)
)
)
- (func $154 (; 154 ;) (type $14) (param $0 v128) (result v128)
+ (func $158 (; 158 ;) (type $14) (param $0 v128) (result v128)
(i16x8.widen_high_i8x16_s
(local.get $0)
)
)
- (func $155 (; 155 ;) (type $14) (param $0 v128) (result v128)
+ (func $159 (; 159 ;) (type $14) (param $0 v128) (result v128)
(i16x8.widen_low_i8x16_u
(local.get $0)
)
)
- (func $156 (; 156 ;) (type $14) (param $0 v128) (result v128)
+ (func $160 (; 160 ;) (type $14) (param $0 v128) (result v128)
(i16x8.widen_high_i8x16_u
(local.get $0)
)
)
- (func $157 (; 157 ;) (type $14) (param $0 v128) (result v128)
+ (func $161 (; 161 ;) (type $14) (param $0 v128) (result v128)
(i32x4.widen_low_i16x8_s
(local.get $0)
)
)
- (func $158 (; 158 ;) (type $14) (param $0 v128) (result v128)
+ (func $162 (; 162 ;) (type $14) (param $0 v128) (result v128)
(i32x4.widen_high_i16x8_s
(local.get $0)
)
)
- (func $159 (; 159 ;) (type $14) (param $0 v128) (result v128)
+ (func $163 (; 163 ;) (type $14) (param $0 v128) (result v128)
(i32x4.widen_low_i16x8_u
(local.get $0)
)
)
- (func $160 (; 160 ;) (type $14) (param $0 v128) (result v128)
+ (func $164 (; 164 ;) (type $14) (param $0 v128) (result v128)
(i32x4.widen_high_i16x8_u
(local.get $0)
)
)
+ (func $165 (; 165 ;) (type $0) (param $0 i32) (result v128)
+ (i16x8.load8x8_u
+ (local.get $0)
+ )
+ )
+ (func $166 (; 166 ;) (type $0) (param $0 i32) (result v128)
+ (i16x8.load8x8_s
+ (local.get $0)
+ )
+ )
+ (func $167 (; 167 ;) (type $0) (param $0 i32) (result v128)
+ (i32x4.load16x4_s
+ (local.get $0)
+ )
+ )
+ (func $168 (; 168 ;) (type $0) (param $0 i32) (result v128)
+ (i32x4.load16x4_u
+ (local.get $0)
+ )
+ )
+ (func $169 (; 169 ;) (type $0) (param $0 i32) (result v128)
+ (i64x2.load32x2_s
+ (local.get $0)
+ )
+ )
+ (func $170 (; 170 ;) (type $0) (param $0 i32) (result v128)
+ (i64x2.load32x2_u
+ (local.get $0)
+ )
+ )
)
diff --git a/test/spec/simd.wast b/test/spec/simd.wast
index 81e679edb..5655fba48 100644
--- a/test/spec/simd.wast
+++ b/test/spec/simd.wast
@@ -1,6 +1,7 @@
(module
(memory 1)
(data (i32.const 128) "WASMSIMDGOESFAST")
+ (data (i32.const 256) "\80\90\a0\b0\c0\d0\e0\f0")
(func (export "v128.load") (param $0 i32) (result v128) (v128.load (local.get $0)))
(func (export "v128.store") (param $0 i32) (param $1 v128) (result v128)
(v128.store offset=0 align=16 (local.get $0) (local.get $1))
@@ -191,6 +192,12 @@
(func (export "i32x4.widen_high_i16x8_s") (param $0 v128) (result v128) (i32x4.widen_high_i16x8_s (local.get $0)))
(func (export "i32x4.widen_low_i16x8_u") (param $0 v128) (result v128) (i32x4.widen_low_i16x8_u (local.get $0)))
(func (export "i32x4.widen_high_i16x8_u") (param $0 v128) (result v128) (i32x4.widen_high_i16x8_u (local.get $0)))
+ (func (export "i16x8.load8x8_u") (param $0 i32) (result v128) (i16x8.load8x8_u (local.get $0)))
+ (func (export "i16x8.load8x8_s") (param $0 i32) (result v128) (i16x8.load8x8_s (local.get $0)))
+ (func (export "i32x4.load16x4_u") (param $0 i32) (result v128) (i32x4.load16x4_u (local.get $0)))
+ (func (export "i32x4.load16x4_s") (param $0 i32) (result v128) (i32x4.load16x4_s (local.get $0)))
+ (func (export "i64x2.load32x2_u") (param $0 i32) (result v128) (i64x2.load32x2_u (local.get $0)))
+ (func (export "i64x2.load32x2_s") (param $0 i32) (result v128) (i64x2.load32x2_s (local.get $0)))
)
;; Basic v128 manipulation
@@ -753,3 +760,9 @@
(assert_return (invoke "i32x4.widen_high_i16x8_s" (v128.const i16x8 0 1 -1 32768 32767 32769 16384 -16384)) (v128.const i32x4 32767 -32767 16384 -16384))
(assert_return (invoke "i32x4.widen_low_i16x8_u" (v128.const i16x8 0 1 -1 32768 32767 32769 16384 -16384)) (v128.const i32x4 0 1 65535 32768))
(assert_return (invoke "i32x4.widen_high_i16x8_u" (v128.const i16x8 0 1 -1 32768 32767 32769 16384 -16384)) (v128.const i32x4 32767 32769 16384 49152))
+(assert_return (invoke "i16x8.load8x8_s" (i32.const 256)) (v128.const i16x8 0xff80 0xff90 0xffa0 0xffb0 0xffc0 0xffd0 0xffe0 0xfff0))
+(assert_return (invoke "i16x8.load8x8_u" (i32.const 256)) (v128.const i16x8 0x0080 0x0090 0x00a0 0x00b0 0x00c0 0x00d0 0x00e0 0x00f0))
+(assert_return (invoke "i32x4.load16x4_s" (i32.const 256)) (v128.const i32x4 0xffff9080 0xffffb0a0 0xffffd0c0 0xfffff0e0))
+(assert_return (invoke "i32x4.load16x4_u" (i32.const 256)) (v128.const i32x4 0x00009080 0x0000b0a0 0x0000d0c0 0x0000f0e0))
+(assert_return (invoke "i64x2.load32x2_s" (i32.const 256)) (v128.const i64x2 0xffffffffb0a09080 0xfffffffff0e0d0c0))
+(assert_return (invoke "i64x2.load32x2_u" (i32.const 256)) (v128.const i64x2 0x00000000b0a09080 0x00000000f0e0d0c0))