Difference between revisions of "Instruction Set/retn"

From Mill Computing Wiki
Jump to: navigation, search
m (Protected "Instruction Set/retn": generated ([Edit=<protect-level-bot>] (indefinite) [Move=<protect-level-bot>] (indefinite)))
 
(One intermediate revision by the same user not shown)
Line 4:Line 4:
 
</div>
 
</div>
  
return from function
+
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
|-
 
| [[Cores/Decimal8/Encoding#retn|Decimal8]] || f0 || 1
 
|-
 
| [[Cores/Decimal16/Encoding#retn|Decimal16]] || 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 F1 || 1
+
| [[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 F1 F2 F3 || 1
+
| [[Cores/Gold/Encoding#retn|Gold]] || F0 || 1
|-
+
| [[Cores/Decimal8/Encoding#retn|Decimal8]] || F0 F1 F2 || 1
+
|-
+
| [[Cores/Decimal16/Encoding#retn|Decimal16]] || F0 F1 F2 || 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">v</span>) &#8594; [[Domains|op]] r<sub>0</sub></code>
+
<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>) &#8594; [[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]] || f1 || 1
+
| [[Cores/Gold/Encoding#retn|Gold]] || f0 || 1
|-
+
| [[Cores/Decimal8/Encoding#retn|Decimal8]] || f0 || 1
+
|-
+
| [[Cores/Decimal16/Encoding#retn|Decimal16]] || 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

realizing  exu stream  flowSkinny block  transfer phase   operation  

native on: all

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()

operands: like Inv :


alternate encoding: skinny

Core In Slots Latencies
Tin f0 1
Copper f0 1
Silver f0 1
Gold f0 1

retn(ops vs) → ops r0 ...

operands: like Inv :


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

retn(op Another) → op r0

operands: like Inv :


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