This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[PATCH] Fix mfcr for POWER targets other than POWER4
- From: Troy Rollo <binutils at troy dot rollo dot name>
- To: binutils at sources dot redhat dot com
- Date: Fri, 3 Nov 2006 18:27:02 +1100
- Subject: [PATCH] Fix mfcr for POWER targets other than POWER4
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.
You can see some of the problems this has caused by googling for "Unrecognized
opcode mfcr".
The attached patch fixes this.
--- opcodes/ppc-opc.c.old Fri Nov 3 18:20:46 2006
+++ opcodes/ppc-opc.c Fri Nov 3 18:21:59 2006
@@ -1836,6 +1836,7 @@
#define PPCPWR2 PPC_OPCODE_PPC | PPC_OPCODE_POWER | PPC_OPCODE_POWER2
#define POWER32 PPC_OPCODE_POWER | PPC_OPCODE_32
#define COM PPC_OPCODE_POWER | PPC_OPCODE_PPC | PPC_OPCODE_COMMON
+#define COMNPW4 PPC_OPCODE_NOPOWER4 | COM
#define COM32 PPC_OPCODE_POWER | PPC_OPCODE_PPC | PPC_OPCODE_COMMON | PPC_OPCODE_32
#define M601 PPC_OPCODE_POWER | PPC_OPCODE_601
#define PWRCOM PPC_OPCODE_POWER | PPC_OPCODE_601 | PPC_OPCODE_COMMON
@@ -3321,7 +3322,7 @@
{ "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, COMNPW4, { RT } },
{ "mfcr", X(31,19), XFXFXM_MASK, POWER4, { RT, FXM4 } },
{ "lwarx", X(31,20), X_MASK, PPC, { RT, RA0, RB } },