Mercurial > hg > CbC > old > device
changeset 344:b7f07df0c0f8
fix parallel assigment bug
author | kono |
---|---|
date | Sun, 27 Jun 2004 14:56:21 +0900 |
parents | 11f8f2e6bb72 |
children | 2b3946ee4fc9 |
files | Changes mc-codegen.c rsyncs |
diffstat | 3 files changed, 34 insertions(+), 16 deletions(-) [+] |
line wrap: on
line diff
--- a/Changes Sun Jun 27 10:39:18 2004 +0900 +++ b/Changes Sun Jun 27 14:56:21 2004 +0900 @@ -5219,4 +5219,13 @@ hash は別関数になってないし。 - +Sun Jun 27 10:58:04 JST 2004 + +大した変更してないけど、ia32 code がバグった。 + +Sun Jun 27 14:52:59 JST 2004 + +is_memory のバグでした。 + +そういえば、double register pair のparallel assignmentって +やってる?
--- a/mc-codegen.c Sun Jun 27 10:39:18 2004 +0900 +++ b/mc-codegen.c Sun Jun 27 14:56:21 2004 +0900 @@ -833,24 +833,33 @@ /* source (after) list2(tag,disp) */ /* source list list3(e,cdr,sz) */ -#define DEBUG_PARALLEL_ASSIGN 0 +#define DEBUG_PARALLEL_ASSIGN 2 static int -overrap(int t,int sz,int source) +overlap(int t,int sz,int source) { int s,s0,s1; int t0=cadr(t); int t1=t0+sz; for(;source;source=cadr(source)) { s=car(source); s0=cadr(s); - if(car(s)==REGISTER && car(t)==REGISTER) { - if(s0==t0) return s; - } else if (is_same_type(s,t)) { + switch(car(s)) { + // double register pair? + case REGISTER: + if(car(t)==REGISTER && s0==t0) return s; + case DREGISTER: + if(car(t)==DREGISTER && s0==t0) return s; + case FREGISTER: + if(car(t)==FREGISTER && s0==t0) return s; + case LREGISTER: + if(car(t)==LREGISTER && s0==t0) return s; + } + if (is_same_type(s,t)) { s1=s0+caddr(source); #if DEBUG_PARALLEL_ASSIGN>1 -printf("# ovedrrap source %d t0 %d t1 %d\n",car(car(t)),t0,t1); -printf("# ovedrrap target %d s0 %d s1 %d\n",car(car(source)),s0,s1); -printf("# ovedrrap equal = %d\n",((t0<=s0&&s0<t1)||(t0<s1&&s1<=t1))); +printf("# overlap source %d t0 %d t1 %d\n",car(car(t)),t0,t1); +printf("# overlap target %d s0 %d s1 %d\n",car(car(source)),s0,s1); +printf("# overlap equal = %d\n",((t0<=s0&&s0<t1)||(t0<s1&&s1<=t1))); #endif if((t0<=s0&&s0<t1)||(t0<s1&&s1<=t1)) return s; } @@ -927,8 +936,8 @@ #endif return 1; } - if ((s1=overrap(t1,sz,*source))) { - /* another overrap start over */ + if ((s1=overlap(t1,sz,*source))) { + /* another overlap start over */ return circular_dependency(t,s1,target,source); } } @@ -953,7 +962,7 @@ #endif remove_target(target,t,use); /* 破壊されては困るので、source listからは除かない */ - } else if (!(s1=overrap(t,sz,*source))) { + } else if (!(s1=overlap(t,sz,*source))) { /* 重なってないので安心して書き込める */ #if DEBUG_PARALLEL_ASSIGN printf("# normal assign %d ty %d+%d sz %d\n",car(t),ty,cadr(t),sz); @@ -1006,6 +1015,7 @@ is_simple(int e1) { switch(e1) { + case CONST: case FNAME: case LVAR: case REGISTER: case DREGISTER: case FREGISTER: case LREGISTER: case GVAR: case RGVAR: case RLVAR: case CRLVAR: case CRGVAR: case DRLVAR: case FRLVAR: case LRLVAR: @@ -1015,6 +1025,7 @@ return 0; } + static int is_same_type(int e1,int e2) { @@ -1051,8 +1062,7 @@ static int is_memory(int e1) { - int ce1=car(e1); - switch(car(ce1)) { + switch(car(e1)) { case LVAR : case RLVAR: case CRLVAR : case DRLVAR : case LRLVAR : case GVAR : case RGVAR: case CRGVAR : case DRGVAR : case LRGVAR : case FRLVAR : case FRGVAR : @@ -1064,7 +1074,6 @@ return 0; } - static void jump(int e1, int env) {