smeari
From Mill Computing Wiki
Find the first one in a bool vector and set all remaining elments to one too.
The main purpose of this operation is to facilitate vectorization of loops, while loops in particular. It allows you to treat conditions created in a SIMD as exit conditions in a loop, since the first occurrence of a true value applies to all the remaining values and would be iterations.
0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 |
becomes
0 | 0 | 0 | 0 | 1 | 1 | 1 | 1 |
which then can be used in pick operations or other vector operations, yet the exit condition is preserved for all elements that would not be in the iteration anymore if it wasn't vectorized.
related operations: smearx, left, mask
operands: like Shuffle [xn:x]
encoding:
smeari(op vs)
Core | In Slots | Latencies |
---|---|---|
Tin | E0 | 1 |
Copper | E0 | 1 |
Silver | E0 E1 E2 E3 | 1 |
Gold | E0 | 1 |
Instruction Set, alphabetical, Instruction Set by Category, Instruction Set, sortable, filterable