Added short-hand for C_cal+C_asp, made interface new_stackptr cleaner

This commit is contained in:
ceriel 1988-06-13 10:29:36 +00:00
parent de0048e96b
commit 8f9818c385
5 changed files with 26 additions and 39 deletions

View file

@ -461,8 +461,7 @@ subu(sz)
{
if (options['R']) C_sbu(sz);
else {
C_cal(sz == word_size ? "subu" : "subul");
c_asp((int)sz);
CAL((int) sz == (int) word_size ? "subu" : "subul", (int) sz);
}
}
@ -472,8 +471,7 @@ addu(sz)
{
if (options['R']) C_adu(sz);
else {
C_cal(sz == word_size ? "addu" : "addul");
c_asp((int)sz);
CAL((int) sz == (int) word_size ? "addu" : "addul", (int) sz);
}
}
@ -500,14 +498,11 @@ CodeStd(nd)
case S_ABS:
CodePExpr(left);
if (tp->tp_fund == T_INTEGER) {
if (tp->tp_size == int_size) C_cal("absi");
else C_cal("absl");
CAL((int)(tp->tp_size) == (int)int_size ? "absi" : "absl", (int)(tp->tp_size));
}
else if (tp->tp_fund == T_REAL) {
if (tp->tp_size == float_size) C_cal("absf");
else C_cal("absd");
CAL((int)(tp->tp_size) == (int)float_size ? "absf" : "absd", (int)(tp->tp_size));
}
c_asp((int)(tp->tp_size));
C_lfr(tp->tp_size);
break;
@ -733,10 +728,8 @@ CodeOper(expr, true_label, false_label)
C_mlu(tp->tp_size);
}
else {
C_cal(tp->tp_size <= word_size ?
"mulu" :
"mulul");
c_asp((int)(tp->tp_size));
CAL((int)(tp->tp_size) <= (int)word_size ? "mulu" : "mulul",
(int)(tp->tp_size));
}
break;
case T_REAL:
@ -1023,8 +1016,8 @@ CodeEl(nd, tp)
}
else C_loc((arith) (eltype->enm_ncst - 1));
Operands(nd);
C_cal("LtoUset"); /* library routine to fill set */
c_asp(5 * (int)word_size);
CAL("LtoUset", 5 * (int) word_size);
/* library routine to fill set */
}
else {
CodePExpr(nd);
@ -1070,7 +1063,7 @@ CodeDAddress(nd, chk_controlvar)
if (chkptr && ! options['R']) {
C_dup(pointer_size);
C_loi((arith) 1);
c_asp((int)word_size);
C_asp(word_size);
}
free_desig(designator);
}
@ -1126,8 +1119,11 @@ c_lae_dlb(l)
C_lae_dlb(l, (arith) 0);
}
c_asp(n)
CAL(name, ssp)
char *name;
int ssp;
{
C_asp((arith) n);
C_cal(name);
C_asp((arith) ssp);
}
#endif

View file

@ -235,8 +235,7 @@ CodeValue(ds, tp)
#endif
CodeAddress(ds);
CodeConst(tp->tp_size, (int) pointer_size);
C_cal("load");
c_asp((int)pointer_size + (int)pointer_size);
CAL("load", (int)pointer_size + (int)pointer_size);
break;
}
break;
@ -367,8 +366,7 @@ CodeMove(rhs, left, rtp)
CodeAddress(lhs);
C_loc(rtp->tp_size);
C_loc(tp->tp_size);
C_cal("StringAssign");
c_asp((int)pointer_size + (int)pointer_size + (int)dword_size);
CAL("StringAssign", (int)pointer_size + (int)pointer_size + (int)dword_size);
break;
}
CodeStore(lhs, tp);
@ -435,8 +433,7 @@ CodeMove(rhs, left, rtp)
case USE_LOAD_STORE:
case USE_LOI_STI:
CodeConst(tp->tp_size, (int) pointer_size);
C_cal("blockmove");
c_asp(3 * (int)pointer_size);
CAL("blockmove", 3 * (int)pointer_size);
break;
}
break;

View file

@ -458,12 +458,11 @@ genrck(tp)
}
c_lae_dlb(ol);
if (size <= word_size) {
C_cal(btp->tp_fund == T_INTEGER ? "rcki" : "rcku");
CAL(btp->tp_fund == T_INTEGER ? "rcki" : "rcku", (int) pointer_size);
}
else {
C_cal(btp->tp_fund == T_INTEGER ? "rckil" : "rckul");
CAL(btp->tp_fund == T_INTEGER ? "rckil" : "rckul", (int) pointer_size);
}
c_asp((int)pointer_size);
}
getbounds(tp, plo, phi)

View file

@ -85,8 +85,7 @@ DoPriority()
if (priority) {
tmpprio = NewInt();
C_loc(priority->nd_INT);
C_cal("stackprio");
c_asp((int)word_size);
CAL("stackprio", (int) word_size);
C_lfr(word_size);
C_stl(tmpprio);
}
@ -97,8 +96,7 @@ EndPriority()
{
if (priority) {
C_lol(tmpprio);
C_cal("unstackprio");
c_asp((int)word_size);
CAL("unstackprio", (int) word_size);
FreeInt(tmpprio);
}
}
@ -304,16 +302,14 @@ WalkProcedure(procedure)
}
/* First compute new stackpointer */
C_lal(param->par_def->var_off);
C_cal("new_stackptr");
c_asp((int)pointer_size);
CAL("new_stackptr", (int)pointer_size);
C_lfr(pointer_size);
C_str((arith) 1);
C_ass(pointer_size);
/* adjusted stack pointer */
LOL(param->par_def->var_off, pointer_size);
/* push source address */
C_cal("copy_array");
CAL("copy_array", (int)pointer_size);
/* copy */
c_asp((int)pointer_size);
}
}
}
@ -407,8 +403,7 @@ MkCalls(df)
if (df->df_kind == D_MODULE) {
C_lxl((arith) 0);
C_cal(df->mod_vis->sc_scope->sc_name);
c_asp((int)pointer_size);
CAL(df->mod_vis->sc_scope->sc_name, (int)pointer_size);
}
}

View file

@ -22,7 +22,7 @@ extern label data_label;
#include "squeeze.h"
#ifndef SQUEEZE
#define c_asp(x) C_asp((arith) (x))
#define c_loc(x) C_loc((arith) (x))
#define c_lae_dlb(x) C_lae_dlb(x,(arith) 0)
#define CAL(nm, sz) (C_cal(nm), C_asp((arith)(sz)))
#endif