Remove stackadjust and stackoffset() from ncg.

This feature has never been used since its introduction, more than 3
years ago, in David Given's commit c93cb69 of May 8, 2013.  The commit
was for "PowerPC and M68K work".  I am not undoing the entire commit.
I am only removing the stackadjust and stackoffset() feature.

This commit removes the feature from my branch kernigh-linuxppc.  This
removal includes the mach/proto/ncg parts.  The default branch already
removed most of the feature, but kept the mach/proto/ncg parts.  That
removal happened in commit 81778b6 of May 13, 2013 (which was a merge;
git diff af0dede 81778b6).  The branch dtrg-experimental-powerpc
merged the default branch but without the removal.  That merge was
commit 4703db0f of Sep 15, 2016 (git diff 8c94b13 4703db0).  My branch
kernigh-linuxppc is off branch dtrg-experimental-powerpc, so I can no
longer get the removal by merging default.

David Given described the stackadjust feature in
  https://sourceforge.net/p/tack/mailman/message/30814691/

The instruction stackadjust would add a value to the offset, and the
function stackoffset() would return this offset.  One would use this
to track sp - fp, then omit the frame pointer by not keeping fp in a
register.
This commit is contained in:
George Koehler 2016-10-07 20:52:13 -04:00
parent 409ba7fb1b
commit 65c2a8a0ae
9 changed files with 3 additions and 51 deletions

View file

@ -39,7 +39,6 @@
#define DO_TOSTACK 23
#define DO_KILLREG 24
#define DO_LABDEF 25
#define DO_STACKADJUST 26
#ifndef MAXATT
#define MAXATT TOKENSIZE
@ -134,7 +133,6 @@ typedef struct exprnode *node_p;
#define EX_ISROM 44
#define EX_TOPELTSIZE 45
#define EX_FALLTHROUGH 46
#define EX_STACKOFFSET 47
typedef struct { /* to stack coercions */

View file

@ -909,23 +909,6 @@ normalfailed: if (stackpad!=tokpatlen) {
break;
}
#endif
#ifdef USE_NOFRAMEPOINTER
case DO_STACKADJUST: {
result_t result;
int nodeno;
DEBUG("STACKADJUST");
/* The offset is an expression, which we need to evaluate. */
getint(nodeno,codep);
compute(&enodes[nodeno], &result);
assert(result.e_typ==EV_INT);
if (toplevel)
stackoffset += result.e_v.e_con;
break;
}
#endif
}
}

View file

@ -20,9 +20,6 @@ extern rl_p curreglist; /* side effect of findcoerc() */
#ifndef NDEBUG
extern int Debug; /* on/off debug printout */
#endif
#ifdef USE_NOFRAMEPOINTER
extern int stackoffset; /* offset from localbase to sp */
#endif
/*
* Next descriptions are external declarations for tables created

View file

@ -38,7 +38,7 @@ int Xstackflag=0; /* set in coercions, moves, and tests. %1 means something
*/
struct varinfo *gen_inst(),*gen_move(),*gen_test(),*gen_preturn(),*gen_tlab();
struct varinfo *gen_label(), *gen_stackadjust(), *make_erase();
struct varinfo *gen_label(), *make_erase();
expr_t make_expr(),ident_expr(),subreg_expr(),tokm_expr(),all_expr();
expr_t perc_ident_expr(),sum_expr(),regvar_expr();
@ -74,9 +74,9 @@ iocc_t iops[20];
%token TOPELTSIZE FALLTHROUGH LABELDEF
%token PROC CALL EXAMPLE
%token FROM TO
%token TEST MOVE STACK RETURN STACKADJUST
%token TEST MOVE STACK RETURN
%token PATTERNS PAT WITH EXACT KILLS USES REUSING GEN YIELDS LEAVING
%token DEFINED SAMESIGN SFIT UFIT ROM LOWW HIGHW ISROM STACKOFFSET
%token DEFINED SAMESIGN SFIT UFIT ROM LOWW HIGHW ISROM
%token CMPEQ CMPNE CMPLT CMPGT CMPLE CMPGE OR2 AND2 LSHIFT RSHIFT NOT COMP
%token INREG REGVAR REG_ANY REG_FLOAT REG_LOOP REG_POINTER
%token <yy_int> ADORNACCESS
@ -849,8 +849,6 @@ gen_instruction
{ $$ = gen_label($2-1); use_tes++; }
| RETURN
{ $$ = gen_preturn(); }
| STACKADJUST expr
{ $$ = gen_stackadjust($2.ex_index); use_noframepointer++; }
;
optstar
: /* empty */
@ -1030,8 +1028,6 @@ expr
{ $$ = make_expr(TYPINT,EX_LOWW,$3-1,0); }
| HIGHW '(' emarg ')'
{ $$ = make_expr(TYPINT,EX_HIGHW,$3-1,0); }
| STACKOFFSET '(' ')'
{ $$ = make_expr(TYPINT,EX_STACKOFFSET, 0, 0); }
/* Excluded, because it causes a shift-reduce conflict
(problems with a tokenset_no followed by an optexpr)
| '-' expr %prec UMINUS

View file

@ -127,15 +127,6 @@ struct varinfo *gen_preturn() {
return(vp);
}
struct varinfo *gen_stackadjust(int expr) {
register struct varinfo *vp;
NEW(vp,struct varinfo);
vp->vi_int[0] = INSSTACKADJUST;
vp->vi_int[1] = expr;
return(vp);
}
struct varinfo *gen_tlab(n) {
register struct varinfo *vp;

View file

@ -37,7 +37,6 @@ extern int regclass;
extern int maxtokensize;
extern int nprocargs, maxprocargs;
extern int use_tes;
extern int use_noframepointer;
extern char *mystrcpy();
extern char *myalloc();

View file

@ -43,8 +43,6 @@ reusing REUSING
rom ROM
samesign SAMESIGN
sfit SFIT
stackadjust STACKADJUST
stackoffset STACKOFFSET
topeltsize TOPELTSIZE
test TEST
to TO

View file

@ -12,8 +12,6 @@ int tabledebug=0; /* do not generate code for table debugging */
#endif
int verbose=0; /* print all statistics */
int use_tes; /* use top element size information */
int use_noframepointer; /* use stackadjust mechanism to remove requirement
for frame pointer */
char *c_file= "tables.c";
char *h_file= "tables.H";
char *cd_file= "code";
@ -614,8 +612,6 @@ outdefs() {
cdef("TABLEDEBUG",1);
if (use_tes)
cdef("USE_TES",1);
if (use_noframepointer)
cdef("USE_NOFRAMEPOINTER",1);
}
outars() {
@ -856,11 +852,6 @@ varinfo *kills,*allocates,*generates,*yields,*leaving;
codeint(vp->vi_int[1]);
codenl();
break;
case INSSTACKADJUST:
code8(DO_STACKADJUST);
codeint(vp->vi_int[1]);
codenl();
break;
}
}
codecoco(cocono);

View file

@ -12,4 +12,3 @@
#define INSERASE (-6)
#define INSREMOVE (-7)
#define INSLABDEF (-8)
#define INSSTACKADJUST (-9)