* config/tc-sparc.c (sparc_ip): Print all architectures that support
authorDavid Edelsohn <dje.gcc@gmail.com>
Mon, 26 Feb 1996 18:38:33 +0000 (18:38 +0000)
committerDavid Edelsohn <dje.gcc@gmail.com>
Mon, 26 Feb 1996 18:38:33 +0000 (18:38 +0000)
the insn on mismatch.

gas/ChangeLog
gas/config/tc-sparc.c

index 77c1dc08becb34cde7dd78a2fdab0824bbaa0cf2..cdec488458c1e309e4a13be60d3b8d56377f3b91 100644 (file)
@@ -1,3 +1,8 @@
+Mon Feb 26 10:34:10 1996  Doug Evans  <dje@charmed.cygnus.com>
+
+       * config/tc-sparc.c (sparc_ip): Print all architectures that support
+       the insn on mismatch.
+
 Fri Feb 23 21:44:39 1996  Rob Savoye  <rob@chinadoll.cygnus.com>
 
        * configure.in: Add support for a29-coff.
index ad8248b730bf678c77c8461627e47b49cf310336..1c241e6ea3e5cab269b99f914a57fc579939c586 100644 (file)
@@ -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;
            }