about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2020-02-20 11:56:50 -0800
committerKartik Agaram <vc@akkartik.com>2020-02-20 11:56:50 -0800
commit0d754bd6d90c1c662b2282d36d30d654142f20dc (patch)
treeff5219a12992340af80b5e00d6212ce7039e0192
parent5d1d61012dc1449feb8928bbf516532afe1c4965 (diff)
downloadmu-0d754bd6d90c1c662b2282d36d30d654142f20dc.tar.gz
6031 - bugfix in selecting codegen pattern
-rwxr-xr-xapps/mubin147384 -> 147461 bytes
-rw-r--r--apps/mu.subx29
2 files changed, 23 insertions, 6 deletions
diff --git a/apps/mu b/apps/mu
index aa1dd742..97a85f1b 100755
--- a/apps/mu
+++ b/apps/mu
Binary files differdiff --git a/apps/mu.subx b/apps/mu.subx
index 30b9db93..6f63b8f7 100644
--- a/apps/mu.subx
+++ b/apps/mu.subx
@@ -6178,8 +6178,20 @@ _Primitive-compare-eax-with-literal:
     2/imm32/imm32-is-second-inout
     0/imm32/no-disp32
     0/imm32/output-is-write-only
-    _Primitive-compare-regmem-with-literal/imm32/next
-_Primitive-compare-regmem-with-literal:
+    _Primitive-compare-reg-with-literal/imm32/next
+_Primitive-compare-reg-with-literal:
+    # compare var1/reg n => 81 7/subop/compare %reg n/imm32
+    "compare"/imm32/name
+    Int-var-in-register-and-literal/imm32/inouts
+    0/imm32/outputs
+    "81 7/subop/compare"/imm32/subx-name
+    1/imm32/rm32-is-first-inout
+    0/imm32/no-r32
+    2/imm32/imm32-is-second-inout
+    0/imm32/no-disp32
+    0/imm32/output-is-write-only
+    _Primitive-compare-mem-with-literal/imm32/next
+_Primitive-compare-mem-with-literal:
     # compare var1 n => 81 7/subop/compare *(ebp+___) n/imm32
     "compare"/imm32/name
     Int-var-and-literal/imm32/inouts
@@ -6718,6 +6730,10 @@ Int-var-and-literal:
     Int-var-on-stack/imm32
     Single-lit-var/imm32/next
 
+Int-var-in-register-and-literal:
+    Int-var-in-some-register/imm32
+    Single-lit-var/imm32/next
+
 Single-int-var-in-some-register:
     Int-var-in-some-register/imm32
     0/imm32/next
@@ -7419,7 +7435,8 @@ operand-matches-primitive?:  # var: (handle var), prim-var: (handle var) -> resu
       3d/compare-eax-and 0/imm32
       74/jump-if-=  $operand-matches-primitive?:end/disp8  # eax goes from meaning var->register to result
       81 7/subop/compare *(edi+0x10) 0/imm32  # Var-register
-      74/jump-if-=  $operand-matches-primitive?:end/disp8  # eax goes from meaning var->register to result
+      b8/copy-to-eax 0/imm32/false
+      74/jump-if-=  $operand-matches-primitive?:end/disp8
       # if prim-var->register is wildcard, it's a match
       (string-equal? *(edi+0x10) Any-register)  # Var-register => eax
       3d/compare-eax-and 0/imm32/false
@@ -7944,8 +7961,8 @@ test-increment-var:
     89/<- %edi 4/r32/esp
     # var stmt/esi: statement
     68/push 0/imm32/next
-    68/push 0/imm32/outputs
-    57/push-edi/inouts
+    57/push-edi/outputs
+    68/push 0/imm32/inouts
     68/push "increment"/imm32/operation
     68/push 1/imm32
     89/<- %esi 4/r32/esp
@@ -7960,7 +7977,7 @@ test-increment-var:
 #?     (rewind-stream _test-output-stream)
 #?     # }}}
     # check output
-    (check-next-stream-line-equal _test-output-stream "ff 0/subop/increment %eax" "F - test-increment-var")
+    (check-next-stream-line-equal _test-output-stream "40/increment-eax" "F - test-increment-var")
     # . epilogue
     89/<- %esp 5/r32/ebp
     5d/pop-to-ebp
ik K. Agaram <vc@akkartik.com> 2016-08-20 20:01:34 -0700 3235' href='/akkartik/mu/commit/html/090scenario_filesystem_test.mu.html?h=main&id=8e7b4429787bc2b7fe289f264d09a4b1f5f6b081'>8e7b4429 ^
e5c11a51 ^
8e7b4429 ^
204dae92 ^




9e751bb8 ^


204dae92 ^
6c52e24e ^
204dae92 ^





9e751bb8 ^




204dae92 ^






6c52e24e ^



204dae92 ^
201458e3 ^
204dae92 ^

9e751bb8 ^
204dae92 ^





9e751bb8 ^


204dae92 ^
6c52e24e ^



204dae92 ^
201458e3 ^
204dae92 ^

9e751bb8 ^
204dae92 ^





9e751bb8 ^
204dae92 ^
6c52e24e ^



204dae92 ^
201458e3 ^
204dae92 ^

9e751bb8 ^
204dae92 ^





9e751bb8 ^



204dae92 ^
6c52e24e ^



204dae92 ^
201458e3 ^
204dae92 ^
201458e3 ^
204dae92 ^


9e751bb8 ^

204dae92 ^

8e7b4429 ^



1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161