Blame SOURCES/binutils-2.28-ppc-extra-insns.patch

0b07f1
diff -rupN binutils.orig/gas/testsuite/gas/ppc/power9.d binutils-2.28/gas/testsuite/gas/ppc/power9.d
0b07f1
--- binutils.orig/gas/testsuite/gas/ppc/power9.d	2017-06-26 15:56:01.251233778 +0100
0b07f1
+++ binutils-2.28/gas/testsuite/gas/ppc/power9.d	2017-06-26 16:08:04.575813938 +0100
0b07f1
@@ -312,8 +312,8 @@ Disassembly of section \.text:
0b07f1
 .*:	(f1 31 9d 6f|6f 9d 31 f1) 	xscvdphp vs41,vs51
0b07f1
 .*:	(f1 58 a7 6f|6f a7 58 f1) 	xvcvhpsp vs42,vs52
0b07f1
 .*:	(f1 79 af 6f|6f af 79 f1) 	xvcvsphp vs43,vs53
0b07f1
-.*:	(4c 60 00 04|04 00 60 4c) 	addpcis r3,0
0b07f1
-.*:	(4c 60 00 04|04 00 60 4c) 	addpcis r3,0
0b07f1
+.*:	(4c 60 00 04|04 00 60 4c) 	lnia    r3
0b07f1
+.*:	(4c 60 00 04|04 00 60 4c) 	lnia    r3
0b07f1
 .*:	(4c 80 00 05|05 00 80 4c) 	addpcis r4,1
0b07f1
 .*:	(4c 80 00 05|05 00 80 4c) 	addpcis r4,1
0b07f1
 .*:	(4c bf ff c4|c4 ff bf 4c) 	addpcis r5,-2
0b07f1
diff -rupN binutils.orig/opcodes/ppc-opc.c binutils-2.28/opcodes/ppc-opc.c
0b07f1
--- binutils.orig/opcodes/ppc-opc.c	2017-06-26 15:56:01.505230821 +0100
0b07f1
+++ binutils-2.28/opcodes/ppc-opc.c	2017-06-26 16:02:19.865826399 +0100
0b07f1
@@ -54,6 +54,7 @@ static long extract_bo (unsigned long, p
0b07f1
 static unsigned long insert_boe (unsigned long, long, ppc_cpu_t, const char **);
0b07f1
 static long extract_boe (unsigned long, ppc_cpu_t, int *);
0b07f1
 static unsigned long insert_esync (unsigned long, long, ppc_cpu_t, const char **);
0b07f1
+static long extract_esync (unsigned long, ppc_cpu_t, int *);
0b07f1
 static unsigned long insert_dcmxs (unsigned long, long, ppc_cpu_t, const char **);
0b07f1
 static long extract_dcmxs (unsigned long, ppc_cpu_t, int *);
0b07f1
 static unsigned long insert_dxd (unsigned long, long, ppc_cpu_t, const char **);
0b07f1
@@ -65,6 +66,7 @@ static long extract_fxm (unsigned long,
0b07f1
 static unsigned long insert_li20 (unsigned long, long, ppc_cpu_t, const char **);
0b07f1
 static long extract_li20 (unsigned long, ppc_cpu_t, int *);
0b07f1
 static unsigned long insert_ls (unsigned long, long, ppc_cpu_t, const char **);
0b07f1
+static long extract_ls (unsigned long, ppc_cpu_t, int *);
0b07f1
 static unsigned long insert_mbe (unsigned long, long, ppc_cpu_t, const char **);
0b07f1
 static long extract_mbe (unsigned long, ppc_cpu_t, int *);
0b07f1
 static unsigned long insert_mb6 (unsigned long, long, ppc_cpu_t, const char **);
0b07f1
@@ -76,12 +78,17 @@ static long extract_nsi (unsigned long,
0b07f1
 static unsigned long insert_oimm (unsigned long, long, ppc_cpu_t, const char **);
0b07f1
 static long extract_oimm (unsigned long, ppc_cpu_t, int *);
0b07f1
 static unsigned long insert_ral (unsigned long, long, ppc_cpu_t, const char **);
0b07f1
+static long extract_ral (unsigned long, ppc_cpu_t, int *);
0b07f1
 static unsigned long insert_ram (unsigned long, long, ppc_cpu_t, const char **);
0b07f1
+static long extract_ram (unsigned long, ppc_cpu_t, int *);
0b07f1
 static unsigned long insert_raq (unsigned long, long, ppc_cpu_t, const char **);
0b07f1
+static long extract_raq (unsigned long, ppc_cpu_t, int *);
0b07f1
 static unsigned long insert_ras (unsigned long, long, ppc_cpu_t, const char **);
0b07f1
+static long extract_ras (unsigned long, ppc_cpu_t, int *);
0b07f1
 static unsigned long insert_rbs (unsigned long, long, ppc_cpu_t, const char **);
0b07f1
 static long extract_rbs (unsigned long, ppc_cpu_t, int *);
0b07f1
 static unsigned long insert_rbx (unsigned long, long, ppc_cpu_t, const char **);
0b07f1
+static long extract_rbx (unsigned long, ppc_cpu_t, int *);
0b07f1
 static unsigned long insert_rx (unsigned long, long, ppc_cpu_t, const char **);
0b07f1
 static long extract_rx (unsigned long, ppc_cpu_t, int *);
0b07f1
 static unsigned long insert_ry (unsigned long, long, ppc_cpu_t, const char **);
0b07f1
@@ -462,7 +469,7 @@ const struct powerpc_operand powerpc_ope
0b07f1
   /* The LS or WC field in an X (sync or wait) form instruction.  */
0b07f1
 #define LS LIA + 1
0b07f1
 #define WC LS
0b07f1
-  { 0x3, 21, insert_ls, NULL, PPC_OPERAND_OPTIONAL },
0b07f1
+  { 0x3, 21, insert_ls, extract_ls, PPC_OPERAND_OPTIONAL },
0b07f1
 
0b07f1
   /* The ME field in an M form instruction.  */
0b07f1
 #define ME LS + 1
0b07f1
@@ -519,24 +526,24 @@ const struct powerpc_operand powerpc_ope
0b07f1
      value restrictions.  */
0b07f1
 #define RAQ RA0 + 1
0b07f1
 #define RAX RAQ
0b07f1
-  { 0x1f, 16, insert_raq, NULL, PPC_OPERAND_GPR_0 },
0b07f1
+  { 0x1f, 16, insert_raq, extract_raq, PPC_OPERAND_GPR_0 },
0b07f1
 
0b07f1
   /* The RA field in a D or X form instruction which is an updating
0b07f1
      load, which means that the RA field may not be zero and may not
0b07f1
      equal the RT field.  */
0b07f1
 #define RAL RAQ + 1
0b07f1
-  { 0x1f, 16, insert_ral, NULL, PPC_OPERAND_GPR_0 },
0b07f1
+  { 0x1f, 16, insert_ral, extract_ral, PPC_OPERAND_GPR_0 },
0b07f1
 
0b07f1
   /* The RA field in an lmw instruction, which has special value
0b07f1
      restrictions.  */
0b07f1
 #define RAM RAL + 1
0b07f1
-  { 0x1f, 16, insert_ram, NULL, PPC_OPERAND_GPR_0 },
0b07f1
+  { 0x1f, 16, insert_ram, extract_ram, PPC_OPERAND_GPR_0 },
0b07f1
 
0b07f1
   /* The RA field in a D or X form instruction which is an updating
0b07f1
      store or an updating floating point load, which means that the RA
0b07f1
      field may not be zero.  */
0b07f1
 #define RAS RAM + 1
0b07f1
-  { 0x1f, 16, insert_ras, NULL, PPC_OPERAND_GPR_0 },
0b07f1
+  { 0x1f, 16, insert_ras, extract_ras, PPC_OPERAND_GPR_0 },
0b07f1
 
0b07f1
   /* The RA field of the tlbwe, dccci and iccci instructions,
0b07f1
      which are optional.  */
0b07f1
@@ -557,7 +564,7 @@ const struct powerpc_operand powerpc_ope
0b07f1
   /* The RB field in an lswx instruction, which has special value
0b07f1
      restrictions.  */
0b07f1
 #define RBX RBS + 1
0b07f1
-  { 0x1f, 11, insert_rbx, NULL, PPC_OPERAND_GPR },
0b07f1
+  { 0x1f, 11, insert_rbx, extract_rbx, PPC_OPERAND_GPR },
0b07f1
 
0b07f1
   /* The RB field of the dccci and iccci instructions, which are optional.  */
0b07f1
 #define RBOPT RBX + 1
0b07f1
@@ -580,6 +587,7 @@ const struct powerpc_operand powerpc_ope
0b07f1
      which have special value restrictions.  */
0b07f1
 #define RSQ RS + 1
0b07f1
 #define RTQ RSQ
0b07f1
+#define Q_MASK (1 << 21)
0b07f1
   { 0x1e, 21, NULL, NULL, PPC_OPERAND_GPR },
0b07f1
 
0b07f1
   /* The RS field of the tlbwe instruction, which is optional.  */
0b07f1
@@ -694,7 +702,7 @@ const struct powerpc_operand powerpc_ope
0b07f1
 
0b07f1
   /* The ESYNC field in an X (sync) form instruction.  */
0b07f1
 #define ESYNC STRM + 1
0b07f1
-  { 0xf, 16, insert_esync, NULL, PPC_OPERAND_OPTIONAL },
0b07f1
+  { 0xf, 16, insert_esync, extract_esync, PPC_OPERAND_OPTIONAL },
0b07f1
 
0b07f1
   /* The SV field in a POWER SC form instruction.  */
0b07f1
 #define SV ESYNC + 1
0b07f1
@@ -1533,6 +1541,22 @@ insert_ls (unsigned long insn,
0b07f1
   return insn | ((value & 0x3) << 21);
0b07f1
 }
0b07f1
 
0b07f1
+static long
0b07f1
+extract_ls (unsigned long insn,
0b07f1
+	    ppc_cpu_t dialect,
0b07f1
+	    int *invalid)
0b07f1
+{
0b07f1
+  unsigned long lvalue = (insn >> 21) & 3;
0b07f1
+
0b07f1
+  if (((insn >> 1) & 0x3ff) == 598)
0b07f1
+    {
0b07f1
+      unsigned long max_lvalue = (dialect & PPC_OPCODE_POWER4) ? 2 : 1;
0b07f1
+      if (lvalue > max_lvalue)
0b07f1
+	*invalid = 1;
0b07f1
+    }
0b07f1
+  return lvalue;
0b07f1
+}
0b07f1
+
0b07f1
 /* The 4-bit E field in a sync instruction that accepts 2 operands.
0b07f1
    If ESYNC is non-zero, then the L field must be either 0 or 1 and
0b07f1
    the complement of ESYNC-bit2.  */
0b07f1
@@ -1560,6 +1584,27 @@ insert_esync (unsigned long insn,
0b07f1
   return insn | ((value & 0xf) << 16);
0b07f1
 }
0b07f1
 
0b07f1
+static long
0b07f1
+extract_esync (unsigned long insn,
0b07f1
+	       ppc_cpu_t dialect,
0b07f1
+	       int *invalid)
0b07f1
+{
0b07f1
+  unsigned long ls = (insn >> 21) & 0x3;
0b07f1
+  unsigned long lvalue = (insn >> 16) & 0xf;
0b07f1
+
0b07f1
+  if (lvalue == 0)
0b07f1
+    {
0b07f1
+      if (((dialect & PPC_OPCODE_E6500) != 0 && ls > 1)
0b07f1
+	  || ((dialect & PPC_OPCODE_POWER9) != 0 && ls > 2))
0b07f1
+	*invalid = 1;
0b07f1
+    }
0b07f1
+  else if ((ls & ~0x1)
0b07f1
+	   || (((lvalue >> 1) & 0x1) ^ ls) == 0)
0b07f1
+    *invalid = 1;
0b07f1
+
0b07f1
+  return lvalue;
0b07f1
+}
0b07f1
+
0b07f1
 /* The MB and ME fields in an M form instruction expressed as a single
0b07f1
    operand which is itself a bitmask.  The extraction function always
0b07f1
    marks it as invalid, since we never want to recognize an
0b07f1
@@ -1743,6 +1788,19 @@ insert_ral (unsigned long insn,
0b07f1
   return insn | ((value & 0x1f) << 16);
0b07f1
 }
0b07f1
 
0b07f1
+static long
0b07f1
+extract_ral (unsigned long insn,
0b07f1
+	     ppc_cpu_t dialect ATTRIBUTE_UNUSED,
0b07f1
+	     int *invalid)
0b07f1
+{
0b07f1
+  long rtvalue = (insn >> 21) & 0x1f;
0b07f1
+  long ravalue = (insn >> 16) & 0x1f;
0b07f1
+
0b07f1
+  if (rtvalue == ravalue || ravalue == 0)
0b07f1
+    *invalid = 1;
0b07f1
+  return ravalue;
0b07f1
+}
0b07f1
+
0b07f1
 /* The RA field in an lmw instruction, which has special value
0b07f1
    restrictions.  */
0b07f1
 
0b07f1
@@ -1757,6 +1815,19 @@ insert_ram (unsigned long insn,
0b07f1
   return insn | ((value & 0x1f) << 16);
0b07f1
 }
0b07f1
 
0b07f1
+static long
0b07f1
+extract_ram (unsigned long insn,
0b07f1
+	     ppc_cpu_t dialect ATTRIBUTE_UNUSED,
0b07f1
+	     int *invalid)
0b07f1
+{
0b07f1
+  unsigned long rtvalue = (insn >> 21) & 0x1f;
0b07f1
+  unsigned long ravalue = (insn >> 16) & 0x1f;
0b07f1
+
0b07f1
+  if (ravalue >= rtvalue)
0b07f1
+    *invalid = 1;
0b07f1
+  return ravalue;
0b07f1
+}
0b07f1
+
0b07f1
 /* The RA field in the DQ form lq or an lswx instruction, which have special
0b07f1
    value restrictions.  */
0b07f1
 
0b07f1
@@ -1773,6 +1844,19 @@ insert_raq (unsigned long insn,
0b07f1
   return insn | ((value & 0x1f) << 16);
0b07f1
 }
0b07f1
 
0b07f1
+static long
0b07f1
+extract_raq (unsigned long insn,
0b07f1
+	     ppc_cpu_t dialect ATTRIBUTE_UNUSED,
0b07f1
+	     int *invalid)
0b07f1
+{
0b07f1
+  unsigned long rtvalue = (insn >> 21) & 0x1f;
0b07f1
+  unsigned long ravalue = (insn >> 16) & 0x1f;
0b07f1
+
0b07f1
+  if (ravalue == rtvalue)
0b07f1
+    *invalid = 1;
0b07f1
+  return ravalue;
0b07f1
+}
0b07f1
+
0b07f1
 /* The RA field in a D or X form instruction which is an updating
0b07f1
    store or an updating floating point load, which means that the RA
0b07f1
    field may not be zero.  */
0b07f1
@@ -1788,6 +1872,18 @@ insert_ras (unsigned long insn,
0b07f1
   return insn | ((value & 0x1f) << 16);
0b07f1
 }
0b07f1
 
0b07f1
+static long
0b07f1
+extract_ras (unsigned long insn,
0b07f1
+	     ppc_cpu_t dialect ATTRIBUTE_UNUSED,
0b07f1
+	     int *invalid)
0b07f1
+{
0b07f1
+  unsigned long ravalue = (insn >> 16) & 0x1f;
0b07f1
+
0b07f1
+  if (ravalue == 0)
0b07f1
+    *invalid = 1;
0b07f1
+  return ravalue;
0b07f1
+}
0b07f1
+
0b07f1
 /* The RB field in an X form instruction when it must be the same as
0b07f1
    the RS field in the instruction.  This is used for extended
0b07f1
    mnemonics like mr.  This operand is marked FAKE.  The insertion
0b07f1
@@ -1829,6 +1925,19 @@ insert_rbx (unsigned long insn,
0b07f1
   return insn | ((value & 0x1f) << 11);
0b07f1
 }
0b07f1
 
0b07f1
+static long
0b07f1
+extract_rbx (unsigned long insn,
0b07f1
+	     ppc_cpu_t dialect ATTRIBUTE_UNUSED,
0b07f1
+	     int *invalid)
0b07f1
+{
0b07f1
+  unsigned long rtvalue = (insn >> 21) & 0x1f;
0b07f1
+  unsigned long rbvalue = (insn >> 11) & 0x1f;
0b07f1
+
0b07f1
+  if (rbvalue == rtvalue)
0b07f1
+    *invalid = 1;
0b07f1
+  return rbvalue;
0b07f1
+}
0b07f1
+
0b07f1
 /* The SCI8 field is made up of SCL and {U,N}I8 fields.  */
0b07f1
 static unsigned long
0b07f1
 insert_sci8 (unsigned long insn,
0b07f1
@@ -2443,6 +2552,8 @@ extract_vleil (unsigned long insn,
0b07f1
 /* An DX form instruction.  */
0b07f1
 #define DX(op, xop) (OP (op) | ((((unsigned long)(xop)) & 0x1f) << 1))
0b07f1
 #define DX_MASK DX (0x3f, 0x1f)
0b07f1
+/* An DX form instruction with the D bits specified.  */
0b07f1
+#define NODX_MASK (DX_MASK | 0x1fffc1)
0b07f1
 
0b07f1
 /* An EVSEL form instruction.  */
0b07f1
 #define EVSEL(op, xop) (OP (op) | (((unsigned long)(xop)) & 0xff) << 3)
0b07f1
@@ -4155,6 +4266,7 @@ const struct powerpc_opcode powerpc_opco
0b07f1
 
0b07f1
 {"mcrf",     XL(19,0), XLBB_MASK|(3<<21)|(3<<16), COM,	PPCVLE,		{BF, BFA}},
0b07f1
 
0b07f1
+{"lnia",     DX(19,2),		NODX_MASK,   POWER9,	PPCVLE,		{RT}},
0b07f1
 {"addpcis",  DX(19,2),		DX_MASK,     POWER9,	PPCVLE,		{RT, DXD}},
0b07f1
 {"subpcis",  DX(19,2),		DX_MASK,     POWER9,	PPCVLE,		{RT, NDXD}},
0b07f1
 
0b07f1
@@ -4974,7 +5086,7 @@ const struct powerpc_opcode powerpc_opco
0b07f1
 
0b07f1
 {"stdux",	X(31,181),	X_MASK,	     PPC64,	0,		{RS, RAS, RB}},
0b07f1
 
0b07f1
-{"stqcx.",	XRC(31,182,1),	X_MASK,	     POWER8,	0,		{RSQ, RA0, RB}},
0b07f1
+{"stqcx.",	XRC(31,182,1), X_MASK|Q_MASK, POWER8,	0,		{RSQ, RA0, RB}},
0b07f1
 {"wchkall",	X(31,182),	X_MASK,	     PPCA2,	0,		{OBF}},
0b07f1
 
0b07f1
 {"stwux",	X(31,183),	X_MASK,	     PPCCOM,	0,		{RS, RAS, RB}},
0b07f1
@@ -5105,7 +5217,7 @@ const struct powerpc_opcode powerpc_opco
0b07f1
 
0b07f1
 {"mfapidi",	X(31,275),	X_MASK,	     BOOKE,	E500|TITAN,	{RT, RA}},
0b07f1
 
0b07f1
-{"lqarx",	X(31,276),	XEH_MASK,    POWER8,	0,		{RTQ, RAX, RBX, EH}},
0b07f1
+{"lqarx",	X(31,276),  XEH_MASK|Q_MASK, POWER8,	0,		{RTQ, RAX, RBX, EH}},
0b07f1
 
0b07f1
 {"lscbx",	XRC(31,277,0),	X_MASK,	     M601,	0,		{RT, RA, RB}},
0b07f1
 {"lscbx.",	XRC(31,277,1),	X_MASK,	     M601,	0,		{RT, RA, RB}},
0b07f1
@@ -6052,7 +6164,7 @@ const struct powerpc_opcode powerpc_opco
0b07f1
 
0b07f1
 {"lhbrx",	X(31,790),	X_MASK,	     COM,	0,		{RT, RA0, RB}},
0b07f1
 
0b07f1
-{"lfdpx",	X(31,791),	X_MASK,	     POWER6,	POWER7,		{FRTp, RA0, RB}},
0b07f1
+{"lfdpx",	X(31,791),    X_MASK|Q_MASK, POWER6,	POWER7,		{FRTp, RA0, RB}},
0b07f1
 {"lfqx",	X(31,791),	X_MASK,	     POWER2,	0,		{FRT, RA, RB}},
0b07f1
 
0b07f1
 {"sraw",	XRC(31,792,0),	X_MASK,	     PPCCOM,	0,		{RA, RS, RB}},
0b07f1
@@ -6167,7 +6279,7 @@ const struct powerpc_opcode powerpc_opco
0b07f1
 
0b07f1
 {"sthbrx",	X(31,918),	X_MASK,	     COM,	0,		{RS, RA0, RB}},
0b07f1
 
0b07f1
-{"stfdpx",	X(31,919),	X_MASK,	     POWER6,	POWER7,		{FRSp, RA0, RB}},
0b07f1
+{"stfdpx",	X(31,919),    X_MASK|Q_MASK, POWER6,	POWER7,		{FRSp, RA0, RB}},
0b07f1
 {"stfqx",	X(31,919),	X_MASK,	     POWER2,	0,		{FRS, RA0, RB}},
0b07f1
 
0b07f1
 {"sraq",	XRC(31,920,0),	X_MASK,	     M601,	0,		{RA, RS, RB}},
0b07f1
@@ -6345,13 +6457,13 @@ const struct powerpc_opcode powerpc_opco
0b07f1
 
0b07f1
 {"stfdu",	OP(55),		OP_MASK,     COM,	PPCEFS|PPCVLE,	{FRS, D, RAS}},
0b07f1
 
0b07f1
-{"lq",		OP(56),		OP_MASK,     POWER4,	PPC476|PPCVLE,	{RTQ, DQ, RAQ}},
0b07f1
+{"lq",		OP(56),	     OP_MASK|Q_MASK, POWER4,	PPC476|PPCVLE,	{RTQ, DQ, RAQ}},
0b07f1
 {"psq_l",	OP(56),		OP_MASK,     PPCPS,	PPCVLE,		{FRT,PSD,RA,PSW,PSQ}},
0b07f1
 {"lfq",		OP(56),		OP_MASK,     POWER2,	PPCVLE,		{FRT, D, RA0}},
0b07f1
 
0b07f1
 {"lxsd",	DSO(57,2),	DS_MASK,     PPCVSX3,	PPCVLE,		{VD, DS, RA0}},
0b07f1
 {"lxssp",	DSO(57,3),	DS_MASK,     PPCVSX3,	PPCVLE,		{VD, DS, RA0}},
0b07f1
-{"lfdp",	OP(57),		OP_MASK,     POWER6,	POWER7|PPCVLE,	{FRTp, DS, RA0}},
0b07f1
+{"lfdp",	OP(57),	     OP_MASK|Q_MASK, POWER6,	POWER7|PPCVLE,	{FRTp, DS, RA0}},
0b07f1
 {"psq_lu",	OP(57),		OP_MASK,     PPCPS,	PPCVLE,		{FRT,PSD,RA,PSW,PSQ}},
0b07f1
 {"lfqu",	OP(57),		OP_MASK,     POWER2,	PPCVLE,		{FRT, D, RA0}},
0b07f1
 
0b07f1
@@ -6676,21 +6788,21 @@ const struct powerpc_opcode powerpc_opco
0b07f1
 {"stxv",	DQX(61,5),	DQX_MASK,    PPCVSX3,	PPCVLE,		{XSQ6, DQ, RA0}},
0b07f1
 {"stxsd",	DSO(61,2),	DS_MASK,     PPCVSX3,	PPCVLE,		{VS, DS, RA0}},
0b07f1
 {"stxssp",	DSO(61,3),	DS_MASK,     PPCVSX3,	PPCVLE,		{VS, DS, RA0}},
0b07f1
-{"stfdp",	OP(61),		OP_MASK,     POWER6,	POWER7|PPCVLE,	{FRSp, DS, RA0}},
0b07f1
+{"stfdp",	OP(61),	     OP_MASK|Q_MASK, POWER6,	POWER7|PPCVLE,	{FRSp, DS, RA0}},
0b07f1
 {"psq_stu",	OP(61),		OP_MASK,     PPCPS,	PPCVLE,		{FRS,PSD,RA,PSW,PSQ}},
0b07f1
 {"stfqu",	OP(61),		OP_MASK,     POWER2,	PPCVLE,		{FRS, D, RA}},
0b07f1
 
0b07f1
 {"std",		DSO(62,0),	DS_MASK,     PPC64,	PPCVLE,		{RS, DS, RA0}},
0b07f1
 {"stdu",	DSO(62,1),	DS_MASK,     PPC64,	PPCVLE,		{RS, DS, RAS}},
0b07f1
-{"stq",		DSO(62,2),	DS_MASK,     POWER4,	PPC476|PPCVLE,	{RSQ, DS, RA0}},
0b07f1
+{"stq",		DSO(62,2),   DS_MASK|Q_MASK, POWER4,	PPC476|PPCVLE,	{RSQ, DS, RA0}},
0b07f1
 
0b07f1
 {"fcmpu",	X(63,0),	XBF_MASK,    COM,	PPCEFS|PPCVLE,	{BF, FRA, FRB}},
0b07f1
 
0b07f1
-{"daddq",	XRC(63,2,0),	X_MASK,	     POWER6,	PPCVLE,		{FRTp, FRAp, FRBp}},
0b07f1
-{"daddq.",	XRC(63,2,1),	X_MASK,	     POWER6,	PPCVLE,		{FRTp, FRAp, FRBp}},
0b07f1
+{"daddq",	XRC(63,2,0),  X_MASK|Q_MASK, POWER6,	PPCVLE,		{FRTp, FRAp, FRBp}},
0b07f1
+{"daddq.",	XRC(63,2,1),  X_MASK|Q_MASK, POWER6,	PPCVLE,		{FRTp, FRAp, FRBp}},
0b07f1
 
0b07f1
-{"dquaq",	ZRC(63,3,0),	Z2_MASK,     POWER6,	PPCVLE,		{FRTp, FRAp, FRBp, RMC}},
0b07f1
-{"dquaq.",	ZRC(63,3,1),	Z2_MASK,     POWER6,	PPCVLE,		{FRTp, FRAp, FRBp, RMC}},
0b07f1
+{"dquaq",	ZRC(63,3,0), Z2_MASK|Q_MASK, POWER6,	PPCVLE,		{FRTp, FRAp, FRBp, RMC}},
0b07f1
+{"dquaq.",	ZRC(63,3,1), Z2_MASK|Q_MASK, POWER6,	PPCVLE,		{FRTp, FRAp, FRBp, RMC}},
0b07f1
 
0b07f1
 {"xsaddqp",	XRC(63,4,0),	X_MASK,	     PPCVSX3,	PPCVLE,		{VD, VA, VB}},
0b07f1
 {"xsaddqpo",	XRC(63,4,1),	X_MASK,	     PPCVSX3,	PPCVLE,		{VD, VA, VB}},
0b07f1
@@ -6772,11 +6884,11 @@ const struct powerpc_opcode powerpc_opco
0b07f1
 
0b07f1
 {"fcmpo",	X(63,32),	XBF_MASK,    COM,	PPCEFS|PPCVLE,	{BF, FRA, FRB}},
0b07f1
 
0b07f1
-{"dmulq",	XRC(63,34,0),	X_MASK,	     POWER6,	PPCVLE,		{FRTp, FRAp, FRBp}},
0b07f1
-{"dmulq.",	XRC(63,34,1),	X_MASK,	     POWER6,	PPCVLE,		{FRTp, FRAp, FRBp}},
0b07f1
+{"dmulq",	XRC(63,34,0), X_MASK|Q_MASK, POWER6,	PPCVLE,		{FRTp, FRAp, FRBp}},
0b07f1
+{"dmulq.",	XRC(63,34,1), X_MASK|Q_MASK, POWER6,	PPCVLE,		{FRTp, FRAp, FRBp}},
0b07f1
 
0b07f1
-{"drrndq",	ZRC(63,35,0),	Z2_MASK,     POWER6,	PPCVLE,		{FRTp, FRA, FRBp, RMC}},
0b07f1
-{"drrndq.",	ZRC(63,35,1),	Z2_MASK,     POWER6,	PPCVLE,		{FRTp, FRA, FRBp, RMC}},
0b07f1
+{"drrndq",	ZRC(63,35,0), Z2_MASK|Q_MASK, POWER6,	PPCVLE,		{FRTp, FRA, FRBp, RMC}},
0b07f1
+{"drrndq.",	ZRC(63,35,1), Z2_MASK|Q_MASK, POWER6,	PPCVLE,		{FRTp, FRA, FRBp, RMC}},
0b07f1
 
0b07f1
 {"xsmulqp",	XRC(63,36,0),	X_MASK,	     PPCVSX3,	PPCVLE,		{VD, VA, VB}},
0b07f1
 {"xsmulqpo",	XRC(63,36,1),	X_MASK,	     PPCVSX3,	PPCVLE,		{VD, VA, VB}},
0b07f1
@@ -6791,11 +6903,11 @@ const struct powerpc_opcode powerpc_opco
0b07f1
 
0b07f1
 {"mcrfs",      X(63,64), XRB_MASK|(3<<21)|(3<<16), COM,	PPCVLE,		{BF, BFA}},
0b07f1
 
0b07f1
-{"dscliq",	ZRC(63,66,0),	Z_MASK,	     POWER6,	PPCVLE,		{FRTp, FRAp, SH16}},
0b07f1
-{"dscliq.",	ZRC(63,66,1),	Z_MASK,	     POWER6,	PPCVLE,		{FRTp, FRAp, SH16}},
0b07f1
+{"dscliq",	ZRC(63,66,0), Z_MASK|Q_MASK, POWER6,	PPCVLE,		{FRTp, FRAp, SH16}},
0b07f1
+{"dscliq.",	ZRC(63,66,1), Z_MASK|Q_MASK, POWER6,	PPCVLE,		{FRTp, FRAp, SH16}},
0b07f1
 
0b07f1
-{"dquaiq",	ZRC(63,67,0),	Z2_MASK,     POWER6,	PPCVLE,		{TE, FRTp, FRBp, RMC}},
0b07f1
-{"dquaiq.",	ZRC(63,67,1),	Z2_MASK,     POWER6,	PPCVLE,		{TE, FRTp, FRBp, RMC}},
0b07f1
+{"dquaiq",	ZRC(63,67,0), Z2_MASK|Q_MASK, POWER6,	PPCVLE,		{TE, FRTp, FRBp, RMC}},
0b07f1
+{"dquaiq.",	ZRC(63,67,1), Z2_MASK|Q_MASK, POWER6,	PPCVLE,		{TE, FRTp, FRBp, RMC}},
0b07f1
 
0b07f1
 {"mtfsb0",	XRC(63,70,0),	XRARB_MASK,  COM,	PPCVLE,		{BT}},
0b07f1
 {"mtfsb0.",	XRC(63,70,1),	XRARB_MASK,  COM,	PPCVLE,		{BT}},
0b07f1
@@ -6803,11 +6915,11 @@ const struct powerpc_opcode powerpc_opco
0b07f1
 {"fmr",		XRC(63,72,0),	XRA_MASK,    COM,	PPCEFS|PPCVLE,	{FRT, FRB}},
0b07f1
 {"fmr.",	XRC(63,72,1),	XRA_MASK,    COM,	PPCEFS|PPCVLE,	{FRT, FRB}},
0b07f1
 
0b07f1
-{"dscriq",	ZRC(63,98,0),	Z_MASK,	     POWER6,	PPCVLE,		{FRTp, FRAp, SH16}},
0b07f1
-{"dscriq.",	ZRC(63,98,1),	Z_MASK,	     POWER6,	PPCVLE,		{FRTp, FRAp, SH16}},
0b07f1
+{"dscriq",	ZRC(63,98,0), Z_MASK|Q_MASK, POWER6,	PPCVLE,		{FRTp, FRAp, SH16}},
0b07f1
+{"dscriq.",	ZRC(63,98,1), Z_MASK|Q_MASK, POWER6,	PPCVLE,		{FRTp, FRAp, SH16}},
0b07f1
 
0b07f1
-{"drintxq",	ZRC(63,99,0),	Z2_MASK,     POWER6,	PPCVLE,		{R, FRTp, FRBp, RMC}},
0b07f1
-{"drintxq.",	ZRC(63,99,1),	Z2_MASK,     POWER6,	PPCVLE,		{R, FRTp, FRBp, RMC}},
0b07f1
+{"drintxq",	ZRC(63,99,0), Z2_MASK|Q_MASK, POWER6,	PPCVLE,		{R, FRTp, FRBp, RMC}},
0b07f1
+{"drintxq.",	ZRC(63,99,1), Z2_MASK|Q_MASK, POWER6,	PPCVLE,		{R, FRTp, FRBp, RMC}},
0b07f1
 
0b07f1
 {"xscpsgnqp",	X(63,100),	X_MASK,	     PPCVSX3,	PPCVLE,		{VD, VA, VB}},
0b07f1
 
0b07f1
@@ -6839,11 +6951,11 @@ const struct powerpc_opcode powerpc_opco
0b07f1
 {"dtstdcq",	Z(63,194),	Z_MASK,	     POWER6,	PPCVLE,		{BF, FRAp, DCM}},
0b07f1
 {"dtstdgq",	Z(63,226),	Z_MASK,	     POWER6,	PPCVLE,		{BF, FRAp, DGM}},
0b07f1
 
0b07f1
-{"drintnq",	ZRC(63,227,0),	Z2_MASK,     POWER6,	PPCVLE,		{R, FRTp, FRBp, RMC}},
0b07f1
-{"drintnq.",	ZRC(63,227,1),	Z2_MASK,     POWER6,	PPCVLE,		{R, FRTp, FRBp, RMC}},
0b07f1
+{"drintnq",	ZRC(63,227,0), Z2_MASK|Q_MASK, POWER6,	PPCVLE,		{R, FRTp, FRBp, RMC}},
0b07f1
+{"drintnq.",	ZRC(63,227,1), Z2_MASK|Q_MASK, POWER6,	PPCVLE,		{R, FRTp, FRBp, RMC}},
0b07f1
 
0b07f1
-{"dctqpq",	XRC(63,258,0),	X_MASK,	     POWER6,	PPCVLE,		{FRTp, FRB}},
0b07f1
-{"dctqpq.",	XRC(63,258,1),	X_MASK,	     POWER6,	PPCVLE,		{FRTp, FRB}},
0b07f1
+{"dctqpq",	XRC(63,258,0), X_MASK|Q_MASK, POWER6,	PPCVLE,		{FRTp, FRB}},
0b07f1
+{"dctqpq.",	XRC(63,258,1), X_MASK|Q_MASK, POWER6,	PPCVLE,		{FRTp, FRB}},
0b07f1
 
0b07f1
 {"fabs",	XRC(63,264,0),	XRA_MASK,    COM,	PPCEFS|PPCVLE,	{FRT, FRB}},
0b07f1
 {"fabs.",	XRC(63,264,1),	XRA_MASK,    COM,	PPCEFS|PPCVLE,	{FRT, FRB}},
0b07f1
@@ -6851,8 +6963,8 @@ const struct powerpc_opcode powerpc_opco
0b07f1
 {"dctfixq",	XRC(63,290,0),	X_MASK,	     POWER6,	PPCVLE,		{FRT, FRBp}},
0b07f1
 {"dctfixq.",	XRC(63,290,1),	X_MASK,	     POWER6,	PPCVLE,		{FRT, FRBp}},
0b07f1
 
0b07f1
-{"ddedpdq",	XRC(63,322,0),	X_MASK,	     POWER6,	PPCVLE,		{SP, FRTp, FRBp}},
0b07f1
-{"ddedpdq.",	XRC(63,322,1),	X_MASK,	     POWER6,	PPCVLE,		{SP, FRTp, FRBp}},
0b07f1
+{"ddedpdq",	XRC(63,322,0), X_MASK|Q_MASK, POWER6,	PPCVLE,		{SP, FRTp, FRBp}},
0b07f1
+{"ddedpdq.",	XRC(63,322,1), X_MASK|Q_MASK, POWER6,	PPCVLE,		{SP, FRTp, FRBp}},
0b07f1
 
0b07f1
 {"dxexq",	XRC(63,354,0),	X_MASK,	     POWER6,	PPCVLE,		{FRT, FRBp}},
0b07f1
 {"dxexq.",	XRC(63,354,1),	X_MASK,	     POWER6,	PPCVLE,		{FRT, FRBp}},
0b07f1
@@ -6881,14 +6993,14 @@ const struct powerpc_opcode powerpc_opco
0b07f1
 {"frim",	XRC(63,488,0),	XRA_MASK,    POWER5,	PPCVLE,		{FRT, FRB}},
0b07f1
 {"frim.",	XRC(63,488,1),	XRA_MASK,    POWER5,	PPCVLE,		{FRT, FRB}},
0b07f1
 
0b07f1
-{"dsubq",	XRC(63,514,0),	X_MASK,	     POWER6,	PPCVLE,		{FRTp, FRAp, FRBp}},
0b07f1
-{"dsubq.",	XRC(63,514,1),	X_MASK,	     POWER6,	PPCVLE,		{FRTp, FRAp, FRBp}},
0b07f1
+{"dsubq",	XRC(63,514,0), X_MASK|Q_MASK, POWER6,	PPCVLE,		{FRTp, FRAp, FRBp}},
0b07f1
+{"dsubq.",	XRC(63,514,1), X_MASK|Q_MASK, POWER6,	PPCVLE,		{FRTp, FRAp, FRBp}},
0b07f1
 
0b07f1
 {"xssubqp",	XRC(63,516,0),	X_MASK,	     PPCVSX3,	PPCVLE,		{VD, VA, VB}},
0b07f1
 {"xssubqpo",	XRC(63,516,1),	X_MASK,	     PPCVSX3,	PPCVLE,		{VD, VA, VB}},
0b07f1
 
0b07f1
-{"ddivq",	XRC(63,546,0),	X_MASK,	     POWER6,	PPCVLE,		{FRTp, FRAp, FRBp}},
0b07f1
-{"ddivq.",	XRC(63,546,1),	X_MASK,	     POWER6,	PPCVLE,		{FRTp, FRAp, FRBp}},
0b07f1
+{"ddivq",	XRC(63,546,0), X_MASK|Q_MASK, POWER6,	PPCVLE,		{FRTp, FRAp, FRBp}},
0b07f1
+{"ddivq.",	XRC(63,546,1), X_MASK|Q_MASK, POWER6,	PPCVLE,		{FRTp, FRAp, FRBp}},
0b07f1
 
0b07f1
 {"xsdivqp",	XRC(63,548,0),	X_MASK,	     PPCVSX3,	PPCVLE,		{VD, VA, VB}},
0b07f1
 {"xsdivqpo",	XRC(63,548,1),	X_MASK,	     PPCVSX3,	PPCVLE,		{VD, VA, VB}},
0b07f1
@@ -6917,11 +7029,11 @@ const struct powerpc_opcode powerpc_opco
0b07f1
 {"mtfsf.",	XFL(63,711,1),	XFL_MASK, POWER6|PPCA2|PPC476, PPCVLE,	{FLM, FRB, XFL_L, W}},
0b07f1
 {"mtfsf.",	XFL(63,711,1),	XFL_MASK,    COM, POWER6|PPCA2|PPC476|PPCEFS|PPCVLE, {FLM, FRB}},
0b07f1
 
0b07f1
-{"drdpq",	XRC(63,770,0),	X_MASK,	     POWER6,	PPCVLE,		{FRTp, FRBp}},
0b07f1
-{"drdpq.",	XRC(63,770,1),	X_MASK,	     POWER6,	PPCVLE,		{FRTp, FRBp}},
0b07f1
+{"drdpq",	XRC(63,770,0), X_MASK|Q_MASK, POWER6,	PPCVLE,		{FRTp, FRBp}},
0b07f1
+{"drdpq.",	XRC(63,770,1), X_MASK|Q_MASK, POWER6,	PPCVLE,		{FRTp, FRBp}},
0b07f1
 
0b07f1
-{"dcffixq",	XRC(63,802,0),	X_MASK,	     POWER6,	PPCVLE,		{FRTp, FRB}},
0b07f1
-{"dcffixq.",	XRC(63,802,1),	X_MASK,	     POWER6,	PPCVLE,		{FRTp, FRB}},
0b07f1
+{"dcffixq",	XRC(63,802,0), X_MASK|Q_MASK, POWER6,	PPCVLE,		{FRTp, FRB}},
0b07f1
+{"dcffixq.",	XRC(63,802,1), X_MASK|Q_MASK, POWER6,	PPCVLE,		{FRTp, FRB}},
0b07f1
 
0b07f1
 {"xsabsqp",	XVA(63,804,0),	XVA_MASK,    PPCVSX3,	PPCVLE,		{VD, VB}},
0b07f1
 {"xsxexpqp",	XVA(63,804,2),	XVA_MASK,    PPCVSX3,	PPCVLE,		{VD, VB}},
0b07f1
@@ -6941,8 +7053,8 @@ const struct powerpc_opcode powerpc_opco
0b07f1
 {"fctidz.",	XRC(63,815,1),	XRA_MASK,    PPC64,	PPCVLE,		{FRT, FRB}},
0b07f1
 {"fctidz.",	XRC(63,815,1),	XRA_MASK,    PPC476,	PPCVLE,		{FRT, FRB}},
0b07f1
 
0b07f1
-{"denbcdq",	XRC(63,834,0),	X_MASK,	     POWER6,	PPCVLE,		{S, FRTp, FRBp}},
0b07f1
-{"denbcdq.",	XRC(63,834,1),	X_MASK,	     POWER6,	PPCVLE,		{S, FRTp, FRBp}},
0b07f1
+{"denbcdq",	XRC(63,834,0), X_MASK|Q_MASK, POWER6,	PPCVLE,		{S, FRTp, FRBp}},
0b07f1
+{"denbcdq.",	XRC(63,834,1), X_MASK|Q_MASK, POWER6,	PPCVLE,		{S, FRTp, FRBp}},
0b07f1
 
0b07f1
 {"xscvqpuwz",	XVA(63,836,1),	XVA_MASK,    PPCVSX3,	PPCVLE,		{VD, VB}},
0b07f1
 {"xscvudqp",	XVA(63,836,2),	XVA_MASK,    PPCVSX3,	PPCVLE,		{VD, VB}},
0b07f1
@@ -6961,8 +7073,8 @@ const struct powerpc_opcode powerpc_opco
0b07f1
 {"fcfid.",	XRC(63,846,1),	XRA_MASK,    PPC64,	PPCVLE,		{FRT, FRB}},
0b07f1
 {"fcfid.",	XRC(63,846,1),	XRA_MASK,    PPC476,	PPCVLE,		{FRT, FRB}},
0b07f1
 
0b07f1
-{"diexq",	XRC(63,866,0),	X_MASK,	     POWER6,	PPCVLE,		{FRTp, FRA, FRBp}},
0b07f1
-{"diexq.",	XRC(63,866,1),	X_MASK,	     POWER6,	PPCVLE,		{FRTp, FRA, FRBp}},
0b07f1
+{"diexq",	XRC(63,866,0), X_MASK|Q_MASK, POWER6,	PPCVLE,		{FRTp, FRA, FRBp}},
0b07f1
+{"diexq.",	XRC(63,866,1), X_MASK|Q_MASK, POWER6,	PPCVLE,		{FRTp, FRA, FRBp}},
0b07f1
 
0b07f1
 {"xsiexpqp",	X(63,868),	X_MASK,	     PPCVSX3,	PPCVLE,		{VD, VA, VB}},
0b07f1