summaryrefslogtreecommitdiff
path: root/test/binaryen.js
diff options
context:
space:
mode:
authorDaniel Wirtz <dcode@dcode.io>2021-04-08 23:50:51 +0200
committerGitHub <noreply@github.com>2021-04-08 23:50:51 +0200
commit0efebfe68cb0e2759b88093e1811d034ef3e8a79 (patch)
treea676971fc2f671ea6817b2e218ef440d7847a827 /test/binaryen.js
parent6921dd30dc82b3df2511def7c941f4a1a9aeeec2 (diff)
downloadbinaryen-0efebfe68cb0e2759b88093e1811d034ef3e8a79.tar.gz
binaryen-0efebfe68cb0e2759b88093e1811d034ef3e8a79.tar.bz2
binaryen-0efebfe68cb0e2759b88093e1811d034ef3e8a79.zip
Add v128.load/storeN_lane SIMD instructions to C/JS API (#3784)
Adds C/JS APIs for the SIMD instructions * Load8LaneVec128 (was LoadLaneVec8x16) * Load16LaneVec128 (was LoadLaneVec16x8) * Load32LaneVec128 (was LoadLaneVec32x4) * Load64LaneVec128 (was LoadLaneVec64x2) * Store8LaneVec128 (was StoreLaneVec8x16) * Store16LaneVec128 (was StoreLaneVec16x8) * Store32LaneVec128 (was StoreLaneVec32x4) * Store64LaneVec128 (was StoreLaneVec64x2)
Diffstat (limited to 'test/binaryen.js')
-rw-r--r--test/binaryen.js/kitchen-sink.js17
-rw-r--r--test/binaryen.js/kitchen-sink.js.txt160
2 files changed, 177 insertions, 0 deletions
diff --git a/test/binaryen.js/kitchen-sink.js b/test/binaryen.js/kitchen-sink.js
index 76193b0bf..0798741cf 100644
--- a/test/binaryen.js/kitchen-sink.js
+++ b/test/binaryen.js/kitchen-sink.js
@@ -517,6 +517,23 @@ function test_core() {
module.v128.load32x2_u(0, 8, module.i32.const(128)),
module.v128.load32_zero(0, 4, module.i32.const(128)),
module.v128.load64_zero(0, 8, module.i32.const(128)),
+ // SIMD load/store lane
+ module.v128.load8_lane(0, 1, 0, module.i32.const(128), module.v128.const(v128_bytes)),
+ module.v128.load8_lane(1, 1, 15, module.i32.const(128), module.v128.const(v128_bytes)),
+ module.v128.load16_lane(0, 2, 0, module.i32.const(128), module.v128.const(v128_bytes)),
+ module.v128.load16_lane(2, 1, 7, module.i32.const(128), module.v128.const(v128_bytes)),
+ module.v128.load32_lane(0, 4, 0, module.i32.const(128), module.v128.const(v128_bytes)),
+ module.v128.load32_lane(4, 2, 3, module.i32.const(128), module.v128.const(v128_bytes)),
+ module.v128.load64_lane(0, 8, 0, module.i32.const(128), module.v128.const(v128_bytes)),
+ module.v128.load64_lane(8, 4, 1, module.i32.const(128), module.v128.const(v128_bytes)),
+ module.v128.store8_lane(0, 1, 0, module.i32.const(128), module.v128.const(v128_bytes)),
+ module.v128.store8_lane(1, 1, 15, module.i32.const(128), module.v128.const(v128_bytes)),
+ module.v128.store16_lane(0, 2, 0, module.i32.const(128), module.v128.const(v128_bytes)),
+ module.v128.store16_lane(2, 1, 7, module.i32.const(128), module.v128.const(v128_bytes)),
+ module.v128.store32_lane(0, 4, 0, module.i32.const(128), module.v128.const(v128_bytes)),
+ module.v128.store32_lane(4, 2, 3, module.i32.const(128), module.v128.const(v128_bytes)),
+ module.v128.store64_lane(0, 8, 0, module.i32.const(128), module.v128.const(v128_bytes)),
+ module.v128.store64_lane(8, 4, 1, module.i32.const(128), module.v128.const(v128_bytes)),
// Other SIMD
module.i8x16.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 c835fe299..623a8207c 100644
--- a/test/binaryen.js/kitchen-sink.js.txt
+++ b/test/binaryen.js/kitchen-sink.js.txt
@@ -1812,6 +1812,86 @@ getExpressionInfo(tuple[3])={"id":14,"type":5,"value":3.7}
)
)
(drop
+ (v128.load8_lane 0
+ (i32.const 128)
+ (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d)
+ )
+ )
+ (drop
+ (v128.load8_lane offset=1 15
+ (i32.const 128)
+ (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d)
+ )
+ )
+ (drop
+ (v128.load16_lane 0
+ (i32.const 128)
+ (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d)
+ )
+ )
+ (drop
+ (v128.load16_lane offset=2 align=1 7
+ (i32.const 128)
+ (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d)
+ )
+ )
+ (drop
+ (v128.load32_lane 0
+ (i32.const 128)
+ (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d)
+ )
+ )
+ (drop
+ (v128.load32_lane offset=4 align=2 3
+ (i32.const 128)
+ (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d)
+ )
+ )
+ (drop
+ (v128.load64_lane 0
+ (i32.const 128)
+ (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d)
+ )
+ )
+ (drop
+ (v128.load64_lane offset=8 align=4 1
+ (i32.const 128)
+ (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d)
+ )
+ )
+ (v128.store8_lane 0
+ (i32.const 128)
+ (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d)
+ )
+ (v128.store8_lane offset=1 15
+ (i32.const 128)
+ (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d)
+ )
+ (v128.store16_lane 0
+ (i32.const 128)
+ (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d)
+ )
+ (v128.store16_lane offset=2 align=1 7
+ (i32.const 128)
+ (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d)
+ )
+ (v128.store32_lane 0
+ (i32.const 128)
+ (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d)
+ )
+ (v128.store32_lane offset=4 align=2 3
+ (i32.const 128)
+ (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d)
+ )
+ (v128.store64_lane 0
+ (i32.const 128)
+ (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d)
+ )
+ (v128.store64_lane offset=8 align=4 1
+ (i32.const 128)
+ (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d)
+ )
+ (drop
(i8x16.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)
@@ -3824,6 +3904,86 @@ getExpressionInfo(tuple[3])={"id":14,"type":5,"value":3.7}
)
)
(drop
+ (v128.load8_lane 0
+ (i32.const 128)
+ (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d)
+ )
+ )
+ (drop
+ (v128.load8_lane offset=1 15
+ (i32.const 128)
+ (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d)
+ )
+ )
+ (drop
+ (v128.load16_lane 0
+ (i32.const 128)
+ (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d)
+ )
+ )
+ (drop
+ (v128.load16_lane offset=2 align=1 7
+ (i32.const 128)
+ (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d)
+ )
+ )
+ (drop
+ (v128.load32_lane 0
+ (i32.const 128)
+ (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d)
+ )
+ )
+ (drop
+ (v128.load32_lane offset=4 align=2 3
+ (i32.const 128)
+ (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d)
+ )
+ )
+ (drop
+ (v128.load64_lane 0
+ (i32.const 128)
+ (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d)
+ )
+ )
+ (drop
+ (v128.load64_lane offset=8 align=4 1
+ (i32.const 128)
+ (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d)
+ )
+ )
+ (v128.store8_lane 0
+ (i32.const 128)
+ (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d)
+ )
+ (v128.store8_lane offset=1 15
+ (i32.const 128)
+ (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d)
+ )
+ (v128.store16_lane 0
+ (i32.const 128)
+ (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d)
+ )
+ (v128.store16_lane offset=2 align=1 7
+ (i32.const 128)
+ (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d)
+ )
+ (v128.store32_lane 0
+ (i32.const 128)
+ (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d)
+ )
+ (v128.store32_lane offset=4 align=2 3
+ (i32.const 128)
+ (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d)
+ )
+ (v128.store64_lane 0
+ (i32.const 128)
+ (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d)
+ )
+ (v128.store64_lane offset=8 align=4 1
+ (i32.const 128)
+ (v128.const i32x4 0x04030201 0x08070605 0x0c0b0a09 0x100f0e0d)
+ )
+ (drop
(i8x16.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)