Blame SOURCES/gdb-rhbz1320945-power9-32of38.patch

a094f6
commit 6fd3a02da5548c71ff469f978444ef6c3af18783
a094f6
Author: Peter Bergner <bergner@vnet.ibm.com>
a094f6
Date:   Wed Jun 22 17:55:17 2016 -0500
a094f6
a094f6
    Add support for yet some more new ISA 3.0 instructions.
a094f6
    
a094f6
    opcodes/
a094f6
            * ppc-opc.c (RM, DRM, VXASH, VXASH_MASK, XMMF, XMMF_MASK): New defines.
a094f6
            (powerpc_opcodes) 
a094f6
            mffscrn, mffscrni, mffsl, nandxor, rldixor, setbool,
a094f6
            xor3>: New mnemonics.
a094f6
            <setb>: Change to a VX form instruction.
a094f6
            (insert_sh6): Add support for rldixor.
a094f6
            (extract_sh6): Likewise.
a094f6
    
a094f6
    gas/
a094f6
            * testsuite/gas/ppc/power9.d 
a094f6
            mffscdrn, mffscdrni, mffscrn, mffscrni, mffsl, nandxor, rldixor,
a094f6
            setbool, xor3>: New tests.
a094f6
            * testsuite/gas/ppc/power9.s: Likewise.
a094f6
a094f6
### a/opcodes/ChangeLog
a094f6
### b/opcodes/ChangeLog
a094f6
## -1,3 +1,13 @@
a094f6
+2016-06-22  Peter Bergner <bergner@vnet.ibm.com>
a094f6
+
a094f6
+	* ppc-opc.c (RM, DRM, VXASH, VXASH_MASK, XMMF, XMMF_MASK): New defines.
a094f6
+	(powerpc_opcodes) 
a094f6
+	mffscrn, mffscrni, mffsl, nandxor, rldixor, setbool,
a094f6
+	xor3>: New mnemonics.
a094f6
+	<setb>: Change to a VX form instruction.
a094f6
+	(insert_sh6): Add support for rldixor.
a094f6
+	(extract_sh6): Likewise.
a094f6
+
a094f6
 2016-06-22  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>
a094f6
 
a094f6
 	* arc-ext.h: Wrap in extern C.
a094f6
--- a/opcodes/ppc-opc.c
a094f6
+++ b/opcodes/ppc-opc.c
a094f6
@@ -238,7 +238,11 @@ const struct powerpc_operand powerpc_operands[] =
a094f6
 #define BOE BO + 1
a094f6
   { 0x1e, 21, insert_boe, extract_boe, 0 },
a094f6
 
a094f6
-#define BH BOE + 1
a094f6
+  /* The RM field in an X form instruction.  */
a094f6
+#define RM BOE + 1
a094f6
+  { 0x3, 11, NULL, NULL, 0 },
a094f6
+
a094f6
+#define BH RM + 1
a094f6
   { 0x3, 11, NULL, NULL, PPC_OPERAND_OPTIONAL },
a094f6
 
a094f6
   /* The BT field in an X or XL form instruction.  */
a094f6
@@ -786,8 +790,9 @@ const struct powerpc_operand powerpc_operands[] =
a094f6
 #define EVUIMM_8 EVUIMM_4 + 1
a094f6
   { 0xf8, 8, NULL, NULL, PPC_OPERAND_PARENS },
a094f6
 
a094f6
-  /* The WS field.  */
a094f6
+  /* The WS or DRM field in an X form instruction.  */
a094f6
 #define WS EVUIMM_8 + 1
a094f6
+#define DRM WS
a094f6
   { 0x7, 11, NULL, NULL, 0 },
a094f6
 
a094f6
   /* PowerPC paired singles extensions.  */
a094f6
@@ -2017,7 +2022,11 @@ insert_sh6 (unsigned long insn,
a094f6
 	    ppc_cpu_t dialect ATTRIBUTE_UNUSED,
a094f6
 	    const char **errmsg ATTRIBUTE_UNUSED)
a094f6
 {
a094f6
-  return insn | ((value & 0x1f) << 11) | ((value & 0x20) >> 4);
a094f6
+  /* SH6 operand in the rldixor instructions.  */
a094f6
+  if (PPC_OP (insn) == 4)
a094f6
+    return insn | ((value & 0x1f) << 6) | ((value & 0x20) >> 5);
a094f6
+  else
a094f6
+    return insn | ((value & 0x1f) << 11) | ((value & 0x20) >> 4);
a094f6
 }
a094f6
 
a094f6
 static long
a094f6
@@ -2025,7 +2034,11 @@ extract_sh6 (unsigned long insn,
a094f6
 	     ppc_cpu_t dialect ATTRIBUTE_UNUSED,
a094f6
 	     int *invalid ATTRIBUTE_UNUSED)
a094f6
 {
a094f6
-  return ((insn >> 11) & 0x1f) | ((insn << 4) & 0x20);
a094f6
+  /* SH6 operand in the rldixor instructions.  */
a094f6
+  if (PPC_OP (insn) == 4)
a094f6
+    return ((insn >> 6) & 0x1f) | ((insn << 5) & 0x20);
a094f6
+  else
a094f6
+    return ((insn >> 11) & 0x1f) | ((insn << 4) & 0x20);
a094f6
 }
a094f6
 
a094f6
 /* The SPR field in an XFX form instruction.  This is flipped--the
a094f6
@@ -2608,6 +2621,9 @@ extract_vleil (unsigned long insn,
a094f6
 /* A VX form instruction with a VA tertiary opcode.  */
a094f6
 #define VXVA(op, xop, vaop) (VX(op,xop) | (((vaop) & 0x1f) << 16))
a094f6
 
a094f6
+#define VXASH(op, xop) (OP (op) | ((((unsigned long)(xop)) & 0x1f) << 1))
a094f6
+#define VXASH_MASK VXASH (0x3f, 0x1f)
a094f6
+
a094f6
 /* An X form instruction.  */
a094f6
 #define X(op, xop) (OP (op) | ((((unsigned long)(xop)) & 0x3ff) << 1))
a094f6
 
a094f6
@@ -2644,6 +2660,9 @@ extract_vleil (unsigned long insn,
a094f6
 /* A X form instruction for Quad-Precision FP Instructions with RC bit.  */
a094f6
 #define XVARC(op, xop, vaop, rc) (XVA ((op), (xop), (vaop)) | ((rc) & 1))
a094f6
 
a094f6
+/* An X form instruction with the RA bits specified as two ops.  */
a094f6
+#define XMMF(op, xop, mop0, mop1) (X ((op), (xop)) | ((mop0) & 3) << 19 | ((mop1) & 7) << 16)
a094f6
+
a094f6
 /* A Z form instruction with the RC bit specified.  */
a094f6
 #define ZRC(op, xop, rc) (Z ((op), (xop)) | ((rc) & 1))
a094f6
 
a094f6
@@ -2696,6 +2715,9 @@ extract_vleil (unsigned long insn,
a094f6
 /* An X form wait instruction with everything filled in except the WC field.  */
a094f6
 #define XWC_MASK (XRC (0x3f, 0x3ff, 1) | (7 << 23) | RA_MASK | RB_MASK)
a094f6
 
a094f6
+/* The mask for an XMMF form instruction.  */
a094f6
+#define XMMF_MASK (XMMF (0x3f, 0x3ff, 3, 7) | (1))
a094f6
+
a094f6
 /* The mask for a Z form instruction.  */
a094f6
 #define Z_MASK ZRC (0x3f, 0x1ff, 1)
a094f6
 #define Z2_MASK ZRC (0x3f, 0xff, 1)
a094f6
@@ -3139,6 +3161,7 @@ const struct powerpc_opcode powerpc_opcodes[] = {
a094f6
 {"machhwu.",	XO (4,	12,0,1), XO_MASK,    MULHW,	0,		{RT, RA, RB}},
a094f6
 {"ps_muls1",	A  (4,	13,0),	AFRB_MASK,   PPCPS,	0,		{FRT, FRA, FRC}},
a094f6
 {"ps_muls1.",	A  (4,	13,1),	AFRB_MASK,   PPCPS,	0,		{FRT, FRA, FRC}},
a094f6
+{"rldixor",	VXASH(4,26),	VXASH_MASK,  POWER9,	0,		{RA, RS, SH6, RB}},
a094f6
 {"ps_madds0",	A  (4,	14,0),	A_MASK,	     PPCPS,	0,		{FRT, FRA, FRC, FRB}},
a094f6
 {"ps_madds0.",	A  (4,	14,1),	A_MASK,	     PPCPS,	0,		{FRT, FRA, FRC, FRB}},
a094f6
 {"ps_madds1",	A  (4,	15,0),	A_MASK,	     PPCPS,	0,		{FRT, FRA, FRC, FRB}},
a094f6
@@ -3180,6 +3203,8 @@ const struct powerpc_opcode powerpc_opcodes[] = {
a094f6
 {"ps_msub.",	A  (4,	28,1),	A_MASK,	     PPCPS,	0,		{FRT, FRA, FRC, FRB}},
a094f6
 {"ps_madd",	A  (4,	29,0),	A_MASK,	     PPCPS,	0,		{FRT, FRA, FRC, FRB}},
a094f6
 {"ps_madd.",	A  (4,	29,1),	A_MASK,	     PPCPS,	0,		{FRT, FRA, FRC, FRB}},
a094f6
+{"xor3",	VXA(4,	54),	VXA_MASK,    POWER9,	0,		{RA, RS, RB, RC}},
a094f6
+{"nandxor",	VXA(4,	55),	VXA_MASK,    POWER9,	0,		{RA, RS, RB, RC}},
a094f6
 {"vpermr",	VXA(4,	59),	VXA_MASK,    PPCVEC3,	0,		{VD, VA, VB, VC}},
a094f6
 {"ps_nmsub",	A  (4,	30,0),	A_MASK,	     PPCPS,	0,		{FRT, FRA, FRC, FRB}},
a094f6
 {"vaddeuqm",	VXA(4,	60),	VXA_MASK,    PPCVEC2,	0,		{VD, VA, VB, VC}},
a094f6
@@ -4918,7 +4943,8 @@ const struct powerpc_opcode powerpc_opcodes[] = {
a094f6
 
a094f6
 {"dcbfep",	XRT(31,127,0),	XRT_MASK, E500MC|PPCA2, 0,		{RA0, RB}},
a094f6
 
a094f6
-{"setb",	X(31,128),    XRB_MASK|(3<<16), POWER9, 0,		{RT, BFA}},
a094f6
+{"setb",	VX(31,256),  VXVB_MASK|(3<<16), POWER9,	0,		{RT, BFA}},
a094f6
+{"setbool",	VX(31,257),  VXVB_MASK,         POWER9,	0,		{RT, BA}},
a094f6
 
a094f6
 {"wrtee",	X(31,131), XRARB_MASK, PPC403|BOOKE|PPCA2|PPC476, 0,	{RS}},
a094f6
 
a094f6
@@ -4968,6 +4994,8 @@ const struct powerpc_opcode powerpc_opcodes[] = {
a094f6
 
a094f6
 {"prtyw",	X(31,154),    XRB_MASK, POWER6|PPCA2|PPC476, 0,		{RA, RS}},
a094f6
 
a094f6
+{"brw",		X(31,155),	XRB_MASK,    POWER9,	0,		{RA, RS}},
a094f6
+
a094f6
 {"stdepx",	X(31,157),	X_MASK,	  E500MC|PPCA2, 0,		{RS, RA0, RB}},
a094f6
 
a094f6
 {"stwepx",	X(31,159),	X_MASK,	  E500MC|PPCA2, 0,		{RS, RA0, RB}},
a094f6
@@ -5005,6 +5033,8 @@ const struct powerpc_opcode powerpc_opcodes[] = {
a094f6
 
a094f6
 {"prtyd",	X(31,186),	XRB_MASK, POWER6|PPCA2,	0,		{RA, RS}},
a094f6
 
a094f6
+{"brd",		X(31,187),	XRB_MASK,    POWER9,	0,		{RA, RS}},
a094f6
+
a094f6
 {"cmprb",	X(31,192),	XCMP_MASK,   POWER9,	0,		{BF, L, RA, RB}},
a094f6
 
a094f6
 {"icblq.",	XRC(31,198,1),	X_MASK,	     E6500,	0,		{CT, RA0, RB}},
a094f6
@@ -5043,6 +5073,8 @@ const struct powerpc_opcode powerpc_opcodes[] = {
a094f6
 {"sleq",	XRC(31,217,0),	X_MASK,	     M601,	0,		{RA, RS, RB}},
a094f6
 {"sleq.",	XRC(31,217,1),	X_MASK,	     M601,	0,		{RA, RS, RB}},
a094f6
 
a094f6
+{"brh",		X(31,219),	XRB_MASK,    POWER9,	0,		{RA, RS}},
a094f6
+
a094f6
 {"stbepx",	X(31,223),	X_MASK,	  E500MC|PPCA2, 0,		{RS, RA0, RB}},
a094f6
 
a094f6
 {"cmpeqb",	X(31,224),	XCMPL_MASK,  POWER9,	0,		{BF, RA, RB}},
a094f6
@@ -6914,6 +6946,13 @@ const struct powerpc_opcode powerpc_opcodes[] = {
a094f6
 {"mffs",	XRC(63,583,0),	XRARB_MASK,  COM,	PPCEFS|PPCVLE,	{FRT}},
a094f6
 {"mffs.",	XRC(63,583,1),	XRARB_MASK,  COM,	PPCEFS|PPCVLE,	{FRT}},
a094f6
 
a094f6
+{"mffsce",	XMMF(63,583,0,1), XMMF_MASK|RB_MASK, POWER9, PPCVLE,	{FRT}},
a094f6
+{"mffscdrn",	XMMF(63,583,2,4), XMMF_MASK,         POWER9, PPCVLE,	{FRT, FRB}},
a094f6
+{"mffscdrni",	XMMF(63,583,2,5), XMMF_MASK|(3<<14), POWER9, PPCVLE,	{FRT, DRM}},
a094f6
+{"mffscrn",	XMMF(63,583,2,6), XMMF_MASK,         POWER9, PPCVLE,	{FRT, FRB}},
a094f6
+{"mffscrni",	XMMF(63,583,2,7), XMMF_MASK|(7<<13), POWER9, PPCVLE,	{FRT, RM}},
a094f6
+{"mffsl",	XMMF(63,583,3,0), XMMF_MASK|RB_MASK, POWER9, PPCVLE,	{FRT}},
a094f6
+
a094f6
 {"dcmpuq",	X(63,642),	X_MASK,	     POWER6,	PPCVLE,		{BF, FRAp, FRBp}},
a094f6
 
a094f6
 {"xscmpuqp",	X(63,644),	XBF_MASK,    PPCVSX3,	PPCVLE,		{BF, VA, VB}},