Re: [rfc] Use target descriptions for PowerPC

Daniel Jacobowitz
2007-10-06T18:00:46Z

On Sat, Oct 06, 2007 at 01:01:24PM -0300, Thiago Jung Bauermann wrote:
> A few more comments, in the hope they can be useful.

Thanks.

> I see that the comments above about variants have been removed. Some of
> them mention different processor models which also fit the register
> description, and others describe choices made and restrictions with the
> register descriptions. Is it worthwhile to transport these to the XML
> files?

In my opinion, not particularly. The comments mostly describe things
which are no longer true. I just went through them again and added a
couple back.

> I'd suggest adding a description about what the FIXME above refers to.

Not a thing. It should be removed. I had an #if 0 below there at one
point, which is what needed to be fixed. Whoops!

> > - /* FIXME: pgilliam/2005-10-21: Assume all PowerPC 64-bit linux systems
> > - have altivec registers. If not, ptrace will fail the first time it's
> > - called to access one and will not be called again. This wart will
> > - be removed when Daniel Jacobowitz's proposal for autodetecting target
> > - registers is implemented. */
>
> The FIXME is being removed above. Was this issue fixed already? It seems
> it's not, so maybe the FIXME could be moved to somewhere else, like
> ppc-linux-nat.c where I believe the behaviour comes from?

This patch fixes the problem. Actually, it's a little more
complicated than that since the comment doesn't really describe the
state of affairs. Take a look at how 32-bit PowerPC is handled;
before my patch, I mean, not after. AltiVec registers are always
included. It doesn't hurt, as long as the underlying target
behaves gracefully: either fetching them or quietly not doing
so. I made the 64-bit handling uniform with that.

Ideally a target which doesn't supply the extra registers should
report a description which doesn't include them. Any time someone
wants to do that, it'd be easy to add the new description required.

> BTW, both powerpc-32.xml and powerpc-64.xml include the altivec feature,
> so you are assuming that ppc32 has altivec registers as well, right?

No, I'm just preserving the messy status quo where we assume them
present if we don't know.