Mercurial > hg > CbC > old > device
diff mc-code-powerpc.c @ 843:6ae3a4f60798
powerpc register arg
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 06 Dec 2010 15:38:18 +0900 |
parents | 425768eb5e9e |
children | 11d784da0c7b |
line wrap: on
line diff
--- a/mc-code-powerpc.c Mon Dec 06 10:01:22 2010 +0900 +++ b/mc-code-powerpc.c Mon Dec 06 15:38:18 2010 +0900 @@ -2145,6 +2145,7 @@ if (reg!=creg) { clear_ptr_cache_reg(reg); if (ireg && reg!=ireg ) { + clear_ptr_cache_reg(ireg); free_register(ireg); if (mode) { printf("\tmr %s,%s\n",register_name(reg),register_name(ireg)); @@ -2514,15 +2515,22 @@ return get_register_var(0); } else if (reg_arg>=MAX_INPUT_REGISTER_VAR) { return list3n(LVAR,caller_arg_offset_v(nargs),0); - } else - return get_input_register_var(reg_arg,0,0); + } else { + int e = get_input_register_var(reg_arg,0,0); + clear_ptr_cache_reg(cadr(e)); + return e; + } } else if (t==LONGLONG||t==ULONGLONG) { if (mode==AS_SAVE) { return get_lregister_var(0); } else if (reg_arg+1>=MAX_INPUT_REGISTER_VAR) { return list3n(LVAR,caller_arg_offset_v(nargs),0); - } else - return get_input_lregister_var(reg_arg,0,0); + } else { + int e = get_input_lregister_var(reg_arg,0,0); + clear_ptr_cache_reg(regv_l(cadr(e))); + clear_ptr_cache_reg(regv_h(cadr(e))); + return e; + } } else if (t==FLOAT) { if (mode==AS_SAVE) { return get_dregister_var(0,0); @@ -2686,9 +2694,12 @@ if(scalar(t)) { reg_arg_list = list2(arg,reg_arg_list); /* protect from input register free */ - if (car(arg)==REGISTER) + if (car(arg)==REGISTER) { + set_ireg(cadr(arg),0); + g_expr_u(assign_expr0(arg,e4,t,t)); use_input_reg(cadr(arg),1); - g_expr_u(assign_expr0(arg,e4,t,t)); + } else + g_expr_u(assign_expr0(arg,e4,t,t)); } else if (t==LONGLONG||t==ULONGLONG) { if (reg_arg+1==MAX_INPUT_REGISTER_VAR) { // half register, half memory case