Mercurial > hg > CbC > old > device
changeset 261:31d7f050ec0d
*** empty log message ***
author | kono |
---|---|
date | Sat, 15 May 2004 22:45:19 +0900 |
parents | 9843979a270e |
children | df917628e532 |
files | mc-code-mips.c mc-parse.c |
diffstat | 2 files changed, 23 insertions(+), 13 deletions(-) [+] |
line wrap: on
line diff
--- a/mc-code-mips.c Sat May 15 21:36:16 2004 +0900 +++ b/mc-code-mips.c Sat May 15 22:45:19 2004 +0900 @@ -2425,12 +2425,13 @@ void code_opening(char *filename) { + static int count=0; /* this is called once per file */ #if 0 char *p=cheapp; char *s,*t; #endif - printf("\t.file \"%s\"\n",filename); + printf("\t.file %d \"%s\"\n",count++,filename); printf(".abicalls\n"); printf(".text\n"); #if 0 @@ -3416,13 +3417,10 @@ char *opc=""; char *grn,*frn; int d; - int cmp; - - if ((d=(op<FOP))) { // double case - use_float(reg,d); - } else { - use_float(reg,d); - } + int cmp=0; + + d=(op<FOP); + use_float(reg,d); switch(op) { case FADD: opn="add.s"; break; case DADD: opc="dpadd"; break;
--- a/mc-parse.c Sat May 15 21:36:16 2004 +0900 +++ b/mc-parse.c Sat May 15 22:45:19 2004 +0900 @@ -3148,7 +3148,11 @@ op=MUL; dcadr(e2)=1/dcadr(e2); } } - if (car(e1)==dop+CONST && (op==ADD||op==MUL)) { + if ((op==ADD||op==MUL) && ( + car(e1)==dop+CONST || + car(e2)==DRLVAR || car(e2)==DRGVAR || + car(e2)==FRLVAR || car(e2)==FRGVAR + )) { return(list3(op+dop,e2,e1)); } if(op==LT) { @@ -3266,8 +3270,10 @@ } if(op==SUB&&car(e2)==LCONST) { op=ADD; lcadr(e2)=-lcadr(e2); } if((op==ADD||op==MUL||op==BOR||op==EOR||op==BAND)&& - (car(e1)==LCONST||(car(e2)!=LCONST&& - (car(e1)==RGVAR||car(e1)==RLVAR)))) { + (car(e1)!=LCONST) && ( + car(e2)==LRGVAR||car(e2)==LRLVAR|| + car(e2)==LURGVAR||car(e2)==LURLVAR + )) { e=e1;e1=e2;e2=e;e=t1;t1=t2;t2=e; } if((op==MUL||op==DIV)&&car(e2)==LCONST&&lcadr(e2)==1) return e1; @@ -3379,8 +3385,14 @@ } if(op==SUB&&car(e2)==CONST) { op=ADD; cadr(e2)=-cadr(e2); } if((op==ADD||op==MUL||op==BOR||op==EOR||op==BAND)&& - (car(e1)==CONST||(car(e2)!=CONST&& - (car(e1)==RGVAR||car(e1)==RLVAR)))) { + (car(e1)!=CONST&& ( + car(e2)==RGVAR||car(e2)==RLVAR|| + car(e2)==URGVAR||car(e2)==URLVAR|| + car(e2)==SRGVAR||car(e2)==SRLVAR|| + car(e2)==SURGVAR||car(e2)==SURLVAR|| + car(e2)==CRGVAR||car(e2)==CRLVAR|| + car(e2)==CURGVAR||car(e2)==CURLVAR + ))) { e=e1;e1=e2;e2=e;e=t1;t1=t2;t2=e; } if(op==ADD) {