Skip to content
This repository has been archived by the owner on Dec 22, 2021. It is now read-only.

Commit

Permalink
v128.load32_zero and v128.load64_zero instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
Maratyszcza committed Jun 2, 2020
1 parent fdca37a commit c4bae8d
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
2 changes: 2 additions & 0 deletions proposals/simd/BinarySIMD.md
Original file line number Diff line number Diff line change
Expand Up @@ -205,3 +205,5 @@ The `v8x16.shuffle` instruction has 16 bytes after `simdop`.
| `i32x4.trunc_sat_f32x4_u` | `0xf9`| - |
| `f32x4.convert_i32x4_s` | `0xfa`| - |
| `f32x4.convert_i32x4_u` | `0xfb`| - |
| `v128.load32_zero` | `0xfc`| - |
| `v128.load64_zero` | `0xfd`| - |
2 changes: 2 additions & 0 deletions proposals/simd/ImplementationStatus.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,8 @@
| `i32x4.trunc_sat_f32x4_u` | `-msimd128` | :heavy_check_mark: | | | :heavy_check_mark: |
| `f32x4.convert_i32x4_s` | `-msimd128` | :heavy_check_mark: | | | :heavy_check_mark: |
| `f32x4.convert_i32x4_u` | `-msimd128` | :heavy_check_mark: | | | :heavy_check_mark: |
| `v128.load32_zero` | | | | | |
| `v128.load64_zero` | | | | | |

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

Expand Down
18 changes: 18 additions & 0 deletions proposals/simd/SIMD.md
Original file line number Diff line number Diff line change
Expand Up @@ -766,6 +766,24 @@ def S.load(memarg):
return S.from_bytes(memory[memarg.offset:memarg.offset + 16])
```

### Load and Zero-Pad

* `v128.load32_zero(memarg) -> v128`
* `v128.load64_zero(memarg) -> v128`

Load a single 32-bit or 64-bit element into the lowest bits of a `v128` vector,
and initialize all other bits of the `v128` vector to zero.

```python
def S.load32_zero(memarg):
return S.from_bytes(memory[memarg.offset:memarg.offset + 4])
```

```python
def S.load64_zero(memarg):
return S.from_bytes(memory[memarg.offset:memarg.offset + 8])
```

### Load and Splat

* `v8x16.load_splat(memarg) -> v128`
Expand Down

0 comments on commit c4bae8d

Please sign in to comment.