Mercurial > hg > CbC > old > device
changeset 401:d621a113b0ca
ARM continue... no segv code-gen
author | kono |
---|---|
date | Sat, 16 Oct 2004 20:45:54 +0900 |
parents | a9427845ca4c |
children | cda558feec30 |
files | Changes mc-code-arm.c |
diffstat | 2 files changed, 18 insertions(+), 14 deletions(-) [+] |
line wrap: on
line diff
--- a/Changes Sat Oct 16 16:08:41 2004 +0900 +++ b/Changes Sat Oct 16 20:45:54 2004 +0900 @@ -6059,3 +6059,10 @@ ってわけで、またがったdouble/longは、半分だけレジスタに置かれる みたいね。 +Sat Oct 16 19:12:31 JST 2004 + +ま、それは直ったんだけど、register は、input register 以外は +全部 save しているみたいだな。frame あわせがめんどくさい。 + +cmf f4,#0が、f4 が初期化されてないと落ちるみたい。illigal instruction +っていうけど、 f4 の値によるのか?
--- a/mc-code-arm.c Sat Oct 16 16:08:41 2004 +0900 +++ b/mc-code-arm.c Sat Oct 16 20:45:54 2004 +0900 @@ -350,7 +350,7 @@ disp &= -SIZE_OF_INT; lvar_offsetv = - -12 - max_reg_var*SIZE_OF_INT-max_freg_var*SIZE_OF_FLOAT; + -12 - max_reg_var*SIZE_OF_INT-max_freg_var*SIZE_OF_DOUBLE; // printf(" @ args = %d, pretend = %d, frame = %d\n", // max_func_args,0,round16(-disp)); // printf(" @ frame_needed = 1, current_function_anonymous_args = 0\n"); @@ -2853,11 +2853,13 @@ xrn = register_name(xreg = emit_pop(0)); /* pop e3 value */ set_ireg(edx,0); ld_indexx(byte,0,creg,ireg,sign); + use_reg(creg); tosop(op,ireg,xreg); crn = register_name(ireg); drn = register_name(creg); printf("\t%s\t%s, [%s, #0]\n",cstore(byte),crn,drn); free_register(edx); + free_register(creg); emit_pop_free(xreg); inc_inst(1); } @@ -3188,15 +3190,13 @@ int i; inc_inst(1); printf("\tstmfd\tsp!, {"); - for (i=reg_var_num(reg_save)-1;i<=reg_var_num(0);i++) { + for (i=reg_var_num(reg_save);i<reg_var_num(0);i++) { printf("%s, ",register_name(i)); - disp -= SIZE_OF_INT; } printf("fp, ip, lr, pc}\n"); if (freg_save>0) { inc_inst(1); printf("\tsfmfd\tf4, %d, [sp]!\n",freg_save); - disp -= SIZE_OF_DOUBLE*freg_save; } return disp; } @@ -3205,16 +3205,16 @@ code_register_restore(int reg_save,int freg_save,int disp) { int i; - if (freg_save>0) { i=reg_save*SIZE_OF_INT+freg_save*SIZE_OF_DOUBLE; - printf("\tlfm\tf4, %d, [fp, #%d]!\n",freg_save,i); - disp -= SIZE_OF_DOUBLE*freg_save; + if (freg_save>0) { + i=reg_save*SIZE_OF_INT+ + freg_save*SIZE_OF_DOUBLE + 20; + printf("\tlfm\tf4, %d, [fp, #%d]\n",freg_save,-i); inc_inst(1); } inc_inst(1); printf("\tldmea\tfp, {"); - for (i=reg_var_num(reg_save)-1;i<=reg_var_num(0);i++) { + for (i=reg_var_num(reg_save);i<reg_var_num(0);i++) { printf("%s, ",register_name(i)); - disp -= SIZE_OF_INT; } printf("fp, sp, pc}\n"); return disp; @@ -3682,8 +3682,7 @@ void code_cmp_dregister(int e2,int d,int label,int cond) { - char *grn,*frn; - int greg; + char *frn; use_float(d,e2); inc_inst(2); @@ -3702,10 +3701,8 @@ printf("\tcmp\tr0, #0\n"); } } else { - grn = register_name(greg = get_dregister(d)); frn = register_name(e2); - printf("\tcmf\t%s, #0\n",grn); - free_register(greg); + printf("\tcmf\t%s, #0\n",frn); } jcond(label,cond); return;