Mercurial > hg > CbC > old > device
comparison mc-code-ia32.c @ 705:0554b7f985ee parse-mode
parse mode done.
author | kono |
---|---|
date | Wed, 24 Oct 2007 10:39:57 +0900 |
parents | 22e0330a6d5b |
children | 8b54c40081de |
comparison
equal
deleted
inserted
replaced
704:6e6dc2d644ed | 705:0554b7f985ee |
---|---|
2623 } else { | 2623 } else { |
2624 set_ireg(reg,mode); | 2624 set_ireg(reg,mode); |
2625 } | 2625 } |
2626 } | 2626 } |
2627 | 2627 |
2628 void | 2628 int |
2629 code_set_return_register(int mode) { | 2629 code_set_return_register(int mode) { |
2630 // before goto leave code, set return register | 2630 // before goto leave code, set return register |
2631 if (cadr(fnptr->ty)==FLOAT) { | 2631 if (cadr(fnptr->ty)==FLOAT) { |
2632 // set_freg(RET_FREGISTER,mode); | 2632 // set_freg(RET_FREGISTER,mode); |
2633 return 0; | |
2633 } else if (cadr(fnptr->ty)==DOUBLE) { | 2634 } else if (cadr(fnptr->ty)==DOUBLE) { |
2634 // set_dreg(RET_DREGISTER,mode); | 2635 // set_dreg(RET_DREGISTER,mode); |
2636 return 0; | |
2635 } else if (cadr(fnptr->ty)==LONGLONG||cadr(fnptr->ty)==ULONGLONG) { | 2637 } else if (cadr(fnptr->ty)==LONGLONG||cadr(fnptr->ty)==ULONGLONG) { |
2636 set_lreg(RET_LREGISTER,mode); | 2638 set_lreg(RET_LREGISTER,mode); |
2639 return ireg; | |
2637 } else if (cadr(fnptr->ty)==VOID) { | 2640 } else if (cadr(fnptr->ty)==VOID) { |
2641 return 0; | |
2638 } else { | 2642 } else { |
2639 set_ireg(RET_REGISTER,mode); | 2643 set_ireg(RET_REGISTER,mode); |
2644 return ireg; | |
2640 } | 2645 } |
2641 } | 2646 } |
2642 | 2647 |
2643 void | 2648 void |
2644 gen_gdecl(char *n, int gpc) | 2649 gen_gdecl(char *n, int gpc) |
4211 | 4216 |
4212 void | 4217 void |
4213 code_table_jump(int l,int csvalue,int delta,int max,int min,int dlabel) | 4218 code_table_jump(int l,int csvalue,int delta,int max,int min,int dlabel) |
4214 { | 4219 { |
4215 char *crn; | 4220 char *crn; |
4216 use_register(creg,csvalue,0); | 4221 // use_register(creg,csvalue,0); |
4222 set_ireg(csvalue,0); | |
4217 crn = register_name(creg,0); | 4223 crn = register_name(creg,0); |
4218 printf("\tsubl\t$%d,%s\n",min,crn); | 4224 printf("\tsubl\t$%d,%s\n",min,crn); |
4219 printf("\tcmpl\t$%d,%s\n",max-min,crn); | 4225 printf("\tcmpl\t$%d,%s\n",max-min,crn); |
4220 printf("\tja\t_%d\n",dlabel); | 4226 printf("\tja\t_%d\n",dlabel); |
4221 if (delta==1) { | 4227 if (delta==1) { |