Difference between revisions of "Instruction Set/smeari"
From Mill Computing Wiki
m (Protected "Instruction Set/smeari": generated ([Edit=<protect-level-bot>] (indefinite) [Move=<protect-level-bot>] (indefinite))) | |||
(2 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
{{DISPLAYTITLE:smeari}} | {{DISPLAYTITLE:smeari}} | ||
− | <div style="font-size:80%;line-height:90%;margin-bottom:2em">[[Speculation| | + | <div style="font-size:80%;line-height:90%;margin-bottom:2em">[[Speculation|speculable]] [[Encoding|exu stream]] [[Decode|exu block]] [[Phasing|compute phase]] operation [[Domains|in the logical value domain]] <br /> |
'''native on:''' [[Cores|all]]<br /> | '''native on:''' [[Cores|all]]<br /> | ||
</div> | </div> | ||
− | + | 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 <abbr title="single instruction, multple data">SIMD</abbr> as exit conditions in a loop, since the first occurrence of a true value applies to all the remaining values and would be iterations. | ||
+ | |||
+ | {| class="wikitable" | ||
+ | |- | ||
+ | ||0||0||0||0||1||0||0||0 | ||
+ | |} | ||
+ | |||
+ | becomes | ||
+ | |||
+ | {| class="wikitable" | ||
+ | |- | ||
+ | ||0||0||0||0||1||1||1||1 | ||
+ | |} | ||
+ | |||
+ | which then can be used in [[Instruction_Set/pick|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. | ||
+ | |||
+ | <b>related operations:</b> [[Instruction_Set/smearx|smearx]], [[Instruction_Set/left|left]], [[Instruction_Set/mask|mask]] | ||
+ | |||
---- | ---- | ||
<code style="font-size:130%"><b style="color:#050">smeari</b>(<span style="color:#009">[[Domains#op|op]]</span> <span title="belt operand from ops window">vs</span>) → [[Domains#op|op]] r<sub>0</sub></code> | <code style="font-size:130%"><b style="color:#050">smeari</b>(<span style="color:#009">[[Domains#op|op]]</span> <span title="belt operand from ops window">vs</span>) → [[Domains#op|op]] r<sub>0</sub></code> | ||
Line 11: | Line 31: | ||
<br /> | <br /> | ||
+ | '''encoding:''' | ||
+ | <code style="font-size:100%"><b style="color:#050">smeari</b>(<span style="color:#009">[[Domains#op|op]]</span> <span title="belt operand from ops window">vs</span>)</code> | ||
+ | <br /> | ||
{| class="mw-collapsible mw-collapsed wikitable" data-expandtext="▸" data-collapsetext="▾" | {| class="mw-collapsible mw-collapsed wikitable" data-expandtext="▸" data-collapsetext="▾" | ||
! [[Cores|Core]] || [[Slot|In Slots]]|| [[Latency|Latencies]] | ! [[Cores|Core]] || [[Slot|In Slots]]|| [[Latency|Latencies]] | ||
|- | |- | ||
− | | [[Cores/Tin/Encoding#smeari|Tin]] || E0 || | + | | [[Cores/Tin/Encoding#smeari|Tin]] || E0 || 1 |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
|- | |- | ||
− | | [[Cores/ | + | | [[Cores/Copper/Encoding#smeari|Copper]] || E0 || 1 |
|- | |- | ||
− | | [[Cores/ | + | | [[Cores/Silver/Encoding#smeari|Silver]] || E0 E1 E2 E3 || 1 |
|- | |- | ||
− | | [[Cores/ | + | | [[Cores/Gold/Encoding#smeari|Gold]] || E0 || 1 |
|} | |} | ||
[[Instruction_Set|Instruction Set, alphabetical]], [[Instruction Set by Category]], [http://millcomputing.com/instructions.html?collapse=7#ops Instruction Set, sortable, filterable] | [[Instruction_Set|Instruction Set, alphabetical]], [[Instruction Set by Category]], [http://millcomputing.com/instructions.html?collapse=7#ops Instruction Set, sortable, filterable] |
Latest revision as of 14:03, 23 February 2021
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