[PATCH] Handle mtsprg and mfsprg properly for BookE
Kumar Gala
kumar.gala@freescale.com
Wed Mar 9 22:30:00 GMT 2005
On Mar 8, 2005, at 8:11 PM, Alan Modra wrote:
> On Tue, Mar 08, 2005 at 08:20:21PM -0500, Jeff Baker wrote:
> > Would it be correct to change the generic PPC_OPCODE_BOOKE case to
> > always use user mode sprg2+ and then override it to be sprg3+ for
> > PPC_OPCODE_403 and PPC_OPCODE_440? Should there be a version of
> mtsprg3
> > for e500 and MPC8560 that encodes 259 instead of 275?
>
> That's what _you_ need to research. If you can decide on the correct
> mapping of sprg number to spr number for a given processor, and defend
> your mapping against potential criticism, I'm more than happy to help
> correct an implementation.
>
> Hmm, looking over your patch again, I suppose you could simply say that
> your mapping of sprg number to spr number matches the existing gas
> opcodes. ie. "mfsprg 0,4" generates the same as "mfsprg4 0" and so
> on.
> Enumerate all the possibilities in an addition to the testsuite, and
> you've made that obvious. If you fix the formatting, correct the
> error
> messages, and extend the testsuite this way I'll accept the patch.
> I'll
> also still be worried that gas isn't generating the right opcodes, but
> I suppose that's another issue..
I'm confused what the correctness concern is. The only subject that is
up in the air is if SPRG3 (SPR #259) should allow read access on some
book-e implementations. It would seem allowing this is more broad and
leaves the decision up to the user.
- kumar
More information about the Binutils
mailing list