2c2fa1
commit 4fff86c517abb5ba454befe0ec0f284f720dde00
2c2fa1
Author: Peter Bergner <bergner@vnet.ibm.com>
2c2fa1
Date:   Mon Apr 27 11:06:54 2015 -0500
2c2fa1
2c2fa1
    opcodes/
2c2fa1
    
2c2fa1
            * ppc-opc.c (DCBT_EO): New define.
2c2fa1
            (powerpc_opcodes) <lbarx>: Enable for POWER8 and later.
2c2fa1
            <lharx>: Likewise.
2c2fa1
            <stbcx.>: Likewise.
2c2fa1
            <sthcx.>: Likewise.
2c2fa1
            <waitrsv>: Do not enable for POWER7 and later.
2c2fa1
            <waitimpl>: Likewise.
2c2fa1
            <dcbt>: Default to the two operand form of the instruction for all
2c2fa1
            "old" cpus.  For "new" cpus, use the operand ordering that matches
2c2fa1
            whether the cpu is server or embedded.
2c2fa1
            <dcbtst>: Likewise.
2c2fa1
    
2c2fa1
    gas/testsuite/
2c2fa1
    
2c2fa1
            * gas/ppc/a2.s: Fixup test case due to dcbt/dcbtst embedded operand
2c2fa1
            ordering change.
2c2fa1
            * gas/ppc/a2.d: Likewise.
2c2fa1
            * gas/ppc/476.d: Likewise.
2c2fa1
            * gas/ppc/booke.s: Remove invalid 3 operand dcbt tests.
2c2fa1
            * gas/ppc/booke.d: Likewise.
2c2fa1
            * gas/ppc/power7.s: Remove lbarx, lharx, stbcx., sthcx., waitrsv
2c2fa1
            and waitimpl tests.
2c2fa1
            * gas/ppc/power7.d: Likewise.
2c2fa1
2c2fa1
### a/opcodes/ChangeLog
2c2fa1
### b/opcodes/ChangeLog
2c2fa1
## -1,3 +1,17 @@
2c2fa1
+2015-04-27  Peter Bergner  <bergner@vnet.ibm.com>
2c2fa1
+
2c2fa1
+	* ppc-opc.c (DCBT_EO): New define.
2c2fa1
+	(powerpc_opcodes) <lbarx>: Enable for POWER8 and later.
2c2fa1
+	<lharx>: Likewise.
2c2fa1
+	<stbcx.>: Likewise.
2c2fa1
+	<sthcx.>: Likewise.
2c2fa1
+	<waitrsv>: Do not enable for POWER7 and later.
2c2fa1
+	<waitimpl>: Likewise.
2c2fa1
+	<dcbt>: Default to the two operand form of the instruction for all
2c2fa1
+	"old" cpus.  For "new" cpus, use the operand ordering that matches
2c2fa1
+	whether the cpu is server or embedded.
2c2fa1
+	<dcbtst>: Likewise.
2c2fa1
+
2c2fa1
 2015-04-27  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>
2c2fa1
 
2c2fa1
 	* s390-opc.c: New instruction type VV0UU2.
2c2fa1
--- a/opcodes/ppc-opc.c
2c2fa1
+++ b/opcodes/ppc-opc.c
2c2fa1
@@ -2756,6 +2756,12 @@ extract_vleil (unsigned long insn,
2c2fa1
 #define E6500	PPC_OPCODE_E6500
2c2fa1
 #define PPCVLE  PPC_OPCODE_VLE
2c2fa1
 #define PPCHTM  PPC_OPCODE_HTM
2c2fa1
+/* The list of embedded processors that use the embedded operand ordering
2c2fa1
+   for the 3 operand dcbt and dcbtst instructions.  */
2c2fa1
+#define DCBT_EO	(PPC_OPCODE_E500 | PPC_OPCODE_E500MC | PPC_OPCODE_476 \
2c2fa1
+		 | PPC_OPCODE_A2 | PPC_OPCODE_VLE)
2c2fa1
+
2c2fa1
+
2c2fa1
 
2c2fa1
 /* The opcode table.
2c2fa1
 
2c2fa1
@@ -4463,7 +4469,7 @@ const struct powerpc_opcode powerpc_opcodes[] = {
2c2fa1
 {"mfvrd",	X(31,51)|1,	XX1RB_MASK|1, PPCVSX2,	PPCNONE,	{RA, VS}},
2c2fa1
 {"eratilx",	X(31,51),	X_MASK,	     PPCA2,	PPCNONE,	{ERAT_T, RA, RB}},
2c2fa1
 
2c2fa1
-{"lbarx",	X(31,52),	XEH_MASK,    POWER7|PPCVLE, PPCNONE,	{RT, RA0, RB, EH}},
2c2fa1
+{"lbarx",	X(31,52),	XEH_MASK,    POWER8|PPCVLE, PPCNONE,	{RT, RA0, RB, EH}},
2c2fa1
 
2c2fa1
 {"ldux",	X(31,53),	X_MASK,      PPC64|PPCVLE, PPCNONE,	{RT, RAL, RB}},
2c2fa1
  
2c2fa1
@@ -4478,8 +4484,8 @@ const struct powerpc_opcode powerpc_opcodes[] = {
2c2fa1
 {"andc",	XRC(31,60,0),	X_MASK,	     COM|PPCVLE, PPCNONE,	{RA, RS, RB}},
2c2fa1
 {"andc.",	XRC(31,60,1),	X_MASK,	     COM|PPCVLE, PPCNONE,	{RA, RS, RB}},
2c2fa1
 
2c2fa1
-{"waitrsv",	X(31,62)|(1<<21), 0xffffffff, POWER7|E500MC|PPCA2, PPCNONE, {0}},
2c2fa1
-{"waitimpl",	X(31,62)|(2<<21), 0xffffffff, POWER7|E500MC|PPCA2, PPCNONE, {0}},
2c2fa1
+{"waitrsv",	X(31,62)|(1<<21), 0xffffffff, E500MC|PPCA2, PPCNONE,	{0}},
2c2fa1
+{"waitimpl",	X(31,62)|(2<<21), 0xffffffff, E500MC|PPCA2, PPCNONE,	{0}},
2c2fa1
 {"wait",	X(31,62),	XWC_MASK,    POWER7|E500MC|PPCA2|PPCVLE, PPCNONE, {WC}},
2c2fa1
  
2c2fa1
 {"dcbstep",	XRT(31,63,0),	XRT_MASK,    E500MC|PPCA2|PPCVLE, PPCNONE, {RA0, RB}},
2c2fa1
@@ -4543,7 +4549,7 @@ const struct powerpc_opcode powerpc_opcodes[] = {
2c2fa1
 {"mfvrwz",	X(31,115)|1,	XX1RB_MASK|1, PPCVSX2,	PPCNONE,	{RA, VS}},
2c2fa1
 {"mfvsrwz",	X(31,115),	XX1RB_MASK,   PPCVSX2,	PPCNONE,	{RA, XS6}},
2c2fa1
 
2c2fa1
-{"lharx",	X(31,116),	XEH_MASK,    POWER7|PPCVLE, PPCNONE,	{RT, RA0, RB, EH}},
2c2fa1
+{"lharx",	X(31,116),	XEH_MASK,    POWER8|PPCVLE, PPCNONE,	{RT, RA0, RB, EH}},
2c2fa1
 
2c2fa1
 {"clf",		X(31,118),	XTO_MASK,    POWER,	PPCNONE,	{RA, RB}},
2c2fa1
 
2c2fa1
@@ -4711,9 +4717,10 @@ const struct powerpc_opcode powerpc_opcodes[] = {
2c2fa1
 {"mtvsrwz",	X(31,243),	XX1RB_MASK,   PPCVSX2,	PPCNONE,	{XT6, RA}},
2c2fa1
 
2c2fa1
 {"dcbtstt",	XRT(31,246,0x10), XRT_MASK,  POWER7,	PPCNONE,	{RA0, RB}},
2c2fa1
-{"dcbtst",	X(31,246),	X_MASK,      POWER4,	PPCNONE,	{RA0, RB, CT}},
2c2fa1
-{"dcbtst",	X(31,246),	X_MASK,      PPC|PPCVLE, POWER4,	{CT, RA0, RB}},
2c2fa1
- 
2c2fa1
+{"dcbtst",	X(31,246),	X_MASK,      POWER4,	DCBT_EO,	{RA0, RB, CT}},
2c2fa1
+{"dcbtst",	X(31,246),	X_MASK,      DCBT_EO,	PPCNONE,	{CT, RA0, RB}},
2c2fa1
+{"dcbtst",	X(31,246),	X_MASK,      PPC,	POWER4|DCBT_EO,	{RA0, RB}},
2c2fa1
+
2c2fa1
 {"stbux",	X(31,247),	X_MASK,	     COM|PPCVLE, PPCNONE,	{RS, RAS, RB}},
2c2fa1
 
2c2fa1
 {"slliq",	XRC(31,248,0),	X_MASK,      M601,	PPCNONE,	{RA, RS, SH}},
2c2fa1
@@ -4753,9 +4760,10 @@ const struct powerpc_opcode powerpc_opcodes[] = {
2c2fa1
 {"lscbx.",	XRC(31,277,1),	X_MASK,      M601,	PPCNONE,	{RT, RA, RB}},
2c2fa1
 
2c2fa1
 {"dcbtt",	XRT(31,278,0x10), XRT_MASK,  POWER7,	PPCNONE,	{RA0, RB}},
2c2fa1
-{"dcbt",	X(31,278),	X_MASK,      POWER4,	PPCNONE,	{RA0, RB, CT}},
2c2fa1
-{"dcbt",	X(31,278),	X_MASK,      PPC|PPCVLE, POWER4,	{CT, RA0, RB}},
2c2fa1
- 
2c2fa1
+{"dcbt",	X(31,278),	X_MASK,      POWER4,	DCBT_EO,	{RA0, RB, CT}},
2c2fa1
+{"dcbt",	X(31,278),	X_MASK,      DCBT_EO,	PPCNONE,	{CT, RA0, RB}},
2c2fa1
+{"dcbt",	X(31,278),	X_MASK,      PPC,	POWER4|DCBT_EO,	{RA0, RB}},
2c2fa1
+
2c2fa1
 {"lhzx",	X(31,279),	X_MASK,      COM|PPCVLE, PPCNONE,	{RT, RA0, RB}},
2c2fa1
 
2c2fa1
 {"cdtbcd",	X(31,282),	XRB_MASK,    POWER6,	PPCNONE,	{RA, RS}},
2c2fa1
@@ -5531,7 +5539,7 @@ const struct powerpc_opcode powerpc_opcodes[] = {
2c2fa1
 {"tendall.",	XRC(31,686,1)|(1<<25), XRTRARB_MASK, PPCHTM, PPCNONE,	{0}},
2c2fa1
 {"tend.",	XRC(31,686,1), XRTARARB_MASK, PPCHTM,	PPCNONE,	{HTM_A}},
2c2fa1
 
2c2fa1
-{"stbcx.",	XRC(31,694,1),	X_MASK,      POWER7,	PPCNONE,	{RS, RA0, RB}},
2c2fa1
+{"stbcx.",	XRC(31,694,1),	X_MASK,      POWER8,	PPCNONE,	{RS, RA0, RB}},
2c2fa1
 
2c2fa1
 {"stfsux",	X(31,695),	X_MASK,      COM,	PPCEFS,		{FRS, RAS, RB}},
2c2fa1
 
2c2fa1
@@ -5561,7 +5569,7 @@ const struct powerpc_opcode powerpc_opcodes[] = {
2c2fa1
 {"stswi",	X(31,725),	X_MASK, PPCCOM|PPCVLE,	E500|E500MC,	{RS, RA0, NB}},
2c2fa1
 {"stsi",	X(31,725),	X_MASK,      PWRCOM,	PPCNONE,	{RS, RA0, NB}},
2c2fa1
 
2c2fa1
-{"sthcx.",	XRC(31,726,1),	X_MASK,      POWER7,	PPCNONE,	{RS, RA0, RB}},
2c2fa1
+{"sthcx.",	XRC(31,726,1),	X_MASK,      POWER8,	PPCNONE,	{RS, RA0, RB}},
2c2fa1
 
2c2fa1
 {"stfdx",	X(31,727),	X_MASK,      COM,	PPCEFS,		{FRS, RA0, RB}},
2c2fa1