Mercurial > hg > CbC > old > device
diff mc-code-powerpc.c @ 647:fe23fe842b82
*** empty log message ***
author | kono |
---|---|
date | Fri, 17 Nov 2006 20:00:37 +0900 |
parents | 35014112c01d |
children | f1d71563a46a |
line wrap: on
line diff
--- a/mc-code-powerpc.c Mon Nov 06 20:15:54 2006 +0900 +++ b/mc-code-powerpc.c Fri Nov 17 20:00:37 2006 +0900 @@ -328,20 +328,25 @@ #define CALLER_ARG(l) ((l)+arg_offset1) #define CALLEE_ARG(l) ((l)+arg_offset) +#define round16(a) ((a+0xf)&~0xf) + void code_offset_set() { #if 0 int l; #endif - int lvar_offsetv = -disp+max_func_args*SIZE_OF_INT+func_disp_offset; - int r1_offsetv = lvar_offsetv-reg_save+12; + int lvar_offsetv = + round16(-disp+max_func_args*SIZE_OF_INT+func_disp_offset); + int r1_offsetv = round16(lvar_offsetv-reg_save)+12; + printf(".set L_%d,%d\n",lvar_offset_label,r1_offsetv-lvar_offsetv); if (r1_offsetv-lvar_offsetv > 65000) error(-1); // too large function arguments? printf(".set L_%d,%d\n",r1_offset_label,r1_offsetv); if (max_func_arg_label) { - printf(".set L_%d,%d\n",max_func_arg_label,max_func_args*SIZE_OF_INT+24); + printf(".set L_%d,%d\n",max_func_arg_label, + round16(max_func_args*SIZE_OF_INT)+24); max_func_arg_label = 0; }