This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: [PATCH] Handle mtsprg and mfsprg properly for BookE
- From: Jeff Baker <jbaker at qnx dot com>
- To: Alan Modra <amodra at bigpond dot net dot au>
- Cc: binutils at sources dot redhat dot com, Alex Rosenberg <alexr at leftfield dot org>, Kumar Gala <kumar dot gala at freescale dot com>
- Date: Wed, 16 Mar 2005 10:29:20 -0500
- Subject: Re: [PATCH] Handle mtsprg and mfsprg properly for BookE
- Organization: QNX Software Systems Ltd.
- References: <20050314041420.GJ13506@bubble.modra.org>
- Reply-to: jbaker at qnx dot com
The IBM PPC440 doesn't support reading from the supervisory SPR's (you
get garbage values back) - the mfsprg's won't be too useful. E.g.:
running the following code (MSR.PR=0) (PVR=0x41020481):
li %r7,-1
li %r8,-1
li %r6,1
mtspr 276,%r6
mfspr %r7,260
mfspr %r8,276
leaves R7 with a 1 and R8 with a 0.
This is correct behaviour according to IBM.
Alan Modra wrote:
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