diff options
Diffstat (limited to 'apps/mu.subx')
-rw-r--r-- | apps/mu.subx | 63 |
1 files changed, 59 insertions, 4 deletions
diff --git a/apps/mu.subx b/apps/mu.subx index 1a0b2050..9837366d 100644 --- a/apps/mu.subx +++ b/apps/mu.subx @@ -216,11 +216,12 @@ # primitives: linked list of info # name: (handle array byte) # mu-inouts: linked list of vars to check -# mu-outputs: linked list of vars to check +# mu-outputs: linked list of vars to check; at most a singleton # subx-name: (handle array byte) # subx-rm32: enum arg-location # subx-r32: enum arg-location # subx-imm32: enum arg-location +# output-is-write-only: boolean # arg-location: enum # 0 means none # 1 means first inout @@ -277,10 +278,12 @@ Primitive-subx-r32: # enum arg-location 0x14/imm32 Primitive-subx-imm32: # enum arg-location 0x18/imm32 -Primitive-next: # (handle function) +Primitive-write-only-output: # boolean 0x1c/imm32 +Primitive-next: # (handle function) + 0x20/imm32 Primitive-size: - 0x20/imm32/24 + 0x24/imm32/36 Stmt-tag: 0/imm32 @@ -2800,6 +2803,7 @@ _Primitive-inc-eax: 0/imm32/no-rm32 0/imm32/no-r32 0/imm32/no-imm32 + 0/imm32/output-is-write-only _Primitive-inc-ecx/imm32/next _Primitive-inc-ecx: # var/ecx <- increment => 41/increment-ecx @@ -2810,6 +2814,7 @@ _Primitive-inc-ecx: 0/imm32/no-rm32 0/imm32/no-r32 0/imm32/no-imm32 + 0/imm32/output-is-write-only _Primitive-inc-edx/imm32/next _Primitive-inc-edx: # var/edx <- increment => 42/increment-edx @@ -2820,6 +2825,7 @@ _Primitive-inc-edx: 0/imm32/no-rm32 0/imm32/no-r32 0/imm32/no-imm32 + 0/imm32/output-is-write-only _Primitive-inc-ebx/imm32/next _Primitive-inc-ebx: # var/ebx <- increment => 43/increment-ebx @@ -2830,6 +2836,7 @@ _Primitive-inc-ebx: 0/imm32/no-rm32 0/imm32/no-r32 0/imm32/no-imm32 + 0/imm32/output-is-write-only _Primitive-inc-esi/imm32/next _Primitive-inc-esi: # var/esi <- increment => 46/increment-esi @@ -2840,6 +2847,7 @@ _Primitive-inc-esi: 0/imm32/no-rm32 0/imm32/no-r32 0/imm32/no-imm32 + 0/imm32/output-is-write-only _Primitive-inc-edi/imm32/next _Primitive-inc-edi: # var/edi <- increment => 47/increment-edi @@ -2850,6 +2858,7 @@ _Primitive-inc-edi: 0/imm32/no-rm32 0/imm32/no-r32 0/imm32/no-imm32 + 0/imm32/output-is-write-only _Primitive-dec-eax/imm32/next _Primitive-dec-eax: # var/eax <- decrement => 48/decrement-eax @@ -2860,6 +2869,7 @@ _Primitive-dec-eax: 0/imm32/no-rm32 0/imm32/no-r32 0/imm32/no-imm32 + 0/imm32/output-is-write-only _Primitive-dec-ecx/imm32/next _Primitive-dec-ecx: # var/ecx <- decrement => 49/decrement-ecx @@ -2870,6 +2880,7 @@ _Primitive-dec-ecx: 0/imm32/no-rm32 0/imm32/no-r32 0/imm32/no-imm32 + 0/imm32/output-is-write-only _Primitive-dec-edx/imm32/next _Primitive-dec-edx: # var/edx <- decrement => 4a/decrement-edx @@ -2880,6 +2891,7 @@ _Primitive-dec-edx: 0/imm32/no-rm32 0/imm32/no-r32 0/imm32/no-imm32 + 0/imm32/output-is-write-only _Primitive-dec-ebx/imm32/next _Primitive-dec-ebx: # var/ebx <- decrement => 4b/decrement-ebx @@ -2890,6 +2902,7 @@ _Primitive-dec-ebx: 0/imm32/no-rm32 0/imm32/no-r32 0/imm32/no-imm32 + 0/imm32/output-is-write-only _Primitive-dec-esi/imm32/next _Primitive-dec-esi: # var/esi <- decrement => 4e/decrement-esi @@ -2900,6 +2913,7 @@ _Primitive-dec-esi: 0/imm32/no-rm32 0/imm32/no-r32 0/imm32/no-imm32 + 0/imm32/output-is-write-only _Primitive-dec-edi/imm32/next _Primitive-dec-edi: # var/edi <- decrement => 4f/decrement-edi @@ -2910,6 +2924,7 @@ _Primitive-dec-edi: 0/imm32/no-rm32 0/imm32/no-r32 0/imm32/no-imm32 + 0/imm32/output-is-write-only _Primitive-inc-mem/imm32/next _Primitive-inc-mem: # increment var => ff 0/subop/increment *(ebp+__) @@ -2920,6 +2935,7 @@ _Primitive-inc-mem: 1/imm32/rm32-is-first-inout 0/imm32/no-r32 0/imm32/no-imm32 + 0/imm32/output-is-write-only _Primitive-inc-reg/imm32/next _Primitive-inc-reg: # var/reg <- increment => ff 0/subop/increment %__ @@ -2930,6 +2946,7 @@ _Primitive-inc-reg: 3/imm32/rm32-is-first-output 0/imm32/no-r32 0/imm32/no-imm32 + 0/imm32/output-is-write-only _Primitive-dec-mem/imm32/next _Primitive-dec-mem: # decrement var => ff 1/subop/decrement *(ebp+__) @@ -2940,6 +2957,7 @@ _Primitive-dec-mem: 1/imm32/rm32-is-first-inout 0/imm32/no-r32 0/imm32/no-imm32 + 0/imm32/output-is-write-only _Primitive-dec-reg/imm32/next _Primitive-dec-reg: # var/reg <- decrement => ff 1/subop/decrement %__ @@ -2950,6 +2968,7 @@ _Primitive-dec-reg: 3/imm32/rm32-is-first-output 0/imm32/no-r32 0/imm32/no-imm32 + 0/imm32/output-is-write-only _Primitive-add-to-eax/imm32/next # - add _Primitive-add-to-eax: @@ -2961,6 +2980,7 @@ _Primitive-add-to-eax: 0/imm32/no-rm32 0/imm32/no-r32 1/imm32/imm32-is-first-inout + 0/imm32/output-is-write-only _Primitive-add-reg-to-reg/imm32/next _Primitive-add-reg-to-reg: # var1/reg <- add var2/reg => 01/add var1/rm32 var2/r32 @@ -2971,6 +2991,7 @@ _Primitive-add-reg-to-reg: 3/imm32/rm32-is-first-output 1/imm32/r32-is-first-inout 0/imm32/no-imm32 + 0/imm32/output-is-write-only _Primitive-add-reg-to-mem/imm32/next _Primitive-add-reg-to-mem: # add-to var1 var2/reg => 01/add var1 var2/r32 @@ -2981,6 +3002,7 @@ _Primitive-add-reg-to-mem: 1/imm32/rm32-is-first-inout 2/imm32/r32-is-second-inout 0/imm32/no-imm32 + 0/imm32/output-is-write-only _Primitive-add-mem-to-reg/imm32/next _Primitive-add-mem-to-reg: # var1/reg <- add var2 => 03/add var2/rm32 var1/r32 @@ -2991,6 +3013,7 @@ _Primitive-add-mem-to-reg: 1/imm32/rm32-is-first-inout 3/imm32/r32-is-first-output 0/imm32/no-imm32 + 0/imm32/output-is-write-only _Primitive-add-lit-to-reg/imm32/next _Primitive-add-lit-to-reg: # var1/reg <- add lit => 81 0/subop/add var1/rm32 lit/imm32 @@ -3001,6 +3024,7 @@ _Primitive-add-lit-to-reg: 3/imm32/rm32-is-first-output 0/imm32/no-r32 1/imm32/imm32-is-first-inout + 0/imm32/output-is-write-only _Primitive-add-lit-to-mem/imm32/next _Primitive-add-lit-to-mem: # add-to var1, lit => 81 0/subop/add var1/rm32 lit/imm32 @@ -3011,6 +3035,7 @@ _Primitive-add-lit-to-mem: 1/imm32/rm32-is-first-inout 0/imm32/no-r32 2/imm32/imm32-is-first-inout + 0/imm32/output-is-write-only _Primitive-subtract-from-eax/imm32/next # - subtract _Primitive-subtract-from-eax: @@ -3022,6 +3047,7 @@ _Primitive-subtract-from-eax: 0/imm32/no-rm32 0/imm32/no-r32 1/imm32/imm32-is-first-inout + 0/imm32/output-is-write-only _Primitive-subtract-reg-from-reg/imm32/next _Primitive-subtract-reg-from-reg: # var1/reg <- subtract var2/reg => 29/subtract var1/rm32 var2/r32 @@ -3032,6 +3058,7 @@ _Primitive-subtract-reg-from-reg: 3/imm32/rm32-is-first-output 1/imm32/r32-is-first-inout 0/imm32/no-imm32 + 0/imm32/output-is-write-only _Primitive-subtract-reg-from-mem/imm32/next _Primitive-subtract-reg-from-mem: # subtract-from var1 var2/reg => 29/subtract var1 var2/r32 @@ -3042,6 +3069,7 @@ _Primitive-subtract-reg-from-mem: 1/imm32/rm32-is-first-inout 2/imm32/r32-is-second-inout 0/imm32/no-imm32 + 0/imm32/output-is-write-only _Primitive-subtract-mem-from-reg/imm32/next _Primitive-subtract-mem-from-reg: # var1/reg <- subtract var2 => 2b/subtract var2/rm32 var1/r32 @@ -3052,6 +3080,7 @@ _Primitive-subtract-mem-from-reg: 1/imm32/rm32-is-first-inout 3/imm32/r32-is-first-output 0/imm32/no-imm32 + 0/imm32/output-is-write-only _Primitive-subtract-lit-from-reg/imm32/next _Primitive-subtract-lit-from-reg: # var1/reg <- subtract lit => 81 5/subop/subtract var1/rm32 lit/imm32 @@ -3062,6 +3091,7 @@ _Primitive-subtract-lit-from-reg: 3/imm32/rm32-is-first-output 0/imm32/no-r32 1/imm32/imm32-is-first-inout + 0/imm32/output-is-write-only _Primitive-subtract-lit-from-mem/imm32/next _Primitive-subtract-lit-from-mem: # subtract-from var1, lit => 81 5/subop/subtract var1/rm32 lit/imm32 @@ -3072,6 +3102,7 @@ _Primitive-subtract-lit-from-mem: 1/imm32/rm32-is-first-inout 0/imm32/no-r32 2/imm32/imm32-is-first-inout + 0/imm32/output-is-write-only _Primitive-and-with-eax/imm32/next # - and _Primitive-and-with-eax: @@ -3083,6 +3114,7 @@ _Primitive-and-with-eax: 0/imm32/no-rm32 0/imm32/no-r32 1/imm32/imm32-is-first-inout + 0/imm32/output-is-write-only _Primitive-and-reg-with-reg/imm32/next _Primitive-and-reg-with-reg: # var1/reg <- and var2/reg => 21/and var1/rm32 var2/r32 @@ -3093,6 +3125,7 @@ _Primitive-and-reg-with-reg: 3/imm32/rm32-is-first-output 1/imm32/r32-is-first-inout 0/imm32/no-imm32 + 0/imm32/output-is-write-only _Primitive-and-reg-with-mem/imm32/next _Primitive-and-reg-with-mem: # and-with var1 var2/reg => 21/and var1 var2/r32 @@ -3103,6 +3136,7 @@ _Primitive-and-reg-with-mem: 1/imm32/rm32-is-first-inout 2/imm32/r32-is-second-inout 0/imm32/no-imm32 + 0/imm32/output-is-write-only _Primitive-and-mem-with-reg/imm32/next _Primitive-and-mem-with-reg: # var1/reg <- and var2 => 23/and var2/rm32 var1/r32 @@ -3113,6 +3147,7 @@ _Primitive-and-mem-with-reg: 1/imm32/rm32-is-first-inout 3/imm32/r32-is-first-output 0/imm32/no-imm32 + 0/imm32/output-is-write-only _Primitive-and-lit-with-reg/imm32/next _Primitive-and-lit-with-reg: # var1/reg <- and lit => 81 4/subop/and var1/rm32 lit/imm32 @@ -3123,6 +3158,7 @@ _Primitive-and-lit-with-reg: 3/imm32/rm32-is-first-output 0/imm32/no-r32 1/imm32/imm32-is-first-inout + 0/imm32/output-is-write-only _Primitive-and-lit-with-mem/imm32/next _Primitive-and-lit-with-mem: # and-with var1, lit => 81 4/subop/and var1/rm32 lit/imm32 @@ -3133,6 +3169,7 @@ _Primitive-and-lit-with-mem: 1/imm32/rm32-is-first-inout 0/imm32/no-r32 2/imm32/imm32-is-first-inout + 0/imm32/output-is-write-only _Primitive-or-with-eax/imm32/next # - or _Primitive-or-with-eax: @@ -3144,6 +3181,7 @@ _Primitive-or-with-eax: 0/imm32/no-rm32 0/imm32/no-r32 1/imm32/imm32-is-first-inout + 0/imm32/output-is-write-only _Primitive-or-reg-with-reg/imm32/next _Primitive-or-reg-with-reg: # var1/reg <- or var2/reg => 09/or var1/rm32 var2/r32 @@ -3154,6 +3192,7 @@ _Primitive-or-reg-with-reg: 3/imm32/rm32-is-first-output 1/imm32/r32-is-first-inout 0/imm32/no-imm32 + 0/imm32/output-is-write-only _Primitive-or-reg-with-mem/imm32/next _Primitive-or-reg-with-mem: # or-with var1 var2/reg => 09/or var1 var2/r32 @@ -3164,6 +3203,7 @@ _Primitive-or-reg-with-mem: 1/imm32/rm32-is-first-inout 2/imm32/r32-is-second-inout 0/imm32/no-imm32 + 0/imm32/output-is-write-only _Primitive-or-mem-with-reg/imm32/next _Primitive-or-mem-with-reg: # var1/reg <- or var2 => 0b/or var2/rm32 var1/r32 @@ -3174,6 +3214,7 @@ _Primitive-or-mem-with-reg: 1/imm32/rm32-is-first-inout 3/imm32/r32-is-first-output 0/imm32/no-imm32 + 0/imm32/output-is-write-only _Primitive-or-lit-with-reg/imm32/next _Primitive-or-lit-with-reg: # var1/reg <- or lit => 81 1/subop/or var1/rm32 lit/imm32 @@ -3184,6 +3225,7 @@ _Primitive-or-lit-with-reg: 3/imm32/rm32-is-first-output 0/imm32/no-r32 1/imm32/imm32-is-first-inout + 0/imm32/output-is-write-only _Primitive-or-lit-with-mem/imm32/next _Primitive-or-lit-with-mem: # or-with var1, lit => 81 1/subop/or var1/rm32 lit/imm32 @@ -3194,6 +3236,7 @@ _Primitive-or-lit-with-mem: 1/imm32/rm32-is-first-inout 0/imm32/no-r32 2/imm32/imm32-is-first-inout + 0/imm32/output-is-write-only _Primitive-xor-with-eax/imm32/next # - xor _Primitive-xor-with-eax: @@ -3205,6 +3248,7 @@ _Primitive-xor-with-eax: 0/imm32/no-rm32 0/imm32/no-r32 1/imm32/imm32-is-first-inout + 0/imm32/output-is-write-only _Primitive-xor-reg-with-reg/imm32/next _Primitive-xor-reg-with-reg: # var1/reg <- xor var2/reg => 31/xor var1/rm32 var2/r32 @@ -3215,6 +3259,7 @@ _Primitive-xor-reg-with-reg: 3/imm32/rm32-is-first-output 1/imm32/r32-is-first-inout 0/imm32/no-imm32 + 0/imm32/output-is-write-only _Primitive-xor-reg-with-mem/imm32/next _Primitive-xor-reg-with-mem: # xor-with var1 var2/reg => 31/xor var1 var2/r32 @@ -3225,6 +3270,7 @@ _Primitive-xor-reg-with-mem: 1/imm32/rm32-is-first-inout 2/imm32/r32-is-second-inout 0/imm32/no-imm32 + 0/imm32/output-is-write-only _Primitive-xor-mem-with-reg/imm32/next _Primitive-xor-mem-with-reg: # var1/reg <- xor var2 => 33/xor var2/rm32 var1/r32 @@ -3235,6 +3281,7 @@ _Primitive-xor-mem-with-reg: 1/imm32/rm32-is-first-inout 3/imm32/r32-is-first-output 0/imm32/no-imm32 + 0/imm32/output-is-write-only _Primitive-xor-lit-with-reg/imm32/next _Primitive-xor-lit-with-reg: # var1/reg <- xor lit => 81 6/subop/xor var1/rm32 lit/imm32 @@ -3245,6 +3292,7 @@ _Primitive-xor-lit-with-reg: 3/imm32/rm32-is-first-output 0/imm32/no-r32 1/imm32/imm32-is-first-inout + 0/imm32/output-is-write-only _Primitive-xor-lit-with-mem/imm32/next _Primitive-xor-lit-with-mem: # xor-with var1, lit => 81 6/subop/xor var1/rm32 lit/imm32 @@ -3255,6 +3303,7 @@ _Primitive-xor-lit-with-mem: 1/imm32/rm32-is-first-inout 0/imm32/no-r32 2/imm32/imm32-is-first-inout + 0/imm32/output-is-write-only 0/imm32/next Single-int-var-on-stack: @@ -3680,7 +3729,7 @@ $find-matching-primitive:loop: } $find-matching-primitive:next-primitive: # curr = curr->next - 8b/-> *(ecx+0x1c) 1/r32/ecx # Primitive-next + 8b/-> *(ecx+0x20) 1/r32/ecx # Primitive-next e9/jump loop/disp32 } # return null @@ -3930,6 +3979,7 @@ test-emit-subx-statement-primitive: 89/<- %esi 4/r32/esp # var primitives/ebx : (ref primitive) 68/push 0/imm32/next + 68/push 0/imm32/output-is-write-only 68/push 0/imm32/no-imm32 68/push 0/imm32/no-r32 68/push 1/imm32/rm32-is-first-inout @@ -4009,6 +4059,7 @@ test-emit-subx-statement-primitive-register: 89/<- %ebx 4/r32/esp # var primitives/ebx : (ref primitive) 68/push 0/imm32/next + 68/push 0/imm32/output-is-write-only 68/push 0/imm32/no-imm32 68/push 0/imm32/no-r32 68/push 3/imm32/rm32-in-first-output @@ -4091,6 +4142,7 @@ test-emit-subx-statement-select-primitive: 89/<- %ebx 4/r32/esp # var primitive1/ebx : (ref primitive) 68/push 0/imm32/next + 68/push 0/imm32/output-is-write-only 68/push 0/imm32/no-imm32 68/push 0/imm32/no-r32 68/push 3/imm32/rm32-in-first-output @@ -4101,6 +4153,7 @@ test-emit-subx-statement-select-primitive: 89/<- %ebx 4/r32/esp # var primitives/ebx : (ref primitive) 53/push-ebx/next + 68/push 0/imm32/output-is-write-only 68/push 0/imm32/no-imm32 68/push 0/imm32/no-r32 68/push 1/imm32/rm32-is-first-inout @@ -4183,6 +4236,7 @@ test-emit-subx-statement-select-primitive-2: 89/<- %ebx 4/r32/esp # var primitive1/ebx : primitive 68/push 0/imm32/next + 68/push 0/imm32/output-is-write-only 68/push 0/imm32/no-imm32 68/push 0/imm32/no-r32 68/push 3/imm32/rm32-in-first-output @@ -4193,6 +4247,7 @@ test-emit-subx-statement-select-primitive-2: 89/<- %ebx 4/r32/esp # var primitives/ebx : (ref primitive) 53/push-ebx/next + 68/push 0/imm32/output-is-write-only 68/push 0/imm32/no-imm32 68/push 0/imm32/no-r32 68/push 1/imm32/rm32-is-first-inout |