[PATCH] Handle mtsprg and mfsprg properly for BookE

Alan Modra amodra@bigpond.net.au
Mon Mar 14 04:14:00 GMT 2005


On Sun, Mar 13, 2005 at 03:34:33PM -0800, Alex Rosenberg wrote:
> On Mar 9, 2005, at 7:58 PM, Alan Modra wrote:
> >There remains the question of which spr number should be used by
> >privileged programs for read access to sprg4 through sprg7.  Does the
> >non-privileged spr number work when privileged?  I would think it
> >probably does, but I'm just guessing..
>
> I think the documentation is the problem here.
>
> Originally, the user mode read-only SPRG were supposed to be referred
> to as USPRG.

Makes sense.  Consistent with the spr numbering for USPRG0 too.

I propose that gas adopt this syntax.  ie.

mtsprg and mtsprg[0-7] writes spr272..279 (as we currently do)
mfsprg and mfsprg[0-7] read the same regs as mtsprg
mfusprg0 reads spr256 (as we currently do)
Add new mfusprg[3-7] insns which read spr259..263
Add a new mfusprg insn which reads spr256..263

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre



More information about the Binutils mailing list