]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Power10 Copy/Paste Extensions
authorPeter Bergner <bergner@linux.ibm.com>
Mon, 11 May 2020 00:00:19 +0000 (09:30 +0930)
committerAlan Modra <amodra@gmail.com>
Mon, 11 May 2020 11:38:36 +0000 (21:08 +0930)
opcodes/
* opcodes/ppc-opc.c (insert_l1opt, extract_l1opt): New functions.
(L1OPT): Define.
(powerpc_opcodes) <paste.>: Add L operand for cpu POWER10.
gas/
* testsuite/gas/ppc/power10.d: Add paste. tests.
* testsuite/gas/ppc/power10.s: Likewise.

gas/ChangeLog
gas/testsuite/gas/ppc/power10.d
gas/testsuite/gas/ppc/power10.s
opcodes/ChangeLog
opcodes/ppc-opc.c

index 14b4c6fdf806655339b565045e0b3abd189c1408..2f1caa7133d4714a7253c3af815d2132a123c548 100644 (file)
@@ -1,3 +1,8 @@
+2020-05-11  Peter Bergner  <bergner@linux.ibm.com>
+
+       * testsuite/gas/ppc/power10.d: Add paste. tests.
+       * testsuite/gas/ppc/power10.s: Likewise.
+
 2020-05-11  Peter Bergner  <bergner@linux.ibm.com>
 
        * testsuite/gas/ppc/power10.s: New test.
index 5d8198da5a21f2e48e3b677cd472585d3cdad354..3fc4b4fb435f37b749202fb79210133c045d12d3 100644 (file)
@@ -10,4 +10,7 @@ Disassembly of section \.text:
 .*:    (7d 40 06 a4|a4 06 40 7d)       slbiag  r10
 .*:    (7d 40 06 a4|a4 06 40 7d)       slbiag  r10
 .*:    (7d 41 06 a4|a4 06 41 7d)       slbiag  r10,1
+.*:    (7c 2a 5f 0d|0d 5f 2a 7c)       paste\.  r10,r11
+.*:    (7c 2a 5f 0d|0d 5f 2a 7c)       paste\.  r10,r11
+.*:    (7c 0a 5f 0d|0d 5f 0a 7c)       paste\.  r10,r11,0
 #pass
index 9e7daf5618a7c44d4077394b13a673e99df5a308..116487c276f54312943519a7ef80ae01ced4071f 100644 (file)
@@ -3,3 +3,6 @@ _start:
        slbiag  10
        slbiag  10,0
        slbiag  10,1
+       paste.  10,11
+       paste.  10,11,1
+       paste.  10,11,0
index 35aba3ded6555684412cd8b89b3851586dc72f0e..4493cb3465e01f69e03da343ee1bfdb42f0cd4f0 100644 (file)
@@ -1,3 +1,9 @@
+2020-05-11  Peter Bergner  <bergner@linux.ibm.com>
+
+       * ppc-opc.c (insert_l1opt, extract_l1opt): New functions.
+       (L1OPT): Define.
+       (powerpc_opcodes) <paste.>: Add L operand for cpu POWER10.
+
 2020-05-11  Peter Bergner  <bergner@linux.ibm.com>
 
        * ppc-opc.c (powerpc_opcodes) <slbiag>: Add variant with L operand.
index 537171861ccf349c0ef563d1f5f3c6e02324e49d..8057f4a9d542fba1856be52d446a7c5ff57d02d8 100644 (file)
@@ -771,6 +771,29 @@ extract_fxm (uint64_t insn,
   return mask;
 }
 
+/* L field in the paste. instruction.  */
+
+static uint64_t
+insert_l1opt (uint64_t insn,
+           int64_t value,
+           ppc_cpu_t dialect ATTRIBUTE_UNUSED,
+           const char **errmsg ATTRIBUTE_UNUSED)
+{
+  return insn | ((value & 1) << 21);
+}
+
+static int64_t
+extract_l1opt (uint64_t insn,
+            ppc_cpu_t dialect ATTRIBUTE_UNUSED,
+            int *invalid)
+{
+  /* Return a value of 1 for a missing optional operand.  */
+  if (*invalid < 0)
+    return 1;
+
+  return (insn >> 21) & 1;
+}
+
 static uint64_t
 insert_li20 (uint64_t insn,
             int64_t value,
@@ -2256,8 +2279,13 @@ const struct powerpc_operand powerpc_operands[] =
 #define HTM_R LOPT
   { 0x1, 21, NULL, NULL, PPC_OPERAND_OPTIONAL },
 
+  /* The optional L field in the paste. instruction. This is similar to LOPT
+     above, but with a default value of 1.  */
+#define L1OPT LOPT + 1
+  { 0x1, 21, insert_l1opt, extract_l1opt, PPC_OPERAND_OPTIONAL },
+
   /* The optional (for 32-bit) L field in cmp[l][i] instructions.  */
-#define L32OPT LOPT + 1
+#define L32OPT L1OPT + 1
   { 0x1, 21, NULL, NULL, PPC_OPERAND_OPTIONAL | PPC_OPERAND_OPTIONAL32 },
 
   /* The L field in dcbf instruction.  */
@@ -7123,7 +7151,8 @@ const struct powerpc_opcode powerpc_opcodes[] = {
 {"extswsli",   XS(31,445,0),   XS_MASK,     POWER9,    0,              {RA, RS, SH6}},
 {"extswsli.",  XS(31,445,1),   XS_MASK,     POWER9,    0,              {RA, RS, SH6}},
 
-{"paste.",     XRCL(31,902,1,1),XRT_MASK,   POWER9,    0,              {RA0, RB}},
+{"paste.",     XRC(31,902,1),  XLRT_MASK,   POWER10,   0,              {RA0, RB, L1OPT}},
+{"paste.",     XRCL(31,902,1,1),XRT_MASK,   POWER9,    POWER10,        {RA0, RB}},
 
 {"stvlxl",     X(31,903),      X_MASK,      CELL,      0,              {VS, RA0, RB}},
 {"stdfcmux",   APU(31,903,0),  APU_MASK,    PPC405,    0,              {FCRT, RA, RB}},