Skip to content

Commit e24b7a7

Browse files
committed
WebAssembly#372 Integer Sign/Zero Extension
1 parent d154084 commit e24b7a7

File tree

3 files changed

+34
-0
lines changed

3 files changed

+34
-0
lines changed

proposals/simd/BinarySIMD.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,3 +225,9 @@ For example, `ImmLaneIdx16` is a byte with values in the range 0-15 (inclusive).
225225
| `f32x4.convert_i32x4_u` | `0xfb`| - |
226226
| `v128.load32_zero` | `0xfc`| - |
227227
| `v128.load64_zero` | `0xfd`| - |
228+
| `i32x4.widen_i8x16_u` | | - |
229+
| `i32x4.widen_i8x16_s` | | - |
230+
| `i64x2.widen_i8x16_u` | | - |
231+
| `i64x2.widen_i8x16_s` | | - |
232+
| `i64x2.widen_i16x8_u` | | - |
233+
| `i64x2.widen_i16x8_s` | | - |

proposals/simd/ImplementationStatus.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,12 @@
193193
| `f32x4.convert_i32x4_u` | `-msimd128` | :heavy_check_mark: | | | :heavy_check_mark: |
194194
| `v128.load32_zero` | | :heavy_check_mark: | | | :heavy_check_mark: |
195195
| `v128.load64_zero` | | :heavy_check_mark: | | | :heavy_check_mark: |
196+
| `i32x4.widen_i8x16_u` | | - | | | |
197+
| `i32x4.widen_i8x16_s` | | - | | | |
198+
| `i64x2.widen_i8x16_u` | | - | | | |
199+
| `i64x2.widen_i8x16_s` | | - | | | |
200+
| `i64x2.widen_i16x8_u` | | - | | | |
201+
| `i64x2.widen_i16x8_s` | | - | | | |
196202

197203
[1] Tip of tree LLVM as of May 20, 2020
198204

proposals/simd/SIMD.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1046,3 +1046,25 @@ def S.widen_low_T_u(a):
10461046
def S.widen_high_T_u(a):
10471047
return S.widen_high_T(Zext, a)
10481048
```
1049+
### Integer to integer Widening (Constant Immediate)
1050+
* `i32x4.widen_i8x16_u(v128: a, ImmLaneIdx4: c) -> v128`
1051+
* `i32x4.widen_i8x16_s(v128: a, ImmLaneIdx4: c) -> v128`
1052+
* `i64x2.widen_i8x16_u(v128: a, ImmLaneIdx8: c) -> v128`
1053+
* `i64x2.widen_i8x16_s(v128: a, ImmLaneIdx8: c) -> v128`
1054+
* `i64x2.widen_i16x8_u(v128: a, ImmLaneIdx4: c) -> v128`
1055+
* `i64x2.widen_i16x8_s(v128: a, ImmLaneIdx4: c) -> v128`
1056+
1057+
Using the constant immediate, widens selected integers with zero or sign extension.
1058+
```python
1059+
def S.widen_T_u(a,c):
1060+
result = S.New()
1061+
for i in range(S.Lanes):
1062+
result[i] = Zext(a[S.Lanes + i + c])
1063+
return result
1064+
1065+
def S.widen_T_s(a,c):
1066+
result = S.New()
1067+
for i in range(S.Lanes):
1068+
result[i] = Sext(a[S.Lanes + i + c])
1069+
return result
1070+
```

0 commit comments

Comments
 (0)