From 110b814dbaff397a671fef550ef432a0e0921623 Mon Sep 17 00:00:00 2001 From: David Edelsohn Date: Mon, 26 Feb 1996 18:38:33 +0000 Subject: [PATCH] * config/tc-sparc.c (sparc_ip): Print all architectures that support the insn on mismatch. --- gas/ChangeLog | 5 +++++ gas/config/tc-sparc.c | 30 +++++++++++++++++++++++++----- 2 files changed, 30 insertions(+), 5 deletions(-) diff --git a/gas/ChangeLog b/gas/ChangeLog index 77c1dc08bec..cdec488458c 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,8 @@ +Mon Feb 26 10:34:10 1996 Doug Evans + + * config/tc-sparc.c (sparc_ip): Print all architectures that support + the insn on mismatch. + Fri Feb 23 21:44:39 1996 Rob Savoye * configure.in: Add support for a29-coff. diff --git a/gas/config/tc-sparc.c b/gas/config/tc-sparc.c index ad8248b730b..1c241e6ea3e 100644 --- a/gas/config/tc-sparc.c +++ b/gas/config/tc-sparc.c @@ -1828,16 +1828,36 @@ sparc_ip (str) current_architecture = needed_architecture; } /* Conflict. */ + /* ??? This seems to be a bit fragile. What if the next entry in + the opcode table is the one we want and it is supported? + It is possible to arrange the table today so that this can't + happen but what about tomorrow? */ else { - enum sparc_opcode_arch_val needed_architecture = - sparc_ffs (~ SPARC_OPCODE_SUPPORTED (max_architecture) - & needed_arch_mask); + int arch,printed_one_p = 0; + char *p; + char required_archs[SPARC_OPCODE_ARCH_MAX * 16]; + + /* Create a list of the architectures that support the insn. */ + needed_arch_mask &= ~ SPARC_OPCODE_SUPPORTED (max_architecture); + p = required_archs; + arch = sparc_ffs (needed_arch_mask); + while ((1 << arch) <= needed_arch_mask) + { + if ((1 << arch) & needed_arch_mask) + { + if (printed_one_p) + *p++ = '|'; + strcpy (p, sparc_opcode_archs[arch].name); + p += strlen (p); + printed_one_p = 1; + } + ++arch; + } - assert (needed_architecture <= SPARC_OPCODE_ARCH_MAX); as_bad ("Architecture mismatch on \"%s\".", str); as_tsktsk (" (Requires %s; requested architecture is %s.)", - sparc_opcode_archs[needed_architecture].name, + required_archs, sparc_opcode_archs[max_architecture].name); return; } -- 2.30.2