diff options
Diffstat (limited to 'html')
-rw-r--r-- | html/mu_instructions.html | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/html/mu_instructions.html b/html/mu_instructions.html index ee8f60c1..073ff552 100644 --- a/html/mu_instructions.html +++ b/html/mu_instructions.html @@ -337,17 +337,17 @@ var/reg: (addr T) <span class="SpecialChar"><-</span> address var2: T <span class="muComment"># Array operations</span> -var/reg <span class="SpecialChar"><-</span> index arr/rega: (addr array T), idx/regi: int +var/reg: (addr T) <span class="SpecialChar"><-</span> index arr/rega: (addr array T), idx/regi: int | if size-of(T) is <span class="Constant">1</span>, <span class="Constant">2</span>, <span class="Constant">4</span> or <span class="Constant">8</span> => <span class="Constant">"(__check-mu-array-bounds *"</span> rega <span class="Constant">" %"</span> regi <span class="Constant">" "</span> size-of(T) <span class="Constant">")"</span> <span class="Constant">"8d/copy-address *("</span> rega <span class="Constant">"+"</span> regi <span class="Constant">"<<"</span> log2(size-of(T)) <span class="Constant">"+4) "</span> reg <span class="Constant">"/r32"</span> -var/reg <span class="SpecialChar"><-</span> index arr: (array T len), idx/regi: int +var/reg: (addr T) <span class="SpecialChar"><-</span> index arr: (array T len), idx/regi: int => <span class="Constant">"(__check-mu-array-bounds *(ebp+"</span> arr.stack-offset <span class="Constant">") %"</span> regi <span class="Constant">" "</span> size-of(T) <span class="Constant">")"</span> <span class="Constant">"8d/copy-address *(ebp+"</span> regi <span class="Constant">"<<"</span> log2(size-of(T)) <span class="Constant">"+"</span> (arr.stack-offset + <span class="Constant">4</span>) <span class="Constant">") "</span> reg <span class="Constant">"/r32"</span> -var/reg <span class="SpecialChar"><-</span> index arr/rega: (addr array T), n +var/reg: (addr T) <span class="SpecialChar"><-</span> index arr/rega: (addr array T), n => <span class="Constant">"(__check-mu-array-bounds *"</span> rega <span class="Constant">" "</span> n <span class="Constant">" "</span> size-of(T) <span class="Constant">")"</span> <span class="Constant">"8d/copy-address *("</span> rega <span class="Constant">"+"</span> (n*size-of(T)+<span class="Constant">4</span>) <span class="Constant">") "</span> reg <span class="Constant">"/r32"</span> -var/reg <span class="SpecialChar"><-</span> index arr: (array T len), n +var/reg: (addr T) <span class="SpecialChar"><-</span> index arr: (array T len), n => <span class="Constant">"(__check-mu-array-bounds *(ebp+"</span> arr.stack-offset <span class="Constant">") "</span> n <span class="Constant">" "</span> size-of(T) <span class="Constant">")"</span> <span class="Constant">"8d/copy-address *(ebp+"</span> (arr.stack-offset+<span class="Constant">4</span>+n*size-of(T)) <span class="Constant">") "</span> reg <span class="Constant">"/r32"</span> @@ -355,13 +355,13 @@ var/reg: (offset T) <span class="SpecialChar"><-</span> compute-offset arr: ( => <span class="Constant">"69/multiply %"</span> regi <span class="Constant">" "</span> size-of(T) <span class="Constant">"/imm32 "</span> reg <span class="Constant">"/r32"</span> var/reg: (offset T) <span class="SpecialChar"><-</span> compute-offset arr: (addr array T), idx: int <span class="muComment"># arr can be in reg or mem</span> => <span class="Constant">"69/multiply *(ebp+"</span> idx.stack-offset <span class="Constant">") "</span> size-of(T) <span class="Constant">"/imm32 "</span> reg <span class="Constant">"/r32"</span> -var/reg <span class="SpecialChar"><-</span> index arr/rega: (addr array T), o/rego: (offset T) +var/reg: (addr T) <span class="SpecialChar"><-</span> index arr/rega: (addr array T), o/rego: (offset T) => <span class="Constant">"(__check-mu-array-bounds %"</span> rega <span class="Constant">" %"</span> rego <span class="Constant">" 1 \"" function-name "</span>\<span class="Constant">")"</span> <span class="Constant">"8d/copy-address *("</span> rega <span class="Constant">"+"</span> rego <span class="Constant">"+4) "</span> reg <span class="Constant">"/r32"</span> Computing the length of an array is complex. -var/reg <span class="SpecialChar"><-</span> length arr/reg2: (addr array T) +var/reg: int <span class="SpecialChar"><-</span> length arr/reg2: (addr array T) | if T is byte (TODO) => <span class="Constant">"8b/-> *"</span> reg2 <span class="Constant">" "</span> reg <span class="Constant">"/r32"</span> | if size-of(T) is <span class="Constant">4</span> or <span class="Constant">8</span> or <span class="Constant">16</span> or <span class="Constant">32</span> or <span class="Constant">64</span> or <span class="Constant">128</span> |