Difference between revisions of "Instruction Set/retn"
(2 intermediate revisions by the same user not shown) | |||
Line 4: | Line 4: | ||
</div> | </div> | ||
− | return from | + | Returns values and control to the caller. |
+ | |||
+ | The Mill architecture supports multiple return values not only on operations but for all functions, as many as there are belt positions. Still most will only have one or none at all, because that is what languages were and are designed for. | ||
+ | |||
+ | Return not only returns from the most recent [[Instruction_Set/call|call]] operation and ends a frame, but also from the most recent [[Instruction_Set/inner|inner]] operation and exits a loop. This depends on whether it was a call or an inner that has been executed most recently. The [[Spiller]] keeps track of that. | ||
+ | |||
+ | <b>related operations:</b> [[Instruction_Set/call|call]], [[Instruction_Set/inner|inner]], [[Instruction_Set/retntr|retntr]], [[Instruction_Set/retnfl|retnfl]] | ||
+ | |||
---- | ---- | ||
<code style="font-size:130%"><b style="color:#050">retn</b>()</code> | <code style="font-size:130%"><b style="color:#050">retn</b>()</code> | ||
Line 22: | Line 29: | ||
|- | |- | ||
| [[Cores/Gold/Encoding#retn|Gold]] || f0 || 1 | | [[Cores/Gold/Encoding#retn|Gold]] || f0 || 1 | ||
− | |||
− | |||
− | |||
− | |||
|} | |} | ||
Line 52: | Line 55: | ||
| [[Cores/Tin/Encoding#retn|Tin]] || F0 || 1 | | [[Cores/Tin/Encoding#retn|Tin]] || F0 || 1 | ||
|- | |- | ||
− | | [[Cores/Copper/Encoding#retn|Copper]] || F0 | + | | [[Cores/Copper/Encoding#retn|Copper]] || F0 || 1 |
|- | |- | ||
| [[Cores/Silver/Encoding#retn|Silver]] || F0 F1 F2 || 1 | | [[Cores/Silver/Encoding#retn|Silver]] || F0 F1 F2 || 1 | ||
|- | |- | ||
− | | [[Cores/Gold/Encoding#retn|Gold]] || F0 | + | | [[Cores/Gold/Encoding#retn|Gold]] || F0 || 1 |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
|} | |} | ||
---- | ---- | ||
− | <code style="font-size:130%"><b style="color:#050">retn</b>(<span style="color:#009">[[Domains#op|op]]</span> <span title="late-evaluated operand from belt"> | + | <code style="font-size:130%"><b style="color:#050">retn</b>(<span style="color:#009">[[Domains#op|op]]</span> <span title="late-evaluated operand from belt">Another</span>) → [[Domains|op]] r<sub>0</sub></code> |
<div style="font-size:80%;line-height:90%;margin-bottom:2em">'''operands:''' [[Operands#likeInv|like Inv :]] | <div style="font-size:80%;line-height:90%;margin-bottom:2em">'''operands:''' [[Operands#likeInv|like Inv :]] | ||
</div> | </div> | ||
Line 79: | Line 78: | ||
| [[Cores/Silver/Encoding#retn|Silver]] || f0 || 1 | | [[Cores/Silver/Encoding#retn|Silver]] || f0 || 1 | ||
|- | |- | ||
− | | [[Cores/Gold/Encoding#retn|Gold | + | | [[Cores/Gold/Encoding#retn|Gold]] || f0 || 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:05, 23 February 2021
Returns values and control to the caller.
The Mill architecture supports multiple return values not only on operations but for all functions, as many as there are belt positions. Still most will only have one or none at all, because that is what languages were and are designed for.
Return not only returns from the most recent call operation and ends a frame, but also from the most recent inner operation and exits a loop. This depends on whether it was a call or an inner that has been executed most recently. The Spiller keeps track of that.
related operations: call, inner, retntr, retnfl
retn()
alternate encoding: skinny
Core | In Slots | Latencies |
---|---|---|
Tin | f0 | 1 |
Copper | f0 | 1 |
Silver | f0 | 1 |
Gold | f0 | 1 |
encoding:
retn(off vs, count c)
,
retn(off vs, count c, lit vs)
,
retn(off vs, count c, lit vs, lit vs)
,
retn(off vs, count c, lit vs, lit vs, lit vs)
Core | In Slots | Latencies |
---|---|---|
Tin | F0 | 1 |
Copper | F0 | 1 |
Silver | F0 F1 F2 | 1 |
Gold | F0 | 1 |
alternate encoding: skinny
Core | In Slots | Latencies |
---|---|---|
Tin | f0 | 1 |
Copper | f0 | 1 |
Silver | f0 | 1 |
Gold | f0 | 1 |
Instruction Set, alphabetical, Instruction Set by Category, Instruction Set, sortable, filterable