* config/tc-sparc.c (v9a_asr_table): New variable.

(sparc_ip): Handle v9a asr's.
        Patch from David Miller <davem@vger.rutgers.edu>.
This commit is contained in:
Richard Henderson 1997-10-23 00:40:25 +00:00
parent 81dac216f9
commit 1277cdda1c
2 changed files with 62 additions and 0 deletions

View 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> Wed Oct 22 17:22:59 1997 Richard Henderson <rth@cygnus.com>
* config/tc-sparc.h (md_do_align): New macro. * config/tc-sparc.h (md_do_align): New macro.

View file

@ -578,6 +578,21 @@ struct priv_reg_entry priv_reg_table[] =
{"", -1}, /* end marker */ {"", -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 static int
cmp_reg_entry (parg, qarg) cmp_reg_entry (parg, qarg)
const PTR parg; const PTR parg;
@ -1232,6 +1247,47 @@ sparc_ip (str, pinsn)
goto error; 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':
case 'm': case 'm':
if (strncmp (s, "%asr", 4) == 0) if (strncmp (s, "%asr", 4) == 0)