Mercurial > repo
diff interps/c-intercal/oilout00.c @ 996:859f9b4339e6
<Gregor> tar xf egobot.tar.xz
author | HackBot |
---|---|
date | Sun, 09 Dec 2012 19:30:08 +0000 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/interps/c-intercal/oilout00.c Sun Dec 09 19:30:08 2012 +0000 @@ -0,0 +1,350 @@ +/* Automatically generated output, edit source and recompile to change */ +#include "oil.h" +int optimize_pass1_0(node *np) +{ int opted=0; + unsigned long c,c1,c2,c3,c4,c5,c6,c7,c8,c9; + unsigned long x,x1,x2,x3,x4,x5,x6,x7,x8,x9,r; + int tempw; + node *tp; + checknodeactbits(np); + if(np->opcode==MINGLE && + (np->lval->opcode==MESH || np->lval->opcode==MESH32) && + (np->rval->opcode==MESH || np->rval->opcode==MESH32)) + do + { + x2=np->rval->constant; c2=np->rval->optdata; + x1=np->lval->constant; c1=np->lval->optdata; + OPTING(minglefold); + tp=newnode(); + MAYBENEWNODE(tp); + tp->opcode=MESH32; + tp->width=32; + tp->constant=(mingle(x1,x2)); + nodefree(np->lval); nodefree(np->rval); + tempw=np->width; *np=*tp; np->width=tempw; free(tp); + } while(0); + + checknodeactbits(np); + if(np->opcode==SELECT && + (np->lval->opcode==MESH || np->lval->opcode==MESH32) && + (np->rval->opcode==MESH || np->rval->opcode==MESH32)) + do + { + x2=np->rval->constant; c2=np->rval->optdata; + x1=np->lval->constant; c1=np->lval->optdata; + OPTING(selectfold); + tp=newnode(); + MAYBENEWNODE(tp); + tp->opcode=MESH32; + tp->width=32; + tp->constant=(iselect(x1,x2)); + nodefree(np->lval); nodefree(np->rval); + tempw=np->width; *np=*tp; np->width=tempw; free(tp); + } while(0); + + checknodeactbits(np); + if(np->opcode==AND && + np->width==32 && + (np->rval->opcode==MESH || np->rval->opcode==MESH32)) + do + { + x1=np->rval->constant; c1=np->rval->optdata; + OPTING(and32fold); + tp=newnode(); + MAYBENEWNODE(tp); + tp->opcode=MESH32; + tp->width=32; + tp->constant=(and32(x1)); + nodefree(np->lval); nodefree(np->rval); + tempw=np->width; *np=*tp; np->width=tempw; free(tp); + } while(0); + + checknodeactbits(np); + if(np->opcode==OR && + np->width==32 && + (np->rval->opcode==MESH || np->rval->opcode==MESH32)) + do + { + x1=np->rval->constant; c1=np->rval->optdata; + OPTING(or32fold); + tp=newnode(); + MAYBENEWNODE(tp); + tp->opcode=MESH32; + tp->width=32; + tp->constant=(or32(x1)); + nodefree(np->lval); nodefree(np->rval); + tempw=np->width; *np=*tp; np->width=tempw; free(tp); + } while(0); + + checknodeactbits(np); + if(np->opcode==XOR && + np->width==32 && + (np->rval->opcode==MESH || np->rval->opcode==MESH32)) + do + { + x1=np->rval->constant; c1=np->rval->optdata; + OPTING(xor32fold); + tp=newnode(); + MAYBENEWNODE(tp); + tp->opcode=MESH32; + tp->width=32; + tp->constant=(xor32(x1)); + nodefree(np->lval); nodefree(np->rval); + tempw=np->width; *np=*tp; np->width=tempw; free(tp); + } while(0); + + checknodeactbits(np); + if(np->opcode==AND && + np->width==16 && + (np->rval->opcode==MESH || np->rval->opcode==MESH32)) + do + { + x1=np->rval->constant; c1=np->rval->optdata; + OPTING(and16fold); + tp=newnode(); + MAYBENEWNODE(tp); + tp->opcode=MESH32; + tp->width=32; + tp->constant=(and16(x1)); + nodefree(np->lval); nodefree(np->rval); + tempw=np->width; *np=*tp; np->width=tempw; free(tp); + } while(0); + + checknodeactbits(np); + if(np->opcode==OR && + np->width==16 && + (np->rval->opcode==MESH || np->rval->opcode==MESH32)) + do + { + x1=np->rval->constant; c1=np->rval->optdata; + OPTING(or16fold); + tp=newnode(); + MAYBENEWNODE(tp); + tp->opcode=MESH32; + tp->width=32; + tp->constant=(or16(x1)); + nodefree(np->lval); nodefree(np->rval); + tempw=np->width; *np=*tp; np->width=tempw; free(tp); + } while(0); + + checknodeactbits(np); + if(np->opcode==XOR && + np->width==16 && + (np->rval->opcode==MESH || np->rval->opcode==MESH32)) + do + { + x1=np->rval->constant; c1=np->rval->optdata; + OPTING(xor16fold); + tp=newnode(); + MAYBENEWNODE(tp); + tp->opcode=MESH32; + tp->width=32; + tp->constant=(xor16(x1)); + nodefree(np->lval); nodefree(np->rval); + tempw=np->width; *np=*tp; np->width=tempw; free(tp); + } while(0); + + checknodeactbits(np); + if(np->opcode==C_AND && + (np->lval->opcode==MESH || np->lval->opcode==MESH32) && + (np->rval->opcode==MESH || np->rval->opcode==MESH32)) + do + { + x2=np->rval->constant; c2=np->rval->optdata; + x1=np->lval->constant; c1=np->lval->optdata; + OPTING(cfold); + tp=newnode(); + MAYBENEWNODE(tp); + tp->opcode=MESH32; + tp->width=32; + tp->constant=(x1 & x2); + nodefree(np->lval); nodefree(np->rval); + tempw=np->width; *np=*tp; np->width=tempw; free(tp); + } while(0); + + checknodeactbits(np); + if(np->opcode==C_OR && + (np->lval->opcode==MESH || np->lval->opcode==MESH32) && + (np->rval->opcode==MESH || np->rval->opcode==MESH32)) + do + { + x2=np->rval->constant; c2=np->rval->optdata; + x1=np->lval->constant; c1=np->lval->optdata; + OPTING(cfold); + tp=newnode(); + MAYBENEWNODE(tp); + tp->opcode=MESH32; + tp->width=32; + tp->constant=(x1 | x2); + nodefree(np->lval); nodefree(np->rval); + tempw=np->width; *np=*tp; np->width=tempw; free(tp); + } while(0); + + checknodeactbits(np); + if(np->opcode==C_XOR && + (np->lval->opcode==MESH || np->lval->opcode==MESH32) && + (np->rval->opcode==MESH || np->rval->opcode==MESH32)) + do + { + x2=np->rval->constant; c2=np->rval->optdata; + x1=np->lval->constant; c1=np->lval->optdata; + OPTING(cfold); + tp=newnode(); + MAYBENEWNODE(tp); + tp->opcode=MESH32; + tp->width=32; + tp->constant=(x1 ^ x2); + nodefree(np->lval); nodefree(np->rval); + tempw=np->width; *np=*tp; np->width=tempw; free(tp); + } while(0); + + checknodeactbits(np); + if(np->opcode==C_PLUS && + (np->lval->opcode==MESH || np->lval->opcode==MESH32) && + (np->rval->opcode==MESH || np->rval->opcode==MESH32)) + do + { + x2=np->rval->constant; c2=np->rval->optdata; + x1=np->lval->constant; c1=np->lval->optdata; + OPTING(cfold); + tp=newnode(); + MAYBENEWNODE(tp); + tp->opcode=MESH32; + tp->width=32; + tp->constant=(x1 + x2); + nodefree(np->lval); nodefree(np->rval); + tempw=np->width; *np=*tp; np->width=tempw; free(tp); + } while(0); + + checknodeactbits(np); + if(np->opcode==C_MINUS && + (np->lval->opcode==MESH || np->lval->opcode==MESH32) && + (np->rval->opcode==MESH || np->rval->opcode==MESH32)) + do + { + x2=np->rval->constant; c2=np->rval->optdata; + x1=np->lval->constant; c1=np->lval->optdata; + OPTING(cfold); + tp=newnode(); + MAYBENEWNODE(tp); + tp->opcode=MESH32; + tp->width=32; + tp->constant=(x1 - x2); + nodefree(np->lval); nodefree(np->rval); + tempw=np->width; *np=*tp; np->width=tempw; free(tp); + } while(0); + + checknodeactbits(np); + if(np->opcode==C_TIMES && + (np->lval->opcode==MESH || np->lval->opcode==MESH32) && + (np->rval->opcode==MESH || np->rval->opcode==MESH32)) + do + { + x2=np->rval->constant; c2=np->rval->optdata; + x1=np->lval->constant; c1=np->lval->optdata; + OPTING(cfold); + tp=newnode(); + MAYBENEWNODE(tp); + tp->opcode=MESH32; + tp->width=32; + tp->constant=(x1 * x2); + nodefree(np->lval); nodefree(np->rval); + tempw=np->width; *np=*tp; np->width=tempw; free(tp); + } while(0); + + checknodeactbits(np); + if(np->opcode==C_DIVIDEBY && + (np->lval->opcode==MESH || np->lval->opcode==MESH32) && + (np->rval->opcode==MESH || np->rval->opcode==MESH32)) + do + { + x2=np->rval->constant; c2=np->rval->optdata; + x1=np->lval->constant; c1=np->lval->optdata; + OPTING(cfold); + tp=newnode(); + MAYBENEWNODE(tp); + tp->opcode=MESH32; + tp->width=32; + tp->constant=(x1 / x2); + nodefree(np->lval); nodefree(np->rval); + tempw=np->width; *np=*tp; np->width=tempw; free(tp); + } while(0); + + checknodeactbits(np); + if(np->opcode==C_MODULUS && + (np->lval->opcode==MESH || np->lval->opcode==MESH32) && + (np->rval->opcode==MESH || np->rval->opcode==MESH32)) + do + { + x2=np->rval->constant; c2=np->rval->optdata; + x1=np->lval->constant; c1=np->lval->optdata; + OPTING(cfold); + tp=newnode(); + MAYBENEWNODE(tp); + tp->opcode=MESH32; + tp->width=32; + tp->constant=(x1 % x2); + nodefree(np->lval); nodefree(np->rval); + tempw=np->width; *np=*tp; np->width=tempw; free(tp); + } while(0); + + checknodeactbits(np); + if(np->opcode==C_GREATER && + (np->lval->opcode==MESH || np->lval->opcode==MESH32) && + (np->rval->opcode==MESH || np->rval->opcode==MESH32)) + do + { + x2=np->rval->constant; c2=np->rval->optdata; + x1=np->lval->constant; c1=np->lval->optdata; + OPTING(cfold); + tp=newnode(); + MAYBENEWNODE(tp); + tp->opcode=MESH32; + tp->width=32; + tp->constant=(x1 > x2); + nodefree(np->lval); nodefree(np->rval); + tempw=np->width; *np=*tp; np->width=tempw; free(tp); + } while(0); + + checknodeactbits(np); + if(np->opcode==C_LESS && + (np->lval->opcode==MESH || np->lval->opcode==MESH32) && + (np->rval->opcode==MESH || np->rval->opcode==MESH32)) + do + { + x2=np->rval->constant; c2=np->rval->optdata; + x1=np->lval->constant; c1=np->lval->optdata; + OPTING(cfold); + tp=newnode(); + MAYBENEWNODE(tp); + tp->opcode=MESH32; + tp->width=32; + tp->constant=(x1 < x2); + nodefree(np->lval); nodefree(np->rval); + tempw=np->width; *np=*tp; np->width=tempw; free(tp); + } while(0); + + checknodeactbits(np); + if(np->opcode==C_RSHIFTBY && + (np->lval->opcode==MESH || np->lval->opcode==MESH32) && + (np->rval->opcode==MESH || np->rval->opcode==MESH32)) + do + { + x2=np->rval->constant; c2=np->rval->optdata; + x1=np->lval->constant; c1=np->lval->optdata; + OPTING(cfold); + tp=newnode(); + MAYBENEWNODE(tp); + tp->opcode=MESH32; + tp->width=32; + tp->constant=(x1 >> x2); + nodefree(np->lval); nodefree(np->rval); + tempw=np->width; *np=*tp; np->width=tempw; free(tp); + } while(0); + + c=c1=c2=c3=c4=c5=c6=c7=c8=c9=0; + x=x1=x2=x3=x4=x5=x6=x7=x8=x9=r=0; + if(c+c1+c2+c3+c4+c5+c6+c7+c8+c9+r+ + x+x1+x2+x3+x4+x5+x6+x7+x8+x9) raise(SIGSEGV); + return opted; +}