Difference between revisions of "Instruction Set/smearx"

From Mill Computing Wiki
Jump to: navigation, search
(Created page with "{{DISPLAYTITLE:smearx}} <div style="font-size:80%;line-height:90%;margin-bottom:2em">realizing  exu stream Decode|exu block...")
 
 
(4 intermediate revisions by the same user not shown)
Line 1:Line 1:
 
{{DISPLAYTITLE:smearx}}
 
{{DISPLAYTITLE:smearx}}
<div style="font-size:80%;line-height:90%;margin-bottom:2em">[[Speculation|realizing]]&nbsp;&nbsp;[[Encoding|exu stream]]&nbsp;&nbsp;[[Decode|exu block]]&nbsp;&nbsp;[[Phasing|compute phase]]&nbsp;&nbsp; operation&nbsp;&nbsp; [[Domains|in the logical value domain]]&nbsp;&nbsp;<br />
+
<div style="font-size:80%;line-height:90%;margin-bottom:2em">[[Speculation|speculable]]&nbsp;&nbsp;[[Encoding|exu stream]]&nbsp;&nbsp;[[Decode|exu block]]&nbsp;&nbsp;[[Phasing|compute phase]]&nbsp;&nbsp; operation&nbsp;&nbsp; [[Domains|in the logical value domain]]&nbsp;&nbsp;<br />
 
'''native on:''' [[Cores|all]]<br />
 
'''native on:''' [[Cores|all]]<br />
 
</div>
 
</div>
  
smear first one to end of vector
+
Find the first one in a bool vector, shift it one to the right and set all remaining elments to one too.
 +
 
 +
The main purpose of this operation is to facilitate vectorization of loops, do-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||0||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.
 +
Since the rightmost value would be shifted out, a second result value is returned to the belt which holds that value. It always must be checked too for the exit condition.
 +
 
 +
<b>related operations:</b>  [[Instruction_Set/smeari|smeari]], [[Instruction_Set/left|left]], [[Instruction_Set/mask|mask]]
 +
 
 
----
 
----
 
<code style="font-size:130%"><b style="color:#050">smearx</b>(<span style="color:#009">[[Domains#op|op]]</span> <span title="belt operand from ops window">vs</span>) &#8594; [[Domains#op|op]] r<sub>0</sub>, [[Domains#op|op]] r<sub>1</sub></code>
 
<code style="font-size:130%"><b style="color:#050">smearx</b>(<span style="color:#009">[[Domains#op|op]]</span> <span title="belt operand from ops window">vs</span>) &#8594; [[Domains#op|op]] r<sub>0</sub>, [[Domains#op|op]] r<sub>1</sub></code>
Line 14:Line 35:
 
! [[Cores|Core]] || [[Slot|In Slots]]|| [[Latency|Latencies]]
 
! [[Cores|Core]] || [[Slot|In Slots]]|| [[Latency|Latencies]]
 
|-
 
|-
| [[Cores/Tin/Encoding#821|Tin]] || E0 || 2 2
+
| [[Cores/Tin/Encoding#smearx|Tin]] || E0 || 1
 
|-
 
|-
| [[Cores/Copper/Encoding#821|Copper]] || E0 E1 || 2 2
+
| [[Cores/Copper/Encoding#smearx|Copper]] || E0 || 1
 
|-
 
|-
| [[Cores/Silver/Encoding#821|Silver]] || E0 E1 E2 E3 || 2 2
+
| [[Cores/Silver/Encoding#smearx|Silver]] || E0 E1 E2 E3 || 1
 
|-
 
|-
| [[Cores/Gold/Encoding#821|Gold]] || E0 E1 E2 E3 E4 E5 E6 E7 || 2 2
+
| [[Cores/Gold/Encoding#smearx|Gold]] || E0 || 1
|-
+
| [[Cores/Decimal8/Encoding#821|Decimal8]] || E0 E1 E2 E3 || 2 2
+
|-
+
| [[Cores/Decimal16/Encoding#821|Decimal16]] || E0 E1 E2 E3 || 2 2
+
 
|}
 
|}
 +
 +
 +
[[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 13:24, 23 February 2021

speculable  exu stream  exu block  compute phase   operation   in the logical value domain  

native on: all

Find the first one in a bool vector, shift it one to the right and set all remaining elments to one too.

The main purpose of this operation is to facilitate vectorization of loops, do-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.

00001000

becomes

00000111

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. Since the rightmost value would be shifted out, a second result value is returned to the belt which holds that value. It always must be checked too for the exit condition.

related operations: smeari, left, mask


smearx(op vs) → op r0, op r1

operands: like Smearx XX:Xx


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