This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH]: More GAS sparc improvements.
On Tue, Apr 29, 2008 at 03:50:18AM -0700, David Miller wrote:
> From: David Miller <davem@davemloft.net>
> Date: Thu, 24 Apr 2008 02:04:48 -0700 (PDT)
>
> > The bulk of this change is the addition of a section on
> > Sparc opcode translations to the GAS manual. The rest
> > are minor fixups and clarifications in Sparc GAS and the
> > disassembler.
> >
> > Ok to commit?
>
> > --- gas/config/tc-sparc.c 23 Apr 2008 07:49:33 -0000 1.72
> > +++ gas/config/tc-sparc.c 24 Apr 2008 08:52:19 -0000
> > @@ -779,6 +779,8 @@ struct priv_reg_entry v9a_asr_table[] =
> > {"stick_cmpr", 25},
> > {"stick", 24},
> > {"softint", 22},
> > + {"softint_clear", 21},
> > + {"softint_set", 20},
> > {"set_softint", 20},
> > {"pic", 17},
> > {"pcr", 16},
Does this work?
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++;
}
So IMHO if parsing %softint_clear, strncmp will return 0 already on the
{"softint", 22}
entry and so both %softint_clear and %softint_set will IMHO both be parsed
as asr22. I'd say the "softint_clear" and "softint_set" entries should
preceede "softint" entry. See also "stick_cmpr" coming before "stick"
and "sys_tick_cmpr" before "sys_tick".
Other than that the patch looks fine.
Jakub