[PATCH] Handle mtsprg and mfsprg properly for BookE

Alan Modra amodra@bigpond.net.au
Wed Mar 9 02:11:00 GMT 2005


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..

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre



More information about the Binutils mailing list