Mercurial > hg > CbC > old > device
changeset 842:3b2bdacc5a31
funciton register arg
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 06 Dec 2010 10:01:22 +0900 |
parents | 7da123aa5a39 |
children | 6ae3a4f60798 |
files | mc-code-i64.c |
diffstat | 1 files changed, 17 insertions(+), 17 deletions(-) [+] |
line wrap: on
line diff
--- a/mc-code-i64.c Sun Dec 05 16:16:31 2010 +0900 +++ b/mc-code-i64.c Mon Dec 06 10:01:22 2010 +0900 @@ -2177,20 +2177,16 @@ if (t>=0&&(car(t)==BIT_FIELD)) { t = type_value(cadr(t)); } - if(scalar(t)) { + if(scalar(t)||(t==LONGLONG||t==ULONGLONG)) { if (mode==AS_SAVE) { return get_register_var(0); } else if (reg_arg>=MAX_INPUT_REGISTER_VAR) { return list3n(LVAR,caller_arg_offset_v(arg),0); - } else - return get_input_register_var(reg_arg,0,0); - } else if (t==LONGLONG||t==ULONGLONG) { - if (mode==AS_SAVE) { - return get_lregister_var(0); - } else if (reg_arg>=MAX_INPUT_REGISTER_VAR) { - return list3n(LVAR,caller_arg_offset_v(arg),0); - } else - return get_input_lregister_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==FLOAT) { if (mode==AS_SAVE) { return get_dregister_var(0,0); @@ -2395,17 +2391,21 @@ reg_arg_list = list2(arg,reg_arg_list); /* protect from input register free */ if (car(arg)==LREGISTER) { + t = LONGLONG; + set_ireg(cadr(arg),0); + g_expr_u(assign_expr0(arg,e4,t,t)); use_input_reg(cadr(arg),1); - t = LONGLONG; - } - g_expr_u(assign_expr0(arg,e4,t,t)); + } else + g_expr_u(assign_expr0(arg,e4,t,t)); } else if (t==DOUBLE||t==FLOAT) { reg_arg_list = list2(arg,reg_arg_list); if (car(arg)==DREGISTER||car(arg)==FREGISTER) { + max_freg ++; + set_freg(cadr(arg),0); + g_expr_u(assign_expr0(arg,e4,t,t)); use_input_reg(cadr(arg),1); /* protect from input register free */ - max_freg ++; - } - g_expr_u(assign_expr0(arg,e4,t,t)); /* XXX */ + } else + g_expr_u(assign_expr0(arg,e4,t,t)); } // structs are finished } @@ -3169,7 +3169,7 @@ } else { if (reg==USE_CREG) { if (regs[CREG_REGISTER]==0) { - set_ireg(CREG_REGISTER,is_int_reg(creg)&®s[creg]==USING_REG); + set_ireg(CREG_REGISTER,is_int_reg(creg)&®s[creg]!=0); return CREG_REGISTER; } }