Mercurial > hg > CbC > old > device
comparison mc-codegen.c @ 814:1dad60c0a073
minor fix
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Thu, 25 Nov 2010 13:13:42 +0900 |
parents | a1dff13fefbf |
children | c59753132812 |
comparison
equal
deleted
inserted
replaced
813:a1dff13fefbf | 814:1dad60c0a073 |
---|---|
3273 int i,e1,n; | 3273 int i,e1,n; |
3274 int repl = 0; | 3274 int repl = 0; |
3275 int repl0; | 3275 int repl0; |
3276 int assign = 0; | 3276 int assign = 0; |
3277 char *p; | 3277 char *p; |
3278 int ty = lp64?LONGLONG:INT; | 3278 int ty; |
3279 | 3279 |
3280 e = reverse0(e); | 3280 e = reverse0(e); |
3281 | 3281 |
3282 for(i=out;i;i=cadr(i)) { | 3282 for(i=out;i;i=cadr(i)) { |
3283 p = (ncaddr(car(i)))->nm; | 3283 p = (ncaddr(car(i)))->nm; |
3284 e1 = car(e); e = cadr(e); | 3284 e1 = car(e); e = cadr(e); |
3285 repl = code_asm_operand(p,e1,ASM_OUTPUT,repl,0,0); | 3285 repl = code_asm_operand(p,e1,ASM_OUTPUT,repl,0,0); |
3286 if (!chk && repl && car(car(repl))==REGISTER) { | 3286 if (!chk && repl) { |
3287 assign = list2(assign_expr0(e1,car(repl),ty,ty),assign); | 3287 switch(car(car(repl))) { |
3288 case REGISTER: ty = INT; break; | |
3289 case LREGISTER: ty = LONGLONG; break; | |
3290 case FREGISTER: ty = FLOAT; break; | |
3291 case DREGISTER: ty = DOUBLE; break; | |
3292 default: continue; | |
3293 } | |
3294 assign = list2(assign_expr0(e1,car(repl),ty,ty),assign); | |
3288 } | 3295 } |
3289 } | 3296 } |
3290 repl0 = repl; | 3297 repl0 = repl; |
3291 n = length(repl0); | 3298 n = length(repl0); |
3292 for(i=in;i;i=cadr(i)) { | 3299 for(i=in;i;i=cadr(i)) { |
3293 p = (ncaddr(car(i)))->nm; | 3300 p = (ncaddr(car(i)))->nm; |
3294 e1 = car(e); e = cadr(e); | 3301 e1 = car(e); e = cadr(e); |
3295 repl = code_asm_operand(p,e1,ASM_INPUT,repl,n,repl0); | 3302 repl = code_asm_operand(p,e1,ASM_INPUT,repl,n,repl0); |
3296 if (!chk && repl && car(car(repl))==REGISTER) { | 3303 if (!chk && repl) { |
3304 switch(car(car(repl))) { | |
3305 case REGISTER: ty = INT; break; | |
3306 case LREGISTER: ty = LONGLONG; break; | |
3307 case FREGISTER: ty = FLOAT; break; | |
3308 case DREGISTER: ty = DOUBLE; break; | |
3309 default: continue; | |
3310 } | |
3297 g_expr_u(assign_expr0(car(repl),e1,ty,ty)); | 3311 g_expr_u(assign_expr0(car(repl),e1,ty,ty)); |
3298 } | 3312 } |
3299 } | 3313 } |
3300 | 3314 |
3301 repl = reverse0(repl); | 3315 repl = reverse0(repl); |