996
|
1 /* Automatically generated output, edit source and recompile to change */
|
|
2 #include "oil.h"
|
|
3 int optimize_pass1_4(node *np)
|
|
4 { int opted=0;
|
|
5 unsigned long c,c1,c2,c3,c4,c5,c6,c7,c8,c9;
|
|
6 unsigned long x,x1,x2,x3,x4,x5,x6,x7,x8,x9,r;
|
|
7 int tempw;
|
|
8 node *tp;
|
|
9 checknodeactbits(np);
|
|
10 if(np->opcode==C_OR &&
|
|
11 np->lval->opcode==C_LSHIFTBY &&
|
|
12 np->lval->lval->opcode==C_AND &&
|
|
13 (np->lval->lval->rval->opcode==MESH || np->lval->lval->rval->opcode==MESH32) &&
|
|
14 np->lval->lval->rval->constant==1431655765LU &&
|
|
15 (np->lval->rval->opcode==MESH || np->lval->rval->opcode==MESH32) &&
|
|
16 np->lval->rval->constant==1LU &&
|
|
17 np->rval->opcode==C_LSHIFTBY &&
|
|
18 np->rval->lval->opcode==C_AND &&
|
|
19 (np->rval->lval->rval->opcode==MESH || np->rval->lval->rval->opcode==MESH32) &&
|
|
20 np->rval->lval->rval->constant==715827882LU &&
|
|
21 (np->rval->rval->opcode==MESH || np->rval->rval->opcode==MESH32) &&
|
|
22 np->rval->rval->constant==1LU)
|
|
23 do
|
|
24 {
|
|
25 if(!nodessame(np->lval->lval->lval,np->rval->lval->lval)) break;
|
|
26 x1=np->rval->lval->lval->constant; c1=np->rval->lval->lval->optdata;
|
|
27 OPTING(lshift32by1);
|
|
28 tp=newnode();
|
|
29 MAYBENEWNODE(tp);
|
|
30 tp->opcode=C_LSHIFTBY;
|
|
31 tp->width=32;
|
|
32 MAYBENEWNODE(tp->lval);
|
|
33 tp->lval->opcode=C_AND;
|
|
34 tp->lval->width=32;
|
|
35 tp->lval->lval=np->rval->lval->lval;
|
|
36 np->rval->lval->lval=0;
|
|
37 MAYBENEWNODE(tp->lval->rval);
|
|
38 tp->lval->rval->opcode=MESH32;
|
|
39 tp->lval->rval->width=32;
|
|
40 tp->lval->rval->constant=(2147483647LU);
|
|
41 MAYBENEWNODE(tp->rval);
|
|
42 tp->rval->opcode=MESH32;
|
|
43 tp->rval->width=32;
|
|
44 tp->rval->constant=(1LU);
|
|
45 nodefree(np->lval); nodefree(np->rval);
|
|
46 tempw=np->width; *np=*tp; np->width=tempw; free(tp);
|
|
47 } while(0);
|
|
48
|
|
49 checknodeactbits(np);
|
|
50 if(np->opcode==C_OR &&
|
|
51 np->lval->opcode==C_LSHIFTBY &&
|
|
52 np->lval->lval->opcode==C_AND &&
|
|
53 (np->lval->lval->lval->opcode==MESH || np->lval->lval->lval->opcode==MESH32) &&
|
|
54 np->lval->lval->lval->constant==1431655765LU &&
|
|
55 (np->lval->rval->opcode==MESH || np->lval->rval->opcode==MESH32) &&
|
|
56 np->lval->rval->constant==1LU &&
|
|
57 np->rval->opcode==C_LSHIFTBY &&
|
|
58 np->rval->lval->opcode==C_AND &&
|
|
59 (np->rval->lval->rval->opcode==MESH || np->rval->lval->rval->opcode==MESH32) &&
|
|
60 np->rval->lval->rval->constant==715827882LU &&
|
|
61 (np->rval->rval->opcode==MESH || np->rval->rval->opcode==MESH32) &&
|
|
62 np->rval->rval->constant==1LU)
|
|
63 do
|
|
64 {
|
|
65 if(!nodessame(np->lval->lval->rval,np->rval->lval->lval)) break;
|
|
66 x1=np->rval->lval->lval->constant; c1=np->rval->lval->lval->optdata;
|
|
67 OPTING(lshift32by1);
|
|
68 tp=newnode();
|
|
69 MAYBENEWNODE(tp);
|
|
70 tp->opcode=C_LSHIFTBY;
|
|
71 tp->width=32;
|
|
72 MAYBENEWNODE(tp->lval);
|
|
73 tp->lval->opcode=C_AND;
|
|
74 tp->lval->width=32;
|
|
75 tp->lval->lval=np->rval->lval->lval;
|
|
76 np->rval->lval->lval=0;
|
|
77 MAYBENEWNODE(tp->lval->rval);
|
|
78 tp->lval->rval->opcode=MESH32;
|
|
79 tp->lval->rval->width=32;
|
|
80 tp->lval->rval->constant=(2147483647LU);
|
|
81 MAYBENEWNODE(tp->rval);
|
|
82 tp->rval->opcode=MESH32;
|
|
83 tp->rval->width=32;
|
|
84 tp->rval->constant=(1LU);
|
|
85 nodefree(np->lval); nodefree(np->rval);
|
|
86 tempw=np->width; *np=*tp; np->width=tempw; free(tp);
|
|
87 } while(0);
|
|
88
|
|
89 checknodeactbits(np);
|
|
90 if(np->opcode==C_OR &&
|
|
91 np->lval->opcode==C_LSHIFTBY &&
|
|
92 np->lval->lval->opcode==C_AND &&
|
|
93 (np->lval->lval->rval->opcode==MESH || np->lval->lval->rval->opcode==MESH32) &&
|
|
94 np->lval->lval->rval->constant==1431655765LU &&
|
|
95 (np->lval->rval->opcode==MESH || np->lval->rval->opcode==MESH32) &&
|
|
96 np->lval->rval->constant==1LU &&
|
|
97 np->rval->opcode==C_LSHIFTBY &&
|
|
98 np->rval->lval->opcode==C_AND &&
|
|
99 (np->rval->lval->lval->opcode==MESH || np->rval->lval->lval->opcode==MESH32) &&
|
|
100 np->rval->lval->lval->constant==715827882LU &&
|
|
101 (np->rval->rval->opcode==MESH || np->rval->rval->opcode==MESH32) &&
|
|
102 np->rval->rval->constant==1LU)
|
|
103 do
|
|
104 {
|
|
105 if(!nodessame(np->lval->lval->lval,np->rval->lval->rval)) break;
|
|
106 x1=np->rval->lval->rval->constant; c1=np->rval->lval->rval->optdata;
|
|
107 OPTING(lshift32by1);
|
|
108 tp=newnode();
|
|
109 MAYBENEWNODE(tp);
|
|
110 tp->opcode=C_LSHIFTBY;
|
|
111 tp->width=32;
|
|
112 MAYBENEWNODE(tp->lval);
|
|
113 tp->lval->opcode=C_AND;
|
|
114 tp->lval->width=32;
|
|
115 tp->lval->lval=np->rval->lval->rval;
|
|
116 np->rval->lval->rval=0;
|
|
117 MAYBENEWNODE(tp->lval->rval);
|
|
118 tp->lval->rval->opcode=MESH32;
|
|
119 tp->lval->rval->width=32;
|
|
120 tp->lval->rval->constant=(2147483647LU);
|
|
121 MAYBENEWNODE(tp->rval);
|
|
122 tp->rval->opcode=MESH32;
|
|
123 tp->rval->width=32;
|
|
124 tp->rval->constant=(1LU);
|
|
125 nodefree(np->lval); nodefree(np->rval);
|
|
126 tempw=np->width; *np=*tp; np->width=tempw; free(tp);
|
|
127 } while(0);
|
|
128
|
|
129 checknodeactbits(np);
|
|
130 if(np->opcode==C_OR &&
|
|
131 np->lval->opcode==C_LSHIFTBY &&
|
|
132 np->lval->lval->opcode==C_AND &&
|
|
133 (np->lval->lval->lval->opcode==MESH || np->lval->lval->lval->opcode==MESH32) &&
|
|
134 np->lval->lval->lval->constant==1431655765LU &&
|
|
135 (np->lval->rval->opcode==MESH || np->lval->rval->opcode==MESH32) &&
|
|
136 np->lval->rval->constant==1LU &&
|
|
137 np->rval->opcode==C_LSHIFTBY &&
|
|
138 np->rval->lval->opcode==C_AND &&
|
|
139 (np->rval->lval->lval->opcode==MESH || np->rval->lval->lval->opcode==MESH32) &&
|
|
140 np->rval->lval->lval->constant==715827882LU &&
|
|
141 (np->rval->rval->opcode==MESH || np->rval->rval->opcode==MESH32) &&
|
|
142 np->rval->rval->constant==1LU)
|
|
143 do
|
|
144 {
|
|
145 if(!nodessame(np->lval->lval->rval,np->rval->lval->rval)) break;
|
|
146 x1=np->rval->lval->rval->constant; c1=np->rval->lval->rval->optdata;
|
|
147 OPTING(lshift32by1);
|
|
148 tp=newnode();
|
|
149 MAYBENEWNODE(tp);
|
|
150 tp->opcode=C_LSHIFTBY;
|
|
151 tp->width=32;
|
|
152 MAYBENEWNODE(tp->lval);
|
|
153 tp->lval->opcode=C_AND;
|
|
154 tp->lval->width=32;
|
|
155 tp->lval->lval=np->rval->lval->rval;
|
|
156 np->rval->lval->rval=0;
|
|
157 MAYBENEWNODE(tp->lval->rval);
|
|
158 tp->lval->rval->opcode=MESH32;
|
|
159 tp->lval->rval->width=32;
|
|
160 tp->lval->rval->constant=(2147483647LU);
|
|
161 MAYBENEWNODE(tp->rval);
|
|
162 tp->rval->opcode=MESH32;
|
|
163 tp->rval->width=32;
|
|
164 tp->rval->constant=(1LU);
|
|
165 nodefree(np->lval); nodefree(np->rval);
|
|
166 tempw=np->width; *np=*tp; np->width=tempw; free(tp);
|
|
167 } while(0);
|
|
168
|
|
169 checknodeactbits(np);
|
|
170 if(np->opcode==C_OR &&
|
|
171 np->lval->opcode==C_LSHIFTBY &&
|
|
172 np->lval->lval->opcode==C_AND &&
|
|
173 (np->lval->lval->rval->opcode==MESH || np->lval->lval->rval->opcode==MESH32) &&
|
|
174 np->lval->lval->rval->constant==715827882LU &&
|
|
175 (np->lval->rval->opcode==MESH || np->lval->rval->opcode==MESH32) &&
|
|
176 np->lval->rval->constant==1LU &&
|
|
177 np->rval->opcode==C_LSHIFTBY &&
|
|
178 np->rval->lval->opcode==C_AND &&
|
|
179 (np->rval->lval->rval->opcode==MESH || np->rval->lval->rval->opcode==MESH32) &&
|
|
180 np->rval->lval->rval->constant==1431655765LU &&
|
|
181 (np->rval->rval->opcode==MESH || np->rval->rval->opcode==MESH32) &&
|
|
182 np->rval->rval->constant==1LU)
|
|
183 do
|
|
184 {
|
|
185 if(!nodessame(np->lval->lval->lval,np->rval->lval->lval)) break;
|
|
186 x1=np->rval->lval->lval->constant; c1=np->rval->lval->lval->optdata;
|
|
187 OPTING(lshift32by1);
|
|
188 tp=newnode();
|
|
189 MAYBENEWNODE(tp);
|
|
190 tp->opcode=C_LSHIFTBY;
|
|
191 tp->width=32;
|
|
192 MAYBENEWNODE(tp->lval);
|
|
193 tp->lval->opcode=C_AND;
|
|
194 tp->lval->width=32;
|
|
195 tp->lval->lval=np->rval->lval->lval;
|
|
196 np->rval->lval->lval=0;
|
|
197 MAYBENEWNODE(tp->lval->rval);
|
|
198 tp->lval->rval->opcode=MESH32;
|
|
199 tp->lval->rval->width=32;
|
|
200 tp->lval->rval->constant=(2147483647LU);
|
|
201 MAYBENEWNODE(tp->rval);
|
|
202 tp->rval->opcode=MESH32;
|
|
203 tp->rval->width=32;
|
|
204 tp->rval->constant=(1LU);
|
|
205 nodefree(np->lval); nodefree(np->rval);
|
|
206 tempw=np->width; *np=*tp; np->width=tempw; free(tp);
|
|
207 } while(0);
|
|
208
|
|
209 checknodeactbits(np);
|
|
210 if(np->opcode==C_OR &&
|
|
211 np->lval->opcode==C_LSHIFTBY &&
|
|
212 np->lval->lval->opcode==C_AND &&
|
|
213 (np->lval->lval->rval->opcode==MESH || np->lval->lval->rval->opcode==MESH32) &&
|
|
214 np->lval->lval->rval->constant==715827882LU &&
|
|
215 (np->lval->rval->opcode==MESH || np->lval->rval->opcode==MESH32) &&
|
|
216 np->lval->rval->constant==1LU &&
|
|
217 np->rval->opcode==C_LSHIFTBY &&
|
|
218 np->rval->lval->opcode==C_AND &&
|
|
219 (np->rval->lval->lval->opcode==MESH || np->rval->lval->lval->opcode==MESH32) &&
|
|
220 np->rval->lval->lval->constant==1431655765LU &&
|
|
221 (np->rval->rval->opcode==MESH || np->rval->rval->opcode==MESH32) &&
|
|
222 np->rval->rval->constant==1LU)
|
|
223 do
|
|
224 {
|
|
225 if(!nodessame(np->lval->lval->lval,np->rval->lval->rval)) break;
|
|
226 x1=np->rval->lval->rval->constant; c1=np->rval->lval->rval->optdata;
|
|
227 OPTING(lshift32by1);
|
|
228 tp=newnode();
|
|
229 MAYBENEWNODE(tp);
|
|
230 tp->opcode=C_LSHIFTBY;
|
|
231 tp->width=32;
|
|
232 MAYBENEWNODE(tp->lval);
|
|
233 tp->lval->opcode=C_AND;
|
|
234 tp->lval->width=32;
|
|
235 tp->lval->lval=np->rval->lval->rval;
|
|
236 np->rval->lval->rval=0;
|
|
237 MAYBENEWNODE(tp->lval->rval);
|
|
238 tp->lval->rval->opcode=MESH32;
|
|
239 tp->lval->rval->width=32;
|
|
240 tp->lval->rval->constant=(2147483647LU);
|
|
241 MAYBENEWNODE(tp->rval);
|
|
242 tp->rval->opcode=MESH32;
|
|
243 tp->rval->width=32;
|
|
244 tp->rval->constant=(1LU);
|
|
245 nodefree(np->lval); nodefree(np->rval);
|
|
246 tempw=np->width; *np=*tp; np->width=tempw; free(tp);
|
|
247 } while(0);
|
|
248
|
|
249 checknodeactbits(np);
|
|
250 if(np->opcode==C_OR &&
|
|
251 np->lval->opcode==C_LSHIFTBY &&
|
|
252 np->lval->lval->opcode==C_AND &&
|
|
253 (np->lval->lval->lval->opcode==MESH || np->lval->lval->lval->opcode==MESH32) &&
|
|
254 np->lval->lval->lval->constant==715827882LU &&
|
|
255 (np->lval->rval->opcode==MESH || np->lval->rval->opcode==MESH32) &&
|
|
256 np->lval->rval->constant==1LU &&
|
|
257 np->rval->opcode==C_LSHIFTBY &&
|
|
258 np->rval->lval->opcode==C_AND &&
|
|
259 (np->rval->lval->rval->opcode==MESH || np->rval->lval->rval->opcode==MESH32) &&
|
|
260 np->rval->lval->rval->constant==1431655765LU &&
|
|
261 (np->rval->rval->opcode==MESH || np->rval->rval->opcode==MESH32) &&
|
|
262 np->rval->rval->constant==1LU)
|
|
263 do
|
|
264 {
|
|
265 if(!nodessame(np->lval->lval->rval,np->rval->lval->lval)) break;
|
|
266 x1=np->rval->lval->lval->constant; c1=np->rval->lval->lval->optdata;
|
|
267 OPTING(lshift32by1);
|
|
268 tp=newnode();
|
|
269 MAYBENEWNODE(tp);
|
|
270 tp->opcode=C_LSHIFTBY;
|
|
271 tp->width=32;
|
|
272 MAYBENEWNODE(tp->lval);
|
|
273 tp->lval->opcode=C_AND;
|
|
274 tp->lval->width=32;
|
|
275 tp->lval->lval=np->rval->lval->lval;
|
|
276 np->rval->lval->lval=0;
|
|
277 MAYBENEWNODE(tp->lval->rval);
|
|
278 tp->lval->rval->opcode=MESH32;
|
|
279 tp->lval->rval->width=32;
|
|
280 tp->lval->rval->constant=(2147483647LU);
|
|
281 MAYBENEWNODE(tp->rval);
|
|
282 tp->rval->opcode=MESH32;
|
|
283 tp->rval->width=32;
|
|
284 tp->rval->constant=(1LU);
|
|
285 nodefree(np->lval); nodefree(np->rval);
|
|
286 tempw=np->width; *np=*tp; np->width=tempw; free(tp);
|
|
287 } while(0);
|
|
288
|
|
289 checknodeactbits(np);
|
|
290 if(np->opcode==C_OR &&
|
|
291 np->lval->opcode==C_LSHIFTBY &&
|
|
292 np->lval->lval->opcode==C_AND &&
|
|
293 (np->lval->lval->lval->opcode==MESH || np->lval->lval->lval->opcode==MESH32) &&
|
|
294 np->lval->lval->lval->constant==715827882LU &&
|
|
295 (np->lval->rval->opcode==MESH || np->lval->rval->opcode==MESH32) &&
|
|
296 np->lval->rval->constant==1LU &&
|
|
297 np->rval->opcode==C_LSHIFTBY &&
|
|
298 np->rval->lval->opcode==C_AND &&
|
|
299 (np->rval->lval->lval->opcode==MESH || np->rval->lval->lval->opcode==MESH32) &&
|
|
300 np->rval->lval->lval->constant==1431655765LU &&
|
|
301 (np->rval->rval->opcode==MESH || np->rval->rval->opcode==MESH32) &&
|
|
302 np->rval->rval->constant==1LU)
|
|
303 do
|
|
304 {
|
|
305 if(!nodessame(np->lval->lval->rval,np->rval->lval->rval)) break;
|
|
306 x1=np->rval->lval->rval->constant; c1=np->rval->lval->rval->optdata;
|
|
307 OPTING(lshift32by1);
|
|
308 tp=newnode();
|
|
309 MAYBENEWNODE(tp);
|
|
310 tp->opcode=C_LSHIFTBY;
|
|
311 tp->width=32;
|
|
312 MAYBENEWNODE(tp->lval);
|
|
313 tp->lval->opcode=C_AND;
|
|
314 tp->lval->width=32;
|
|
315 tp->lval->lval=np->rval->lval->rval;
|
|
316 np->rval->lval->rval=0;
|
|
317 MAYBENEWNODE(tp->lval->rval);
|
|
318 tp->lval->rval->opcode=MESH32;
|
|
319 tp->lval->rval->width=32;
|
|
320 tp->lval->rval->constant=(2147483647LU);
|
|
321 MAYBENEWNODE(tp->rval);
|
|
322 tp->rval->opcode=MESH32;
|
|
323 tp->rval->width=32;
|
|
324 tp->rval->constant=(1LU);
|
|
325 nodefree(np->lval); nodefree(np->rval);
|
|
326 tempw=np->width; *np=*tp; np->width=tempw; free(tp);
|
|
327 } while(0);
|
|
328
|
|
329 checknodeactbits(np);
|
|
330 if(np->opcode==MINGLE &&
|
|
331 (np->lval->opcode==MESH || np->lval->opcode==MESH32) &&
|
|
332 np->lval->constant==0LU &&
|
|
333 np->rval->opcode==SELECT &&
|
|
334 np->rval->lval->opcode==C_AND &&
|
|
335 np->rval->lval->lval->width==32 &&
|
|
336 (np->rval->lval->rval->opcode==MESH || np->rval->lval->rval->opcode==MESH32) &&
|
|
337 np->rval->lval->rval->constant==2863311530LU &&
|
|
338 (np->rval->rval->opcode==MESH || np->rval->rval->opcode==MESH32) &&
|
|
339 np->rval->rval->constant==715827883LU)
|
|
340 do
|
|
341 {
|
|
342 x1=np->rval->lval->lval->constant; c1=np->rval->lval->lval->optdata;
|
|
343 OPTING(lshift32half);
|
|
344 tp=newnode();
|
|
345 MAYBENEWNODE(tp);
|
|
346 tp->opcode=C_LSHIFTBY;
|
|
347 tp->width=32;
|
|
348 MAYBENEWNODE(tp->lval);
|
|
349 tp->lval->opcode=C_AND;
|
|
350 tp->lval->width=32;
|
|
351 tp->lval->lval=np->rval->lval->lval;
|
|
352 np->rval->lval->lval=0;
|
|
353 MAYBENEWNODE(tp->lval->rval);
|
|
354 tp->lval->rval->opcode=MESH32;
|
|
355 tp->lval->rval->width=32;
|
|
356 tp->lval->rval->constant=(2863311530LU);
|
|
357 MAYBENEWNODE(tp->rval);
|
|
358 tp->rval->opcode=MESH32;
|
|
359 tp->rval->width=32;
|
|
360 tp->rval->constant=(1LU);
|
|
361 nodefree(np->lval); nodefree(np->rval);
|
|
362 tempw=np->width; *np=*tp; np->width=tempw; free(tp);
|
|
363 } while(0);
|
|
364
|
|
365 checknodeactbits(np);
|
|
366 if(np->opcode==C_NOT &&
|
|
367 np->width==16 &&
|
|
368 np->rval->opcode==C_RSHIFTBY &&
|
|
369 np->rval->lval->width==16 &&
|
|
370 (np->rval->rval->opcode==MESH || np->rval->rval->opcode==MESH32))
|
|
371 do
|
|
372 {
|
|
373 x2=np->rval->rval->constant; c2=np->rval->rval->optdata;
|
|
374 x1=np->rval->lval->constant; c1=np->rval->lval->optdata;
|
|
375 OPTING(rshiftoutofneg);
|
|
376 tp=newnode();
|
|
377 MAYBENEWNODE(tp);
|
|
378 tp->opcode=C_OR;
|
|
379 tp->width=32;
|
|
380 MAYBENEWNODE(tp->lval);
|
|
381 tp->lval->opcode=C_RSHIFTBY;
|
|
382 tp->lval->width=32;
|
|
383 MAYBENEWNODE(tp->lval->lval);
|
|
384 tp->lval->lval->opcode=C_NOT;
|
|
385 tp->lval->lval->width=16;
|
|
386 tp->lval->lval->rval=np->rval->lval;
|
|
387 np->rval->lval=0;
|
|
388 tp->lval->rval=np->rval->rval;
|
|
389 np->rval->rval=0;
|
|
390 MAYBENEWNODE(tp->rval);
|
|
391 tp->rval->opcode=MESH32;
|
|
392 tp->rval->width=32;
|
|
393 tp->rval->constant=(32768LU);
|
|
394 nodefree(np->lval); nodefree(np->rval);
|
|
395 tempw=np->width; *np=*tp; np->width=tempw; free(tp);
|
|
396 } while(0);
|
|
397
|
|
398 checknodeactbits(np);
|
|
399 if(np->opcode==C_NOT &&
|
|
400 np->width==32 &&
|
|
401 np->rval->opcode==C_RSHIFTBY &&
|
|
402 np->rval->lval->width==32 &&
|
|
403 (np->rval->rval->opcode==MESH || np->rval->rval->opcode==MESH32))
|
|
404 do
|
|
405 {
|
|
406 x2=np->rval->rval->constant; c2=np->rval->rval->optdata;
|
|
407 x1=np->rval->lval->constant; c1=np->rval->lval->optdata;
|
|
408 OPTING(rshiftoutofneg);
|
|
409 tp=newnode();
|
|
410 MAYBENEWNODE(tp);
|
|
411 tp->opcode=C_OR;
|
|
412 tp->width=32;
|
|
413 MAYBENEWNODE(tp->lval);
|
|
414 tp->lval->opcode=C_RSHIFTBY;
|
|
415 tp->lval->width=32;
|
|
416 MAYBENEWNODE(tp->lval->lval);
|
|
417 tp->lval->lval->opcode=C_NOT;
|
|
418 tp->lval->lval->width=32;
|
|
419 tp->lval->lval->rval=np->rval->lval;
|
|
420 np->rval->lval=0;
|
|
421 tp->lval->rval=np->rval->rval;
|
|
422 np->rval->rval=0;
|
|
423 MAYBENEWNODE(tp->rval);
|
|
424 tp->rval->opcode=MESH32;
|
|
425 tp->rval->width=32;
|
|
426 tp->rval->constant=(2147483648LU);
|
|
427 nodefree(np->lval); nodefree(np->rval);
|
|
428 tempw=np->width; *np=*tp; np->width=tempw; free(tp);
|
|
429 } while(0);
|
|
430
|
|
431 checknodeactbits(np);
|
|
432 if(np->opcode==C_NOT &&
|
|
433 np->width==16 &&
|
|
434 np->rval->opcode==C_AND &&
|
|
435 np->rval->lval->width==16 &&
|
|
436 (np->rval->rval->opcode==MESH || np->rval->rval->opcode==MESH32))
|
|
437 do
|
|
438 {
|
|
439 x2=np->rval->rval->constant; c2=np->rval->rval->optdata;
|
|
440 x1=np->rval->lval->constant; c1=np->rval->lval->optdata;
|
|
441 OPTING(andoutofneg);
|
|
442 tp=newnode();
|
|
443 MAYBENEWNODE(tp);
|
|
444 tp->opcode=C_OR;
|
|
445 tp->width=32;
|
|
446 MAYBENEWNODE(tp->lval);
|
|
447 tp->lval->opcode=C_AND;
|
|
448 tp->lval->width=32;
|
|
449 MAYBENEWNODE(tp->lval->lval);
|
|
450 tp->lval->lval->opcode=C_NOT;
|
|
451 tp->lval->lval->width=16;
|
|
452 tp->lval->lval->rval=np->rval->lval;
|
|
453 np->rval->lval=0;
|
|
454 tp->lval->rval=np->rval->rval;
|
|
455 np->rval->rval=0;
|
|
456 MAYBENEWNODE(tp->rval);
|
|
457 tp->rval->opcode=MESH32;
|
|
458 tp->rval->width=32;
|
|
459 tp->rval->constant=((~x2)&65535);
|
|
460 nodefree(np->lval); nodefree(np->rval);
|
|
461 tempw=np->width; *np=*tp; np->width=tempw; free(tp);
|
|
462 } while(0);
|
|
463
|
|
464 checknodeactbits(np);
|
|
465 if(np->opcode==C_NOT &&
|
|
466 np->width==32 &&
|
|
467 np->rval->opcode==C_AND &&
|
|
468 np->rval->lval->width==32 &&
|
|
469 (np->rval->rval->opcode==MESH || np->rval->rval->opcode==MESH32))
|
|
470 do
|
|
471 {
|
|
472 x2=np->rval->rval->constant; c2=np->rval->rval->optdata;
|
|
473 x1=np->rval->lval->constant; c1=np->rval->lval->optdata;
|
|
474 OPTING(andoutofneg);
|
|
475 tp=newnode();
|
|
476 MAYBENEWNODE(tp);
|
|
477 tp->opcode=C_OR;
|
|
478 tp->width=32;
|
|
479 MAYBENEWNODE(tp->lval);
|
|
480 tp->lval->opcode=C_AND;
|
|
481 tp->lval->width=32;
|
|
482 MAYBENEWNODE(tp->lval->lval);
|
|
483 tp->lval->lval->opcode=C_NOT;
|
|
484 tp->lval->lval->width=32;
|
|
485 tp->lval->lval->rval=np->rval->lval;
|
|
486 np->rval->lval=0;
|
|
487 tp->lval->rval=np->rval->rval;
|
|
488 np->rval->rval=0;
|
|
489 MAYBENEWNODE(tp->rval);
|
|
490 tp->rval->opcode=MESH32;
|
|
491 tp->rval->width=32;
|
|
492 tp->rval->constant=(~x2);
|
|
493 nodefree(np->lval); nodefree(np->rval);
|
|
494 tempw=np->width; *np=*tp; np->width=tempw; free(tp);
|
|
495 } while(0);
|
|
496
|
|
497 checknodeactbits(np);
|
|
498 if(np->opcode==C_AND &&
|
|
499 np->lval->opcode==C_LSHIFTBY &&
|
|
500 (np->lval->rval->opcode==MESH || np->lval->rval->opcode==MESH32) &&
|
|
501 (np->rval->opcode==MESH || np->rval->opcode==MESH32))
|
|
502 do
|
|
503 {
|
|
504 x3=np->rval->constant; c3=np->rval->optdata;
|
|
505 x2=np->lval->rval->constant; c2=np->lval->rval->optdata;
|
|
506 x1=np->lval->lval->constant; c1=np->lval->lval->optdata;
|
|
507 OPTING(andintoshift);
|
|
508 tp=newnode();
|
|
509 MAYBENEWNODE(tp);
|
|
510 tp->opcode=C_LSHIFTBY;
|
|
511 tp->width=32;
|
|
512 MAYBENEWNODE(tp->lval);
|
|
513 tp->lval->opcode=C_AND;
|
|
514 tp->lval->width=32;
|
|
515 tp->lval->lval=np->lval->lval;
|
|
516 np->lval->lval=0;
|
|
517 MAYBENEWNODE(tp->lval->rval);
|
|
518 tp->lval->rval->opcode=MESH32;
|
|
519 tp->lval->rval->width=32;
|
|
520 tp->lval->rval->constant=(x3>>x2);
|
|
521 tp->rval=np->lval->rval;
|
|
522 np->lval->rval=0;
|
|
523 nodefree(np->lval); nodefree(np->rval);
|
|
524 tempw=np->width; *np=*tp; np->width=tempw; free(tp);
|
|
525 } while(0);
|
|
526
|
|
527 checknodeactbits(np);
|
|
528 if(np->opcode==C_AND &&
|
|
529 np->lval->opcode==C_RSHIFTBY &&
|
|
530 (np->lval->rval->opcode==MESH || np->lval->rval->opcode==MESH32) &&
|
|
531 (np->rval->opcode==MESH || np->rval->opcode==MESH32))
|
|
532 do
|
|
533 {
|
|
534 x3=np->rval->constant; c3=np->rval->optdata;
|
|
535 x2=np->lval->rval->constant; c2=np->lval->rval->optdata;
|
|
536 x1=np->lval->lval->constant; c1=np->lval->lval->optdata;
|
|
537 OPTING(andintoshift);
|
|
538 tp=newnode();
|
|
539 MAYBENEWNODE(tp);
|
|
540 tp->opcode=C_RSHIFTBY;
|
|
541 tp->width=32;
|
|
542 MAYBENEWNODE(tp->lval);
|
|
543 tp->lval->opcode=C_AND;
|
|
544 tp->lval->width=32;
|
|
545 tp->lval->lval=np->lval->lval;
|
|
546 np->lval->lval=0;
|
|
547 MAYBENEWNODE(tp->lval->rval);
|
|
548 tp->lval->rval->opcode=MESH32;
|
|
549 tp->lval->rval->width=32;
|
|
550 tp->lval->rval->constant=(x3<<x2);
|
|
551 tp->rval=np->lval->rval;
|
|
552 np->lval->rval=0;
|
|
553 nodefree(np->lval); nodefree(np->rval);
|
|
554 tempw=np->width; *np=*tp; np->width=tempw; free(tp);
|
|
555 } while(0);
|
|
556
|
|
557 checknodeactbits(np);
|
|
558 if(np->opcode==C_LSHIFTBY &&
|
|
559 np->lval->opcode==C_OR &&
|
|
560 (np->lval->rval->opcode==MESH || np->lval->rval->opcode==MESH32) &&
|
|
561 (np->rval->opcode==MESH || np->rval->opcode==MESH32))
|
|
562 do
|
|
563 {
|
|
564 x3=np->rval->constant; c3=np->rval->optdata;
|
|
565 x2=np->lval->rval->constant; c2=np->lval->rval->optdata;
|
|
566 x1=np->lval->lval->constant; c1=np->lval->lval->optdata;
|
|
567 OPTING(oroutofshift);
|
|
568 tp=newnode();
|
|
569 MAYBENEWNODE(tp);
|
|
570 tp->opcode=C_OR;
|
|
571 tp->width=32;
|
|
572 MAYBENEWNODE(tp->lval);
|
|
573 tp->lval->opcode=C_LSHIFTBY;
|
|
574 tp->lval->width=32;
|
|
575 tp->lval->lval=np->lval->lval;
|
|
576 np->lval->lval=0;
|
|
577 tp->lval->rval=np->rval;
|
|
578 np->rval=0;
|
|
579 MAYBENEWNODE(tp->rval);
|
|
580 tp->rval->opcode=MESH32;
|
|
581 tp->rval->width=32;
|
|
582 tp->rval->constant=(x2<<x3);
|
|
583 nodefree(np->lval); nodefree(np->rval);
|
|
584 tempw=np->width; *np=*tp; np->width=tempw; free(tp);
|
|
585 } while(0);
|
|
586
|
|
587 checknodeactbits(np);
|
|
588 if(np->opcode==C_RSHIFTBY &&
|
|
589 np->lval->opcode==C_OR &&
|
|
590 (np->lval->rval->opcode==MESH || np->lval->rval->opcode==MESH32) &&
|
|
591 (np->rval->opcode==MESH || np->rval->opcode==MESH32))
|
|
592 do
|
|
593 {
|
|
594 x3=np->rval->constant; c3=np->rval->optdata;
|
|
595 x2=np->lval->rval->constant; c2=np->lval->rval->optdata;
|
|
596 x1=np->lval->lval->constant; c1=np->lval->lval->optdata;
|
|
597 OPTING(oroutofshift);
|
|
598 tp=newnode();
|
|
599 MAYBENEWNODE(tp);
|
|
600 tp->opcode=C_OR;
|
|
601 tp->width=32;
|
|
602 MAYBENEWNODE(tp->lval);
|
|
603 tp->lval->opcode=C_RSHIFTBY;
|
|
604 tp->lval->width=32;
|
|
605 tp->lval->lval=np->lval->lval;
|
|
606 np->lval->lval=0;
|
|
607 tp->lval->rval=np->rval;
|
|
608 np->rval=0;
|
|
609 MAYBENEWNODE(tp->rval);
|
|
610 tp->rval->opcode=MESH32;
|
|
611 tp->rval->width=32;
|
|
612 tp->rval->constant=(x2>>x3);
|
|
613 nodefree(np->lval); nodefree(np->rval);
|
|
614 tempw=np->width; *np=*tp; np->width=tempw; free(tp);
|
|
615 } while(0);
|
|
616
|
|
617 checknodeactbits(np);
|
|
618 if(np->opcode==C_LSHIFTBY &&
|
|
619 np->lval->opcode==C_XOR &&
|
|
620 (np->lval->rval->opcode==MESH || np->lval->rval->opcode==MESH32) &&
|
|
621 (np->rval->opcode==MESH || np->rval->opcode==MESH32))
|
|
622 do
|
|
623 {
|
|
624 x3=np->rval->constant; c3=np->rval->optdata;
|
|
625 x2=np->lval->rval->constant; c2=np->lval->rval->optdata;
|
|
626 x1=np->lval->lval->constant; c1=np->lval->lval->optdata;
|
|
627 OPTING(xoroutofshift);
|
|
628 tp=newnode();
|
|
629 MAYBENEWNODE(tp);
|
|
630 tp->opcode=C_XOR;
|
|
631 tp->width=32;
|
|
632 MAYBENEWNODE(tp->lval);
|
|
633 tp->lval->opcode=C_LSHIFTBY;
|
|
634 tp->lval->width=32;
|
|
635 tp->lval->lval=np->lval->lval;
|
|
636 np->lval->lval=0;
|
|
637 tp->lval->rval=np->rval;
|
|
638 np->rval=0;
|
|
639 MAYBENEWNODE(tp->rval);
|
|
640 tp->rval->opcode=MESH32;
|
|
641 tp->rval->width=32;
|
|
642 tp->rval->constant=(x2<<x3);
|
|
643 nodefree(np->lval); nodefree(np->rval);
|
|
644 tempw=np->width; *np=*tp; np->width=tempw; free(tp);
|
|
645 } while(0);
|
|
646
|
|
647 checknodeactbits(np);
|
|
648 if(np->opcode==C_RSHIFTBY &&
|
|
649 np->lval->opcode==C_XOR &&
|
|
650 (np->lval->rval->opcode==MESH || np->lval->rval->opcode==MESH32) &&
|
|
651 (np->rval->opcode==MESH || np->rval->opcode==MESH32))
|
|
652 do
|
|
653 {
|
|
654 x3=np->rval->constant; c3=np->rval->optdata;
|
|
655 x2=np->lval->rval->constant; c2=np->lval->rval->optdata;
|
|
656 x1=np->lval->lval->constant; c1=np->lval->lval->optdata;
|
|
657 OPTING(xoroutofshift);
|
|
658 tp=newnode();
|
|
659 MAYBENEWNODE(tp);
|
|
660 tp->opcode=C_XOR;
|
|
661 tp->width=32;
|
|
662 MAYBENEWNODE(tp->lval);
|
|
663 tp->lval->opcode=C_RSHIFTBY;
|
|
664 tp->lval->width=32;
|
|
665 tp->lval->lval=np->lval->lval;
|
|
666 np->lval->lval=0;
|
|
667 tp->lval->rval=np->rval;
|
|
668 np->rval=0;
|
|
669 MAYBENEWNODE(tp->rval);
|
|
670 tp->rval->opcode=MESH32;
|
|
671 tp->rval->width=32;
|
|
672 tp->rval->constant=(x2>>x3);
|
|
673 nodefree(np->lval); nodefree(np->rval);
|
|
674 tempw=np->width; *np=*tp; np->width=tempw; free(tp);
|
|
675 } while(0);
|
|
676
|
|
677 checknodeactbits(np);
|
|
678 if(np->opcode==C_LSHIFTBY &&
|
|
679 np->lval->opcode==C_LSHIFTBY &&
|
|
680 (np->lval->rval->opcode==MESH || np->lval->rval->opcode==MESH32) &&
|
|
681 (np->rval->opcode==MESH || np->rval->opcode==MESH32))
|
|
682 do
|
|
683 {
|
|
684 x3=np->rval->constant; c3=np->rval->optdata;
|
|
685 x2=np->lval->rval->constant; c2=np->lval->rval->optdata;
|
|
686 x1=np->lval->lval->constant; c1=np->lval->lval->optdata;
|
|
687 OPTING(combinellshift);
|
|
688 tp=newnode();
|
|
689 MAYBENEWNODE(tp);
|
|
690 tp->opcode=C_LSHIFTBY;
|
|
691 tp->width=32;
|
|
692 tp->lval=np->lval->lval;
|
|
693 np->lval->lval=0;
|
|
694 MAYBENEWNODE(tp->rval);
|
|
695 tp->rval->opcode=MESH32;
|
|
696 tp->rval->width=32;
|
|
697 tp->rval->constant=(x2+x3);
|
|
698 nodefree(np->lval); nodefree(np->rval);
|
|
699 tempw=np->width; *np=*tp; np->width=tempw; free(tp);
|
|
700 } while(0);
|
|
701
|
|
702 c=c1=c2=c3=c4=c5=c6=c7=c8=c9=0;
|
|
703 x=x1=x2=x3=x4=x5=x6=x7=x8=x9=r=0;
|
|
704 if(c+c1+c2+c3+c4+c5+c6+c7+c8+c9+r+
|
|
705 x+x1+x2+x3+x4+x5+x6+x7+x8+x9) raise(SIGSEGV);
|
|
706 return opted;
|
|
707 }
|