Mercurial > hg > CbC > old > device
changeset 253:7b2762739df6
*** empty log message ***
author | kono |
---|---|
date | Wed, 12 May 2004 19:48:42 +0900 |
parents | 1452eb0eab20 |
children | 5aaca4f9d96b |
files | .gdbinit mc-code-mips.c stdio.h |
diffstat | 3 files changed, 15 insertions(+), 16 deletions(-) [+] |
line wrap: on
line diff
--- a/.gdbinit Wed May 12 19:13:19 2004 +0900 +++ b/.gdbinit Wed May 12 19:48:42 2004 +0900 @@ -1,6 +1,6 @@ tb main -# run -s -ob00.s test/int.c -run -s -ob00.s mc-parse.c +run -s -ob00.s test/basic.c +# run -s -ob00.s mc-parse.c # run -s test/code-gen-all.c define regs printf "pc =%08x lr =%08x r0 =%08x r1 =%08x r3= %08x r4= %08x\n",$pc,$lr,$r0,$r1,$r3,$r4
--- a/mc-code-mips.c Wed May 12 19:13:19 2004 +0900 +++ b/mc-code-mips.c Wed May 12 19:48:42 2004 +0900 @@ -94,7 +94,7 @@ #define FREG_OFFSET REAL_MAX_REGISTER #define LREG_OFFSET (REAL_MAX_REGISTER+REAL_MAX_FREGISTER) -int MAX_INPUT_REGISTER_VAR = 7-MIN_TMP_REG; +int MAX_INPUT_REGISTER_VAR = 4; int MAX_CODE_INPUT_REGISTER_VAR = 7-MIN_TMP_REG; int MAX_INPUT_DREGISTER_VAR = 2; int MAX_INPUT_FREGISTER_VAR = 1; @@ -693,7 +693,7 @@ { int j; if (d) { - if (i<0||i>=MAX_INPUT_DREGISTER_VAR) return 0; + // if (i<0||i>=MAX_INPUT_REGISTER_VAR) return 0; j = get_input_lregister_var(i,n,is_code); if (car(j)==LREGISTER) { if (regs[cadr(j)]==INPUT_REG) regs[cadr(j)]=INPUT_DREG; @@ -1139,8 +1139,9 @@ void code_lnot(int creg) { + int dreg = get_register(); use_int(creg); - int dreg = get_register(); + printf("\txori %s,%s,0x0\n", register_name(dreg),register_name(creg)); printf("\tsltu %s,%s,1\n", @@ -1830,7 +1831,7 @@ if (reg_arg>=MAX_INPUT_REGISTER_VAR) { arg = list2(LVAR,caller_arg_offset_v(nargs)); } else if (!simple_args(e3) && cadr(e3)) { - arg = get_lregister_var(0); + arg = t==DOUBLE?get_dregister_var(0,1):get_lregister_var(0); arg_assign = list2( assign_expr0(r0= (t==DOUBLE? @@ -1841,10 +1842,8 @@ arg_assign); use_input_reg(cadr(r0),1); } else { - if (t==DOUBLE) - arg=get_input_dregister_var(reg_arg,0,0,1); - else - arg=get_input_lregister_var(reg_arg,0,0); + arg = t==DOUBLE?get_input_dregister_var(reg_arg,0,0,1): + get_input_lregister_var(reg_arg,0,0); use_input_reg(cadr(arg),1); } reg_arg_list = list2(arg,reg_arg_list); @@ -1856,20 +1855,20 @@ if (freg_arg>=MAX_INPUT_FREGISTER_VAR) { arg = list2(LVAR,caller_arg_offset_v(nargs)); } else if (!simple_args(e3) && cadr(e3)) { - arg = get_dregister_var(0,1); + arg = get_dregister_var(0,0); if (freg_arg<2) { arg_assign = list2( list3(FASS_INPUT, - get_input_dregister_var(freg_arg,0,0,1),arg), + get_input_dregister_var(freg_arg,0,0,0),arg), arg_assign); } else { arg_assign = list2( - assign_expr0(get_input_dregister_var(freg_arg,0,0,1), + assign_expr0(get_input_dregister_var(freg_arg,0,0,0), arg,t,t), arg_assign); } } else { - arg = get_input_dregister_var(freg_arg,0,0,1); + arg = get_input_dregister_var(freg_arg,0,0,0); } reg_arg_list = list2(arg,reg_arg_list); if (car(arg)==FREGISTER) { @@ -3285,7 +3284,7 @@ int edx,edx0; if (!d) { - int xreg=emit_dpop(d); + xreg=emit_dpop(d); crn=register_name(ireg); use_float(d,reg); frn =fregister_name(reg);