[PATCH] Fix mfcr for POWER targets other than POWER4
Alan Modra
amodra@bigpond.net.au
Mon Nov 6 00:45:00 GMT 2006
On Mon, Nov 06, 2006 at 10:52:48AM +1100, Troy Rollo wrote:
> On Monday 06 November 2006 10:10, Alan Modra wrote:
> > On Fri, Nov 03, 2006 at 06:27:02PM +1100, Troy Rollo wrote:
> > > The patch at
> > > <http://sources.redhat.com/ml/binutils/2003-07/msg00094.html> introduced
> > > an alternative (faster) mfcr instruction for POWER4 targets, however the
> > > flags were changed on the old instruction so that it was no longer
> > > available when targeting POWER architectures other than POWER4.
> >
> > Eh? The old single operand is still available. What makes you think
> > otherwise? Please write a little testcase and "as" invocation to show
> > what you mean.
>
> If you just run "as -mpwr" on a file with that instruction in it you'll get
> the error.
Hmm. I see, and yes, your patch looks a lot more reasonable now that
I've looked at exactly how ppc_cpu flags are being set for -mpwr and
at what changed in the 2003 patch.. Thanks! Applying the following.
2006-11-06 Troy Rollo <troy@corvu.com.au>
* ppc-opc.c: Restore COM to mfcr wrongly removed 2003-07-04.
Index: opcodes/ppc-opc.c
===================================================================
RCS file: /cvs/src/src/opcodes/ppc-opc.c,v
retrieving revision 1.87
diff -u -p -r1.87 ppc-opc.c
--- opcodes/ppc-opc.c 26 Oct 2006 17:37:26 -0000 1.87
+++ opcodes/ppc-opc.c 6 Nov 2006 00:43:25 -0000
@@ -3383,7 +3383,7 @@ const struct powerpc_opcode powerpc_opco
{ "isel", XISEL(31,15), XISEL_MASK, PPCISEL, { RT, RA, RB, CRB } },
{ "mfocrf", XFXM(31,19,0,1), XFXFXM_MASK, COM, { RT, FXM } },
-{ "mfcr", X(31,19), XRARB_MASK, NOPOWER4, { RT } },
+{ "mfcr", X(31,19), XRARB_MASK, NOPOWER4 | COM, { RT } },
{ "mfcr", X(31,19), XFXFXM_MASK, POWER4, { RT, FXM4 } },
{ "lwarx", X(31,20), XEH_MASK, PPC, { RT, RA0, RB, EH } },
--
Alan Modra
IBM OzLabs - Linux Technology Centre
More information about the Binutils
mailing list