Mercurial > hg > CbC > old > device
diff mc-code-powerpc.c @ 186:6391432ca002
nkf binary fix
author | kono |
---|---|
date | Mon, 01 Dec 2003 15:36:22 +0900 |
parents | 427008a06333 |
children | dffcccf8b1cb |
line wrap: on
line diff
--- a/mc-code-powerpc.c Mon Dec 01 03:24:30 2003 +0900 +++ b/mc-code-powerpc.c Mon Dec 01 15:36:22 2003 +0900 @@ -691,6 +691,28 @@ return xreg; } +int +stack_top(int type) +{ + int xreg; + if (type==INT) { + xreg = reg_stack[reg_sp]; + if (xreg<= -REG_LVAR_OFFSET) { + return list2(LVAR,REG_LVAR_OFFSET+xreg); + } else { + return list2(REGISTER,xreg); + } + } else { + xreg = freg_stack[freg_sp]; + if (xreg<= -REG_LVAR_OFFSET) { + return list2(LVAR,REG_LVAR_OFFSET+xreg); + } else { + return list2(DREGISTER,xreg); + } + } + return xreg; +} + static int code_base; #define MAX_PTR_CACHE 10 @@ -1664,11 +1686,11 @@ regv[creg]=1; return; case RSHIFT: - shift("srw",oreg); + shift("sraw",oreg); regv[creg]=1; return; case URSHIFT: - shift("sraw",oreg); + shift("srw",oreg); regv[creg]=1; return; } @@ -1734,7 +1756,7 @@ { char *crn = register_name(creg); char *rrn = register_name(reg); - printf("\t%s %s,%s,%s\n",op,crn,rrn,crn); + printf("\t%s %s,%s,%s\n",op,crn,crn,rrn); } void