From 1277cdda1c03a8a2411246cf03941c977d335a59 Mon Sep 17 00:00:00 2001 From: Richard Henderson Date: Thu, 23 Oct 1997 00:40:25 +0000 Subject: [PATCH] * config/tc-sparc.c (v9a_asr_table): New variable. (sparc_ip): Handle v9a asr's. Patch from David Miller . --- gas/ChangeLog | 6 +++++ gas/config/tc-sparc.c | 56 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 62 insertions(+) diff --git a/gas/ChangeLog b/gas/ChangeLog index 6eafd0374b..e1137bd265 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,9 @@ +Wed Oct 22 17:42:12 1997 Richard Henderson + + * config/tc-sparc.c (v9a_asr_table): New variable. + (sparc_ip): Handle v9a asr's. + Patch from David Miller . + Wed Oct 22 17:22:59 1997 Richard Henderson * config/tc-sparc.h (md_do_align): New macro. diff --git a/gas/config/tc-sparc.c b/gas/config/tc-sparc.c index 124da4ea9d..9eee6ac06f 100644 --- a/gas/config/tc-sparc.c +++ b/gas/config/tc-sparc.c @@ -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)