X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=opcodes%2Fia64-gen.c;h=6443c7c4b250f9f7009be8052acc4997c121aa15;hb=c2274b2767dba3175e585bd17f9f4a93b56cdc63;hp=e5e4e9307237508ea8ecec1977686bc3890f63bf;hpb=514829c3af7d26ac20b0f3993f449624d965bb18;p=deliverable%2Fbinutils-gdb.git diff --git a/opcodes/ia64-gen.c b/opcodes/ia64-gen.c index e5e4e93072..6443c7c4b2 100644 --- a/opcodes/ia64-gen.c +++ b/opcodes/ia64-gen.c @@ -1,5 +1,5 @@ /* 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, This file is part of GDB, GAS, and the GNU binutils. @@ -35,10 +35,10 @@ */ #include -#include #include "ansidecl.h" #include "libiberty.h" +#include "safe-ctype.h" #include "sysdep.h" #include "ia64-opc.h" #include "ia64-opc-a.c" @@ -399,9 +399,21 @@ fetch_insn_class(const char *full_name, int create) 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) { @@ -413,8 +425,9 @@ fetch_insn_class(const char *full_name, int create) } } - /* 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) @@ -530,7 +543,7 @@ load_insn_classes() 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; @@ -558,7 +571,7 @@ load_insn_classes() char *subname; int sub; - while (*tmp && isspace(*tmp)) + while (*tmp && ISSPACE (*tmp)) { ++tmp; if (tmp == buf + sizeof(buf)) @@ -620,7 +633,7 @@ parse_resource_users(ref, usersp, nusersp, notesp) int create = 0; char *name; - while (isspace(*tmp)) + while (ISSPACE (*tmp)) ++tmp; name = tmp; while (*tmp && *tmp != ',') @@ -741,7 +754,7 @@ load_depfile (const char *filename, enum ia64_dependency_mode mode) 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; @@ -749,21 +762,21 @@ load_depfile (const char *filename, enum ia64_dependency_mode mode) ++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; @@ -1055,6 +1068,9 @@ in_iclass(struct ia64_opcode *idesc, struct iclass *ic, 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; }