Skip to content

Commit

Permalink
Add relaxed swizzle to overview (#24)
Browse files Browse the repository at this point in the history
  • Loading branch information
ngzhian authored Jun 10, 2021
1 parent 023ce40 commit e71547e
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion proposals/relaxed-simd/Overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,22 @@ same results when given the same inputs.

## Instructions

> This is a placeholder for instructions that this proposal adds.
### Relaxed swizzle

- `relaxed i8x16.swizzle(a : v128, s : v128) -> v128`

`relaxed i8x16.swizzle(a, s)` selects lanes from `a` using indices in `s`, indices in the range `[0,15]` will select the `i`-th element of `a`, the result for any out of range indices is implementation-defined (i.e. if the index is `[16-255]`.

```python
def relaxed_i8x16_swizzle(a, s):
result = []
for i in range(16):
if s[i] < 16:
result[i] = a[s[i]]
else:
result[i] = UNDEFINED
return result
```

## Binary format

Expand Down

0 comments on commit e71547e

Please sign in to comment.