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

View file

@ -909,23 +909,6 @@ normalfailed: if (stackpad!=tokpatlen) {
break; 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 #endif
} }
} }

View file

@ -20,9 +20,6 @@ extern rl_p curreglist; /* side effect of findcoerc() */
#ifndef NDEBUG #ifndef NDEBUG
extern int Debug; /* on/off debug printout */ extern int Debug; /* on/off debug printout */
#endif #endif
#ifdef USE_NOFRAMEPOINTER
extern int stackoffset; /* offset from localbase to sp */
#endif
/* /*
* Next descriptions are external declarations for tables created * 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_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 make_expr(),ident_expr(),subreg_expr(),tokm_expr(),all_expr();
expr_t perc_ident_expr(),sum_expr(),regvar_expr(); expr_t perc_ident_expr(),sum_expr(),regvar_expr();
@ -74,9 +74,9 @@ iocc_t iops[20];
%token TOPELTSIZE FALLTHROUGH LABELDEF %token TOPELTSIZE FALLTHROUGH LABELDEF
%token PROC CALL EXAMPLE %token PROC CALL EXAMPLE
%token FROM TO %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 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 CMPEQ CMPNE CMPLT CMPGT CMPLE CMPGE OR2 AND2 LSHIFT RSHIFT NOT COMP
%token INREG REGVAR REG_ANY REG_FLOAT REG_LOOP REG_POINTER %token INREG REGVAR REG_ANY REG_FLOAT REG_LOOP REG_POINTER
%token <yy_int> ADORNACCESS %token <yy_int> ADORNACCESS
@ -849,8 +849,6 @@ gen_instruction
{ $$ = gen_label($2-1); use_tes++; } { $$ = gen_label($2-1); use_tes++; }
| RETURN | RETURN
{ $$ = gen_preturn(); } { $$ = gen_preturn(); }
| STACKADJUST expr
{ $$ = gen_stackadjust($2.ex_index); use_noframepointer++; }
; ;
optstar optstar
: /* empty */ : /* empty */
@ -1030,8 +1028,6 @@ expr
{ $$ = make_expr(TYPINT,EX_LOWW,$3-1,0); } { $$ = make_expr(TYPINT,EX_LOWW,$3-1,0); }
| HIGHW '(' emarg ')' | HIGHW '(' emarg ')'
{ $$ = make_expr(TYPINT,EX_HIGHW,$3-1,0); } { $$ = make_expr(TYPINT,EX_HIGHW,$3-1,0); }
| STACKOFFSET '(' ')'
{ $$ = make_expr(TYPINT,EX_STACKOFFSET, 0, 0); }
/* Excluded, because it causes a shift-reduce conflict /* Excluded, because it causes a shift-reduce conflict
(problems with a tokenset_no followed by an optexpr) (problems with a tokenset_no followed by an optexpr)
| '-' expr %prec UMINUS | '-' expr %prec UMINUS

View file

@ -127,15 +127,6 @@ struct varinfo *gen_preturn() {
return(vp); 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) { struct varinfo *gen_tlab(n) {
register struct varinfo *vp; register struct varinfo *vp;

View file

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

View file

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

View file

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

View file

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