summaryrefslogtreecommitdiff
path: root/test/example/c-api-kitchen-sink.c
diff options
context:
space:
mode:
authorThomas Lively <7121787+tlively@users.noreply.github.com>2019-09-23 18:15:14 -0700
committerGitHub <noreply@github.com>2019-09-23 18:15:14 -0700
commit835581f58eb5040656243f7345ebcacf6d7deee5 (patch)
treed5f8878015be2edcdf3d69306c0a8bc20ecd9bf6 /test/example/c-api-kitchen-sink.c
parentfb217c80c6d9c4b52d90571c435fc52dc868df47 (diff)
downloadbinaryen-835581f58eb5040656243f7345ebcacf6d7deee5.tar.gz
binaryen-835581f58eb5040656243f7345ebcacf6d7deee5.tar.bz2
binaryen-835581f58eb5040656243f7345ebcacf6d7deee5.zip
vNxM.load_splat instructions (#2350)
Introduces a new instruction class, `SIMDLoad`. Implements encoding, decoding, parsing, printing, and interpretation of the load and splat instructions, including in the C and JS APIs. `v128.load` remains in the `Load` instruction class for now because the interpreter code expects a `Load` to be able to load any memory value type.
Diffstat (limited to 'test/example/c-api-kitchen-sink.c')
-rw-r--r--test/example/c-api-kitchen-sink.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/test/example/c-api-kitchen-sink.c b/test/example/c-api-kitchen-sink.c
index 1c45b90b5..ae037a14d 100644
--- a/test/example/c-api-kitchen-sink.c
+++ b/test/example/c-api-kitchen-sink.c
@@ -1,4 +1,3 @@
-
// We always need asserts here
#ifdef NDEBUG
#undef NDEBUG
@@ -482,6 +481,15 @@ void test_core() {
makeSIMDShift(module, BinaryenShlVecI64x2()),
makeSIMDShift(module, BinaryenShrSVecI64x2()),
makeSIMDShift(module, BinaryenShrUVecI64x2()),
+ // SIMD load
+ BinaryenSIMDLoad(
+ module, BinaryenLoadSplatVec8x16(), 0, 1, makeInt32(module, 128)),
+ BinaryenSIMDLoad(
+ module, BinaryenLoadSplatVec16x8(), 16, 1, makeInt32(module, 128)),
+ BinaryenSIMDLoad(
+ module, BinaryenLoadSplatVec32x4(), 16, 4, makeInt32(module, 128)),
+ BinaryenSIMDLoad(
+ module, BinaryenLoadSplatVec64x2(), 0, 4, makeInt32(module, 128)),
// Other SIMD
makeSIMDShuffle(module),
makeSIMDTernary(module, BinaryenBitselectVec128()),