Difference between revisions of "Instruction Set/pick"
Line 4: | Line 4: | ||
</div> | </div> | ||
− | pick | + | Pick between two values based on a condition. |
+ | |||
+ | The pick operation takes 3 arguments and has its own dedicated encoding [[Block]]. The selector argument q only looks at the lowest bit, and when it is set, the first value v1 is moved to the front of the belt, else v2. | ||
+ | |||
+ | The pick operation has zero latency, because there isn't actually any processing taking place. It merely renames the belt positions in different ways in the same process that advances the belt positions between cycles as new values are dropped. | ||
+ | |||
+ | How many pick operations can be executed in parallel depends on the number of pick [[Slot]]s of the [[Cores|Core]]. It finds extensive use in if-conversion to transform control flow into data flow and avoid conditional branches which are a major source of stalls. | ||
+ | |||
+ | <b>related operations:</b> [[Instruction_Set/recur|recur]] | ||
+ | |||
---- | ---- | ||
<code style="font-size:130%"><b style="color:#050">pick</b>(<span style="color:#009">[[Domains#sel|sel]]</span> <span title="1-bit per byte selector from picks window">q</span>, <span style="color:#009">[[Domains#op|op]]</span> <span title="operand from picks window">v1</span>)</code> | <code style="font-size:130%"><b style="color:#050">pick</b>(<span style="color:#009">[[Domains#sel|sel]]</span> <span title="1-bit per byte selector from picks window">q</span>, <span style="color:#009">[[Domains#op|op]]</span> <span title="operand from picks window">v1</span>)</code> |
Revision as of 17:09, 16 December 2014
Pick between two values based on a condition.
The pick operation takes 3 arguments and has its own dedicated encoding Block. The selector argument q only looks at the lowest bit, and when it is set, the first value v1 is moved to the front of the belt, else v2.
The pick operation has zero latency, because there isn't actually any processing taking place. It merely renames the belt positions in different ways in the same process that advances the belt positions between cycles as new values are dropped.
How many pick operations can be executed in parallel depends on the number of pick Slots of the Core. It finds extensive use in if-conversion to transform control flow into data flow and avoid conditional branches which are a major source of stalls.
related operations: recur
A pick operation where the second pick value would be a None of the same width as the first.
Core | In Slots | Latencies |
---|---|---|
Tin | P0 | 0 |
Copper | P0 | 0 |
Silver | P0 P1 | 0 |
Gold | P0 P1 P2 P3 | 0 |
Decimal8 | P0 P1 | 0 |
Decimal16 | P0 P1 | 0 |
Core | In Slots | Latencies |
---|---|---|
Tin | P0 | 0 |
Copper | P0 | 0 |
Silver | P0 P1 | 0 |
Gold | P0 P1 P2 P3 | 0 |
Decimal8 | P0 P1 | 0 |
Decimal16 | P0 P1 | 0 |
Instruction Set, alphabetical, Instruction Set by Category, Instruction Set, sortable, filterable