2 Commits

Author SHA1 Message Date
David Given
3f09da5045 Rename branch.
--HG--
branch : dtrg-experimental-powerpc-branch
2015-06-18 23:39:26 +02:00
David Given
33b4873932 Readjust after merge to default.
--HG--
branch : dtrg-experimental-powerpc
2013-05-09 18:15:49 +01:00
8 changed files with 34 additions and 6 deletions

View File

@@ -39,6 +39,7 @@
#define DO_TOSTACK 23
#define DO_KILLREG 24
#define DO_LABDEF 25
#define DO_STACKADJUST 26
#ifndef MAXATT
#define MAXATT TOKENSIZE
@@ -133,6 +134,7 @@ 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 */

2
pmfile
View File

@@ -186,7 +186,7 @@ default = group {
platform_pc86,
platform_linux386,
-- platform_linuxppc,
platform_linuxppc,
platform_linux68k,
platform_cpm,
}

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(), *make_erase();
struct varinfo *gen_label(), *gen_stackadjust(), *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
%token TEST MOVE STACK RETURN STACKADJUST
%token PATTERNS PAT WITH EXACT KILLS USES REUSING GEN YIELDS LEAVING
%token DEFINED SAMESIGN SFIT UFIT ROM LOWW HIGHW ISROM
%token DEFINED SAMESIGN SFIT UFIT ROM LOWW HIGHW ISROM STACKOFFSET
%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
@@ -635,8 +635,8 @@ coderule
maxempatlen=empatlen;
}
patterns
{ if (!saferulefound)
error("Previous rule impossible on empty stack");
{ /* if (!saferulefound)
error("Previous rule impossible on empty stack"); */
outpatterns();
}
| PROC IDENT example
@@ -849,6 +849,8 @@ gen_instruction
{ $$ = gen_label($2-1); use_tes++; }
| RETURN
{ $$ = gen_preturn(); }
| STACKADJUST expr
{ $$ = gen_stackadjust($2.ex_index); use_noframepointer++; }
;
optstar
: /* empty */
@@ -1028,6 +1030,8 @@ 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,6 +127,15 @@ 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,6 +37,7 @@ 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,6 +43,8 @@ reusing REUSING
rom ROM
samesign SAMESIGN
sfit SFIT
stackadjust STACKADJUST
stackoffset STACKOFFSET
topeltsize TOPELTSIZE
test TEST
to TO

View File

@@ -12,6 +12,8 @@ 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";
@@ -612,6 +614,8 @@ outdefs() {
cdef("TABLEDEBUG",1);
if (use_tes)
cdef("USE_TES",1);
if (use_noframepointer)
cdef("USE_NOFRAMEPOINTER",1);
}
outars() {
@@ -852,6 +856,11 @@ 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,3 +12,4 @@
#define INSERASE (-6)
#define INSREMOVE (-7)
#define INSLABDEF (-8)
#define INSSTACKADJUST (-9)