* config/tc-sparc.c (v9a_asr_table): New variable.
authorRichard Henderson <rth@redhat.com>
Thu, 23 Oct 1997 00:40:25 +0000 (00:40 +0000)
committerRichard Henderson <rth@redhat.com>
Thu, 23 Oct 1997 00:40:25 +0000 (00:40 +0000)
        (sparc_ip): Handle v9a asr's.
        Patch from David Miller <davem@vger.rutgers.edu>.

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

index 6eafd03..e1137bd 100644 (file)
@@ -1,3 +1,9 @@
+Wed Oct 22 17:42:12 1997  Richard Henderson  <rth@cygnus.com>
+
+       * config/tc-sparc.c (v9a_asr_table): New variable.
+       (sparc_ip): Handle v9a asr's.
+       Patch from David Miller <davem@vger.rutgers.edu>.
+
 Wed Oct 22 17:22:59 1997  Richard Henderson  <rth@cygnus.com>
 
        * config/tc-sparc.h (md_do_align): New macro.
index 124da4e..9eee6ac 100644 (file)
@@ -578,6 +578,21 @@ struct priv_reg_entry priv_reg_table[] =
   {"", -1},                    /* end marker */
 };
 
+/* v9a specific asrs */
+
+struct priv_reg_entry v9a_asr_table[] =
+{
+  {"tick_cmpr", 23},
+  {"softint", 22},
+  {"set_softint", 20},
+  {"pic", 17},
+  {"pcr", 16},
+  {"gsr", 19},
+  {"dcr", 18},
+  {"clear_softint", 21},
+  {"", -1},                    /* end marker */
+};
+
 static int
 cmp_reg_entry (parg, qarg)
      const PTR parg;
@@ -1232,6 +1247,47 @@ sparc_ip (str, pinsn)
                  goto error;
                }
 
+           case '_':
+           case '/':
+             /* Parse a v9a ancillary state register.  */
+             if (*s == '%')
+               {
+                 struct priv_reg_entry *p = v9a_asr_table;
+                 unsigned int len = 9999999; /* init to make gcc happy */
+
+                 s += 1;
+                 while (p->name[0] > s[0])
+                   p++;
+                 while (p->name[0] == s[0])
+                   {
+                     len = strlen (p->name);
+                     if (strncmp (p->name, s, len) == 0)
+                       break;
+                     p++;
+                   }
+                 if (p->name[0] != s[0])
+                   {
+                     error_message = ": unrecognizable v9a ancillary state register";
+                     goto error;
+                   }
+                 if (*args == '/' && (p->regnum == 20 || p->regnum == 21))
+                   {
+                     error_message = ": rd on write only ancillary state register";
+                     goto error;
+                   }                 
+                 if (*args == '/')
+                   opcode |= (p->regnum << 14);
+                 else
+                   opcode |= (p->regnum << 25);
+                 s += len;
+                 continue;
+               }
+             else
+               {
+                 error_message = ": unrecognizable v9a ancillary state register";
+                 goto error;
+               }
+
            case 'M':
            case 'm':
              if (strncmp (s, "%asr", 4) == 0)