/* ia64-gen.c -- Generate a shrunk set of opcode tables
- Copyright (c) 1999 Free Software Foundation, Inc.
+ Copyright 1999, 2000, 2001 Free Software Foundation, Inc.
Written by Bob Manson, Cygnus Solutions, <manson@cygnus.com>
This file is part of GDB, GAS, and the GNU binutils.
*/
#include <stdio.h>
-#include <ctype.h>
#include "ansidecl.h"
#include "libiberty.h"
+#include "safe-ctype.h"
#include "sysdep.h"
#include "ia64-opc.h"
#include "ia64-opc-a.c"
if ((comment = strchr(name, '[')) != NULL)
is_class = 1;
if ((notestr = strchr(name, '+')) != NULL)
+ is_class = 1;
+
+ /* If it is a composite class, then ignore comments and notes that come after
+ the '\\', since they don't apply to the part we are decoding now. */
+ if (xsect)
+ {
+ if (comment > xsect)
+ comment = 0;
+ if (notestr > xsect)
+ notestr = 0;
+ }
+
+ if (notestr)
{
char *nextnotestr;
- is_class = 1;
note = atoi (notestr + 1);
if ((nextnotestr = strchr (notestr + 1, '+')) != NULL)
{
}
}
- /* if it's a composite class, leave the notes and comments in place so that
- we have a unique name for the composite class */
+ /* If it's a composite class, leave the notes and comments in place so that
+ we have a unique name for the composite class. Otherwise, we remove
+ them. */
if (!xsect)
{
if (notestr)
if (fgets (buf, sizeof(buf), fp) == NULL)
break;
- while (isspace(buf[strlen(buf)-1]))
+ while (ISSPACE (buf[strlen(buf)-1]))
buf[strlen(buf)-1] = '\0';
name = tmp = buf;
char *subname;
int sub;
- while (*tmp && isspace(*tmp))
+ while (*tmp && ISSPACE (*tmp))
{
++tmp;
if (tmp == buf + sizeof(buf))
int create = 0;
char *name;
- while (isspace(*tmp))
+ while (ISSPACE (*tmp))
++tmp;
name = tmp;
while (*tmp && *tmp != ',')
if (fgets (buf, sizeof(buf), fp) == NULL)
break;
- while (isspace(buf[strlen(buf)-1]))
+ while (ISSPACE (buf[strlen(buf)-1]))
buf[strlen(buf)-1] = '\0';
name = tmp = buf;
++tmp;
*tmp++ = '\0';
- while (isspace (*tmp))
+ while (ISSPACE (*tmp))
++tmp;
regp = tmp;
tmp = strchr (tmp, ';');
if (!tmp)
abort ();
*tmp++ = 0;
- while (isspace (*tmp))
+ while (ISSPACE (*tmp))
++tmp;
chkp = tmp;
tmp = strchr (tmp, ';');
if (!tmp)
abort ();
*tmp++ = 0;
- while (isspace (*tmp))
+ while (ISSPACE (*tmp))
++tmp;
semantics = parse_semantics (tmp);
extra = semantics == IA64_DVS_OTHER ? xstrdup (tmp) : NULL;
resolved = idesc->operands[0] == IA64_OPND_B2;
else if (strcmp (ic->name, "invala") == 0)
resolved = strcmp (idesc->name, ic->name) == 0;
+ else if (strncmp (idesc->name, "st", 2) == 0
+ && strstr (format, "M5") != NULL)
+ resolved = idesc->flags & IA64_OPCODE_POSTINC;
else
resolved = 0;
}