diff options
author | Daniel Wirtz <dcode@dcode.io> | 2021-04-07 23:04:20 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-07 23:04:20 +0200 |
commit | 2f2d5a80197b837aea928a0a604a13cc1c74219b (patch) | |
tree | 7f2edb11c605b80f7b093f984b0fe9d7d78e2c7d /test | |
parent | b3484a7a44de4d46b0fec598074ca3f8b33a293c (diff) | |
download | binaryen-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')
-rw-r--r-- | test/binaryen.js/kitchen-sink.js | 10 | ||||
-rw-r--r-- | test/binaryen.js/kitchen-sink.js.txt | 112 | ||||
-rw-r--r-- | test/example/c-api-kitchen-sink.c | 10 | ||||
-rw-r--r-- | test/example/c-api-kitchen-sink.txt | 56 |
4 files changed, 188 insertions, 0 deletions
diff --git a/test/binaryen.js/kitchen-sink.js b/test/binaryen.js/kitchen-sink.js index cb2cd32ff..5e70b0072 100644 --- a/test/binaryen.js/kitchen-sink.js +++ b/test/binaryen.js/kitchen-sink.js @@ -266,6 +266,7 @@ function test_core() { module.f64x2.splat(module.f64.const(42.0)), module.v128.not(module.v128.const(v128_bytes)), module.v128.any_true(module.v128.const(v128_bytes)), + module.i8x16.popcnt(module.v128.const(v128_bytes)), module.i8x16.abs(module.v128.const(v128_bytes)), module.i8x16.neg(module.v128.const(v128_bytes)), module.i8x16.all_true(module.v128.const(v128_bytes)), @@ -278,7 +279,10 @@ function test_core() { module.i32x4.neg(module.v128.const(v128_bytes)), module.i32x4.all_true(module.v128.const(v128_bytes)), module.i32x4.bitmask(module.v128.const(v128_bytes)), + module.i64x2.abs(module.v128.const(v128_bytes)), module.i64x2.neg(module.v128.const(v128_bytes)), + module.i64x2.all_true(module.v128.const(v128_bytes)), + module.i64x2.bitmask(module.v128.const(v128_bytes)), module.f32x4.abs(module.v128.const(v128_bytes)), module.f32x4.neg(module.v128.const(v128_bytes)), module.f32x4.sqrt(module.v128.const(v128_bytes)), @@ -360,6 +364,12 @@ function test_core() { module.i32x4.le_u(module.v128.const(v128_bytes), module.v128.const(v128_bytes)), module.i32x4.ge_s(module.v128.const(v128_bytes), module.v128.const(v128_bytes)), module.i32x4.ge_u(module.v128.const(v128_bytes), module.v128.const(v128_bytes)), + module.i64x2.eq(module.v128.const(v128_bytes), module.v128.const(v128_bytes)), + module.i64x2.ne(module.v128.const(v128_bytes), module.v128.const(v128_bytes)), + module.i64x2.lt_s(module.v128.const(v128_bytes), module.v128.const(v128_bytes)), + module.i64x2.gt_s(module.v128.const(v128_bytes), module.v128.const(v128_bytes)), + module.i64x2.le_s(module.v128.const(v128_bytes), module.v128.const(v128_bytes)), + module.i64x2.ge_s(module.v128.const(v128_bytes), module.v128.const(v128_bytes)), module.f32x4.eq(module.v128.const(v128_bytes), module.v128.const(v128_bytes)), module.f32x4.ne(module.v128.const(v128_bytes), module.v128.const(v128_bytes)), module.f32x4.lt(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 9d97b6523..8d7ccdbca 100644 --- a/test/binaryen.js/kitchen-sink.js.txt +++ b/test/binaryen.js/kitchen-sink.js.txt @@ -407,6 +407,11 @@ getExpressionInfo(tuple[3])={"id":14,"type":5,"value":3.7} ) ) (drop + (i8x16.popcnt + (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) + ) + ) + (drop (i8x16.abs (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) ) @@ -467,11 +472,26 @@ getExpressionInfo(tuple[3])={"id":14,"type":5,"value":3.7} ) ) (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) ) @@ -934,6 +954,42 @@ getExpressionInfo(tuple[3])={"id":14,"type":5,"value":3.7} ) ) (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) @@ -2205,6 +2261,11 @@ getExpressionInfo(tuple[3])={"id":14,"type":5,"value":3.7} ) ) (drop + (i8x16.popcnt + (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) + ) + ) + (drop (i8x16.abs (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d) ) @@ -2265,11 +2326,26 @@ getExpressionInfo(tuple[3])={"id":14,"type":5,"value":3.7} ) ) (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) ) @@ -2732,6 +2808,42 @@ getExpressionInfo(tuple[3])={"id":14,"type":5,"value":3.7} ) ) (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) 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) |