summaryrefslogtreecommitdiff
path: root/test/example
diff options
context:
space:
mode:
authorDaniel Wirtz <dcode@dcode.io>2021-04-07 23:04:20 +0200
committerGitHub <noreply@github.com>2021-04-07 23:04:20 +0200
commit2f2d5a80197b837aea928a0a604a13cc1c74219b (patch)
tree7f2edb11c605b80f7b093f984b0fe9d7d78e2c7d /test/example
parentb3484a7a44de4d46b0fec598074ca3f8b33a293c (diff)
downloadbinaryen-2f2d5a80197b837aea928a0a604a13cc1c74219b.tar.gz
binaryen-2f2d5a80197b837aea928a0a604a13cc1c74219b.tar.bz2
binaryen-2f2d5a80197b837aea928a0a604a13cc1c74219b.zip
Add various SIMD instructions to C/JS API (#3777)
Adds C/JS APIs for the SIMD instructions * PopcntVecI8x16 * AbsVecI64x2 * AllTrueVecI64x2 * BitmaskVecI64x2 * EqVecI64x2 * NeVecI64x2 * LtSVecI64x2 * GtSVecI64x2 * LeSVecI64x2 * GeSVecI64x2
Diffstat (limited to 'test/example')
-rw-r--r--test/example/c-api-kitchen-sink.c10
-rw-r--r--test/example/c-api-kitchen-sink.txt56
2 files changed, 66 insertions, 0 deletions
diff --git a/test/example/c-api-kitchen-sink.c b/test/example/c-api-kitchen-sink.c
index e4e8c37b0..abc5e1489 100644
--- a/test/example/c-api-kitchen-sink.c
+++ b/test/example/c-api-kitchen-sink.c
@@ -404,6 +404,7 @@ void test_core() {
makeUnary(module, BinaryenSplatVecF64x2(), f64),
makeUnary(module, BinaryenNotVec128(), v128),
makeUnary(module, BinaryenAnyTrueVec128(), v128),
+ makeUnary(module, BinaryenPopcntVecI8x16(), v128),
makeUnary(module, BinaryenAbsVecI8x16(), v128),
makeUnary(module, BinaryenNegVecI8x16(), v128),
makeUnary(module, BinaryenAllTrueVecI8x16(), v128),
@@ -416,7 +417,10 @@ void test_core() {
makeUnary(module, BinaryenNegVecI32x4(), v128),
makeUnary(module, BinaryenAllTrueVecI32x4(), v128),
makeUnary(module, BinaryenBitmaskVecI32x4(), v128),
+ makeUnary(module, BinaryenAbsVecI64x2(), v128),
makeUnary(module, BinaryenNegVecI64x2(), v128),
+ makeUnary(module, BinaryenAllTrueVecI64x2(), v128),
+ makeUnary(module, BinaryenBitmaskVecI64x2(), v128),
makeUnary(module, BinaryenAbsVecF32x4(), v128),
makeUnary(module, BinaryenNegVecF32x4(), v128),
makeUnary(module, BinaryenSqrtVecF32x4(), v128),
@@ -498,6 +502,12 @@ void test_core() {
makeBinary(module, BinaryenLeUVecI32x4(), v128),
makeBinary(module, BinaryenGeSVecI32x4(), v128),
makeBinary(module, BinaryenGeUVecI32x4(), v128),
+ makeBinary(module, BinaryenEqVecI64x2(), v128),
+ makeBinary(module, BinaryenNeVecI64x2(), v128),
+ makeBinary(module, BinaryenLtSVecI64x2(), v128),
+ makeBinary(module, BinaryenGtSVecI64x2(), v128),
+ makeBinary(module, BinaryenLeSVecI64x2(), v128),
+ makeBinary(module, BinaryenGeSVecI64x2(), v128),
makeBinary(module, BinaryenEqVecF32x4(), v128),
makeBinary(module, BinaryenNeVecF32x4(), v128),
makeBinary(module, BinaryenLtVecF32x4(), v128),
diff --git a/test/example/c-api-kitchen-sink.txt b/test/example/c-api-kitchen-sink.txt
index e67850376..8bf0c770a 100644
--- a/test/example/c-api-kitchen-sink.txt
+++ b/test/example/c-api-kitchen-sink.txt
@@ -317,6 +317,11 @@ BinaryenFeatureAll: 8191
)
)
(drop
+ (i8x16.popcnt
+ (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d)
+ )
+ )
+ (drop
(i8x16.abs
(v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d)
)
@@ -377,11 +382,26 @@ BinaryenFeatureAll: 8191
)
)
(drop
+ (i64x2.abs
+ (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d)
+ )
+ )
+ (drop
(i64x2.neg
(v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d)
)
)
(drop
+ (i64x2.all_true
+ (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d)
+ )
+ )
+ (drop
+ (i64x2.bitmask
+ (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d)
+ )
+ )
+ (drop
(f32x4.abs
(v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d)
)
@@ -844,6 +864,42 @@ BinaryenFeatureAll: 8191
)
)
(drop
+ (i64x2.eq
+ (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d)
+ (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d)
+ )
+ )
+ (drop
+ (i64x2.ne
+ (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d)
+ (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d)
+ )
+ )
+ (drop
+ (i64x2.lt_s
+ (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d)
+ (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d)
+ )
+ )
+ (drop
+ (i64x2.gt_s
+ (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d)
+ (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d)
+ )
+ )
+ (drop
+ (i64x2.le_s
+ (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d)
+ (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d)
+ )
+ )
+ (drop
+ (i64x2.ge_s
+ (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d)
+ (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d)
+ )
+ )
+ (drop
(f32x4.eq
(v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d)
(v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d)