Commit a1f5cd2
authored
Make mask types opaque (linebender#218)
This is necessary for eventual AVX-512 support. Part of linebender#179.
This does not add any AVX-512 stuff yet, just lays the groundwork by
abstracting away the internal representation.
Contrary to what the description of linebender#196 said, we don't actually need
i64 vectors in the public API so long as we're not providing direct
conversions between mask types and integer vector types, which aren't
available even on main.
Summary of changes:
- Add `SimdMask<S>` trait independent from `SimdBase<S>`.
- Remove integer-vector-style APIs from masks:
- `Deref`
- Indexing
- `Bytes`
- public `SimdSplit` / `SimdCombine`
- public `slide` / `slide_within_blocks`
- public byte conversions
- Remove scalar bit-op overloads for masks, so masks support
mask-to-mask `& | ^ !` but not `mask & -1`.
This was extricated from a larger changeset I had locally that also
added some std::simd API compatibility functions, but that was getting
too complicated to review. I'm happy to add more APIs if there's desire
and review capacity for them.
A port of vello to this API can be found [here](
https://github.com/linebender/vello/compare/main...Shnatsel:opaque-masks?expand=1).1 parent 12523a6 commit a1f5cd2
22 files changed
Lines changed: 1847 additions & 8039 deletions
File tree
- fearless_simd_gen/src
- fearless_simd_tests/tests/harness
- lm_generated
- fearless_simd/src
- generated
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
13 | | - | |
| 12 | + | |
| 13 | + | |
14 | 14 | | |
15 | | - | |
16 | | - | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
16 | 29 | | |
17 | 30 | | |
18 | 31 | | |
| |||
0 commit comments