Cleanups for z8k target

This commit is contained in:
Nick Clifton
2001-08-01 15:39:17 +00:00
parent d8adc60f05
commit 28bab82b5a
5 changed files with 68 additions and 33 deletions

View File

@ -1,3 +1,10 @@
2001-08-01 Christian Groessler <cpg@aladdin.de>
* config/tc-z8k.c (parse_reg): If a string starts with "r", "rl",
"rh", "rr", "rq", or "sp" then don't automatically assume
it's a register name. Check whether there is a number
following.
2001-08-01 Alan Modra <amodra@bigpond.net.au>
* config/tc-i386.c (lex_got): Match lower case relocation tokens.

View File

@ -259,7 +259,7 @@ parse_reg (src, mode, reg)
char *res = 0;
char regno;
if (src[0] == 's' && src[1] == 'p')
if (src[0] == 's' && src[1] == 'p' && (src[2] == 0 || src[2] == ','))
{
if (segmented_mode)
{
@ -277,6 +277,8 @@ parse_reg (src, mode, reg)
{
if (src[1] == 'r')
{
if (src[2] < '0' || src[2] > '9')
return res; /* Assume no register name but a label starting with 'rr'. */
*mode = CLASS_REG_LONG;
res = whatreg (reg, src + 2);
regno = *reg;
@ -285,6 +287,8 @@ parse_reg (src, mode, reg)
}
else if (src[1] == 'h')
{
if (src[2] < '0' || src[2] > '9')
return res; /* Assume no register name but a label starting with 'rh'. */
*mode = CLASS_REG_BYTE;
res = whatreg (reg, src + 2);
regno = *reg;
@ -293,6 +297,8 @@ parse_reg (src, mode, reg)
}
else if (src[1] == 'l')
{
if (src[2] < '0' || src[2] > '9')
return res; /* Assume no register name but a label starting with 'rl'. */
*mode = CLASS_REG_BYTE;
res = whatreg (reg, src + 2);
regno = *reg;
@ -302,6 +308,8 @@ parse_reg (src, mode, reg)
}
else if (src[1] == 'q')
{
if (src[2] < '0' || src[2] > '9')
return res; /* Assume no register name but a label starting with 'rq'. */
*mode = CLASS_REG_QUAD;
res = whatreg (reg, src + 2);
regno = *reg;
@ -310,6 +318,8 @@ parse_reg (src, mode, reg)
}
else
{
if (src[1] < '0' || src[1] > '9')
return res; /* Assume no register name but a label starting with 'r'. */
*mode = CLASS_REG_WORD;
res = whatreg (reg, src + 1);
regno = *reg;

View File

@ -1,3 +1,11 @@
2001-08-01 Christian Groessler <cpg@aladdin.de>
* z8kgen.c: Fixed indentation of opt[] array. Include stdio.h to
get stderr definition.
(internal, gas): Removed warnings.
(gas): Create a correct final entry for created array.
* z8k-opc.h: Recreated with new z8kgen.
2001-07-28 Kazu Hirata <kazu@hxi.com>
* i386-dis.c: Fix formatting.

View File

@ -4467,5 +4467,13 @@ opcode_entry_type z8k_table[] = {
#endif
"xorb",OPC_xorb,0,{CLASS_REG_BYTE+(ARG_RD),CLASS_REG_BYTE+(ARG_RS),},
{CLASS_BIT+8,CLASS_BIT+8,CLASS_REG+(ARG_RS),CLASS_REG+(ARG_RD),0,0,0,0,0,},2,2,420},
0,0};
/* end marker */
{
#ifdef NICENAMES
NULL,0,0,
0,
#endif
NULL,0,0,{0,0,0,0},{0,0,0,0,0,0,0,0,0,0},0,0,0}
};
#endif

View File

@ -19,6 +19,7 @@
/* This program generates z8k-opc.h */
#include <stdio.h>
#include "sysdep.h"
#define BYTE_INFO_LEN 10
@ -703,7 +704,6 @@ struct tok_struct toks[] =
"01ii", "CLASS_01II", 1,
"00ii", "CLASS_00II", 1,
0, 0
};
char *
@ -899,7 +899,7 @@ void
internal ()
{
int c = count ();
struct op *new = xmalloc (sizeof (struct op) * c);
struct op *new = (struct op *) xmalloc (sizeof (struct op) * c);
struct op *p = opt;
memcpy (new, p, c * sizeof (struct op));
@ -958,7 +958,7 @@ gas ()
struct op *p = opt;
int idx = 0;
char *oldname = "";
struct op *new = xmalloc (sizeof (struct op) * c);
struct op *new = (struct op *) xmalloc (sizeof (struct op) * c);
memcpy (new, p, c * sizeof (struct op));
@ -1278,7 +1278,9 @@ gas ()
printf ("},\n");
new++;
}
printf ("0,0};\n");
printf ("\n/* end marker */\n");
printf ("{\n#ifdef NICENAMES\nNULL,0,0,\n0,\n#endif\n");
printf ("NULL,0,0,{0,0,0,0},{0,0,0,0,0,0,0,0,0,0},0,0,0}\n};\n");
printf ("#endif\n");
}