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

a094f6
commit 6ec2b213de6962ceeb81bfa33354ea6e60c57049
a094f6
Author: Edjunior Barbosa Machado <emachado@linux.vnet.ibm.com>
a094f6
Date:   Wed Sep 21 13:30:39 2016 -0300
a094f6
a094f6
    ppc: Add Power ISA 3.0/POWER9 instructions record support
a094f6
    
a094f6
    gdb/ChangeLog:
a094f6
    2016-09-21  Edjunior Barbosa Machado  <emachado@linux.vnet.ibm.com>
a094f6
    
a094f6
            * rs6000-tdep.c (PPC_DQ): New macro.
a094f6
            (ppc_process_record_op4): Add Power ISA 3.0 instructions.
a094f6
            (ppc_process_record_op19): Likewise.
a094f6
            (ppc_process_record_op31): Likewise.
a094f6
            (ppc_process_record_op59): Likewise.
a094f6
            (ppc_process_record_op60): Likewise.
a094f6
            (ppc_process_record_op63): Likewise.
a094f6
            (ppc_process_record): Likewise.
a094f6
            (ppc_process_record_op61): New function.
a094f6
a094f6
### a/gdb/ChangeLog
a094f6
### b/gdb/ChangeLog
a094f6
## -1,3 +1,15 @@
a094f6
+2016-09-21  Edjunior Barbosa Machado  <emachado@linux.vnet.ibm.com>
a094f6
+
a094f6
+	* rs6000-tdep.c (PPC_DQ): New macro.
a094f6
+	(ppc_process_record_op4): Add Power ISA 3.0 instructions.
a094f6
+	(ppc_process_record_op19): Likewise.
a094f6
+	(ppc_process_record_op31): Likewise.
a094f6
+	(ppc_process_record_op59): Likewise.
a094f6
+	(ppc_process_record_op60): Likewise.
a094f6
+	(ppc_process_record_op63): Likewise.
a094f6
+	(ppc_process_record): Likewise.
a094f6
+	(ppc_process_record_op61): New function.
a094f6
+
a094f6
 2016-09-21  Yao Qi  <yao.qi@linaro.org>
a094f6
 
a094f6
 	* aarch32-linux-nat.c (aarch32_gp_regcache_collect): Keep
a094f6
Index: gdb-7.6.1/gdb/rs6000-tdep.c
a094f6
===================================================================
a094f6
--- gdb-7.6.1.orig/gdb/rs6000-tdep.c	2017-03-19 00:08:32.893569127 +0100
a094f6
+++ gdb-7.6.1/gdb/rs6000-tdep.c	2017-03-19 00:08:49.775687752 +0100
a094f6
@@ -3721,6 +3721,7 @@
a094f6
 #define PPC_T(insn)	PPC_FIELD (insn, 6, 5)
a094f6
 #define PPC_D(insn)	PPC_SEXT (PPC_FIELD (insn, 16, 16), 16)
a094f6
 #define PPC_DS(insn)	PPC_SEXT (PPC_FIELD (insn, 16, 14), 14)
a094f6
+#define PPC_DQ(insn)	PPC_SEXT (PPC_FIELD (insn, 16, 12), 12)
a094f6
 #define PPC_BIT(insn,n)	((insn & (1 << (31 - (n)))) ? 1 : 0)
a094f6
 #define PPC_OE(insn)	PPC_BIT (insn, 21)
a094f6
 #define PPC_RC(insn)	PPC_BIT (insn, 31)
a094f6
@@ -3768,6 +3769,7 @@
a094f6
 {
a094f6
   struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
a094f6
   int ext = PPC_FIELD (insn, 21, 11);
a094f6
+  int vra = PPC_FIELD (insn, 11, 5);
a094f6
 
a094f6
   switch (ext & 0x3f)
a094f6
     {
a094f6
@@ -3779,6 +3781,7 @@
a094f6
       /* FALL-THROUGH */
a094f6
     case 42:		/* Vector Select */
a094f6
     case 43:		/* Vector Permute */
a094f6
+    case 59:		/* Vector Permute Right-indexed */
a094f6
     case 44:		/* Vector Shift Left Double by Octet Immediate */
a094f6
     case 45:		/* Vector Permute and Exclusive-OR */
a094f6
     case 60:		/* Vector Add Extended Unsigned Quadword Modulo */
a094f6
@@ -3786,6 +3789,7 @@
a094f6
     case 62:		/* Vector Subtract Extended Unsigned Quadword Modulo */
a094f6
     case 63:		/* Vector Subtract Extended & write Carry Unsigned Quadword */
a094f6
     case 34:		/* Vector Multiply-Low-Add Unsigned Halfword Modulo */
a094f6
+    case 35:		/* Vector Multiply-Sum Unsigned Doubleword Modulo */
a094f6
     case 36:		/* Vector Multiply-Sum Unsigned Byte Modulo */
a094f6
     case 37:		/* Vector Multiply-Sum Mixed Byte Modulo */
a094f6
     case 38:		/* Vector Multiply-Sum Unsigned Halfword Modulo */
a094f6
@@ -3795,14 +3799,37 @@
a094f6
       record_full_arch_list_add_reg (regcache,
a094f6
 				     tdep->ppc_vr0_regnum + PPC_VRT (insn));
a094f6
       return 0;
a094f6
+
a094f6
+    case 48:		/* Multiply-Add High Doubleword */
a094f6
+    case 49:		/* Multiply-Add High Doubleword Unsigned */
a094f6
+    case 51:		/* Multiply-Add Low Doubleword */
a094f6
+      record_full_arch_list_add_reg (regcache,
a094f6
+				     tdep->ppc_gp0_regnum + PPC_RT (insn));
a094f6
+      return 0;
a094f6
     }
a094f6
 
a094f6
   switch ((ext & 0x1ff))
a094f6
     {
a094f6
+    case 385:
a094f6
+      if (vra != 0	/* Decimal Convert To Signed Quadword */
a094f6
+	  && vra != 2	/* Decimal Convert From Signed Quadword */
a094f6
+	  && vra != 4	/* Decimal Convert To Zoned */
a094f6
+	  && vra != 5	/* Decimal Convert To National */
a094f6
+	  && vra != 6	/* Decimal Convert From Zoned */
a094f6
+	  && vra != 7	/* Decimal Convert From National */
a094f6
+	  && vra != 31)	/* Decimal Set Sign */
a094f6
+	break;
a094f6
 			/* 5.16 Decimal Integer Arithmetic Instructions */
a094f6
     case 1:		/* Decimal Add Modulo */
a094f6
     case 65:		/* Decimal Subtract Modulo */
a094f6
 
a094f6
+    case 193:		/* Decimal Shift */
a094f6
+    case 129:		/* Decimal Unsigned Shift */
a094f6
+    case 449:		/* Decimal Shift and Round */
a094f6
+
a094f6
+    case 257:		/* Decimal Truncate */
a094f6
+    case 321:		/* Decimal Unsigned Truncate */
a094f6
+
a094f6
       /* Bit-21 should be set.  */
a094f6
       if (!PPC_BIT (insn, 21))
a094f6
 	break;
a094f6
@@ -3832,6 +3859,12 @@
a094f6
     case 198:		/* Vector Compare Equal To Single-Precision */
a094f6
     case 454:		/* Vector Compare Greater Than or Equal To Single-Precision */
a094f6
     case 710:		/* Vector Compare Greater Than Single-Precision */
a094f6
+    case 7:		/* Vector Compare Not Equal Byte */
a094f6
+    case 71:		/* Vector Compare Not Equal Halfword */
a094f6
+    case 135:		/* Vector Compare Not Equal Word */
a094f6
+    case 263:		/* Vector Compare Not Equal or Zero Byte */
a094f6
+    case 327:		/* Vector Compare Not Equal or Zero Halfword */
a094f6
+    case 391:		/* Vector Compare Not Equal or Zero Word */
a094f6
       if (PPC_Rc (insn))
a094f6
 	record_full_arch_list_add_reg (regcache, tdep->ppc_cr_regnum);
a094f6
       record_full_arch_list_add_reg (regcache,
a094f6
@@ -3839,6 +3872,38 @@
a094f6
       return 0;
a094f6
     }
a094f6
 
a094f6
+  if (ext  == 1538)
a094f6
+    {
a094f6
+      switch (vra)
a094f6
+	{
a094f6
+	case 0:		/* Vector Count Leading Zero Least-Significant Bits
a094f6
+			   Byte */
a094f6
+	case 1:		/* Vector Count Trailing Zero Least-Significant Bits
a094f6
+			   Byte */
a094f6
+	  record_full_arch_list_add_reg (regcache,
a094f6
+					 tdep->ppc_gp0_regnum + PPC_RT (insn));
a094f6
+	  return 0;
a094f6
+
a094f6
+	case 6:		/* Vector Negate Word */
a094f6
+	case 7:		/* Vector Negate Doubleword */
a094f6
+	case 8:		/* Vector Parity Byte Word */
a094f6
+	case 9:		/* Vector Parity Byte Doubleword */
a094f6
+	case 10:	/* Vector Parity Byte Quadword */
a094f6
+	case 16:	/* Vector Extend Sign Byte To Word */
a094f6
+	case 17:	/* Vector Extend Sign Halfword To Word */
a094f6
+	case 24:	/* Vector Extend Sign Byte To Doubleword */
a094f6
+	case 25:	/* Vector Extend Sign Halfword To Doubleword */
a094f6
+	case 26:	/* Vector Extend Sign Word To Doubleword */
a094f6
+	case 28:	/* Vector Count Trailing Zeros Byte */
a094f6
+	case 29:	/* Vector Count Trailing Zeros Halfword */
a094f6
+	case 30:	/* Vector Count Trailing Zeros Word */
a094f6
+	case 31:	/* Vector Count Trailing Zeros Doubleword */
a094f6
+	  record_full_arch_list_add_reg (regcache,
a094f6
+					 tdep->ppc_vr0_regnum + PPC_VRT (insn));
a094f6
+	  return 0;
a094f6
+	}
a094f6
+    }
a094f6
+
a094f6
   switch (ext)
a094f6
     {
a094f6
     case 142:		/* Vector Pack Unsigned Halfword Unsigned Saturate */
a094f6
@@ -4010,10 +4075,44 @@
a094f6
     case 1923:		/* Vector Population Count Word */
a094f6
     case 1987:		/* Vector Population Count Doubleword */
a094f6
     case 1356:		/* Vector Bit Permute Quadword */
a094f6
+    case 1484:		/* Vector Bit Permute Doubleword */
a094f6
+    case 513:		/* Vector Multiply-by-10 Unsigned Quadword */
a094f6
+    case 1:		/* Vector Multiply-by-10 & write Carry Unsigned
a094f6
+			   Quadword */
a094f6
+    case 577:		/* Vector Multiply-by-10 Extended Unsigned Quadword */
a094f6
+    case 65:		/* Vector Multiply-by-10 Extended & write Carry
a094f6
+			   Unsigned Quadword */
a094f6
+    case 1027:		/* Vector Absolute Difference Unsigned Byte */
a094f6
+    case 1091:		/* Vector Absolute Difference Unsigned Halfword */
a094f6
+    case 1155:		/* Vector Absolute Difference Unsigned Word */
a094f6
+    case 1796:		/* Vector Shift Right Variable */
a094f6
+    case 1860:		/* Vector Shift Left Variable */
a094f6
+    case 133:		/* Vector Rotate Left Word then Mask Insert */
a094f6
+    case 197:		/* Vector Rotate Left Doubleword then Mask Insert */
a094f6
+    case 389:		/* Vector Rotate Left Word then AND with Mask */
a094f6
+    case 453:		/* Vector Rotate Left Doubleword then AND with Mask */
a094f6
+    case 525:		/* Vector Extract Unsigned Byte */
a094f6
+    case 589:		/* Vector Extract Unsigned Halfword */
a094f6
+    case 653:		/* Vector Extract Unsigned Word */
a094f6
+    case 717:		/* Vector Extract Doubleword */
a094f6
+    case 781:		/* Vector Insert Byte */
a094f6
+    case 845:		/* Vector Insert Halfword */
a094f6
+    case 909:		/* Vector Insert Word */
a094f6
+    case 973:		/* Vector Insert Doubleword */
a094f6
       record_full_arch_list_add_reg (regcache,
a094f6
 				     tdep->ppc_vr0_regnum + PPC_VRT (insn));
a094f6
       return 0;
a094f6
 
a094f6
+    case 1549:		/* Vector Extract Unsigned Byte Left-Indexed */
a094f6
+    case 1613:		/* Vector Extract Unsigned Halfword Left-Indexed */
a094f6
+    case 1677:		/* Vector Extract Unsigned Word Left-Indexed */
a094f6
+    case 1805:		/* Vector Extract Unsigned Byte Right-Indexed */
a094f6
+    case 1869:		/* Vector Extract Unsigned Halfword Right-Indexed */
a094f6
+    case 1933:		/* Vector Extract Unsigned Word Right-Indexed */
a094f6
+      record_full_arch_list_add_reg (regcache,
a094f6
+				     tdep->ppc_gp0_regnum + PPC_RT (insn));
a094f6
+      return 0;
a094f6
+
a094f6
     case 1604:		/* Move To Vector Status and Control Register */
a094f6
       record_full_arch_list_add_reg (regcache, PPC_VSCR_REGNUM);
a094f6
       return 0;
a094f6
@@ -4021,6 +4120,11 @@
a094f6
       record_full_arch_list_add_reg (regcache,
a094f6
 				     tdep->ppc_vr0_regnum + PPC_VRT (insn));
a094f6
       return 0;
a094f6
+    case 833:		/* Decimal Copy Sign */
a094f6
+      record_full_arch_list_add_reg (regcache,
a094f6
+				     tdep->ppc_vr0_regnum + PPC_VRT (insn));
a094f6
+      record_full_arch_list_add_reg (regcache, tdep->ppc_cr_regnum);
a094f6
+      return 0;
a094f6
     }
a094f6
 
a094f6
   fprintf_unfiltered (gdb_stdlog, "Warning: Don't know how to record %08x "
a094f6
@@ -4038,6 +4142,14 @@
a094f6
   struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
a094f6
   int ext = PPC_EXTOP (insn);
a094f6
 
a094f6
+  switch (ext & 0x01f)
a094f6
+    {
a094f6
+    case 2:		/* Add PC Immediate Shifted */
a094f6
+      record_full_arch_list_add_reg (regcache,
a094f6
+				     tdep->ppc_gp0_regnum + PPC_RT (insn));
a094f6
+      return 0;
a094f6
+    }
a094f6
+
a094f6
   switch (ext)
a094f6
     {
a094f6
     case 0:		/* Move Condition Register Field */
a094f6
@@ -4143,6 +4255,15 @@
a094f6
       return 0;
a094f6
     }
a094f6
 
a094f6
+  if ((ext & 0xff) == 170)
a094f6
+    {
a094f6
+      /* Add Extended using alternate carry bits */
a094f6
+      record_full_arch_list_add_reg (regcache, tdep->ppc_xer_regnum);
a094f6
+      record_full_arch_list_add_reg (regcache,
a094f6
+				     tdep->ppc_gp0_regnum + PPC_RT (insn));
a094f6
+      return 0;
a094f6
+    }
a094f6
+
a094f6
   switch (ext)
a094f6
     {
a094f6
     case 78:		/* Determine Leftmost Zero Byte */
a094f6
@@ -4161,6 +4282,9 @@
a094f6
     case 302:		/* Move From Branch History Rolling Buffer */
a094f6
     case 339:		/* Move From Special Purpose Register */
a094f6
     case 371:		/* Move From Time Base [Phased-Out]  */
a094f6
+    case 309:		/* Load Doubleword Monitored Indexed  */
a094f6
+    case 128:		/* Set Boolean */
a094f6
+    case 755:		/* Deliver A Random Number */
a094f6
       record_full_arch_list_add_reg (regcache,
a094f6
 				     tdep->ppc_gp0_regnum + PPC_RT (insn));
a094f6
       return 0;
a094f6
@@ -4177,6 +4301,7 @@
a094f6
     case 282:		/* Convert Declets To Binary Coded Decimal */
a094f6
     case 314:		/* Convert Binary Coded Decimal To Declets */
a094f6
     case 508:		/* Compare bytes */
a094f6
+    case 307:		/* Move From VSR Lower Doubleword */
a094f6
       record_full_arch_list_add_reg (regcache,
a094f6
 				     tdep->ppc_gp0_regnum + PPC_RA (insn));
a094f6
       return 0;
a094f6
@@ -4195,6 +4320,12 @@
a094f6
     case 32:		/* Compare logical */
a094f6
     case 144:		/* Move To Condition Register Fields */
a094f6
 			/* Move To One Condition Register Field */
a094f6
+    case 192:		/* Compare Ranged Byte */
a094f6
+    case 224:		/* Compare Equal Byte */
a094f6
+    case 576:		/* Move XER to CR Extended */
a094f6
+    case 902:		/* Paste (should always fail due to single-stepping and
a094f6
+			   the memory location might not be accessible, so
a094f6
+			   record only CR) */
a094f6
       record_full_arch_list_add_reg (regcache, tdep->ppc_cr_regnum);
a094f6
       return 0;
a094f6
 
a094f6
@@ -4221,6 +4352,12 @@
a094f6
     case 790:		/* Load Halfword Byte-Reverse Indexed */
a094f6
     case 534:		/* Load Word Byte-Reverse Indexed */
a094f6
     case 532:		/* Load Doubleword Byte-Reverse Indexed */
a094f6
+    case 582:		/* Load Word Atomic */
a094f6
+    case 614:		/* Load Doubleword Atomic */
a094f6
+    case 265:		/* Modulo Unsigned Doubleword */
a094f6
+    case 777:		/* Modulo Signed Doubleword */
a094f6
+    case 267:		/* Modulo Unsigned Word */
a094f6
+    case 779:		/* Modulo Signed Word */
a094f6
       record_full_arch_list_add_reg (regcache,
a094f6
 				     tdep->ppc_gp0_regnum + PPC_RT (insn));
a094f6
       return 0;
a094f6
@@ -4299,6 +4436,16 @@
a094f6
     case 844:		/* Load VSX Vector Doubleword*2 Indexed */
a094f6
     case 332:		/* Load VSX Vector Doubleword & Splat Indexed */
a094f6
     case 780:		/* Load VSX Vector Word*4 Indexed */
a094f6
+    case 268:		/* Load VSX Vector Indexed */
a094f6
+    case 364:		/* Load VSX Vector Word & Splat Indexed */
a094f6
+    case 812:		/* Load VSX Vector Halfword*8 Indexed */
a094f6
+    case 876:		/* Load VSX Vector Byte*16 Indexed */
a094f6
+    case 269:		/* Load VSX Vector with Length */
a094f6
+    case 301:		/* Load VSX Vector Left-justified with Length */
a094f6
+    case 781:		/* Load VSX Scalar as Integer Byte & Zero Indexed */
a094f6
+    case 813:		/* Load VSX Scalar as Integer Halfword & Zero Indexed */
a094f6
+    case 403:		/* Move To VSR Word & Splat */
a094f6
+    case 435:		/* Move To VSR Double Doubleword */
a094f6
       ppc_record_vsr (regcache, tdep, PPC_XT (insn));
a094f6
       return 0;
a094f6
 
a094f6
@@ -4320,6 +4467,10 @@
a094f6
     case 922:		/* Extend Sign Halfword */
a094f6
     case 954:		/* Extend Sign Byte */
a094f6
     case 986:		/* Extend Sign Word */
a094f6
+    case 538:		/* Count Trailing Zeros Word */
a094f6
+    case 570:		/* Count Trailing Zeros Doubleword */
a094f6
+    case 890:		/* Extend-Sign Word and Shift Left Immediate (445) */
a094f6
+    case 890 | 1:	/* Extend-Sign Word and Shift Left Immediate (445) */
a094f6
       if (PPC_RC (insn))
a094f6
 	record_full_arch_list_add_reg (regcache, tdep->ppc_cr_regnum);
a094f6
       record_full_arch_list_add_reg (regcache,
a094f6
@@ -4362,6 +4513,11 @@
a094f6
     case 727:		/* Store Floating-Point Double Indexed */
a094f6
     case 919:		/* Store Floating-Point Double Pair Indexed */
a094f6
     case 983:		/* Store Floating-Point as Integer Word Indexed */
a094f6
+    case 396:		/* Store VSX Vector Indexed */
a094f6
+    case 940:		/* Store VSX Vector Halfword*8 Indexed */
a094f6
+    case 1004:		/* Store VSX Vector Byte*16 Indexed */
a094f6
+    case 909:		/* Store VSX Scalar as Integer Byte Indexed */
a094f6
+    case 941:		/* Store VSX Scalar as Integer Halfword Indexed */
a094f6
       if (ext == 694 || ext == 726 || ext == 150 || ext == 214 || ext == 182)
a094f6
 	record_full_arch_list_add_reg (regcache, tdep->ppc_cr_regnum);
a094f6
 
a094f6
@@ -4391,6 +4547,7 @@
a094f6
 	case 135:	/* Store Vector Element Byte Indexed */
a094f6
 	case 215:	/* Store Byte Indexed */
a094f6
 	case 694:	/* Store Byte Conditional Indexed */
a094f6
+	case 909:	/* Store VSX Scalar as Integer Byte Indexed */
a094f6
 	  size = 1;
a094f6
 	  break;
a094f6
 	case 439:	/* Store Halfword with Update Indexed */
a094f6
@@ -4398,6 +4555,7 @@
a094f6
 	case 407:	/* Store Halfword Indexed */
a094f6
 	case 726:	/* Store Halfword Conditional Indexed */
a094f6
 	case 918:	/* Store Halfword Byte-Reverse Indexed */
a094f6
+	case 941:	/* Store VSX Scalar as Integer Halfword Indexed */
a094f6
 	  size = 2;
a094f6
 	  break;
a094f6
 	case 181:	/* Store Doubleword with Update Indexed */
a094f6
@@ -4415,6 +4573,9 @@
a094f6
 	case 231:	/* Store Vector Indexed */
a094f6
 	case 487:	/* Store Vector Indexed LRU */
a094f6
 	case 919:	/* Store Floating-Point Double Pair Indexed */
a094f6
+	case 396:	/* Store VSX Vector Indexed */
a094f6
+	case 940:	/* Store VSX Vector Halfword*8 Indexed */
a094f6
+	case 1004:	/* Store VSX Vector Byte*16 Indexed */
a094f6
 	  size = 16;
a094f6
 	  break;
a094f6
 	default:
a094f6
@@ -4442,6 +4603,38 @@
a094f6
 	return -1;
a094f6
       return 0;
a094f6
 
a094f6
+    case 397:		/* Store VSX Vector with Length */
a094f6
+    case 429:		/* Store VSX Vector Left-justified with Length */
a094f6
+      if (PPC_RA (insn) != 0)
a094f6
+	regcache_raw_read_unsigned (regcache,
a094f6
+				    tdep->ppc_gp0_regnum + PPC_RA (insn), &ea);
a094f6
+      regcache_raw_read_unsigned (regcache,
a094f6
+				  tdep->ppc_gp0_regnum + PPC_RB (insn), &rb);
a094f6
+      /* Store up to 16 bytes.  */
a094f6
+      nb = (rb & 0xff) > 16 ? 16 : (rb & 0xff);
a094f6
+      if (nb > 0)
a094f6
+	record_full_arch_list_add_mem (ea, nb);
a094f6
+      return 0;
a094f6
+
a094f6
+    case 710:		/* Store Word Atomic */
a094f6
+    case 742:		/* Store Doubleword Atomic */
a094f6
+      if (PPC_RA (insn) != 0)
a094f6
+	regcache_raw_read_unsigned (regcache,
a094f6
+				    tdep->ppc_gp0_regnum + PPC_RA (insn), &ea);
a094f6
+      switch (ext)
a094f6
+	{
a094f6
+	case 710:	/* Store Word Atomic */
a094f6
+	  size = 8;
a094f6
+	  break;
a094f6
+	case 742:	/* Store Doubleword Atomic */
a094f6
+	  size = 16;
a094f6
+	  break;
a094f6
+	default:
a094f6
+	  gdb_assert (0);
a094f6
+	}
a094f6
+      record_full_arch_list_add_mem (ea, size);
a094f6
+      return 0;
a094f6
+
a094f6
     case 725:		/* Store String Word Immediate */
a094f6
       ra = 0;
a094f6
       if (PPC_RA (insn) != 0)
a094f6
@@ -4509,6 +4702,7 @@
a094f6
     case 430:		/* Clear BHRB */
a094f6
     case 598:		/* Synchronize */
a094f6
     case 62:		/* Wait for Interrupt */
a094f6
+    case 30:		/* Wait */
a094f6
     case 22:		/* Instruction Cache Block Touch */
a094f6
     case 854:		/* Enforce In-order Execution of I/O */
a094f6
     case 246:		/* Data Cache Block Touch for Store */
a094f6
@@ -4517,6 +4711,8 @@
a094f6
     case 278:		/* Data Cache Block Touch */
a094f6
     case 758:		/* Data Cache Block Allocate */
a094f6
     case 982:		/* Instruction Cache Block Invalidate */
a094f6
+    case 774:		/* Copy */
a094f6
+    case 838:		/* CP_Abort */
a094f6
       return 0;
a094f6
 
a094f6
     case 654:		/* Transaction Begin */
a094f6
@@ -4617,6 +4813,7 @@
a094f6
     case 226:		/* DFP Test Data Group */
a094f6
     case 642:		/* DFP Compare Unordered */
a094f6
     case 674:		/* DFP Test Significance */
a094f6
+    case 675:		/* DFP Test Significance Immediate */
a094f6
       record_full_arch_list_add_reg (regcache, tdep->ppc_cr_regnum);
a094f6
       record_full_arch_list_add_reg (regcache, tdep->ppc_fpscr_regnum);
a094f6
       return 0;
a094f6
@@ -4716,7 +4913,16 @@
a094f6
     case 217:		/* ditto */
a094f6
     case 104:		/* VSX Vector Subtract Double-Precision */
a094f6
     case 72:		/* VSX Vector Subtract Single-Precision */
a094f6
+    case 128:		/* VSX Scalar Maximum Type-C Double-Precision */
a094f6
+    case 136:		/* VSX Scalar Minimum Type-C Double-Precision */
a094f6
+    case 144:		/* VSX Scalar Maximum Type-J Double-Precision */
a094f6
+    case 152:		/* VSX Scalar Minimum Type-J Double-Precision */
a094f6
+    case 3:		/* VSX Scalar Compare Equal Double-Precision */
a094f6
+    case 11:		/* VSX Scalar Compare Greater Than Double-Precision */
a094f6
+    case 19:		/* VSX Scalar Compare Greater Than or Equal
a094f6
+			   Double-Precision */
a094f6
       record_full_arch_list_add_reg (regcache, tdep->ppc_fpscr_regnum);
a094f6
+      /* FALL-THROUGH */
a094f6
     case 240:		/* VSX Vector Copy Sign Double-Precision */
a094f6
     case 208:		/* VSX Vector Copy Sign Single-Precision */
a094f6
     case 130:		/* VSX Logical AND */
a094f6
@@ -4737,6 +4943,14 @@
a094f6
     case 2 | 0x20:	/* VSX Shift Left Double by Word Immediate (SHW=1) */
a094f6
     case 2 | 0x40:	/* VSX Shift Left Double by Word Immediate (SHW=2) */
a094f6
     case 2 | 0x60:	/* VSX Shift Left Double by Word Immediate (SHW=3) */
a094f6
+    case 216:		/* VSX Vector Insert Exponent Single-Precision */
a094f6
+    case 248:		/* VSX Vector Insert Exponent Double-Precision */
a094f6
+    case 26:		/* VSX Vector Permute */
a094f6
+    case 58:		/* VSX Vector Permute Right-indexed */
a094f6
+    case 213:		/* VSX Vector Test Data Class Single-Precision (DC=0) */
a094f6
+    case 213 | 0x8:	/* VSX Vector Test Data Class Single-Precision (DC=1) */
a094f6
+    case 245:		/* VSX Vector Test Data Class Double-Precision (DC=0) */
a094f6
+    case 245 | 0x8:	/* VSX Vector Test Data Class Double-Precision (DC=1) */
a094f6
       ppc_record_vsr (regcache, tdep, PPC_XT (insn));
a094f6
       return 0;
a094f6
 
a094f6
@@ -4748,6 +4962,7 @@
a094f6
 
a094f6
     case 35:		/* VSX Scalar Compare Unordered Double-Precision */
a094f6
     case 43:		/* VSX Scalar Compare Ordered Double-Precision */
a094f6
+    case 59:		/* VSX Scalar Compare Exponents Double-Precision */
a094f6
       record_full_arch_list_add_reg (regcache, tdep->ppc_cr_regnum);
a094f6
       record_full_arch_list_add_reg (regcache, tdep->ppc_fpscr_regnum);
a094f6
       return 0;
a094f6
@@ -4894,6 +5109,7 @@
a094f6
     case 203:		/* VSX Vector Square Root Double-Precision */
a094f6
     case 139:		/* VSX Vector Square Root Single-Precision */
a094f6
       record_full_arch_list_add_reg (regcache, tdep->ppc_fpscr_regnum);
a094f6
+      /* FALL-THROUGH */
a094f6
     case 345:		/* VSX Scalar Absolute Value Double-Precision */
a094f6
     case 267:		/* VSX Scalar Convert Scalar Single-Precision to
a094f6
 			   Vector Single-Precision format Non-signalling */
a094f6
@@ -4908,9 +5124,15 @@
a094f6
     case 505:		/* VSX Vector Negate Double-Precision */
a094f6
     case 441:		/* VSX Vector Negate Single-Precision */
a094f6
     case 164:		/* VSX Splat Word */
a094f6
+    case 165:		/* VSX Vector Extract Unsigned Word */
a094f6
+    case 181:		/* VSX Vector Insert Word */
a094f6
       ppc_record_vsr (regcache, tdep, PPC_XT (insn));
a094f6
       return 0;
a094f6
 
a094f6
+    case 298:		/* VSX Scalar Test Data Class Single-Precision */
a094f6
+    case 362:		/* VSX Scalar Test Data Class Double-Precision */
a094f6
+      record_full_arch_list_add_reg (regcache, tdep->ppc_fpscr_regnum);
a094f6
+      /* FALL-THROUGH */
a094f6
     case 106:		/* VSX Scalar Test for software Square Root
a094f6
 			   Double-Precision */
a094f6
     case 234:		/* VSX Vector Test for software Square Root
a094f6
@@ -4919,6 +5141,60 @@
a094f6
 			   Single-Precision */
a094f6
       record_full_arch_list_add_reg (regcache, tdep->ppc_cr_regnum);
a094f6
       return 0;
a094f6
+
a094f6
+    case 347:
a094f6
+      switch (PPC_FIELD (insn, 11, 5))
a094f6
+	{
a094f6
+	case 0:		/* VSX Scalar Extract Exponent Double-Precision */
a094f6
+	case 1:		/* VSX Scalar Extract Significand Double-Precision */
a094f6
+          record_full_arch_list_add_reg (regcache,
a094f6
+					 tdep->ppc_gp0_regnum + PPC_RT (insn));
a094f6
+	  return 0;
a094f6
+	case 16:	/* VSX Scalar Convert Half-Precision format to
a094f6
+			   Double-Precision format */
a094f6
+	case 17:	/* VSX Scalar round & Convert Double-Precision format
a094f6
+			   to Half-Precision format */
a094f6
+	  record_full_arch_list_add_reg (regcache, tdep->ppc_fpscr_regnum);
a094f6
+	  ppc_record_vsr (regcache, tdep, PPC_XT (insn));
a094f6
+	  return 0;
a094f6
+	}
a094f6
+      break;
a094f6
+
a094f6
+    case 475:
a094f6
+      switch (PPC_FIELD (insn, 11, 5))
a094f6
+	{
a094f6
+	case 24:	/* VSX Vector Convert Half-Precision format to
a094f6
+			   Single-Precision format */
a094f6
+	case 25:	/* VSX Vector round and Convert Single-Precision format
a094f6
+			   to Half-Precision format */
a094f6
+	  record_full_arch_list_add_reg (regcache, tdep->ppc_fpscr_regnum);
a094f6
+	  /* FALL-THROUGH */
a094f6
+	case 0:		/* VSX Vector Extract Exponent Double-Precision */
a094f6
+	case 1:		/* VSX Vector Extract Significand Double-Precision */
a094f6
+	case 7:		/* VSX Vector Byte-Reverse Halfword */
a094f6
+	case 8:		/* VSX Vector Extract Exponent Single-Precision */
a094f6
+	case 9:		/* VSX Vector Extract Significand Single-Precision */
a094f6
+	case 15:	/* VSX Vector Byte-Reverse Word */
a094f6
+	case 23:	/* VSX Vector Byte-Reverse Doubleword */
a094f6
+	case 31:	/* VSX Vector Byte-Reverse Quadword */
a094f6
+	  ppc_record_vsr (regcache, tdep, PPC_XT (insn));
a094f6
+	  return 0;
a094f6
+	}
a094f6
+      break;
a094f6
+    }
a094f6
+
a094f6
+  switch (ext)
a094f6
+    {
a094f6
+    case 360:		/* VSX Vector Splat Immediate Byte */
a094f6
+      if (PPC_FIELD (insn, 11, 2) == 0)
a094f6
+	{
a094f6
+	  ppc_record_vsr (regcache, tdep, PPC_XT (insn));
a094f6
+	  return 0;
a094f6
+	}
a094f6
+      break;
a094f6
+    case 918:		/* VSX Scalar Insert Exponent Double-Precision */
a094f6
+      ppc_record_vsr (regcache, tdep, PPC_XT (insn));
a094f6
+      return 0;
a094f6
     }
a094f6
 
a094f6
   if (((ext >> 3) & 0x3) == 3)	/* VSX Select */
a094f6
@@ -4932,6 +5208,65 @@
a094f6
   return -1;
a094f6
 }
a094f6
 
a094f6
+/* Parse and record instructions of primary opcode-61 at ADDR.
a094f6
+   Return 0 if successful.  */
a094f6
+
a094f6
+static int
a094f6
+ppc_process_record_op61 (struct gdbarch *gdbarch, struct regcache *regcache,
a094f6
+			   CORE_ADDR addr, uint32_t insn)
a094f6
+{
a094f6
+  struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
a094f6
+  ULONGEST ea = 0;
a094f6
+  int size;
a094f6
+
a094f6
+  switch (insn & 0x3)
a094f6
+    {
a094f6
+    case 0:		/* Store Floating-Point Double Pair */
a094f6
+    case 2:		/* Store VSX Scalar Doubleword */
a094f6
+    case 3:		/* Store VSX Scalar Single */
a094f6
+      if (PPC_RA (insn) != 0)
a094f6
+	regcache_raw_read_unsigned (regcache,
a094f6
+				    tdep->ppc_gp0_regnum + PPC_RA (insn),
a094f6
+				    &ea);
a094f6
+      ea += PPC_DS (insn) << 2;
a094f6
+      switch (insn & 0x3)
a094f6
+	{
a094f6
+	case 0:		/* Store Floating-Point Double Pair */
a094f6
+	  size = 16;
a094f6
+	  break;
a094f6
+	case 2:		/* Store VSX Scalar Doubleword */
a094f6
+	  size = 8;
a094f6
+	  break;
a094f6
+	case 3:		/* Store VSX Scalar Single */
a094f6
+	  size = 4;
a094f6
+	  break;
a094f6
+	default:
a094f6
+	  gdb_assert (0);
a094f6
+	}
a094f6
+      record_full_arch_list_add_mem (ea, size);
a094f6
+      return 0;
a094f6
+    }
a094f6
+
a094f6
+  switch (insn & 0x7)
a094f6
+    {
a094f6
+    case 1:		/* Load VSX Vector */
a094f6
+      ppc_record_vsr (regcache, tdep, PPC_XT (insn));
a094f6
+      return 0;
a094f6
+    case 5:		/* Store VSX Vector */
a094f6
+      if (PPC_RA (insn) != 0)
a094f6
+	regcache_raw_read_unsigned (regcache,
a094f6
+				    tdep->ppc_gp0_regnum + PPC_RA (insn),
a094f6
+				    &ea);
a094f6
+      ea += PPC_DQ (insn) << 4;
a094f6
+      record_full_arch_list_add_mem (ea, 16);
a094f6
+      return 0;
a094f6
+    }
a094f6
+
a094f6
+  fprintf_unfiltered (gdb_stdlog, "Warning: Don't know how to record %08x "
a094f6
+		      "at %s.\n", insn, paddress (gdbarch, addr));
a094f6
+  return -1;
a094f6
+}
a094f6
+
a094f6
 /* Parse and record instructions of primary opcode-63 at ADDR.
a094f6
    Return 0 if successful.  */
a094f6
 
a094f6
@@ -4970,6 +5305,16 @@
a094f6
 	record_full_arch_list_add_reg (regcache, tdep->ppc_cr_regnum);
a094f6
     }
a094f6
 
a094f6
+  switch (ext & 0xff)
a094f6
+    {
a094f6
+    case 5:		/* VSX Scalar Round to Quad-Precision Integer */
a094f6
+    case 37:		/* VSX Scalar Round Quad-Precision to Double-Extended
a094f6
+			   Precision */
a094f6
+      record_full_arch_list_add_reg (regcache, tdep->ppc_fpscr_regnum);
a094f6
+      ppc_record_vsr (regcache, tdep, PPC_VRT (insn) + 32);
a094f6
+      return 0;
a094f6
+    }
a094f6
+
a094f6
   switch (ext)
a094f6
     {
a094f6
     case 2:		/* DFP Add Quad */
a094f6
@@ -4999,6 +5344,7 @@
a094f6
     case 226:		/* DFP Test Data Group Quad */
a094f6
     case 642:		/* DFP Compare Unordered Quad */
a094f6
     case 674:		/* DFP Test Significance Quad */
a094f6
+    case 675:		/* DFP Test Significance Immediate Quad */
a094f6
       record_full_arch_list_add_reg (regcache, tdep->ppc_cr_regnum);
a094f6
       record_full_arch_list_add_reg (regcache, tdep->ppc_fpscr_regnum);
a094f6
       return 0;
a094f6
@@ -5055,7 +5401,26 @@
a094f6
       record_full_arch_list_add_reg (regcache, tdep->ppc_fpscr_regnum);
a094f6
       return 0;
a094f6
 
a094f6
-    case 583:		/* Move From FPSCR */
a094f6
+    case 583:
a094f6
+      switch (PPC_FIELD (insn, 11, 5))
a094f6
+        {
a094f6
+	  case 1:	/* Move From FPSCR & Clear Enables */
a094f6
+	  case 20:	/* Move From FPSCR Control & set DRN */
a094f6
+	  case 21:	/* Move From FPSCR Control & set DRN Immediate */
a094f6
+	  case 22:	/* Move From FPSCR Control & set RN */
a094f6
+	  case 23:	/* Move From FPSCR Control & set RN Immediate */
a094f6
+	    record_full_arch_list_add_reg (regcache, tdep->ppc_fpscr_regnum);
a094f6
+	  case 0:	/* Move From FPSCR */
a094f6
+	  case 24:	/* Move From FPSCR Lightweight */
a094f6
+	    if (PPC_FIELD (insn, 11, 5) == 0 && PPC_RC (insn))
a094f6
+	      record_full_arch_list_add_reg (regcache, tdep->ppc_cr_regnum);
a094f6
+	    record_full_arch_list_add_reg (regcache,
a094f6
+					   tdep->ppc_fp0_regnum
a094f6
+					   + PPC_FRT (insn));
a094f6
+	    return 0;
a094f6
+        }
a094f6
+      break;
a094f6
+
a094f6
     case 8:		/* Floating Copy Sign */
a094f6
     case 40:		/* Floating Negate */
a094f6
     case 72:		/* Floating Move Register */
a094f6
@@ -5085,6 +5450,10 @@
a094f6
     case 0:		/* Floating Compare Unordered */
a094f6
     case 32:		/* Floating Compare Ordered */
a094f6
     case 64:		/* Move to Condition Register from FPSCR */
a094f6
+    case 132:		/* VSX Scalar Compare Ordered Quad-Precision */
a094f6
+    case 164:		/* VSX Scalar Compare Exponents Quad-Precision */
a094f6
+    case 644:		/* VSX Scalar Compare Unordered Quad-Precision */
a094f6
+    case 708:		/* VSX Scalar Test Data Class Quad-Precision */
a094f6
       record_full_arch_list_add_reg (regcache, tdep->ppc_fpscr_regnum);
a094f6
       /* FALL-THROUGH */
a094f6
     case 128:		/* Floating Test for software Divide */
a094f6
@@ -5092,10 +5461,65 @@
a094f6
       record_full_arch_list_add_reg (regcache, tdep->ppc_cr_regnum);
a094f6
       return 0;
a094f6
 
a094f6
+    case 4:		/* VSX Scalar Add Quad-Precision */
a094f6
+    case 36:		/* VSX Scalar Multiply Quad-Precision */
a094f6
+    case 388:		/* VSX Scalar Multiply-Add Quad-Precision */
a094f6
+    case 420:		/* VSX Scalar Multiply-Subtract Quad-Precision */
a094f6
+    case 452:		/* VSX Scalar Negative Multiply-Add Quad-Precision */
a094f6
+    case 484:		/* VSX Scalar Negative Multiply-Subtract
a094f6
+			   Quad-Precision */
a094f6
+    case 516:		/* VSX Scalar Subtract Quad-Precision */
a094f6
+    case 548:		/* VSX Scalar Divide Quad-Precision */
a094f6
+      record_full_arch_list_add_reg (regcache, tdep->ppc_fpscr_regnum);
a094f6
+      /* FALL-THROUGH */
a094f6
+    case 100:		/* VSX Scalar Copy Sign Quad-Precision */
a094f6
+    case 868:		/* VSX Scalar Insert Exponent Quad-Precision */
a094f6
+      ppc_record_vsr (regcache, tdep, PPC_VRT (insn) + 32);
a094f6
+      return 0;
a094f6
+
a094f6
+    case 804:
a094f6
+      switch (PPC_FIELD (insn, 11, 5))
a094f6
+	{
a094f6
+	case 27:	/* VSX Scalar Square Root Quad-Precision */
a094f6
+	  record_full_arch_list_add_reg (regcache, tdep->ppc_fpscr_regnum);
a094f6
+	  /* FALL-THROUGH */
a094f6
+	case 0:		/* VSX Scalar Absolute Quad-Precision */
a094f6
+	case 2:		/* VSX Scalar Extract Exponent Quad-Precision */
a094f6
+	case 8:		/* VSX Scalar Negative Absolute Quad-Precision */
a094f6
+	case 16:	/* VSX Scalar Negate Quad-Precision */
a094f6
+	case 18:	/* VSX Scalar Extract Significand Quad-Precision */
a094f6
+	  ppc_record_vsr (regcache, tdep, PPC_VRT (insn) + 32);
a094f6
+	  return 0;
a094f6
+	}
a094f6
+      break;
a094f6
+
a094f6
+    case 836:
a094f6
+      switch (PPC_FIELD (insn, 11, 5))
a094f6
+	{
a094f6
+	case 1:		/* VSX Scalar truncate & Convert Quad-Precision format
a094f6
+			   to Unsigned Word format */
a094f6
+	case 2:		/* VSX Scalar Convert Unsigned Doubleword format to
a094f6
+			   Quad-Precision format */
a094f6
+	case 9:		/* VSX Scalar truncate & Convert Quad-Precision format
a094f6
+			   to Signed Word format */
a094f6
+	case 10:	/* VSX Scalar Convert Signed Doubleword format to
a094f6
+			   Quad-Precision format */
a094f6
+	case 17:	/* VSX Scalar truncate & Convert Quad-Precision format
a094f6
+			   to Unsigned Doubleword format */
a094f6
+	case 20:	/* VSX Scalar round & Convert Quad-Precision format to
a094f6
+			   Double-Precision format */
a094f6
+	case 22:	/* VSX Scalar Convert Double-Precision format to
a094f6
+			   Quad-Precision format */
a094f6
+	case 25:	/* VSX Scalar truncate & Convert Quad-Precision format
a094f6
+			   to Signed Doubleword format */
a094f6
+	  record_full_arch_list_add_reg (regcache, tdep->ppc_fpscr_regnum);
a094f6
+	  ppc_record_vsr (regcache, tdep, PPC_VRT (insn) + 32);
a094f6
+	  return 0;
a094f6
+	}
a094f6
     }
a094f6
 
a094f6
   fprintf_unfiltered (gdb_stdlog, "Warning: Don't know how to record %08x "
a094f6
-		      "at %s, 59-%d.\n", insn, paddress (gdbarch, addr), ext);
a094f6
+		      "at %s, 63-%d.\n", insn, paddress (gdbarch, addr), ext);
a094f6
   return -1;
a094f6
 }
a094f6
 
a094f6
@@ -5308,12 +5732,21 @@
a094f6
 	}
a094f6
       break;
a094f6
 
a094f6
-    case 57:		/* Load Floating-Point Double Pair */
a094f6
-      if (PPC_FIELD (insn, 30, 2) != 0)
a094f6
-	goto UNKNOWN_OP;
a094f6
-      tmp = tdep->ppc_fp0_regnum + (PPC_RT (insn) & ~1);
a094f6
-      record_full_arch_list_add_reg (regcache, tmp);
a094f6
-      record_full_arch_list_add_reg (regcache, tmp + 1);
a094f6
+    case 57:
a094f6
+      switch (insn & 0x3)
a094f6
+        {
a094f6
+	case 0:		/* Load Floating-Point Double Pair */
a094f6
+	  tmp = tdep->ppc_fp0_regnum + (PPC_RT (insn) & ~1);
a094f6
+	  record_full_arch_list_add_reg (regcache, tmp);
a094f6
+	  record_full_arch_list_add_reg (regcache, tmp + 1);
a094f6
+	  break;
a094f6
+	case 2:		/* Load VSX Scalar Doubleword */
a094f6
+	case 3:		/* Load VSX Scalar Single */
a094f6
+	  ppc_record_vsr (regcache, tdep, PPC_VRT (insn) + 32);
a094f6
+	  break;
a094f6
+	default:
a094f6
+	  goto UNKNOWN_OP;
a094f6
+	}
a094f6
       break;
a094f6
 
a094f6
     case 58:		/* Load Doubleword */
a094f6
@@ -5339,7 +5772,11 @@
a094f6
 	return -1;
a094f6
       break;
a094f6
 
a094f6
-    case 61:		/* Store Floating-Point Double Pair */
a094f6
+    case 61:
a094f6
+      if (ppc_process_record_op61 (gdbarch, regcache, addr, insn) != 0)
a094f6
+	return -1;
a094f6
+      break;
a094f6
+
a094f6
     case 62:		/* Store Doubleword */
a094f6
 			/* Store Doubleword with Update */
a094f6
 			/* Store Quadword with Update */
a094f6
@@ -5348,7 +5785,7 @@
a094f6
 	  int size;
a094f6
 	  int sub2 = PPC_FIELD (insn, 30, 2);
a094f6
 
a094f6
-	  if ((op6 == 61 && sub2 != 0) || (op6 == 62 && sub2 > 2))
a094f6
+	  if (sub2 > 2)
a094f6
 	    goto UNKNOWN_OP;
a094f6
 
a094f6
 	  if (PPC_RA (insn) != 0)
a094f6
@@ -5356,7 +5793,7 @@
a094f6
 					tdep->ppc_gp0_regnum + PPC_RA (insn),
a094f6
 					&addr);
a094f6
 
a094f6
-	  size = ((op6 == 61) || sub2 == 2) ? 16 : 8;
a094f6
+	  size = (sub2 == 2) ? 16 : 8;
a094f6
 
a094f6
 	  addr += PPC_DS (insn) << 2;
a094f6
 	  if (record_full_arch_list_add_mem (addr, size) != 0)