This is the mail archive of the mailing list for the binutils project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH, PPC] Revert VLE merge bug

Hi Jim,

Last September, Jan added some extra ppc gas checks to catch some invalid
operand combinations:

That included these two hunks:

-{"lswx",	X(31,533),	X_MASK,      PPCCOM,	E500|E500MC,	{RT, RA0, RB}},
+{"lswx",	X(31,533),	X_MASK,      PPCCOM,	E500|E500MC,	{RT, RAX, RBX}},


-{"lswi",	X(31,597),	X_MASK,      PPCCOM,	E500|E500MC,	{RT, RA0, NB}},
+{"lswi",	X(31,597),	X_MASK,      PPCCOM,	E500|E500MC,	{RT, RA0, NBI}},

With your VLE commit, you backed out the two hunks above when you added PPCVLE
to those two instructions.  My guess is that this was a merge bug when you
updated your patch to upstream sources and you did not really mean backout
Jan's changes.  I'm going to commit the following patch as obvious to re-enable
Jan's operand checks, but will give you a day or to respond just in case you
really meant to change them.

I'll note that I added a use of RAX to lswi's second operand, whereas before
is was RA0, but the RT and RA operands cannot be the same register, otherwise
the instruction is invalid.  This was caught by Jan's changes, but via the
NBI check.  This just checks for the problem sooner.


	* ppc-opc.c (powerpc_opcodes) <"lswx">: Use RAX for the second and
	RBX for the third operand.
	<"lswi">: Use RAX for second and NBI for the third operand.

Index: opcodes/ppc-opc.c
RCS file: /cvs/src/src/opcodes/ppc-opc.c,v
retrieving revision 1.149
diff -u -p -r1.149 ppc-opc.c
--- opcodes/ppc-opc.c	15 Aug 2012 21:25:21 -0000	1.149
+++ opcodes/ppc-opc.c	16 Aug 2012 15:50:23 -0000
@@ -5205,7 +5205,7 @@ const struct powerpc_opcode powerpc_opco
 {"ldbrx",	X(31,532),	X_MASK, CELL|POWER7|PPCA2, PPCNONE,	{RT, RA0, RB}},
-{"lswx",	X(31,533),	X_MASK,  PPCCOM|PPCVLE, E500|E500MC,	{RT, RA0, RB}},
+{"lswx",	X(31,533),	X_MASK,  PPCCOM|PPCVLE, E500|E500MC,	{RT, RAX, RBX}},
 {"lsx",		X(31,533),	X_MASK,      PWRCOM,	PPCNONE,	{RT, RA, RB}},
 {"lwbrx",	X(31,534),	X_MASK,  PPCCOM|PPCVLE, PPCNONE,	{RT, RA0, RB}},
@@ -5255,7 +5255,7 @@ const struct powerpc_opcode powerpc_opco
 {"mfsr",	X(31,595), XRB_MASK|(1<<20), COM,	NON32,  	{RT, SR}},
-{"lswi",	X(31,597),	X_MASK,  PPCCOM|PPCVLE, E500|E500MC,	{RT, RA0, NB}},
+{"lswi",	X(31,597),	X_MASK,  PPCCOM|PPCVLE, E500|E500MC,	{RT, RAX, NBI}},
 {"lsi",		X(31,597),	X_MASK,      PWRCOM,	PPCNONE,	{RT, RA0, NB}},
 {"lwsync",	XSYNC(31,598,1), 0xffffffff, PPC,	E500,		{0}},

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]