comparison mc-inline.c @ 533:80b5058f0535 inline-code-gen-passed

inline code-gen test passed.
author kono
date Fri, 30 Dec 2005 18:33:55 +0900
parents cecf5103679e
children 25e61d68c545
comparison
equal deleted inserted replaced
532:cecf5103679e 533:80b5058f0535
449 449
450 static int 450 static int
451 prindirect(int e) 451 prindirect(int e)
452 { 452 {
453 int lvar; 453 int lvar;
454 int offset = caddr(e);
454 if (car(lvar=cadr(e))==IVAR) { 455 if (car(lvar=cadr(e))==IVAR) {
455 lvar=p_lvar(cadr(e)); // can be anything.... 456 lvar=p_lvar(cadr(e)); // can be anything....
456 switch(car(lvar)) { 457 switch(car(lvar)) {
457 case LVAR: 458 case LVAR:
459 if(offset) {
460 return list3(car(e),lvar,offset);
461 }
458 return rvalue_t(lvar,cadddr(e)); 462 return rvalue_t(lvar,cadddr(e));
459 case REGISTER: case DREGISTER: 463 case REGISTER: case DREGISTER:
460 case FREGISTER: case LREGISTER: 464 case FREGISTER: case LREGISTER:
461 case CONST: case FCONST: case DCONST: case LCONST: 465 case CONST: case FCONST: case DCONST: case LCONST:
462 // should do type check 466 // should do type check
467 if (offset) error(-1);
463 return lvar; 468 return lvar;
464 } 469 }
465 } 470 }
466 return list3(car(e),pexpr(cadr(e)),caddr(e)); 471 return list3(car(e),pexpr(cadr(e)),offset);
467 } 472 }
468 473
469 static int 474 static int
470 pindirect(int e) 475 pindirect(int e)
471 { 476 {
488 } 493 }
489 494
490 static int 495 static int
491 pbinop(int op,int e1,int e2) 496 pbinop(int op,int e1,int e2)
492 { 497 {
498 // we should call binop here, but we don't know the type...
493 return list3(op,pexpr(e1),pexpr(e2)); 499 return list3(op,pexpr(e1),pexpr(e2));
494 } 500 }
495 501
496 static int 502 static int
497 prexpr(int op,int e1,int e2) 503 prexpr(int op,int e1,int e2)