PowerPC: Add support for RFC02657 - AES acceleration, instructions

Message ID afd20b95-9e30-499d-bbcf-d688de380194@linux.ibm.com
State New
Headers
Series PowerPC: Add support for RFC02657 - AES acceleration, instructions |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_binutils_build--master-arm success Build passed
linaro-tcwg-bot/tcwg_binutils_build--master-aarch64 success Build passed
linaro-tcwg-bot/tcwg_binutils_check--master-aarch64 success Test passed
linaro-tcwg-bot/tcwg_binutils_check--master-arm success Test passed

Commit Message

Surya Kumari Jangala Dec. 18, 2024, 1:26 p.m. UTC
  PowerPC: Add support for RFC02657 - AES acceleration instructions

opcodes/
	* ppc-opc.c (insert_m, extract_m): New functions.
	(AESM, P, XX2M, XX3M, XX3GF, XX2AES_MASK, XX2AESM_MASK,
	XX3AES_MASK, XX3AESM_MASK, XX3GF_MASK, XX3GFP_MASK): New macros.
	(UIM): Update for new macros.
	(powerpc_opcodes): Add xxaes128encp, xxaes192encp, xxaes256encp,
	xxaesencp, xxaes128decp, xxaes192decp, xxaes256decp, xxaesdecp,
	xxaes128genlkp, xxaes192genlkp, xxaes256genlkp, xxaesgenlkp,
	xxgfmul128gcm, xxgfmul128xts, xxgfmul128.

gas/
	* testsuite/gas/ppc/future.s: New test.
	* testsuite/gas/ppc/future.d: Likewise.
---
 gas/testsuite/gas/ppc/future.d | 22 ++++++++++
 gas/testsuite/gas/ppc/future.s | 22 ++++++++++
 opcodes/ppc-opc.c              | 78 +++++++++++++++++++++++++++++++++-
 3 files changed, 121 insertions(+), 1 deletion(-)
  

Comments

Jan Beulich Dec. 24, 2024, 7:30 a.m. UTC | #1
On 18.12.2024 14:26, Surya Kumari Jangala wrote:
> @@ -9389,6 +9444,16 @@ const struct powerpc_opcode powerpc_opcodes[] = {
>  {"xsnegdp",	XX2(60,377),	XX2_MASK,    PPCVSX,	PPCVLE,		{XT6, XB6}},
>  {"xvmaxsp",	XX3(60,192),	XX3_MASK,    PPCVSX,	PPCVLE,		{XT6, XA6, XB6}},
>  {"xvnmaddasp",	XX3(60,193),	XX3_MASK,    PPCVSX,	PPCVLE,		{XT6, XA6, XB6}},
> +
> +{"xxaes128encp",XX3M(60,194,0,0),XX3AESM_MASK,  PPCVSX,	PPCVLE|EXT,	{XTP, XA5p, XB5p}},
> +{"xxaes192encp",XX3M(60,194,0,1),XX3AESM_MASK,  PPCVSX,	PPCVLE|EXT,	{XTP, XA5p, XB5p}},
> +{"xxaes256encp",XX3M(60,194,1,0),XX3AESM_MASK,  PPCVSX,	PPCVLE|EXT,	{XTP, XA5p, XB5p}},
> +{"xxaesencp",	XX3M(60,194,0,0),XX3AES_MASK,   PPCVSX,	PPCVLE,		{XTP, XA5p, XB5p, AESM}},
> +{"xxaes128decp",XX3M(60,202,0,0),XX3AESM_MASK,  PPCVSX,	PPCVLE|EXT,	{XTP, XA5p, XB5p}},
> +{"xxaes192decp",XX3M(60,202,0,1),XX3AESM_MASK,  PPCVSX,	PPCVLE|EXT,	{XTP, XA5p, XB5p}},
> +{"xxaes256decp",XX3M(60,202,1,0),XX3AESM_MASK,  PPCVSX,	PPCVLE|EXT,	{XTP, XA5p, XB5p}},
> +{"xxaesdecp",	XX3M(60,202,0,0),XX3AES_MASK,   PPCVSX,	PPCVLE,		{XTP, XA5p, XB5p, AESM}},
> +
>  {"xvcvspuxds",	XX2(60,392),	XX2_MASK,    PPCVSX,	PPCVLE,		{XT6, XB6}},
>  {"xvcvdpsp",	XX2(60,393),	XX2_MASK,    PPCVSX,	PPCVLE,		{XT6, XB6}},
>  {"xvminsp",	XX3(60,200),	XX3_MASK,    PPCVSX,	PPCVLE,		{XT6, XA6, XB6}},
> @@ -9398,11 +9463,22 @@ const struct powerpc_opcode powerpc_opcodes[] = {
>  {"xvmovsp",	XX3(60,208),	XX3_MASK,    PPCVSX,	PPCVLE|EXT,	{XT6, XAB6}},
>  {"xvcpsgnsp",	XX3(60,208),	XX3_MASK,    PPCVSX,	PPCVLE,		{XT6, XA6, XB6}},
>  {"xvnmsubasp",	XX3(60,209),	XX3_MASK,    PPCVSX,	PPCVLE,		{XT6, XA6, XB6}},
> +
> +{"xxaes128genlkp",XX2M(60,420,0,0),XX2AESM_MASK, PPCVSX, PPCVLE|EXT,	{XTP, XB5p}},
> +{"xxaes192genlkp",XX2M(60,420,0,1),XX2AESM_MASK, PPCVSX, PPCVLE|EXT,	{XTP, XB5p}},
> +{"xxaes256genlkp",XX2M(60,420,1,0),XX2AESM_MASK, PPCVSX, PPCVLE|EXT,	{XTP, XB5p}},
> +{"xxaesgenlkp",   XX2M(60,420,0,0),XX2AES_MASK,  PPCVSX, PPCVLE,	{XTP, XB5p, AESM}},
> +
>  {"xvcvuxdsp",	XX2(60,424),	XX2_MASK,    PPCVSX,	PPCVLE,		{XT6, XB6}},
>  {"xvnabssp",	XX2(60,425),	XX2_MASK,    PPCVSX,	PPCVLE,		{XT6, XB6}},
>  {"xvtstdcsp",	XX2(60,426),  XX2DCMXS_MASK, PPCVSX3,	PPCVLE,		{XT6, XB6, DCMXS}},
>  {"xviexpsp",	XX3(60,216),	XX3_MASK,    PPCVSX3,	PPCVLE,		{XT6, XA6, XB6}},
>  {"xvnmsubmsp",	XX3(60,217),	XX3_MASK,    PPCVSX,	PPCVLE,		{XT6, XA6, XB6}},
> +
> +{"xxgfmul128gcm",XX3GF(60,26,3,0),  XX3GFP_MASK, PPCVSX,	PPCVLE|EXT,	{XT6, XA6, XB6}},
> +{"xxgfmul128xts",XX3GF(60,26,3,1),  XX3GFP_MASK, PPCVSX,	PPCVLE|EXT,	{XT6, XA6, XB6}},
> +{"xxgfmul128",	 XX3GF(60,26,3,0),  XX3GF_MASK,  PPCVSX,	PPCVLE,		{XT6, XA6, XB6, P}},

Shouldn't all of these additions be PPCVSXF, like the RFC02677 and RFC02680
had it?

Jan
  
Peter Bergner Dec. 24, 2024, 8:42 p.m. UTC | #2
On 12/24/24 1:30 AM, Jan Beulich wrote:
> On 18.12.2024 14:26, Surya Kumari Jangala wrote:
[snip]
>> +{"xxgfmul128gcm",XX3GF(60,26,3,0),  XX3GFP_MASK, PPCVSX,	PPCVLE|EXT,	{XT6, XA6, XB6}},
>> +{"xxgfmul128xts",XX3GF(60,26,3,1),  XX3GFP_MASK, PPCVSX,	PPCVLE|EXT,	{XT6, XA6, XB6}},
>> +{"xxgfmul128",	 XX3GF(60,26,3,0),  XX3GF_MASK,  PPCVSX,	PPCVLE,		{XT6, XA6, XB6, P}},
> 
> Shouldn't all of these additions be PPCVSXF, like the RFC02677 and RFC02680
> had it?

Correct, all of these new mnemonics should be conditional on PPCVSXF.
Good catch and thanks.

Peter
  
Peter Bergner Jan. 6, 2025, 8:47 p.m. UTC | #3
On 12/18/24 7:26 AM, Surya Kumari Jangala wrote:
> PowerPC: Add support for RFC02657 - AES acceleration instructions
> 
> opcodes/
> 	* ppc-opc.c (insert_m, extract_m): New functions.

Let's change the names to insert_m2 and extract_m2.  We sometimes have
multiple operand fields with the same "name", but different sizes, so
we normally tack on the field size to the name to disambiguate them.





> +static uint64_t
> +insert_m (uint64_t insn,
> +	  int64_t value,
> +	  ppc_cpu_t dialect ATTRIBUTE_UNUSED,
> +	  const char **errmsg)
> +{
> +  if (value!= 0 && value != 1 && value != 2)

Missing space ^


> +    *errmsg = _("invalid M value");
> +  return insn | ((value & 0x2) << (16 - 1)) | ((value & 0x1) << 11);
> +}

Please replace the (16 - 1) with just 15, like you did in the extract
function.



> +static int64_t
> +extract_m (uint64_t insn,
> +	   ppc_cpu_t dialect ATTRIBUTE_UNUSED,
> +	   int *invalid)
> +{
> +  int64_t value = ((insn >> 11) & 1) | ((insn >> 15) & 2);

Let's use 0x1/0x2 rather than 1/2 to match the bitmask values we used
in the insert function, just to be consistent.  I know we aren't always
consistent. :-(

Also, let's swap the order of sub-expressions so that the MSB is on the
left and the LSB on the right.  Like so:

  int64_t value = ((insn >> 15) & 0x2) | ((insn >> 11) & 0x1);



> +  if (value != 0 && value != 1 && value != 2)
> +    *invalid = 1;
> +  return value;
> +}

Let's change this to just "if (value == 3)" here, since given how we
computed value, it can only contain the values 0, 1, 2 or 3.  That's not
the case for the insert_m2 function, so I'm fine leaving that test as
is, since value could be be any 64-bit signed value there.




> +#define AESM DMEX + 1
> +  { 0x3, PPC_OPSHIFT_INV, insert_m, extract_m, 0 },

Needs updating to the new insert_m2 and extract_m2 names.
It also needs a comment.  Something like:

  /* The 2-bit M field in an AES XX2/XX3 form instruction.  This is split.  */




> +  /* The P field in Galois Field XX3 form instruction.  */
> +#define P yx
>    { 0x1, 8, NULL, NULL, 0 },

Similarly, let's change this to P1.



> +/* An XX2 form instruction with the M bits specified.  */
> +#define XX2M(op, xop, m0, m1)			\
> +  (XX2 (op, xop)				\
> +   | (((uint64_t)(m0) & 1) << 16)		\
> +   | (((uint64_t)(m1) & 1) << 11))

m0 and m1 only exist in the insn's encoding, so let's use one 2-bit
m operand rather than 2 1-bit m0 and m1 operands, so it matches the
mnemonic description.




> +#define XX3M(op, xop, m0, m1)			\
> +  (XX3 (op, xop)				\
> +   | (((uint64_t)(m0) & 1) << 16)		\
> +   | (((uint64_t)(m1) & 1) << 11))

Ditto.



> +/* The masks for XX2 AES instructions with m0, m1 bits.  */
> +#define XX2AES_MASK (XX2M (0x3f, 0x1ff, 0, 0) | (0xf << 17) | 1)
> +#define XX2AESM_MASK (XX2AES_MASK | (1 << 16) | (1 << 11))
> +
> +/* The masks for XX3 AES instructions with m0, m1 bits.  */
> +#define XX3AES_MASK (XX3M (0x3f, 0xff, 0, 0) | 1)
> +#define XX3AESM_MASK (XX3AES_MASK | (1 << 16) | (1 << 11))

...which means these need updating.




> +#define XX3GF_MASK (XX3 (0x3f, 0x1f) | (3 << 9))

This is exactly a XX3_MASK minus the P bit, so I think it's better
written as:

#define XX3GF_MASK (XX3 (0x3f, 0xff) & ~(1 << 8))


> +#define XX3GFP_MASK (XX3GF_MASK | (1 << 8))

...which means this is exactly a XX3_MASK, so this mask isn't needed.




> +{"xxaes128encp",XX3M(60,194,0,0),XX3AESM_MASK,  PPCVSX,	PPCVLE|EXT,	{XTP, XA5p, XB5p}},
[snip]

As Jan mentioned, these should all be enabled with the PPCVSXF mask instead of PPCVSX.
Otherwise, these will all be enabled for -mpower7 and later.


Thanks for working on this!

Peter
  

Patch

diff --git a/gas/testsuite/gas/ppc/future.d b/gas/testsuite/gas/ppc/future.d
index d639e8c618f..76a30a50316 100644
--- a/gas/testsuite/gas/ppc/future.d
+++ b/gas/testsuite/gas/ppc/future.d
@@ -35,4 +35,26 @@  Disassembly of section \.text:
 .*:	(d8 1d 22 f0|f0 22 1d d8) 	xvmulhsh vs1,vs2,vs3
 .*:	(90 b3 95 f2|f2 95 b3 90) 	xvmulhuw vs20,vs21,vs22
 .*:	(d6 a3 8a f2|f2 8a a3 d6) 	xvmulhuh vs20,vs42,vs52
+.*:	(10 36 44 f0|f0 44 36 10) 	xxaes128encp vs2,vs4,vs6
+.*:	(10 36 44 f0|f0 44 36 10) 	xxaes128encp vs2,vs4,vs6
+.*:	(12 2e 44 f0|f0 44 2e 12) 	xxaes192encp vs2,vs4,vs36
+.*:	(12 2e 44 f0|f0 44 2e 12) 	xxaes192encp vs2,vs4,vs36
+.*:	(16 26 23 f0|f0 23 26 16) 	xxaes256encp vs32,vs34,vs36
+.*:	(16 26 23 f0|f0 23 26 16) 	xxaes256encp vs32,vs34,vs36
+.*:	(50 36 44 f0|f0 44 36 50) 	xxaes128decp vs2,vs4,vs6
+.*:	(50 36 44 f0|f0 44 36 50) 	xxaes128decp vs2,vs4,vs6
+.*:	(52 2e 44 f0|f0 44 2e 52) 	xxaes192decp vs2,vs4,vs36
+.*:	(52 2e 44 f0|f0 44 2e 52) 	xxaes192decp vs2,vs4,vs36
+.*:	(56 26 23 f0|f0 23 26 56) 	xxaes256decp vs32,vs34,vs36
+.*:	(56 26 23 f0|f0 23 26 56) 	xxaes256decp vs32,vs34,vs36
+.*:	(90 96 00 f2|f2 00 96 90) 	xxaes128genlkp vs16,vs18
+.*:	(90 96 00 f2|f2 00 96 90) 	xxaes128genlkp vs16,vs18
+.*:	(92 9e 20 f1|f1 20 9e 92) 	xxaes192genlkp vs40,vs50
+.*:	(92 9e 20 f1|f1 20 9e 92) 	xxaes192genlkp vs40,vs50
+.*:	(92 b6 81 f2|f2 81 b6 92) 	xxaes256genlkp vs20,vs54
+.*:	(92 b6 81 f2|f2 81 b6 92) 	xxaes256genlkp vs20,vs54
+.*:	(d0 1e 22 f0|f0 22 1e d0) 	xxgfmul128gcm vs1,vs2,vs3
+.*:	(d0 1e 22 f0|f0 22 1e d0) 	xxgfmul128gcm vs1,vs2,vs3
+.*:	(d6 0f e0 f3|f3 e0 0f d6) 	xxgfmul128xts vs31,vs32,vs33
+.*:	(d6 0f e0 f3|f3 e0 0f d6) 	xxgfmul128xts vs31,vs32,vs33
 #pass
diff --git a/gas/testsuite/gas/ppc/future.s b/gas/testsuite/gas/ppc/future.s
index 9abf6b3de7b..fec99e348bf 100644
--- a/gas/testsuite/gas/ppc/future.s
+++ b/gas/testsuite/gas/ppc/future.s
@@ -27,3 +27,25 @@  _start:
 	xvmulhsh 1,2,3
 	xvmulhuw 20,21,22
 	xvmulhuh 20,42,52
+	xxaesencp 2, 4, 6, 0
+	xxaes128encp 2, 4, 6
+	xxaesencp 2, 4, 36, 1
+	xxaes192encp 2, 4, 36
+	xxaesencp 32, 34, 36, 2
+	xxaes256encp 32, 34, 36
+	xxaesdecp 2, 4, 6, 0
+	xxaes128decp 2, 4, 6
+	xxaesdecp 2, 4, 36, 1
+	xxaes192decp 2, 4, 36
+	xxaesdecp 32, 34, 36, 2
+	xxaes256decp 32, 34, 36
+	xxaesgenlkp 16, 18, 0
+	xxaes128genlkp 16, 18
+	xxaesgenlkp 40, 50, 1
+	xxaes192genlkp 40, 50
+	xxaesgenlkp 20, 54, 2
+	xxaes256genlkp 20, 54
+	xxgfmul128 1, 2, 3, 0
+	xxgfmul128gcm 1, 2, 3
+	xxgfmul128 31, 32, 33, 1
+	xxgfmul128xts 31, 32, 33
diff --git a/opcodes/ppc-opc.c b/opcodes/ppc-opc.c
index 568a3d6d8f0..fabf56a2526 100644
--- a/opcodes/ppc-opc.c
+++ b/opcodes/ppc-opc.c
@@ -2392,6 +2392,28 @@  extract_dm (uint64_t insn,
   return (value) ? 1 : 0;
 }
 
+static uint64_t
+insert_m (uint64_t insn,
+	  int64_t value,
+	  ppc_cpu_t dialect ATTRIBUTE_UNUSED,
+	  const char **errmsg)
+{
+  if (value!= 0 && value != 1 && value != 2)
+    *errmsg = _("invalid M value");
+  return insn | ((value & 0x2) << (16 - 1)) | ((value & 0x1) << 11);
+}
+
+static int64_t
+extract_m (uint64_t insn,
+	   ppc_cpu_t dialect ATTRIBUTE_UNUSED,
+	   int *invalid)
+{
+  int64_t value = ((insn >> 11) & 1) | ((insn >> 15) & 2);
+  if (value != 0 && value != 1 && value != 2)
+    *invalid = 1;
+  return value;
+}
+
 /* The VLESIMM field in an I16A form instruction.  This is split.  */
 
 static uint64_t
@@ -3887,8 +3909,12 @@  const struct powerpc_operand powerpc_operands[] =
 #define DMEX DM + 1
   { 0x3, 8, insert_dm, extract_dm, 0 },
 
+#define AESM DMEX + 1
+  { 0x3, PPC_OPSHIFT_INV, insert_m, extract_m, 0 },
+
+
   /* The UIM field in an XX2 form instruction.  */
-#define UIM DMEX + 1
+#define UIM AESM + 1
   /* The 2-bit UIMM field in a VX form instruction.  */
 #define UIMM2 UIM
   /* The 2-bit L field in a darn instruction.  */
@@ -3943,6 +3969,8 @@  const struct powerpc_operand powerpc_operands[] =
 
 #define ms vs + 1
 #define yx ms
+  /* The P field in Galois Field XX3 form instruction.  */
+#define P yx
   { 0x1, 8, NULL, NULL, 0 },
 
 #define SVLcr ms + 1
@@ -4467,6 +4495,12 @@  const unsigned int num_powerpc_operands = ARRAY_SIZE (powerpc_operands);
 /* A XX2 form instruction with the VA bits specified.  */
 #define XX2VA(op, xop, vaop) (XX2(op,xop) | (((vaop) & 0x1f) << 16))
 
+/* An XX2 form instruction with the M bits specified.  */
+#define XX2M(op, xop, m0, m1)			\
+  (XX2 (op, xop)				\
+   | (((uint64_t)(m0) & 1) << 16)		\
+   | (((uint64_t)(m1) & 1) << 11))
+
 /* An XX3 form instruction.  */
 #define XX3(op, xop) (OP (op) | ((((uint64_t)(xop)) & 0xff) << 3))
 
@@ -4476,6 +4510,16 @@  const unsigned int num_powerpc_operands = ARRAY_SIZE (powerpc_operands);
    | (((uint64_t)(rc) & 1) << 10)		\
    | ((((uint64_t)(xop)) & 0x7f) << 3))
 
+#define XX3M(op, xop, m0, m1)			\
+  (XX3 (op, xop)				\
+   | (((uint64_t)(m0) & 1) << 16)		\
+   | (((uint64_t)(m1) & 1) << 11))
+
+#define XX3GF(op, xop, xop1, p)			\
+  (XX3 (op, xop)				\
+   | (((uint64_t)(xop1) & 3) << 9)		\
+   | (((uint64_t)(p) & 1) << 8))
+
 /* An XX4 form instruction.  */
 #define XX4(op, xop) (OP (op) | ((((uint64_t)(xop)) & 0x3) << 4))
 
@@ -4565,6 +4609,17 @@  const unsigned int num_powerpc_operands = ARRAY_SIZE (powerpc_operands);
 #define XX2DMR_MASK (XX2ACC_MASK | (0xf << 17))
 #define XX3GERX_MASK (XX3ACC_MASK | (1 << 16))
 
+/* The masks for XX2 AES instructions with m0, m1 bits.  */
+#define XX2AES_MASK (XX2M (0x3f, 0x1ff, 0, 0) | (0xf << 17) | 1)
+#define XX2AESM_MASK (XX2AES_MASK | (1 << 16) | (1 << 11))
+
+/* The masks for XX3 AES instructions with m0, m1 bits.  */
+#define XX3AES_MASK (XX3M (0x3f, 0xff, 0, 0) | 1)
+#define XX3AESM_MASK (XX3AES_MASK | (1 << 16) | (1 << 11))
+
+#define XX3GF_MASK (XX3 (0x3f, 0x1f) | (3 << 9))
+#define XX3GFP_MASK (XX3GF_MASK | (1 << 8))
+
 /* The mask for an XX4 form instruction.  */
 #define XX4_MASK XX4 (0x3f, 0x3)
 
@@ -9389,6 +9444,16 @@  const struct powerpc_opcode powerpc_opcodes[] = {
 {"xsnegdp",	XX2(60,377),	XX2_MASK,    PPCVSX,	PPCVLE,		{XT6, XB6}},
 {"xvmaxsp",	XX3(60,192),	XX3_MASK,    PPCVSX,	PPCVLE,		{XT6, XA6, XB6}},
 {"xvnmaddasp",	XX3(60,193),	XX3_MASK,    PPCVSX,	PPCVLE,		{XT6, XA6, XB6}},
+
+{"xxaes128encp",XX3M(60,194,0,0),XX3AESM_MASK,  PPCVSX,	PPCVLE|EXT,	{XTP, XA5p, XB5p}},
+{"xxaes192encp",XX3M(60,194,0,1),XX3AESM_MASK,  PPCVSX,	PPCVLE|EXT,	{XTP, XA5p, XB5p}},
+{"xxaes256encp",XX3M(60,194,1,0),XX3AESM_MASK,  PPCVSX,	PPCVLE|EXT,	{XTP, XA5p, XB5p}},
+{"xxaesencp",	XX3M(60,194,0,0),XX3AES_MASK,   PPCVSX,	PPCVLE,		{XTP, XA5p, XB5p, AESM}},
+{"xxaes128decp",XX3M(60,202,0,0),XX3AESM_MASK,  PPCVSX,	PPCVLE|EXT,	{XTP, XA5p, XB5p}},
+{"xxaes192decp",XX3M(60,202,0,1),XX3AESM_MASK,  PPCVSX,	PPCVLE|EXT,	{XTP, XA5p, XB5p}},
+{"xxaes256decp",XX3M(60,202,1,0),XX3AESM_MASK,  PPCVSX,	PPCVLE|EXT,	{XTP, XA5p, XB5p}},
+{"xxaesdecp",	XX3M(60,202,0,0),XX3AES_MASK,   PPCVSX,	PPCVLE,		{XTP, XA5p, XB5p, AESM}},
+
 {"xvcvspuxds",	XX2(60,392),	XX2_MASK,    PPCVSX,	PPCVLE,		{XT6, XB6}},
 {"xvcvdpsp",	XX2(60,393),	XX2_MASK,    PPCVSX,	PPCVLE,		{XT6, XB6}},
 {"xvminsp",	XX3(60,200),	XX3_MASK,    PPCVSX,	PPCVLE,		{XT6, XA6, XB6}},
@@ -9398,11 +9463,22 @@  const struct powerpc_opcode powerpc_opcodes[] = {
 {"xvmovsp",	XX3(60,208),	XX3_MASK,    PPCVSX,	PPCVLE|EXT,	{XT6, XAB6}},
 {"xvcpsgnsp",	XX3(60,208),	XX3_MASK,    PPCVSX,	PPCVLE,		{XT6, XA6, XB6}},
 {"xvnmsubasp",	XX3(60,209),	XX3_MASK,    PPCVSX,	PPCVLE,		{XT6, XA6, XB6}},
+
+{"xxaes128genlkp",XX2M(60,420,0,0),XX2AESM_MASK, PPCVSX, PPCVLE|EXT,	{XTP, XB5p}},
+{"xxaes192genlkp",XX2M(60,420,0,1),XX2AESM_MASK, PPCVSX, PPCVLE|EXT,	{XTP, XB5p}},
+{"xxaes256genlkp",XX2M(60,420,1,0),XX2AESM_MASK, PPCVSX, PPCVLE|EXT,	{XTP, XB5p}},
+{"xxaesgenlkp",   XX2M(60,420,0,0),XX2AES_MASK,  PPCVSX, PPCVLE,	{XTP, XB5p, AESM}},
+
 {"xvcvuxdsp",	XX2(60,424),	XX2_MASK,    PPCVSX,	PPCVLE,		{XT6, XB6}},
 {"xvnabssp",	XX2(60,425),	XX2_MASK,    PPCVSX,	PPCVLE,		{XT6, XB6}},
 {"xvtstdcsp",	XX2(60,426),  XX2DCMXS_MASK, PPCVSX3,	PPCVLE,		{XT6, XB6, DCMXS}},
 {"xviexpsp",	XX3(60,216),	XX3_MASK,    PPCVSX3,	PPCVLE,		{XT6, XA6, XB6}},
 {"xvnmsubmsp",	XX3(60,217),	XX3_MASK,    PPCVSX,	PPCVLE,		{XT6, XA6, XB6}},
+
+{"xxgfmul128gcm",XX3GF(60,26,3,0),  XX3GFP_MASK, PPCVSX,	PPCVLE|EXT,	{XT6, XA6, XB6}},
+{"xxgfmul128xts",XX3GF(60,26,3,1),  XX3GFP_MASK, PPCVSX,	PPCVLE|EXT,	{XT6, XA6, XB6}},
+{"xxgfmul128",	 XX3GF(60,26,3,0),  XX3GF_MASK,  PPCVSX,	PPCVLE,		{XT6, XA6, XB6, P}},
+
 {"xvcvsxdsp",	XX2(60,440),	XX2_MASK,    PPCVSX,	PPCVLE,		{XT6, XB6}},
 {"xvnegsp",	XX2(60,441),	XX2_MASK,    PPCVSX,	PPCVLE,		{XT6, XB6}},
 {"xvmaxdp",	XX3(60,224),	XX3_MASK,    PPCVSX,	PPCVLE,		{XT6, XA6, XB6}},