about summary refs log tree commit diff stats
path: root/html
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2021-06-24 21:50:38 -0700
committerKartik Agaram <vc@akkartik.com>2021-06-24 21:50:38 -0700
commit718fd031f9e7a60f092c830ed547f5e461fb66ec (patch)
treedd3740d2a7f7199a1e6a6f05284420f7cb946ac1 /html
parentec32c11d3bde6772ddd250d3b217e0541409e0ce (generated by cgit-pink 1.4.1-2-gfad0 (git 2.36.2.497.gbbea4dcf42) at 2024-11-21 18:29:26 +0000 ecrement =&gt; <span class="Constant">&quot;4f/decrement-edi&quot;</span> +var/<span class="muRegEax">eax</span> <span class="Special">&lt;-</span> decrement =&gt; <span class="Constant">&quot;48/decrement-eax&quot;</span> +var/<span class="muRegEcx">ecx</span> <span class="Special">&lt;-</span> decrement =&gt; <span class="Constant">&quot;49/decrement-ecx&quot;</span> +var/<span class="muRegEdx">edx</span> <span class="Special">&lt;-</span> decrement =&gt; <span class="Constant">&quot;4a/decrement-edx&quot;</span> +var/<span class="muRegEbx">ebx</span> <span class="Special">&lt;-</span> decrement =&gt; <span class="Constant">&quot;4b/decrement-ebx&quot;</span> +var/<span class="muRegEsi">esi</span> <span class="Special">&lt;-</span> decrement =&gt; <span class="Constant">&quot;4e/decrement-esi&quot;</span> +var/<span class="muRegEdi">edi</span> <span class="Special">&lt;-</span> decrement =&gt; <span class="Constant">&quot;4f/decrement-edi&quot;</span> decrement var =&gt; <span class="Constant">&quot;ff 1/subop/decrement *(ebp+&quot;</span> var.stack-offset <span class="Constant">&quot;)&quot;</span> decrement *var/reg =&gt; <span class="Constant">&quot;ff 1/subop/decrement *&quot;</span> reg @@ -65,7 +71,7 @@ var/reg <span class="Special">&lt;-</span> add var2 =&gt; <span cl var/reg <span class="Special">&lt;-</span> add *var2/reg2 =&gt; <span class="Constant">&quot;03/add *&quot;</span> reg2 <span class="Constant">&quot; &quot;</span> reg <span class="Constant">&quot;/r32&quot;</span> add-to var1, var2/reg =&gt; <span class="Constant">&quot;01/add-to *(ebp+&quot;</span> var1.stack-offset <span class="Constant">&quot;) &quot;</span> reg <span class="Constant">&quot;/r32&quot;</span> add-to *var1/reg1, var2/reg2 =&gt; <span class="Constant">&quot;01/add-to *&quot;</span> reg1 <span class="Constant">&quot; &quot;</span> reg2 <span class="Constant">&quot;/r32&quot;</span> -var/<span class="Constant">eax</span> <span class="Special">&lt;-</span> add n =&gt; <span class="Constant">&quot;05/add-to-eax &quot;</span> n <span class="Constant">&quot;/imm32&quot;</span> +var/<span class="muRegEax">eax</span> <span class="Special">&lt;-</span> add n =&gt; <span class="Constant">&quot;05/add-to-eax &quot;</span> n <span class="Constant">&quot;/imm32&quot;</span> var/reg <span class="Special">&lt;-</span> add n =&gt; <span class="Constant">&quot;81 0/subop/add %&quot;</span> reg <span class="Constant">&quot; &quot;</span> n <span class="Constant">&quot;/imm32&quot;</span> add-to var, n =&gt; <span class="Constant">&quot;81 0/subop/add *(ebp+&quot;</span> var.stack-offset <span class="Constant">&quot;) &quot;</span> n <span class="Constant">&quot;/imm32&quot;</span> add-to *var/reg, n =&gt; <span class="Constant">&quot;81 0/subop/add *&quot;</span> reg <span class="Constant">&quot; &quot;</span> n <span class="Constant">&quot;/imm32&quot;</span> @@ -75,7 +81,7 @@ var/reg <span class="Special">&lt;-</span> subtract var2 =&gt; <span cl var/reg <span class="Special">&lt;-</span> subtract *var2/reg2 =&gt; <span class="Constant">&quot;2b/subtract *&quot;</span> reg2 <span class="Constant">&quot; &quot;</span> reg1 <span class="Constant">&quot;/r32&quot;</span> subtract-from var1, var2/reg2 =&gt; <span class="Constant">&quot;29/subtract-from *(ebp+&quot;</span> var1.stack-offset <span class="Constant">&quot;) &quot;</span> reg2 <span class="Constant">&quot;/r32&quot;</span> subtract-from *var1/reg1, var2/reg2 =&gt; <span class="Constant">&quot;29/subtract-from *&quot;</span> reg1 <span class="Constant">&quot; &quot;</span> reg2 <span class="Constant">&quot;/r32&quot;</span> -var/<span class="Constant">eax</span> <span class="Special">&lt;-</span> subtract n =&gt; <span class="Constant">&quot;2d/subtract-from-eax &quot;</span> n <span class="Constant">&quot;/imm32&quot;</span> +var/<span class="muRegEax">eax</span> <span class="Special">&lt;-</span> subtract n =&gt; <span class="Constant">&quot;2d/subtract-from-eax &quot;</span> n <span class="Constant">&quot;/imm32&quot;</span> var/reg <span class="Special">&lt;-</span> subtract n =&gt; <span class="Constant">&quot;81 5/subop/subtract %&quot;</span> reg <span class="Constant">&quot; &quot;</span> n <span class="Constant">&quot;/imm32&quot;</span> subtract-from var, n =&gt; <span class="Constant">&quot;81 5/subop/subtract *(ebp+&quot;</span> var.stack-offset <span class="Constant">&quot;) &quot;</span> n <span class="Constant">&quot;/imm32&quot;</span> subtract-from *var/reg, n =&gt; <span class="Constant">&quot;81 5/subop/subtract *&quot;</span> reg <span class="Constant">&quot; &quot;</span> n <span class="Constant">&quot;/imm32&quot;</span> @@ -85,7 +91,7 @@ var/reg <span class="Special">&lt;-</span> and var2 =&gt; <span cl var/reg <span class="Special">&lt;-</span> and *var2/reg2 =&gt; <span class="Constant">&quot;23/and *&quot;</span> reg2 <span class="Constant">&quot; &quot;</span> reg <span class="Constant">&quot;/r32&quot;</span> and-with var1, var2/reg =&gt; <span class="Constant">&quot;21/and-with *(ebp+&quot;</span> var1.stack-offset <span class="Constant">&quot;) &quot;</span> reg <span class="Constant">&quot;/r32&quot;</span> and-with *var1/reg1, var2/reg2 =&gt; <span class="Constant">&quot;21/and-with *&quot;</span> reg1 <span class="Constant">&quot; &quot;</span> reg2 <span class="Constant">&quot;/r32&quot;</span> -var/<span class="Constant">eax</span> <span class="Special">&lt;-</span> and n =&gt; <span class="Constant">&quot;25/and-with-eax &quot;</span> n <span class="Constant">&quot;/imm32&quot;</span> +var/<span class="muRegEax">eax</span> <span class="Special">&lt;-</span> and n =&gt; <span class="Constant">&quot;25/and-with-eax &quot;</span> n <span class="Constant">&quot;/imm32&quot;</span> var/reg <span class="Special">&lt;-</span> and n =&gt; <span class="Constant">&quot;81 4/subop/and %&quot;</span> reg <span class="Constant">&quot; &quot;</span> n <span class="Constant">&quot;/imm32&quot;</span> and-with var, n =&gt; <span class="Constant">&quot;81 4/subop/and *(ebp+&quot;</span> var.stack-offset <span class="Constant">&quot;) &quot;</span> n <span class="Constant">&quot;/imm32&quot;</span> and-with *var/reg, n =&gt; <span class="Constant">&quot;81 4/subop/and *&quot;</span> reg <span class="Constant">&quot; &quot;</span> n <span class="Constant">&quot;/imm32&quot;</span> @@ -95,7 +101,7 @@ var/reg <span class="Special">&lt;-</span> or var2 =&gt; <span cl var/reg <span class="Special">&lt;-</span> or *var2/reg2 =&gt; <span class="Constant">&quot;0b/or *&quot;</span> reg2 <span class="Constant">&quot; &quot;</span> reg <span class="Constant">&quot;/r32&quot;</span> or-with var1, var2/reg2 =&gt; <span class="Constant">&quot;09/or-with *(ebp+&quot;</span> var1.stack-offset <span class="Constant">&quot; &quot;</span> reg2 <span class="Constant">&quot;/r32&quot;</span> or-with *var1/reg1, var2/reg2 =&gt; <span class="Constant">&quot;09/or-with *&quot;</span> reg1 <span class="Constant">&quot; &quot;</span> reg2 <span class="Constant">&quot;/r32&quot;</span> -var/<span class="Constant">eax</span> <span class="Special">&lt;-</span> or n =&gt; <span class="Constant">&quot;0d/or-with-eax &quot;</span> n <span class="Constant">&quot;/imm32&quot;</span> +var/<span class="muRegEax">eax</span> <span class="Special">&lt;-</span> or n =&gt; <span class="Constant">&quot;0d/or-with-eax &quot;</span> n <span class="Constant">&quot;/imm32&quot;</span> var/reg <span class="Special">&lt;-</span> or n =&gt; <span class="Constant">&quot;81 1/subop/or %&quot;</span> reg <span class="Constant">&quot; &quot;</span> n <span class="Constant">&quot;/imm32&quot;</span> or-with var, n =&gt; <span class="Constant">&quot;81 1/subop/or *(ebp+&quot;</span> var.stack-offset <span class="Constant">&quot;) &quot;</span> n <span class="Constant">&quot;/imm32&quot;</span> or-with *var/reg, n =&gt; <span class="Constant">&quot;81 1/subop/or *&quot;</span> reg <span class="Constant">&quot; &quot;</span> n <span class="Constant">&quot;/imm32&quot;</span> @@ -109,7 +115,7 @@ var/reg <span class="Special">&lt;-</span> xor var2 =&gt; <span cl var/reg <span class="Special">&lt;-</span> xor *var2/reg2 =&gt; <span class="Constant">&quot;33/xor *&quot;</span> reg2 <span class="Constant">&quot; &quot;</span> reg <span class="Constant">&quot;/r32&quot;</span> xor-with var1, var2/reg =&gt; <span class="Constant">&quot;31/xor-with *(ebp+&quot;</span> var1.stack-offset <span class="Constant">&quot;) &quot;</span> reg <span class="Constant">&quot;/r32&quot;</span> xor-with *var1/reg1, var2/reg2 =&gt; <span class="Constant">&quot;31/xor-with *&quot;</span> reg1 <span class="Constant">&quot; &quot;</span> reg2 <span class="Constant">&quot;/r32&quot;</span> -var/<span class="Constant">eax</span> <span class="Special">&lt;-</span> xor n =&gt; <span class="Constant">&quot;35/xor-with-eax &quot;</span> n <span class="Constant">&quot;/imm32&quot;</span> +var/<span class="muRegEax">eax</span> <span class="Special">&lt;-</span> xor n =&gt; <span class="Constant">&quot;35/xor-with-eax &quot;</span> n <span class="Constant">&quot;/imm32&quot;</span> var/reg <span class="Special">&lt;-</span> xor n =&gt; <span class="Constant">&quot;81 6/subop/xor %&quot;</span> reg <span class="Constant">&quot; &quot;</span> n <span class="Constant">&quot;/imm32&quot;</span> xor-with var, n =&gt; <span class="Constant">&quot;81 6/subop/xor *(ebp+&quot;</span> var.stack-offset <span class="Constant">&quot;) &quot;</span> n <span class="Constant">&quot;/imm32&quot;</span> xor-with *var/reg, n =&gt; <span class="Constant">&quot;81 6/subop/xor *&quot;</span> reg <span class="Constant">&quot; &quot;</span> n <span class="Constant">&quot;/imm32&quot;</span> @@ -128,12 +134,12 @@ shift-right *var/reg, n =&gt; <span class="Constant">&quot;c1/shift 5/ shift-right-signed var, n =&gt; <span class="Constant">&quot;c1/shift 7/subop/right-signed *(ebp+&quot;</span> var.stack-offset <span class="Constant">&quot;) &quot;</span> n <span class="Constant">&quot;/imm32&quot;</span> shift-right-signed *var/reg, n =&gt; <span class="Constant">&quot;c1/shift 7/subop/right-signed *&quot;</span> reg <span class="Constant">&quot; &quot;</span> n <span class="Constant">&quot;/imm32&quot;</span> -var/<span class="Constant">eax</span> <span class="Special">&lt;-</span> copy n =&gt; <span class="Constant">&quot;b8/copy-to-eax &quot;</span> n <span class="Constant">&quot;/imm32&quot;</span> -var/<span class="Constant">ecx</span> <span class="Special">&lt;-</span> copy n =&gt; <span class="Constant">&quot;b9/copy-to-ecx &quot;</span> n <span class="Constant">&quot;/imm32&quot;</span> -var/<span class="Constant">edx</span> <span class="Special">&lt;-</span> copy n =&gt; <span class="Constant">&quot;ba/copy-to-edx &quot;</span> n <span class="Constant">&quot;/imm32&quot;</span> -var/<span class="Constant">ebx</span> <span class="Special">&lt;-</span> copy n =&gt; <span class="Constant">&quot;bb/copy-to-ebx &quot;</span> n <span class="Constant">&quot;/imm32&quot;</span> -var/<span class="Constant">esi</span> <span class="Special">&lt;-</span> copy n =&gt; <span class="Constant">&quot;be/copy-to-esi &quot;</span> n <span class="Constant">&quot;/imm32&quot;</span> -var/<span class="Constant">edi</span> <span class="Special">&lt;-</span> copy n =&gt; <span class="Constant">&quot;bf/copy-to-edi &quot;</span> n <span class="Constant">&quot;/imm32&quot;</span> +var/<span class="muRegEax">eax</span> <span class="Special">&lt;-</span> copy n =&gt; <span class="Constant">&quot;b8/copy-to-eax &quot;</span> n <span class="Constant">&quot;/imm32&quot;</span> +var/<span class="muRegEcx">ecx</span> <span class="Special">&lt;-</span> copy n =&gt; <span class="Constant">&quot;b9/copy-to-ecx &quot;</span> n <span class="Constant">&quot;/imm32&quot;</span> +var/<span class="muRegEdx">edx</span> <span class="Special">&lt;-</span> copy n =&gt; <span class="Constant">&quot;ba/copy-to-edx &quot;</span> n <span class="Constant">&quot;/imm32&quot;</span> +var/<span class="muRegEbx">ebx</span> <span class="Special">&lt;-</span> copy n =&gt; <span class="Constant">&quot;bb/copy-to-ebx &quot;</span> n <span class="Constant">&quot;/imm32&quot;</span> +var/<span class="muRegEsi">esi</span> <span class="Special">&lt;-</span> copy n =&gt; <span class="Constant">&quot;be/copy-to-esi &quot;</span> n <span class="Constant">&quot;/imm32&quot;</span> +var/<span class="muRegEdi">edi</span> <span class="Special">&lt;-</span> copy n =&gt; <span class="Constant">&quot;bf/copy-to-edi &quot;</span> n <span class="Constant">&quot;/imm32&quot;</span> var/reg <span class="Special">&lt;-</span> copy var2/reg2 =&gt; <span class="Constant">&quot;89/&lt;- %&quot;</span> reg <span class="Constant">&quot; &quot;</span> reg2 <span class="Constant">&quot;/r32&quot;</span> copy-to var1, var2/reg =&gt; <span class="Constant">&quot;89/&lt;- *(ebp+&quot;</span> var1.stack-offset <span class="Constant">&quot;) &quot;</span> reg <span class="Constant">&quot;/r32&quot;</span> copy-to *var1/reg1, var2/reg2 =&gt; <span class="Constant">&quot;89/&lt;- *&quot;</span> reg1 <span class="Constant">&quot; &quot;</span> reg2 <span class="Constant">&quot;/r32&quot;</span> @@ -153,7 +159,7 @@ compare var1, var2/reg2 =&gt; <span class="Constant">&quot;39/compare compare *var1/reg1, var2/reg2 =&gt; <span class="Constant">&quot;39/compare *&quot;</span> reg1 <span class="Constant">&quot; &quot;</span> reg2 <span class="Constant">&quot;/r32&quot;</span> compare var1/reg1, var2 =&gt; <span class="Constant">&quot;3b/compare&lt;- *(ebp+&quot;</span> var2.stack-offset <span class="Constant">&quot;) &quot;</span> reg1 <span class="Constant">&quot;/r32&quot;</span> compare var/reg, *var2/reg2 =&gt; <span class="Constant">&quot;3b/compare&lt;- *&quot;</span> reg <span class="Constant">&quot; &quot;</span> n <span class="Constant">&quot;/imm32&quot;</span> -compare var/<span class="Constant">eax</span>, n =&gt; <span class="Constant">&quot;3d/compare-eax-with &quot;</span> n <span class="Constant">&quot;/imm32&quot;</span> +compare var/<span class="muRegEax">eax</span>, n =&gt; <span class="Constant">&quot;3d/compare-eax-with &quot;</span> n <span class="Constant">&quot;/imm32&quot;</span> compare var/reg, n =&gt; <span class="Constant">&quot;81 7/subop/compare %&quot;</span> reg <span class="Constant">&quot; &quot;</span> n <span class="Constant">&quot;/imm32&quot;</span> compare var, n =&gt; <span class="Constant">&quot;81 7/subop/compare *(ebp+&quot;</span> var.stack-offset <span class="Constant">&quot;) &quot;</span> n <span class="Constant">&quot;/imm32&quot;</span> compare *var/reg, n =&gt; <span class="Constant">&quot;81 7/subop/compare *&quot;</span> reg <span class="Constant">&quot; &quot;</span> n <span class="Constant">&quot;/imm32&quot;</span> @@ -408,30 +414,30 @@ var/reg: int <span class="Special">&lt;-</span> length arr/reg2: (addr array T) <span class="Constant">&quot;c1/shift 5/subop/logic-right %&quot;</span> reg <span class="Constant">&quot; &quot;</span> log2(size-of(T)) <span class="Constant">&quot;/imm8&quot;</span> | otherwise x86 has no instruction to divide by a literal, so - we need up to <span class="Constant">3</span> extra registers! <span class="Constant">eax</span>/<span class="Constant">edx</span> for division and say <span class="Constant">ecx</span> - =&gt; if reg is not <span class="Constant">eax</span> + we need up to <span class="Constant">3</span> extra registers! <span class="muRegEax">eax</span>/<span class="muRegEdx">edx</span> for division and say <span class="muRegEcx">ecx</span> + =&gt; if reg is not <span class="muRegEax">eax</span> <span class="Constant">&quot;50/push-eax&quot;</span> - if reg is not <span class="Constant">ecx</span> + if reg is not <span class="muRegEcx">ecx</span> <span class="Constant">&quot;51/push-ecx&quot;</span> - if reg is not <span class="Constant">edx</span> + if reg is not <span class="muRegEdx">edx</span> <span class="Constant">&quot;52/push-edx&quot;</span> <span class="Constant">&quot;8b/-&gt; *&quot;</span> reg2 <span class="Constant">&quot; eax/r32&quot;</span> <span class="Constant">&quot;31/xor %edx 2/r32/edx&quot;</span> <span class="muComment"># sign-extend, but array size can't be negative</span> <span class="Constant">&quot;b9/copy-to-ecx &quot;</span> size-of(T) <span class="Constant">&quot;/imm32&quot;</span> <span class="Constant">&quot;f7 7/subop/idiv-eax-edx-by %ecx&quot;</span> - if reg is not <span class="Constant">eax</span> + if reg is not <span class="muRegEax">eax</span> <span class="Constant">&quot;89/&lt;- %&quot;</span> reg <span class="Constant">&quot; 0/r32/eax&quot;</span> - if reg is not <span class="Constant">edx</span> + if reg is not <span class="muRegEdx">edx</span> <span class="Constant">&quot;5a/pop-to-edx&quot;</span> - if reg is not <span class="Constant">ecx</span> + if reg is not <span class="muRegEcx">ecx</span> <span class="Constant">&quot;59/pop-to-ecx&quot;</span> - if reg is not <span class="Constant">eax</span> + if reg is not <span class="muRegEax">eax</span> <span class="Constant">&quot;58/pop-to-eax&quot;</span> <span class="muComment"># User-defined types</span> -If a record (product) <span class="PreProc">type</span> T was defined to have elements a, b, c, ... of -types T_a, T_b, T_c, ..., then accessing one of those elements f of <span class="PreProc">type</span> T_f: +If a record (product) type T was defined to have elements a, b, c, ... of +types T_a, T_b, T_c, ..., then accessing one of those elements f of type T_f: var/reg: (addr T_f) <span class="Special">&lt;-</span> get var2/reg2: (addr T), f =&gt; <span class="Constant">&quot;81 7/subop/compare %&quot;</span> reg2 <span class="Constant">&quot; 0/imm32&quot;</span>