996
|
1 /* Automatically generated output, edit source and recompile to change */
|
|
2 #include "oil.h"
|
|
3 int optimize_pass1_e(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_PLUS &&
|
|
11 (np->lval->opcode==MESH || np->lval->opcode==MESH32) &&
|
|
12 np->lval->constant==1LU &&
|
|
13 np->rval->opcode==C_LOGICALNOT)
|
|
14 do
|
|
15 {
|
|
16 x1=np->rval->rval->constant; c1=np->rval->rval->optdata;
|
|
17 x=x1; c=c1; if(!(c==1)) break;
|
|
18 OPTING(not21);
|
|
19 tp=newnode();
|
|
20 MAYBENEWNODE(tp);
|
|
21 tp->opcode=C_MINUS;
|
|
22 tp->width=32;
|
|
23 MAYBENEWNODE(tp->lval);
|
|
24 tp->lval->opcode=MESH32;
|
|
25 tp->lval->width=32;
|
|
26 tp->lval->constant=(2LU);
|
|
27 tp->rval=np->rval->rval;
|
|
28 np->rval->rval=0;
|
|
29 nodefree(np->lval); nodefree(np->rval);
|
|
30 tempw=np->width; *np=*tp; np->width=tempw; free(tp);
|
|
31 } while(0);
|
|
32
|
|
33 checknodeactbits(np);
|
|
34 if(np->opcode==C_PLUS &&
|
|
35 np->lval->opcode==C_LOGICALNOT &&
|
|
36 (np->rval->opcode==MESH || np->rval->opcode==MESH32) &&
|
|
37 np->rval->constant==1LU)
|
|
38 do
|
|
39 {
|
|
40 x1=np->lval->rval->constant; c1=np->lval->rval->optdata;
|
|
41 x=x1; c=c1; if(!(c==1)) break;
|
|
42 OPTING(not21);
|
|
43 tp=newnode();
|
|
44 MAYBENEWNODE(tp);
|
|
45 tp->opcode=C_MINUS;
|
|
46 tp->width=32;
|
|
47 MAYBENEWNODE(tp->lval);
|
|
48 tp->lval->opcode=MESH32;
|
|
49 tp->lval->width=32;
|
|
50 tp->lval->constant=(2LU);
|
|
51 tp->rval=np->lval->rval;
|
|
52 np->lval->rval=0;
|
|
53 nodefree(np->lval); nodefree(np->rval);
|
|
54 tempw=np->width; *np=*tp; np->width=tempw; free(tp);
|
|
55 } while(0);
|
|
56
|
|
57 checknodeactbits(np);
|
|
58 if(np->opcode==MINGLE &&
|
|
59 (np->lval->opcode==MESH || np->lval->opcode==MESH32) &&
|
|
60 np->lval->constant==0LU)
|
|
61 do
|
|
62 {
|
|
63 x1=np->rval->constant; c1=np->rval->optdata;
|
|
64 x=x1; c=c1; if(!(c==1)) break;
|
|
65 OPTING(nullmingle);
|
|
66 tp=newnode();
|
|
67 tp=np->rval;
|
|
68 np->rval=0;
|
|
69 nodefree(np->lval); nodefree(np->rval);
|
|
70 tempw=np->width; *np=*tp; np->width=tempw; free(tp);
|
|
71 } while(0);
|
|
72
|
|
73 checknodeactbits(np);
|
|
74 if(np->opcode==C_LOGICALNOT &&
|
|
75 np->rval->opcode==C_LOGICALNOT)
|
|
76 do
|
|
77 {
|
|
78 x1=np->rval->rval->constant; c1=np->rval->rval->optdata;
|
|
79 x=x1; c=c1; if(!(c==1)) break;
|
|
80 OPTING(redundantdoublenot);
|
|
81 tp=newnode();
|
|
82 tp=np->rval->rval;
|
|
83 np->rval->rval=0;
|
|
84 nodefree(np->lval); nodefree(np->rval);
|
|
85 tempw=np->width; *np=*tp; np->width=tempw; free(tp);
|
|
86 } while(0);
|
|
87
|
|
88 c=c1=c2=c3=c4=c5=c6=c7=c8=c9=0;
|
|
89 x=x1=x2=x3=x4=x5=x6=x7=x8=x9=r=0;
|
|
90 if(c+c1+c2+c3+c4+c5+c6+c7+c8+c9+r+
|
|
91 x+x1+x2+x3+x4+x5+x6+x7+x8+x9) raise(SIGSEGV);
|
|
92 return opted;
|
|
93 }
|