From 408027c1d518ed078964f223e8d01fdb361c445f Mon Sep 17 00:00:00 2001 From: Richard Winterton Date: Fri, 3 May 2019 10:01:33 -0700 Subject: [PATCH 1/3] Introduce Load and Extend Incorporate review suggestions from WebAssembly/simd#77 --- proposals/simd/BinarySIMD.md | 30 +++++++++++++++----------- proposals/simd/ImplementationStatus.md | 6 ++++++ proposals/simd/SIMD.md | 11 ++++++++++ 3 files changed, 35 insertions(+), 12 deletions(-) diff --git a/proposals/simd/BinarySIMD.md b/proposals/simd/BinarySIMD.md index 80514f913..78bfd4b80 100644 --- a/proposals/simd/BinarySIMD.md +++ b/proposals/simd/BinarySIMD.md @@ -172,15 +172,21 @@ The `v8x16.shuffle` instruction has 16 bytes after `simdop`. | `v16x8.load_splat` | `0xc3`| - | | `v32x4.load_splat` | `0xc4`| - | | `v64x2.load_splat` | `0xc5`| - | -| `i8x16.narrow_i16x8_s` | `0xc6`| - | -| `i8x16.narrow_i16x8_u` | `0xc7`| - | -| `i16x8.narrow_i32x4_s` | `0xc8`| - | -| `i16x8.narrow_i32x4_u` | `0xc9`| - | -| `i16x8.widen_low_i8x16_s` | `0xca`| - | -| `i16x8.widen_high_i8x16_s` | `0xcb`| - | -| `i16x8.widen_low_i8x16_u` | `0xcc`| - | -| `i16x8.widen_high_i8x16_u` | `0xcd`| - | -| `i32x4.widen_low_i16x8_s` | `0xce`| - | -| `i32x4.widen_high_i16x8_s` | `0xcf`| - | -| `i32x4.widen_low_i16x8_u` | `0xd0`| - | -| `i32x4.widen_high_i16x8_u` | `0xd1`| - | +| `i16x8.load8x8_u` | `0xc6`| m:memarg | +| `i16x8.load8x8_s` | `0xc7`| m:memarg | +| `i32x4.load16x4_u` | `0xc8`| m:memarg | +| `i32x4.load16x4_s` | `0xc9`| m:memarg | +| `i64x2.load32x2_u` | `0xca`| m:memarg | +| `i64x2.load32x2_s` | `0xcb`| m:memarg | +| `i8x16.narrow_i16x8_s` | `0xcc`| - | +| `i8x16.narrow_i16x8_u` | `0xcd`| - | +| `i16x8.narrow_i32x4_s` | `0xce`| - | +| `i16x8.narrow_i32x4_u` | `0xcf`| - | +| `i16x8.widen_low_i8x16_s` | `0xd0`| - | +| `i16x8.widen_high_i8x16_s` | `0xd1`| - | +| `i16x8.widen_low_i8x16_u` | `0xd2`| - | +| `i16x8.widen_high_i8x16_u` | `0xd3`| - | +| `i32x4.widen_low_i16x8_s` | `0xd4`| - | +| `i32x4.widen_high_i16x8_s` | `0xd5`| - | +| `i32x4.widen_low_i16x8_u` | `0xd6`| - | +| `i32x4.widen_high_i16x8_u` | `0xd7`| - | diff --git a/proposals/simd/ImplementationStatus.md b/proposals/simd/ImplementationStatus.md index 7ef69ec39..8128f3e06 100644 --- a/proposals/simd/ImplementationStatus.md +++ b/proposals/simd/ImplementationStatus.md @@ -145,6 +145,12 @@ | `f64x2.convert_u/i64x2` | `-munimplemented-simd128` | | :heavy_check_mark: | :heavy_check_mark: | | `v8x16.swizzle` | | | :heavy_check_mark: | | | `v8x16.shuffle` | | | :heavy_check_mark: | :heavy_check_mark: | +| `i16x8.load8x8_u` | | | | | +| `i16x8.load8x8_s` | | | | | +| `i32x4.load16x4_u` | | | | | +| `i32x4.load16x4_s` | | | | | +| `i64x2.load32x2_u` | | | | | +| `i64x2.load32x2_s` | | | | | | `i8x16.narrow_i16x8_s` | | :heavy_check_mark: | :heavy_check_mark: | | | `i8x16.narrow_i16x8_u` | | :heavy_check_mark: | :heavy_check_mark: | | | `i16x8.narrow_i32x4_s` | | :heavy_check_mark: | :heavy_check_mark: | | diff --git a/proposals/simd/SIMD.md b/proposals/simd/SIMD.md index c8a4f0a23..6a53bfd4d 100644 --- a/proposals/simd/SIMD.md +++ b/proposals/simd/SIMD.md @@ -675,6 +675,17 @@ Load a `v128` vector from the given heap address. Load a single element and splat to all lanes of a `v128` vector. +### Load and Extend + +* `i16x8.load8x8_u(memarg) -> v128`: load eight 8-bit integers and zero extend each one to a 16-bit lane +* `i16x8.load8x8_s(memarg) -> v128`: load eight 8-bit integers and sign extend each one to a 16-bit lane +* `i32x4.load16x4_u(memarg) -> v128`: load four 16-bit integers and zero extend each one to a 32-bit lane +* `i32x4.load16x4_s(memarg) -> v128`: load four 16-bit integers and sign extend each one to a 32-bit lane +* `i64x2.load32x2_u(memarg) -> v128`: load two 32-bit integers and zero extend each one to a 64-bit lane +* `i64x2.load32x2_s(memarg) -> v128`: load two 32-bit integers and sign extend each one to a 64-bit lane + +Fetch consequtive integers up to 32-bit wide and produce a vector with lanes up to 64 bits. + ### Store * `v128.store(memarg, data: v128)` From 0e992791363622e8a36c1101f1e96752c8a1527a Mon Sep 17 00:00:00 2001 From: Petr Penzin Date: Tue, 3 Sep 2019 15:21:57 -0700 Subject: [PATCH 2/3] Move extended loads to the bottom of opcode list --- proposals/simd/BinarySIMD.md | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/proposals/simd/BinarySIMD.md b/proposals/simd/BinarySIMD.md index 78bfd4b80..4344e1c93 100644 --- a/proposals/simd/BinarySIMD.md +++ b/proposals/simd/BinarySIMD.md @@ -172,21 +172,21 @@ The `v8x16.shuffle` instruction has 16 bytes after `simdop`. | `v16x8.load_splat` | `0xc3`| - | | `v32x4.load_splat` | `0xc4`| - | | `v64x2.load_splat` | `0xc5`| - | -| `i16x8.load8x8_u` | `0xc6`| m:memarg | -| `i16x8.load8x8_s` | `0xc7`| m:memarg | -| `i32x4.load16x4_u` | `0xc8`| m:memarg | -| `i32x4.load16x4_s` | `0xc9`| m:memarg | -| `i64x2.load32x2_u` | `0xca`| m:memarg | -| `i64x2.load32x2_s` | `0xcb`| m:memarg | -| `i8x16.narrow_i16x8_s` | `0xcc`| - | -| `i8x16.narrow_i16x8_u` | `0xcd`| - | -| `i16x8.narrow_i32x4_s` | `0xce`| - | -| `i16x8.narrow_i32x4_u` | `0xcf`| - | -| `i16x8.widen_low_i8x16_s` | `0xd0`| - | -| `i16x8.widen_high_i8x16_s` | `0xd1`| - | -| `i16x8.widen_low_i8x16_u` | `0xd2`| - | -| `i16x8.widen_high_i8x16_u` | `0xd3`| - | -| `i32x4.widen_low_i16x8_s` | `0xd4`| - | -| `i32x4.widen_high_i16x8_s` | `0xd5`| - | -| `i32x4.widen_low_i16x8_u` | `0xd6`| - | -| `i32x4.widen_high_i16x8_u` | `0xd7`| - | +| `i8x16.narrow_i16x8_s` | `0xc6`| - | +| `i8x16.narrow_i16x8_u` | `0xc7`| - | +| `i16x8.narrow_i32x4_s` | `0xc8`| - | +| `i16x8.narrow_i32x4_u` | `0xc9`| - | +| `i16x8.widen_low_i8x16_s` | `0xca`| - | +| `i16x8.widen_high_i8x16_s` | `0xcb`| - | +| `i16x8.widen_low_i8x16_u` | `0xcc`| - | +| `i16x8.widen_high_i8x16_u` | `0xcd`| - | +| `i32x4.widen_low_i16x8_s` | `0xce`| - | +| `i32x4.widen_high_i16x8_s` | `0xcf`| - | +| `i32x4.widen_low_i16x8_u` | `0xd0`| - | +| `i32x4.widen_high_i16x8_u` | `0xd1`| - | +| `i16x8.load8x8_u` | `0xd2`| m:memarg | +| `i16x8.load8x8_s` | `0xd3`| m:memarg | +| `i32x4.load16x4_u` | `0xd4`| m:memarg | +| `i32x4.load16x4_s` | `0xd5`| m:memarg | +| `i64x2.load32x2_u` | `0xd6`| m:memarg | +| `i64x2.load32x2_s` | `0xd7`| m:memarg | From 075c14a643d15d20f7a148a4d5033abeaf557551 Mon Sep 17 00:00:00 2001 From: Petr Penzin Date: Tue, 10 Sep 2019 14:00:06 -0700 Subject: [PATCH 3/3] Remove i8x16.mul Consensus for the removal is documented in WebAssembly/simd#28 and WebAssembly/simd#98. --- proposals/simd/BinarySIMD.md | 1 - proposals/simd/ImplementationStatus.md | 1 - proposals/simd/SIMD.md | 1 - 3 files changed, 3 deletions(-) diff --git a/proposals/simd/BinarySIMD.md b/proposals/simd/BinarySIMD.md index 4344e1c93..a9a589720 100644 --- a/proposals/simd/BinarySIMD.md +++ b/proposals/simd/BinarySIMD.md @@ -109,7 +109,6 @@ The `v8x16.shuffle` instruction has 16 bytes after `simdop`. | `i8x16.sub` | `0x5a`| - | | `i8x16.sub_saturate_s` | `0x5b`| - | | `i8x16.sub_saturate_u` | `0x5c`| - | -| `i8x16.mul` | `0x5d`| - | | `i16x8.neg` | `0x62`| - | | `i16x8.any_true` | `0x63`| - | | `i16x8.all_true` | `0x64`| - | diff --git a/proposals/simd/ImplementationStatus.md b/proposals/simd/ImplementationStatus.md index 8128f3e06..3ced5d861 100644 --- a/proposals/simd/ImplementationStatus.md +++ b/proposals/simd/ImplementationStatus.md @@ -86,7 +86,6 @@ | `i8x16.sub` | `-msimd128` | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | | `i8x16.sub_saturate_s` | `-msimd128` | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | | `i8x16.sub_saturate_u` | `-msimd128` | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | -| `i8x16.mul` | `-msimd128` | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | | `i16x8.neg` | `-msimd128` | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | | `i16x8.any_true` | `-msimd128` | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | | `i16x8.all_true` | `-msimd128` | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | diff --git a/proposals/simd/SIMD.md b/proposals/simd/SIMD.md index 6a53bfd4d..04c700092 100644 --- a/proposals/simd/SIMD.md +++ b/proposals/simd/SIMD.md @@ -367,7 +367,6 @@ def S.sub(a, b): ``` ### Integer multiplication -* `i8x16.mul(a: v128, b: v128) -> v128` * `i16x8.mul(a: v128, b: v128) -> v128` * `i32x4.mul(a: v128, b: v128) -> v128`