diff options
-rw-r--r-- | gas/ChangeLog | 7 | ||||
-rw-r--r-- | gas/config/tc-sparc.c | 50 |
2 files changed, 56 insertions, 1 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog index a484a9f..28b5575 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,10 @@ +2006-02-24 David S. Miller <davem@sunset.davemloft.net> + + * config/tc-sparc.c (priv_reg_table): Add entry for "gl". + (hpriv_reg_table): New table for hyperprivileged registers. + (sparc_ip): New cases '$' and '%' for wrhpr/rdhpr hyperprivileged + register encoding. + 2006-02-24 DJ Delorie <dj@redhat.com> * config/tc-m32c.h (md_apply_fix): Define to m32c_apply_fix. diff --git a/gas/config/tc-sparc.c b/gas/config/tc-sparc.c index b14c377..04bfb53 100644 --- a/gas/config/tc-sparc.c +++ b/gas/config/tc-sparc.c @@ -724,7 +724,7 @@ struct {NULL, NULL, NULL}, }; -/* sparc64 privileged registers. */ +/* sparc64 privileged and hyperprivileged registers. */ struct priv_reg_entry { @@ -750,10 +750,22 @@ struct priv_reg_entry priv_reg_table[] = {"otherwin", 13}, {"wstate", 14}, {"fq", 15}, + {"gl", 16}, {"ver", 31}, {"", -1}, /* End marker. */ }; +struct priv_reg_entry hpriv_reg_table[] = +{ + {"hpstate", 0}, + {"htstate", 1}, + {"hintp", 3}, + {"htba", 5}, + {"hver", 6}, + {"hstick_cmpr", 31}, + {"", -1}, /* End marker. */ +}; + /* v9a specific asrs. */ struct priv_reg_entry v9a_asr_table[] = @@ -1572,6 +1584,42 @@ sparc_ip (str, pinsn) goto error; } + case '$': + case '%': + /* Parse a sparc64 hyperprivileged register. */ + if (*s == '%') + { + struct priv_reg_entry *p = hpriv_reg_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 hyperprivileged register"); + goto error; + } + if (*args == '$') + opcode |= (p->regnum << 14); + else + opcode |= (p->regnum << 25); + s += len; + continue; + } + else + { + error_message = _(": unrecognizable hyperprivileged register"); + goto error; + } + case '_': case '/': /* Parse a v9a/v9b ancillary state register. */ |