Difference between revisions of "Instruction Set/lea"

From Mill Computing Wiki
Jump to: navigation, search
 
(4 intermediate revisions by the same user not shown)
Line 1:Line 1:
 
{{DISPLAYTITLE:lea}}
 
{{DISPLAYTITLE:lea}}
<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|compute phase]]&nbsp;&nbsp; operation&nbsp;&nbsp;<br />
+
<div style="font-size:80%;line-height:90%;margin-bottom:2em">[[Speculation|speculable]]&nbsp;&nbsp;[[Encoding|flow stream]]&nbsp;&nbsp;[[Decode|flow block]]&nbsp;&nbsp;[[Phasing|compute phase]]&nbsp;&nbsp; operation&nbsp;&nbsp;<br />
 
'''native on:''' [[Cores|all]]<br />
 
'''native on:''' [[Cores|all]]<br />
 
</div>
 
</div>
Line 6:Line 6:
 
Load Effective Address.
 
Load Effective Address.
  
Allows you to do address arithmetic the same way the [[Instruciton_Set/load|load]] and [[Instruciton_Set/store|store]] operations, and to some degree the [[Instruciton_Set/call|call]] and [[Instruciton_Set/inner|inner]] operation, do.<br />
+
Allows you to do address arithmetic the same way the [[Instruction_Set/load|load]] and [[Instruction_Set/store|store]] operations, and to some degree the [[Instruction_Set/call|call]] and [[Instruction_Set/inner|inner]] operation, do.<br />
 
Produces pointers that in turn can then be used as base pointers for loads, stores and calls.
 
Produces pointers that in turn can then be used as base pointers for loads, stores and calls.
  
----
+
There are several different addressing modes. The general formula for computing addresses is
<code style="font-size:130%"><b style="color:#050">lea</b>(<span style="color:#009">[[Sources#base|base]]</span> <span title="base special register">b</span>, <i><span style="color:#009">[[Immediates#off|off]]</span> <span title="manifest constant">o</span></i>)</code>
+
<code>base+offset+(scale*index)</code>.<br />
<div style="font-size:80%;line-height:90%;margin-bottom:2em">'''operands:''' [[Operands#likeInv|like Inv :]]
+
Base can come from a number of special [[Registers]] or the belt. Offset is always an inline constant. Those two are always present, although a zero offset doesn't take any space at all.<br />
</div>
+
Scale and index are optional and alway appear together. The scale is a compile time constant, the index is always from the belt.
<br />
+
  
{| class="mw-collapsible mw-collapsed wikitable" data-expandtext="&#9656;" data-collapsetext="&#9662;"
+
<b>related operations:</b>  [[Instruction_Set/load|load]], [[Instruction_Set/store|store]], [[Instruction_Set/loadf|loadf]], [[Instruction_Set/loadd|loadd]], [[Instruction_Set/call|call]], [[Instruction_Set/inner|inner]]
! [[Cores|Core]] || [[Slot|In Slots]]|| [[Latency|Latencies]]
+
|-
+
| [[Cores/Tin/Encoding#lea|Tin]] || F0 || 2
+
|-
+
| [[Cores/Copper/Encoding#lea|Copper]] || F0 F1 || 2
+
|-
+
| [[Cores/Silver/Encoding#lea|Silver]] || F0 F1 F2 F3 || 2
+
|-
+
| [[Cores/Gold/Encoding#lea|Gold]] || F0 F1 F2 F3 F4 F5 F6 F7 || 2
+
|-
+
| [[Cores/Decimal8/Encoding#lea|Decimal8]] || F0 F1 F2 F3 || 2
+
|-
+
| [[Cores/Decimal16/Encoding#lea|Decimal16]] || F0 F1 F2 F3 || 2
+
|}
+
  
 
----
 
----
<code style="font-size:130%"><b style="color:#050">lea</b>(<span style="color:#009">[[Sources#base|base]]</span> <span title="base special register">b</span>, <i><span style="color:#009">[[Immediates#off|off]]</span> <span title="manifest constant">o</span></i>, <span style="color:#009">[[Domains#u|u]]</span> <span title="belt operand from opsWindow">i</span>, <i><span style="color:#009">[[Immediates#scale|scale]]</span> <span title="scale factor
+
<code style="font-size:130%"><b style="color:#050">lea</b>(<span style="color:#009">[[Sources#base|base]]</span> <span title="base special register">b</span>, <i><span style="color:#009">[[Immediates#off|off]]</span> <span title="manifest constant">o</span></i>) &#8594; [[Domains#op|op]] r<sub>0</sub></code>
            for indexes in load/store/lea">s</span></i>)</code>
+
<div style="font-size:80%;line-height:90%;margin-bottom:2em">'''operands:''' [[Operands#likeLea|like Lea px:p]]
<div style="font-size:80%;line-height:90%;margin-bottom:2em">'''operands:''' [[Operands#likeInv|like Inv :]]
+
 
</div>
 
</div>
 
<br />
 
<br />
Line 41:Line 25:
 
! [[Cores|Core]] || [[Slot|In Slots]]|| [[Latency|Latencies]]
 
! [[Cores|Core]] || [[Slot|In Slots]]|| [[Latency|Latencies]]
 
|-
 
|-
| [[Cores/Tin/Encoding#lea|Tin]] || F0 || 2
+
| [[Cores/Tin/Encoding#lea|Tin]] || F0 ||  
 
|-
 
|-
| [[Cores/Copper/Encoding#lea|Copper]] || F0 F1 || 2
+
| [[Cores/Copper/Encoding#lea|Copper]] || F0 ||  
 
|-
 
|-
| [[Cores/Silver/Encoding#lea|Silver]] || F0 F1 F2 F3 || 2
+
| [[Cores/Silver/Encoding#lea|Silver]] || F0 F1 F2 ||  
 
|-
 
|-
| [[Cores/Gold/Encoding#lea|Gold]] || F0 F1 F2 F3 F4 F5 F6 F7 || 2
+
| [[Cores/Gold/Encoding#lea|Gold]] || F0 ||  
|-
+
| [[Cores/Decimal8/Encoding#lea|Decimal8]] || F0 F1 F2 F3 || 2
+
|-
+
| [[Cores/Decimal16/Encoding#lea|Decimal16]] || F0 F1 F2 F3 || 2
+
 
|}
 
|}
  
 
----
 
----
 
<code style="font-size:130%"><b style="color:#050">lea</b>(<span style="color:#009">[[Domains#p|p]]</span> <span title="belt operand from opsWindow">b</span>, <i><span style="color:#009">[[Immediates#off|off]]</span> <span title="manifest constant">o</span></i>) &#8594; [[Domains#op|op]] r<sub>0</sub></code>
 
<code style="font-size:130%"><b style="color:#050">lea</b>(<span style="color:#009">[[Domains#p|p]]</span> <span title="belt operand from opsWindow">b</span>, <i><span style="color:#009">[[Immediates#off|off]]</span> <span title="manifest constant">o</span></i>) &#8594; [[Domains#op|op]] r<sub>0</sub></code>
<div style="font-size:80%;line-height:90%;margin-bottom:2em">'''operands:''' [[Operands#likeAllocStack|like AllocStack xx:p]]
+
<div style="font-size:80%;line-height:90%;margin-bottom:2em">'''operands:''' [[Operands#likeLea|like Lea px:p]]
 
</div>
 
</div>
 
<br />
 
<br />
Line 63:Line 43:
 
! [[Cores|Core]] || [[Slot|In Slots]]|| [[Latency|Latencies]]
 
! [[Cores|Core]] || [[Slot|In Slots]]|| [[Latency|Latencies]]
 
|-
 
|-
| [[Cores/Tin/Encoding#lea|Tin]] || F0 || 2
+
| [[Cores/Tin/Encoding#lea|Tin]] || F0 ||  
 
|-
 
|-
| [[Cores/Copper/Encoding#lea|Copper]] || F0 F1 || 2
+
| [[Cores/Copper/Encoding#lea|Copper]] || F0 ||  
 
|-
 
|-
| [[Cores/Silver/Encoding#lea|Silver]] || F0 F1 F2 F3 || 2
+
| [[Cores/Silver/Encoding#lea|Silver]] || F0 F1 F2 ||  
 
|-
 
|-
| [[Cores/Gold/Encoding#lea|Gold]] || F0 F1 F2 F3 F4 F5 F6 F7 || 2
+
| [[Cores/Gold/Encoding#lea|Gold]] || F0 ||  
|-
+
| [[Cores/Decimal8/Encoding#lea|Decimal8]] || F0 F1 F2 F3 || 2
+
|-
+
| [[Cores/Decimal16/Encoding#lea|Decimal16]] || F0 F1 F2 F3 || 2
+
 
|}
 
|}
  
 
----
 
----
<code style="font-size:130%"><b style="color:#050">lea</b>(<span style="color:#009">[[Domains#p|p]]</span> <span title="belt operand from opsWindow">b</span>, <i><span style="color:#009">[[Immediates#off|off]]</span> <span title="manifest constant">o</span></i>, <span style="color:#009">[[Domains#u|u]]</span> <span title="belt operand from opsWindow">i</span>, <i><span style="color:#009">[[Immediates#scale|scale]]</span> <span title="scale
+
<code style="font-size:130%"><b style="color:#050">lea</b>(<i><span style="color:#009">[[Immediates#lbl|lbl]]</span> <span title="name of label or function">l</span></i>) &#8594; [[Domains#op|op]] r<sub>0</sub></code>
            factor for indexes in load/store/lea">s</span></i>)</code>
+
<div style="font-size:80%;line-height:90%;margin-bottom:2em">'''operands:''' [[Operands#likeLea|like Lea px:p]]
<div style="font-size:80%;line-height:90%;margin-bottom:2em">'''operands:''' [[Operands#likeInv|like Inv :]]
+
 
</div>
 
</div>
 
<br />
 
<br />
Line 86:Line 61:
 
! [[Cores|Core]] || [[Slot|In Slots]]|| [[Latency|Latencies]]
 
! [[Cores|Core]] || [[Slot|In Slots]]|| [[Latency|Latencies]]
 
|-
 
|-
| [[Cores/Tin/Encoding#lea|Tin]] || F0 || 2
+
| [[Cores/Tin/Encoding#lea|Tin]] || F0 ||  
|-
+
| [[Cores/Copper/Encoding#lea|Copper]] || F0 F1 || 2
+
|-
+
| [[Cores/Silver/Encoding#lea|Silver]] || F0 F1 F2 F3 || 2
+
|-
+
| [[Cores/Gold/Encoding#lea|Gold]] || F0 F1 F2 F3 F4 F5 F6 F7 || 2
+
|-
+
| [[Cores/Decimal8/Encoding#lea|Decimal8]] || F0 F1 F2 F3 || 2
+
|-
+
| [[Cores/Decimal16/Encoding#lea|Decimal16]] || F0 F1 F2 F3 || 2
+
|}
+
 
+
----
+
<code style="font-size:130%"><b style="color:#050">lea</b>(<i><span style="color:#009">[[Immediates#lbl|lbl]]</span> <span title="name of label or function">l</span></i>)</code>
+
<div style="font-size:80%;line-height:90%;margin-bottom:2em">'''operands:''' [[Operands#likeInv|like Inv :]]
+
</div>
+
<br />
+
 
+
{| class="mw-collapsible mw-collapsed wikitable" data-expandtext="&#9656;" data-collapsetext="&#9662;"
+
! [[Cores|Core]] || [[Slot|In Slots]]|| [[Latency|Latencies]]
+
|-
+
| [[Cores/Tin/Encoding#lea|Tin]] || F0 || 2
+
|-
+
| [[Cores/Copper/Encoding#lea|Copper]] || F0 F1 || 2
+
|-
+
| [[Cores/Silver/Encoding#lea|Silver]] || F0 F1 F2 F3 || 2
+
 
|-
 
|-
| [[Cores/Gold/Encoding#lea|Gold]] || F0 F1 F2 F3 F4 F5 F6 F7 || 2
+
| [[Cores/Copper/Encoding#lea|Copper]] || F0 ||  
 
|-
 
|-
| [[Cores/Decimal8/Encoding#lea|Decimal8]] || F0 F1 F2 F3 || 2
+
| [[Cores/Silver/Encoding#lea|Silver]] || F0 F1 F2 ||  
 
|-
 
|-
| [[Cores/Decimal16/Encoding#lea|Decimal16]] || F0 F1 F2 F3 || 2
+
| [[Cores/Gold/Encoding#lea|Gold]] || F0 ||  
 
|}
 
|}
  
  
 
[[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:13, 23 February 2021

speculable  flow stream  flow block  compute phase   operation  

native on: all

Load Effective Address.

Allows you to do address arithmetic the same way the load and store operations, and to some degree the call and inner operation, do.
Produces pointers that in turn can then be used as base pointers for loads, stores and calls.

There are several different addressing modes. The general formula for computing addresses is base+offset+(scale*index).
Base can come from a number of special Registers or the belt. Offset is always an inline constant. Those two are always present, although a zero offset doesn't take any space at all.
Scale and index are optional and alway appear together. The scale is a compile time constant, the index is always from the belt.

related operations: load, store, loadf, loadd, call, inner


lea(base b, off o) → op r0

operands: like Lea px:p


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

lea(p b, off o) → op r0

operands: like Lea px:p


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

lea(lbl l) → op r0

operands: like Lea px:p


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


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