diff options
author | Jeff Law <law@redhat.com> | 1996-09-03 18:31:48 +0000 |
---|---|---|
committer | Jeff Law <law@redhat.com> | 1996-09-03 18:31:48 +0000 |
commit | 9fca2fd3c601fc6e65f5c3b76bfaf86916c3705d (patch) | |
tree | 5bf6f1520fa84627a89a4c4f4a13651f5bb00ade /sim/v850/gencode.c | |
parent | eb5c28e1736c54e6928852edb7ecf0ff65e91412 (diff) | |
download | gdb-9fca2fd3c601fc6e65f5c3b76bfaf86916c3705d.zip gdb-9fca2fd3c601fc6e65f5c3b76bfaf86916c3705d.tar.gz gdb-9fca2fd3c601fc6e65f5c3b76bfaf86916c3705d.tar.bz2 |
* gencode.c: Fix various indention & style problems.
Remove test code. Remove #if 0 code.
* interp.c: Provide prototypes for all static functions.
Fix minor indention problems.
(sim_open, sim_resume): Remove unused variables.
(sim_read): Return type is "int".
* simops.c: Remove unused variables.
(divh): Make result of divide-by-zero zero.
(setf): Initialize result to keep compiler quiet.
(sar instructions): These just clear the overflow bit.
* v850_sim.h: Provide prototypes for put_byte, put_half
and put_word.
Cleaning up.
Diffstat (limited to 'sim/v850/gencode.c')
-rw-r--r-- | sim/v850/gencode.c | 47 |
1 files changed, 17 insertions, 30 deletions
diff --git a/sim/v850/gencode.c b/sim/v850/gencode.c index 37f41b8..3e98ace 100644 --- a/sim/v850/gencode.c +++ b/sim/v850/gencode.c @@ -4,14 +4,17 @@ 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)) + if ((argc > 1) && (strcmp (argv[1], "-h") == 0)) write_header(); - else if ((argc > 1) && (strcmp (argv[1],"-t") == 0)) + else if ((argc > 1) && (strcmp (argv[1], "-t") == 0)) write_template (); else write_opcodes(); @@ -25,7 +28,8 @@ write_header () struct v850_opcode *opcode; for (opcode = (struct v850_opcode *)v850_opcodes; opcode->name; opcode++) - printf("void OP_%X PARAMS ((void));\t\t/* %s */\n",opcode->opcode, opcode->name); + printf("void OP_%X PARAMS ((void));\t\t/* %s */\n", + opcode->opcode, opcode->name); } @@ -43,7 +47,7 @@ write_template () for (opcode = (struct v850_opcode *)v850_opcodes; opcode->name; opcode++) { - printf("/* %s */\nvoid\nOP_%X ()\n{\n",opcode->name,opcode->opcode); + printf("/* %s */\nvoid\nOP_%X ()\n{\n", opcode->name, opcode->opcode); /* count operands */ j = 0; @@ -57,38 +61,26 @@ write_template () switch (j) { case 0: - printf ("printf(\" %s\\n\");\n",opcode->name); + printf ("printf(\" %s\\n\");\n", opcode->name); break; case 1: - printf ("printf(\" %s\\t%%x\\n\",OP[0]);\n",opcode->name); + 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); + 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); + 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); + fprintf (stderr,"Too many operands: %d\n", j); } printf ("}\n\n"); } } - -long Opcodes[512]; -static int curop=0; - -check_opcodes( long op) -{ - int i; - - for (i=0;i<curop;i++) - if (Opcodes[i] == op) - fprintf(stderr,"DUPLICATE OPCODES: %x\n",op); -} - - static void write_opcodes () { @@ -105,8 +97,6 @@ write_opcodes () printf (" { %ld,%ld,OP_%X,", opcode->opcode, opcode->mask, opcode->opcode); - /* REMOVE ME */ - check_opcodes (opcode->opcode); Opcodes[curop++] = opcode->opcode; /* count operands */ @@ -130,11 +120,8 @@ write_opcodes () { if (j) printf (", "); -#if 0 - if ((flags & OPERAND_REG) && (opcode->format == LONG_L)) - shift += 15; -#endif - printf ("%d,%d,%d",shift,v850_operands[opcode->operands[i]].bits,flags); + printf ("%d,%d,%d", shift, + v850_operands[opcode->operands[i]].bits,flags); j = 1; } } |