Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add relaxed swizzle to overview #24

Merged
merged 1 commit into from
Jun 10, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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