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

Rename to laneselect #41

Merged
merged 1 commit into from
Oct 5, 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
20 changes: 10 additions & 10 deletions proposals/relaxed-simd/Overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -182,17 +182,17 @@ where:
- the intermediate `b * c` is be rounded first, and the final result rounded again (for a total of 2 roundings), or
- the the entire expression evaluated with higher precision and then only rounded once (if supported by hardware).

### Relaxed bitselect (blend/laneselect)
### Relaxed laneselect
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest just "laneselect", without "relaxed"

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The relaxed isn't really part of the name, plus the names aren't confirmed. I can file an issue for this. I think the instruction names should reflect this non-determinism, it doesn't have to be "relaxed".


- `i8x16.blend(a: v128, b: v128, m: v128) -> v128`
- `i16x8.blend(a: v128, b: v128, m: v128) -> v128`
- `i32x4.blend(a: v128, b: v128, m: v128) -> v128`
- `i64x2.blend(a: v128, b: v128, m: v128) -> v128`
- `i8x16.laneselect(a: v128, b: v128, m: v128) -> v128`
- `i16x8.laneselect(a: v128, b: v128, m: v128) -> v128`
- `i32x4.laneselect(a: v128, b: v128, m: v128) -> v128`
- `i64x2.laneselect(a: v128, b: v128, m: v128) -> v128`

Select lanes from `a` or `b` based on masks in `m`. If each lane-sized mask in `m` has all bits set or all bits unset, these instructions behave the same as `v128.bitselect`. Otherwise, the result is implementation defined.

```python
def blend(a : v128, b : v128, m: v128, lanes : int):
def laneselect(a : v128, b : v128, m: v128, lanes : int):
result = []
for i in range(lanes):
mask = m[i]
Expand Down Expand Up @@ -243,10 +243,10 @@ All opcodes have the `0xfd` prefix (same as SIMD proposal), which are omitted in
| `f32x4.fms` | 0xb0 |
| `f64x2.fma` | 0xcf |
| `f64x2.fms` | 0xd0 |
| `i8x16.blend` | 0xb2 |
| `i16x8.blend` | 0xb3 |
| `i32x4.blend` | 0xd2 |
| `i64x2.blend` | 0xd3 |
| `i8x16.laneselect` | 0xb2 |
| `i16x8.laneselect` | 0xb3 |
| `i32x4.laneselect` | 0xd2 |
| `i64x2.laneselect` | 0xd3 |
| `f32x4.min` | 0xb4 |
| `f32x4.max` | 0xe2 |
| `f64x2.min` | 0xd4 |
Expand Down