From 0efebfe68cb0e2759b88093e1811d034ef3e8a79 Mon Sep 17 00:00:00 2001 From: Daniel Wirtz Date: Thu, 8 Apr 2021 23:50:51 +0200 Subject: 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) --- test/binaryen.js/kitchen-sink.js | 17 ++++ test/binaryen.js/kitchen-sink.js.txt | 160 +++++++++++++++++++++++++++++++++++ 2 files changed, 177 insertions(+) (limited to 'test/binaryen.js') 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 @@ -1811,6 +1811,86 @@ getExpressionInfo(tuple[3])={"id":14,"type":5,"value":3.7} (i32.const 128) ) ) + (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) @@ -3823,6 +3903,86 @@ getExpressionInfo(tuple[3])={"id":14,"type":5,"value":3.7} (i32.const 128) ) ) + (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) -- cgit v1.2.3