* gencode.c, simops.c: Delete.

* Makefile.in: Remove non-COMMON dependencies and commands.
This commit is contained in:
Alexandre Oliva 2004-06-26 21:44:56 +00:00
parent 2726dafcc9
commit 622c89b6e6
4 changed files with 6 additions and 3433 deletions

View file

@ -1,5 +1,8 @@
2004-06-26 Alexandre Oliva <aoliva@redhat.com>
* gencode.c, simops.c: Delete.
* Makefile.in: Remove non-COMMON dependencies and commands.
* configure.in: Use common simulator always. Don't subst sim_gen
nor mn10300_common.
* configure: Rebuilt.

View file

@ -29,14 +29,13 @@ MN10300_OBJS = \
sim-reason.o \
sim-stop.o \
dv-sockser.o
MN10300_INTERP_DEP =
SIM_OBJS = $(MN10300_OBJS) interp.o
# List of main object files for `run'.
SIM_RUN_OBJS = nrun.o
SIM_EXTRA_CLEAN = clean-extra
SIM_EXTRA_CLEAN = clean-igen
# Extra dependencies for "sim-main.h"
SIM_EXTRA_DEPS = mn10300_sim.h itable.h idecode.h
@ -50,28 +49,7 @@ SIM_EXTRA_CFLAGS = -DPOLL_QUIT_INTERVAL=0x20
## COMMON_POST_CONFIG_FRAG
#
# Old generator (default)
#
simops.h: gencode
./gencode -h >$@
table.c: gencode simops.h
./gencode >$@
gencode.o: gencode.c $(INCLUDE)
$(CC_FOR_BUILD) $(BUILD_CFLAGS) -c $(srcdir)/gencode.c
m10300-opc.o: $(srcdir)/../../opcodes/m10300-opc.c
$(CC_FOR_BUILD) $(BUILD_CFLAGS) -c $(srcdir)/../../opcodes/m10300-opc.c
gencode: gencode.o m10300-opc.o
$(CC_FOR_BUILD) $(BUILD_CFLAGS) -o gencode gencode.o m10300-opc.o $(BUILD_LIB)
idecode.o op_utils.o semantics.o simops.o: targ-vals.h
idecode.o op_utils.o semantics.o: targ-vals.h
BUILT_SRC_FROM_IGEN = \
icache.h \
@ -145,10 +123,4 @@ tmp-igen: $(IGEN_INSN) $(IGEN_DC) ../igen/igen
$(SHELL) $(srcdir)/../../move-if-change tmp-irun.c irun.c
touch tmp-igen
interp.o: interp.c $(MN10300_INTERP_DEP) $(INCLUDE)
simops.o: simops.c simops.h $(INCLUDE)
table.o: table.c
clean-extra: clean-igen
rm -f table.c simops.h gencode
interp.o: interp.c $(INCLUDE)

View file

@ -1,163 +0,0 @@
#include "mn10300_sim.h"
static void write_header PARAMS ((void));
static void write_opcodes PARAMS ((void));
static void write_template PARAMS ((void));
long Opcodes[512];
static int curop=0;
int
main (argc, argv)
int argc;
char *argv[];
{
if ((argc > 1) && (strcmp (argv[1], "-h") == 0))
write_header();
else if ((argc > 1) && (strcmp (argv[1], "-t") == 0))
write_template ();
else
write_opcodes();
return 0;
}
static void
write_header ()
{
struct mn10300_opcode *opcode;
for (opcode = (struct mn10300_opcode *)mn10300_opcodes; opcode->name; opcode++)
printf("void OP_%X PARAMS ((unsigned long, unsigned long));\t\t/* %s */\n",
opcode->opcode, opcode->name);
}
/* write_template creates a file all required functions, ready */
/* to be filled out */
static void
write_template ()
{
struct mn10300_opcode *opcode;
int i,j;
printf ("#include \"mn10300_sim.h\"\n");
printf ("#include \"simops.h\"\n");
for (opcode = (struct mn10300_opcode *)mn10300_opcodes; opcode->name; opcode++)
{
printf("/* %s */\nvoid\nOP_%X (insn, extension)\n unsigned long insn, extension;\n{\n", opcode->name, opcode->opcode);
/* count operands */
j = 0;
for (i = 0; i < 6; i++)
{
int flags = mn10300_operands[opcode->operands[i]].flags;
if (flags)
j++;
}
switch (j)
{
case 0:
printf ("printf(\" %s\\n\");\n", opcode->name);
break;
case 1:
printf ("printf(\" %s\\t%%x\\n\", OP[0]);\n", opcode->name);
break;
case 2:
printf ("printf(\" %s\\t%%x,%%x\\n\",OP[0],OP[1]);\n",
opcode->name);
break;
case 3:
printf ("printf(\" %s\\t%%x,%%x,%%x\\n\",OP[0],OP[1],OP[2]);\n",
opcode->name);
break;
default:
fprintf (stderr,"Too many operands: %d\n", j);
}
printf ("}\n\n");
}
}
static void
write_opcodes ()
{
struct mn10300_opcode *opcode;
int i, j;
int numops;
/* write out opcode table */
printf ("#include \"mn10300_sim.h\"\n");
printf ("#include \"simops.h\"\n\n");
printf ("struct simops Simops[] = {\n");
for (opcode = (struct mn10300_opcode *)mn10300_opcodes; opcode->name; opcode++)
{
int size;
if (opcode->format == FMT_S0)
size = 1;
else if (opcode->format == FMT_S1
|| opcode->format == FMT_D0)
size = 2;
else if (opcode->format == FMT_S2
|| opcode->format == FMT_D1)
size = 3;
else if (opcode->format == FMT_S4)
size = 5;
else if (opcode->format == FMT_D2)
size = 4;
else if (opcode->format == FMT_D4)
size = 6;
else
size = 7;
printf (" { 0x%x,0x%x,OP_%X,%d,%d,",
opcode->opcode, opcode->mask, opcode->opcode,
size, opcode->format);
Opcodes[curop++] = opcode->opcode;
/* count operands */
j = 0;
for (i = 0; i < 6; i++)
{
int flags = mn10300_operands[opcode->operands[i]].flags;
if (flags)
j++;
}
printf ("%d,{",j);
j = 0;
numops = 0;
for (i = 0; i < 6; i++)
{
int flags = mn10300_operands[opcode->operands[i]].flags;
int shift = mn10300_operands[opcode->operands[i]].shift;
if (flags)
{
if (j)
printf (", ");
printf ("%d,%d,%d", shift,
mn10300_operands[opcode->operands[i]].bits,flags);
j = 1;
numops++;
}
}
switch (numops)
{
case 0:
printf ("0,0,0");
case 1:
printf (",0,0,0");
}
printf ("}},\n");
}
printf ("{ 0,0,NULL,0,0,0,{0,0,0,0,0,0}},\n};\n");
}

File diff suppressed because it is too large Load diff