Difference between revisions of "Instruction Set/inner"

From Mill Computing Wiki
Jump to: navigation, search
 
(2 intermediate revisions by the same user not shown)
Line 1:Line 1:
 
{{DISPLAYTITLE:inner}}
 
{{DISPLAYTITLE:inner}}
<div style="font-size:80%;line-height:90%;margin-bottom:2em">[[Speculation|realizing]]&nbsp;&nbsp;[[Encoding|flow stream]]&nbsp;&nbsp;[[Decode|flow block]]&nbsp;&nbsp;[[Phasing|call phase]]&nbsp;&nbsp; operation&nbsp;&nbsp;<br />
+
<div style="font-size:80%;line-height:90%;margin-bottom:2em">[[Speculation|realizing]]&nbsp;&nbsp;[[Encoding|flow stream]]&nbsp;&nbsp;[[Decode|flow block]]&nbsp;&nbsp;[[Phasing|transfer phase]]&nbsp;&nbsp; operation&nbsp;&nbsp;<br />
 
'''native on:''' [[Cores|all]]<br />
 
'''native on:''' [[Cores|all]]<br />
 
</div>
 
</div>
  
enter a loop
+
Unconditional loop.
----
+
<code style="font-size:130%"><b style="color:#050">inner</b>(<i><span style="color:#009">[[Immediates#lit|lit]]</span> <span title="morsel-sized manifest constant">n</span></i>, <span style="color:#009">[[Domains#p|p]]</span> <span title="call argument from calls window">target</span>, <span style="color:#009">[[Domains#args|args]]</span> <span title="zero or more call
+
            arguments from calls window">args</span>) &#8594; [[Domains|ops]] r<sub>0</sub> ...</code>
+
<div style="font-size:80%;line-height:90%;margin-bottom:2em">'''operands:''' [[Operands#likeInv|like Inv :]]
+
</div>
+
<br />
+
  
'''encoding:'''
+
In many respects the inner operations are the same as the corresponding [[Instruction_Set/call|call]] operations. They have the same syntax and encodings and variants and behaviors. They get passed arguments and reserve return value slots.
<code style="font-size:100%"><b style="color:#050">inner</b>(<i><span style="color:#009">[[Immediates#lit|lit]]</span> <span title="morsel-sized manifest constant">n</span></i>, <span style="color:#009">[[Domains#p|p]]</span> <span title="call argument from calls window">target</span>, <i><span style="color:#009">[[Immediates#off|off]]</span> <span title="manifest constant">argv</span></i>, <i><span style="color:#009">[[Immediates#count|count]]</span> <span title="morsel-sized count of polyadic args">argc</span></i>)</code>
+
<br />
+
'''encoding:'''
+
<code style="font-size:100%"><b style="color:#050">inner</b>(<i><span style="color:#009">[[Immediates#lit|lit]]</span> <span title="morsel-sized manifest constant">n</span></i>, <span style="color:#009">[[Domains#p|p]]</span> <span title="call argument from calls window">target</span>, <i><span style="color:#009">[[Immediates#off|off]]</span> <span title="manifest constant">argv</span></i>, <i><span style="color:#009">[[Immediates#count|count]]</span> <span title="morsel-sized count of polyadic args">argc</span></i>, <i><span style="color:#009">[[Immediates#lit|lit]]</span> <span title="morsel-sized manifest constant">argv</span></i>)</code>
+
<br />
+
'''alternate encoding:''' [[Instruction_Set/inner0|inner0]], [[Instruction_Set/inner1|inner1]], [[Instruction_Set/innern|innern]], <br />
+
  
{| class="mw-collapsible mw-collapsed wikitable" data-expandtext="&#9656;" data-collapsetext="&#9662;"
+
The only difference is, that inner operations don't create a new frame, i.e. the frame ID stays the same, and the new values on the belt are still tagged with the same ID. This means it is still possible to access all belt values, and it is still possible to retrieve values from the caller from the [[Scratchpad]].
! [[Cores|Core]] || [[Slot|In Slots]]|| [[Latency|Latencies]]
+
 
|-
+
This is somewhat comparable to how many functional languages have no dedicated looping keyword construct, but implement looping with recursive tail calls, that just reuse and overwrite the old context. Inner doesn't overwrite the old context due to the nature of the belt, but it also doesn't create a new one.
| [[Cores/Tin/Encoding#inner|Tin]] || F0 || 1
+
 
|-
+
The inner operation, in conjunktion with the [[Instruction_Set/rotate|rotate]] operation and the [[Scratchpad]] makes it possible to statically schedule and [[pipeline|Pipelining]] nested loops of any depth level.
| [[Cores/Copper/Encoding#inner|Copper]] || F0 F1 || 1
+
 
|-
+
<b>related operations:</b>  [[Instruction_Set/innertr|innertr]], [[Instruction_Set/innerfl|innerfl]]
| [[Cores/Silver/Encoding#inner|Silver]] || F0 F1 F2 || 1
+
|-
+
| [[Cores/Gold/Encoding#inner|Gold]] || F0 F1 F2 F3 || 1
+
|-
+
| [[Cores/Decimal8/Encoding#inner|Decimal8]] || F0 F1 F2 || 1
+
|-
+
| [[Cores/Decimal16/Encoding#inner|Decimal16]] || F0 F1 F2 || 1
+
|}
+
  
 
----
 
----
<code style="font-size:130%"><b style="color:#050">inner</b>(<i><span style="color:#009">[[Immediates#lit|lit]]</span> <span title="morsel-sized manifest constant">n</span></i>, <i><span style="color:#009">[[Immediates#lbl|lbl]]</span> <span title="name of label or function">target</span></i>, <span style="color:#009">[[Domains#args|args]]</span> <span title="zero or more call arguments
+
<code style="font-size:130%"><b style="color:#050">inner</b>(<i><span style="color:#009">[[Immediates#lbl|lbl]]</span> <span title="name of label or function">off0</span></i>, <span style="color:#009">[[Domains#ops|ops]]</span> <span title="one or more return arguments">args</span>)</code>
            from calls window">args</span>) &#8594; [[Domains|ops]] 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 44:Line 23:
  
 
'''encoding:'''  
 
'''encoding:'''  
<code style="font-size:100%"><b style="color:#050">inner</b>(<i><span style="color:#009">[[Immediates#lit|lit]]</span> <span title="morsel-sized manifest constant">n</span></i>, <i><span style="color:#009">[[Immediates#off|off]]</span> <span title="manifest constant">target</span></i>, <i><span style="color:#009">[[Immediates#count|count]]</span> <span title="morsel-sized count of polyadic  
+
<code style="font-size:100%"><b style="color:#050">inner</b>(<i><span style="color:#009">[[Immediates#off|off]]</span> <span title="manifest constant">count0</span></i>, <i><span style="color:#009">[[Immediates#count|count]]</span> <span title="morsel-sized count of polyadic args">off0</span></i>)</code>
             args">argc</span></i>)</code>
+
,
 +
<code style="font-size:100%"><b style="color:#050">inner</b>(<i><span style="color:#009">[[Immediates#off|off]]</span> <span title="manifest constant">count0</span></i>, <i><span style="color:#009">[[Immediates#count|count]]</span> <span title="morsel-sized count of polyadic args">lit0</span></i>, <i><span style="color:#009">[[Immediates#lit|lit]]</span> <span title="morsel-sized manifest  
 +
            constant">off0</span></i>)</code>
 +
,  
 +
<code style="font-size:100%"><b style="color:#050">inner</b>(<i><span style="color:#009">[[Immediates#off|off]]</span> <span title="manifest constant">count0</span></i>, <i><span style="color:#009">[[Immediates#count|count]]</span> <span title="morsel-sized count of polyadic args">lit0</span></i>, <i><span style="color:#009">[[Immediates#lit|lit]]</span> <span title="morsel-sized manifest
 +
             constant">lit1</span></i>, <i><span style="color:#009">[[Immediates#lit|lit]]</span> <span title="morsel-sized manifest constant">off0</span></i>)</code>
 +
,
 +
<code style="font-size:100%"><b style="color:#050">inner</b>(<i><span style="color:#009">[[Immediates#off|off]]</span> <span title="manifest constant">count0</span></i>, <i><span style="color:#009">[[Immediates#count|count]]</span> <span title="morsel-sized count of polyadic args">lit0</span></i>, <i><span style="color:#009">[[Immediates#lit|lit]]</span> <span title="morsel-sized manifest
 +
            constant">lit1</span></i>, <i><span style="color:#009">[[Immediates#lit|lit]]</span> <span title="morsel-sized manifest constant">lit2</span></i>, <i><span style="color:#009">[[Immediates#lit|lit]]</span> <span title="morsel-sized manifest constant">off0</span></i>)</code>
 
<br />
 
<br />
'''encoding:'''
 
<code style="font-size:100%"><b style="color:#050">inner</b>(<i><span style="color:#009">[[Immediates#lit|lit]]</span> <span title="morsel-sized manifest constant">n</span></i>, <i><span style="color:#009">[[Immediates#off|off]]</span> <span title="manifest constant">target</span></i>, <i><span style="color:#009">[[Immediates#count|count]]</span> <span title="morsel-sized count of polyadic
 
            args">argc</span></i>, <i><span style="color:#009">[[Immediates#lit|lit]]</span> <span title="morsel-sized manifest constant">argv</span></i>)</code>
 
<br />
 
'''encoding:'''
 
<code style="font-size:100%"><b style="color:#050">inner</b>(<i><span style="color:#009">[[Immediates#lit|lit]]</span> <span title="morsel-sized manifest constant">n</span></i>, <i><span style="color:#009">[[Immediates#off|off]]</span> <span title="manifest constant">target</span></i>, <i><span style="color:#009">[[Immediates#count|count]]</span> <span title="morsel-sized count of polyadic
 
            args">argc</span></i>, <i><span style="color:#009">[[Immediates#lit|lit]]</span> <span title="morsel-sized manifest constant">argv</span></i>, <i><span style="color:#009">[[Immediates#lit|lit]]</span> <span title="morsel-sized manifest constant">argv</span></i>)</code>
 
<br />
 
'''alternate encoding:''' [[Instruction_Set/inner0|inner0]], [[Instruction_Set/inner1|inner1]], [[Instruction_Set/innern|innern]], <br />
 
  
 
{| class="mw-collapsible mw-collapsed wikitable" data-expandtext="&#9656;" data-collapsetext="&#9662;"
 
{| class="mw-collapsible mw-collapsed wikitable" data-expandtext="&#9656;" data-collapsetext="&#9662;"
Line 62:Line 40:
 
| [[Cores/Tin/Encoding#inner|Tin]] || F0 || 1
 
| [[Cores/Tin/Encoding#inner|Tin]] || F0 || 1
 
|-
 
|-
| [[Cores/Copper/Encoding#inner|Copper]] || F0 F1 || 1
+
| [[Cores/Copper/Encoding#inner|Copper]] || F0 || 1
 
|-
 
|-
 
| [[Cores/Silver/Encoding#inner|Silver]] || F0 F1 F2 || 1
 
| [[Cores/Silver/Encoding#inner|Silver]] || F0 F1 F2 || 1
 
|-
 
|-
| [[Cores/Gold/Encoding#inner|Gold]] || F0 F1 F2 F3 || 1
+
| [[Cores/Gold/Encoding#inner|Gold]] || F0 || 1
|-
+
| [[Cores/Decimal8/Encoding#inner|Decimal8]] || F0 F1 F2 || 1
+
|-
+
| [[Cores/Decimal16/Encoding#inner|Decimal16]] || F0 F1 F2 || 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 13:24, 23 February 2021

realizing  flow stream  flow block  transfer phase   operation  

native on: all

Unconditional loop.

In many respects the inner operations are the same as the corresponding call operations. They have the same syntax and encodings and variants and behaviors. They get passed arguments and reserve return value slots.

The only difference is, that inner operations don't create a new frame, i.e. the frame ID stays the same, and the new values on the belt are still tagged with the same ID. This means it is still possible to access all belt values, and it is still possible to retrieve values from the caller from the Scratchpad.

This is somewhat comparable to how many functional languages have no dedicated looping keyword construct, but implement looping with recursive tail calls, that just reuse and overwrite the old context. Inner doesn't overwrite the old context due to the nature of the belt, but it also doesn't create a new one.

The inner operation, in conjunktion with the rotate operation and the Scratchpad makes it possible to statically schedule and Pipelining nested loops of any depth level.

related operations: innertr, innerfl


inner(lbl off0, ops args)

operands: like Inv :


encoding: inner(off count0, count off0) , inner(off count0, count lit0, lit off0) , inner(off count0, count lit0, lit lit1, lit off0) , inner(off count0, count lit0, lit lit1, lit lit2, lit off0)

Core In Slots Latencies
Tin F0 1
Copper F0 1
Silver F0 F1 F2 1
Gold F0 1


Instruction Set, alphabetical, Instruction Set by Category, Instruction Set, sortable, filterable