]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
rs6000: Corrections for the AES builtins for powerpc
authorAvinash Jayakar <avinashd@linux.ibm.com>
Thu, 9 Jul 2026 08:15:30 +0000 (13:45 +0530)
committerAvinash Jayakar <avinashd@linux.ibm.com>
Thu, 9 Jul 2026 08:15:30 +0000 (13:45 +0530)
This patch fixes few implementations issues for the AES builtins in
powerpc in documentation, testcases and builtin definition.

2026-07-09  Avinash Jayakar  <avinashd@linux.ibm.com>

gcc/ChangeLog:
* config/rs6000/rs6000-builtins.def: Move AES builtins to future-vsx
stanza.
* doc/extend.texi: Add subheading for AES builtins.

gcc/testsuite/ChangeLog:
* gcc.target/powerpc/aes-builtin-1.c: Add future_compile_ok and lp64
testsuite directive.
* gcc.target/powerpc/aes-builtin-2.c: Add future_compile_ok and lp64
testsuite directive.
* gcc.target/powerpc/aes-builtin-3.c: Add future_compile_ok and lp64
testsuite directive.

gcc/config/rs6000/rs6000-builtins.def
gcc/doc/extend.texi
gcc/testsuite/gcc.target/powerpc/aes-builtin-1.c
gcc/testsuite/gcc.target/powerpc/aes-builtin-2.c
gcc/testsuite/gcc.target/powerpc/aes-builtin-3.c

index 832aa1b2c45f7624ef439150f71b77cd843231ee..85486c70f0d7f3ad2fb033b1d776f3ec2a8764db 100644 (file)
   void __builtin_vsx_stxvp (v256, unsigned long, const v256 *);
     STXVP nothing {mma,pair}
 
-[future]
-  const v256 __builtin_aes_encrypt_paired (v256, v256, const int<2>);
-    XXAESENCP xxaesencp {}
-
-  const v256 __builtin_aes128_encrypt_paired (v256, v256);
-    XXAES128ENCP xxaes128encp {}
-
-  const v256 __builtin_aes192_encrypt_paired (v256, v256);
-    XXAES192ENCP xxaes192encp {}
-
-  const v256 __builtin_aes256_encrypt_paired (v256, v256);
-    XXAES256ENCP xxaes256encp {}
-
-  const v256 __builtin_aes_decrypt_paired (v256, v256, const int<2>);
-    XXAESDECP xxaesdecp {}
-
-  const v256 __builtin_aes128_decrypt_paired (v256, v256);
-    XXAES128DECP xxaes128decp {}
-
-  const v256 __builtin_aes192_decrypt_paired (v256, v256);
-    XXAES192DECP xxaes192decp {}
-
-  const v256 __builtin_aes256_decrypt_paired (v256, v256);
-    XXAES256DECP xxaes256decp {}
-
-  const v256 __builtin_aes_genlastkey_paired (v256, const int<2>);
-    XXAESGENLKP xxaesgenlkp {}
-
-  const v256 __builtin_aes128_genlastkey_paired (v256);
-    XXAES128GENLKP xxaes128genlkp {}
-
-  const v256 __builtin_aes192_genlastkey_paired (v256);
-    XXAES192GENLKP xxaes192genlkp {}
-
-  const v256 __builtin_aes256_genlastkey_paired (v256);
-    XXAES256GENLKP xxaes256genlkp {}
-
-  const vuc __builtin_galois_field_mult (vuc, vuc, const int<1>);
-    XXGFMUL128 xxgfmul128 {}
-
-  const vuc __builtin_galois_field_mult_gcm (vuc, vuc);
-    XXGFMUL128GCM xxgfmul128gcm {}
-
-  const vuc __builtin_galois_field_mult_xts (vuc, vuc);
-    XXGFMUL128XTS xxgfmul128xts {}
-
 [future-vsx]
   const vus __builtin_vsx_xvmulhuh (vus, vus);
     XVMULHUH umulv8hi3_highpart {}
   const vsc __builtin_altivec_unpack_lsn_to_byte (vull);
     VUPKLSNTOB altivec_vupklsntob {}
 
+  const v256 __builtin_aes_encrypt_paired (v256, v256, const int<2>);
+    XXAESENCP xxaesencp {}
+
+  const v256 __builtin_aes128_encrypt_paired (v256, v256);
+    XXAES128ENCP xxaes128encp {}
+
+  const v256 __builtin_aes192_encrypt_paired (v256, v256);
+    XXAES192ENCP xxaes192encp {}
+
+  const v256 __builtin_aes256_encrypt_paired (v256, v256);
+    XXAES256ENCP xxaes256encp {}
+
+  const v256 __builtin_aes_decrypt_paired (v256, v256, const int<2>);
+    XXAESDECP xxaesdecp {}
+
+  const v256 __builtin_aes128_decrypt_paired (v256, v256);
+    XXAES128DECP xxaes128decp {}
+
+  const v256 __builtin_aes192_decrypt_paired (v256, v256);
+    XXAES192DECP xxaes192decp {}
+
+  const v256 __builtin_aes256_decrypt_paired (v256, v256);
+    XXAES256DECP xxaes256decp {}
+
+  const v256 __builtin_aes_genlastkey_paired (v256, const int<2>);
+    XXAESGENLKP xxaesgenlkp {}
+
+  const v256 __builtin_aes128_genlastkey_paired (v256);
+    XXAES128GENLKP xxaes128genlkp {}
+
+  const v256 __builtin_aes192_genlastkey_paired (v256);
+    XXAES192GENLKP xxaes192genlkp {}
+
+  const v256 __builtin_aes256_genlastkey_paired (v256);
+    XXAES256GENLKP xxaes256genlkp {}
+
+  const vuc __builtin_galois_field_mult (vuc, vuc, const int<1>);
+    XXGFMUL128 xxgfmul128 {}
+
+  const vuc __builtin_galois_field_mult_gcm (vuc, vuc);
+    XXGFMUL128GCM xxgfmul128gcm {}
+
+  const vuc __builtin_galois_field_mult_xts (vuc, vuc);
+    XXGFMUL128XTS xxgfmul128xts {}
+
 [future-altivec]
   const vus __builtin_altivec_uncompresshn (vuc, vui);
     VUCMPRHN altivec_vucmprhn {}
index d7dccd863c5315f58eab58e673fd684aa8f6e62f..93c29baa0f535bc907cf4625275eef13ae565dc7 100644 (file)
@@ -26985,6 +26985,8 @@ vector unsigned char);
 The following additional built-in functions are available for the
 PowerPC family of processors, starting with Future ISA.
 
+@subsubheading PowerPC Advanced Encryption Standard (AES) Acceleration Built-in Functions
+
 Future ISA of the PowerPC may add new instructions for accelerating AES
 algorithm. GCC provides support for these new instructions through the
 following built-in functions. The third argument to
index 2777fcdc7ae265306b72827889a529c9d32f3ec4..729ae1ef26db50729769df8218caa938ea9e62dd 100644 (file)
@@ -1,4 +1,6 @@
 /* { dg-do compile } */
+/* { dg-require-effective-target powerpc_future_compile_ok } */
+/* { dg-require-effective-target lp64 } */
 /* { dg-options "-mdejagnu-cpu=future -O2" } */
 
 void
index 98f16ad0fe8e33baec148f470f83602987fa070d..a509f760cd65f13582f2d76df41cf3750d8318a0 100644 (file)
@@ -1,4 +1,6 @@
 /* { dg-do compile } */
+/* { dg-require-effective-target powerpc_future_compile_ok } */
+/* { dg-require-effective-target lp64 } */
 /* { dg-options "-mdejagnu-cpu=future -O2" } */
 
 typedef unsigned char vec_t __attribute__((vector_size(16)));
index 007bf878afb2e8888e1675e4067432d022762c55..bbed43a1e8c3e1661e81b770939b2e2e35c144e4 100644 (file)
@@ -1,4 +1,6 @@
 /* { dg-do compile } */
+/* { dg-require-effective-target powerpc_future_compile_ok } */
+/* { dg-require-effective-target lp64 } */
 /* { dg-options "-mdejagnu-cpu=future -O2" } */
 
 void