[gcc r17-2937] aarch64: Document `DEF_*` macros

Karl Meakin via Gcc-cvs <[email protected]> Tue, 4 Aug 2026 14:24:07 +0000 (GMT)
Newsgroups gmane.comp.gcc.cvs
Message-ID <[email protected]>
https://gcc.gnu.org/g:7cb210417d246aac62dc1812ef5f5e40291c1bb2

commit r17-2937-g7cb210417d246aac62dc1812ef5f5e40291c1bb2
Author: Karl Meakin <[email protected]>
Date:   Tue Sep 16 10:43:17 2025 +0000

    aarch64: Document `DEF_*` macros
    
    Document all the `DEF_*` macros and their arguments.
    
    gcc/ChangeLog:
    
            * config/aarch64/aarch64-neon-sve-bridge-builtins.def (DEF_NEON_SVE_FUNCTION): Document.
            * config/aarch64/aarch64-simd-builtin-types.def (DEF_SIMD_TYPE): Likewise.
            * config/aarch64/aarch64-sve-builtins-base.def (DEF_SVE_FUNCTION_GS_FPM): Likewise.
            (DEF_SVE_FUNCTION_GS): Likewise.
            (DEF_SVE_FUNCTION): Likewise.
            * config/aarch64/aarch64-sve-builtins-sme.def (DEF_SME_FUNCTION): Likewise.
            (DEF_SME_FUNCTION_GS): Likewise.
            (DEF_SME_ZA_FUNCTION_GS): Likewise.
            (DEF_SME_ZA_FUNCTION): Likewise.
            * config/aarch64/aarch64-sve-builtins.def (DEF_SVE_MODE): Likewise.
            (DEF_SVE_TYPE): Likewise.
            (DEF_SVE_TYPE_SUFFIX): Likewise.
            (DEF_SME_ZA_SUFFIX): Likewise.
            (DEF_SVE_GROUP_SUFFIX): Likewise.
            (DEF_SVE_FUNCTION_GS_FPM): Likewise.
            (DEF_SVE_FUNCTION_GS): Likewise.
            (DEF_SVE_NEON_TYPE_SUFFIX): Likewise.
            (DEF_SVE_FUNCTION): Likewise.

Diff:
---
 .../aarch64/aarch64-neon-sve-bridge-builtins.def   |  4 ++-
 gcc/config/aarch64/aarch64-simd-builtin-types.def  |  4 ++-
 gcc/config/aarch64/aarch64-sve-builtins-base.def   | 18 ++++++++++
 gcc/config/aarch64/aarch64-sve-builtins-sme.def    | 18 ++++++----
 gcc/config/aarch64/aarch64-sve-builtins.def        | 42 +++++++++++++++-------
 5 files changed, 65 insertions(+), 21 deletions(-)

diff --git a/gcc/config/aarch64/aarch64-neon-sve-bridge-builtins.def b/gcc/config/aarch64/aarch64-neon-sve-bridge-builtins.def
index 8f6402b6c537..1983dbd99057 100644
--- a/gcc/config/aarch64/aarch64-neon-sve-bridge-builtins.def
+++ b/gcc/config/aarch64/aarch64-neon-sve-bridge-builtins.def
@@ -17,8 +17,10 @@
    along with GCC; see the file COPYING3.  If not see
    <http://www.gnu.org/licenses/>.  */
 
+/* Define an SVE function with a Neon bridge.
+   See the fields in `function_group_info` for the meaning of each argument.  */
 #ifndef DEF_NEON_SVE_FUNCTION
-#define DEF_NEON_SVE_FUNCTION(A, B, C, D, E)
+#define DEF_NEON_SVE_FUNCTION(NAME, SHAPE, TYPES, GROUPS, PREDS)
 #endif
 
 DEF_NEON_SVE_FUNCTION (svset_neonq, set_neonq, all_data, none, none)
diff --git a/gcc/config/aarch64/aarch64-simd-builtin-types.def b/gcc/config/aarch64/aarch64-simd-builtin-types.def
index 19d55acb9ac3..1990e1df118f 100644
--- a/gcc/config/aarch64/aarch64-simd-builtin-types.def
+++ b/gcc/config/aarch64/aarch64-simd-builtin-types.def
@@ -18,8 +18,10 @@
    along with GCC; see the file COPYING3.  If not see
    <http://www.gnu.org/licenses/>.  */
 
+/* Define an AdvSIMD (NEON) type.
+   See `aarch64_simd_type_info` for the meaning of each argument.  */
 #ifndef DEF_SIMD_TYPE
-#define DEF_SIMD_TYPE(A, B, C, D)
+#define DEF_SIMD_TYPE(NAME, MODE, QUALIFIERS, LEN)
 #endif
 
 DEF_SIMD_TYPE (Int8x8_t, V8QI, none, 10)
diff --git a/gcc/config/aarch64/aarch64-sve-builtins-base.def b/gcc/config/aarch64/aarch64-sve-builtins-base.def
index 3b5e2433674c..334dca3d2999 100644
--- a/gcc/config/aarch64/aarch64-sve-builtins-base.def
+++ b/gcc/config/aarch64/aarch64-sve-builtins-base.def
@@ -20,6 +20,24 @@
 /* Code organization: See block comment at the top of
    aarch64-sve-builtins.def.  */
 
+/* Define an SVE function group.
+   See the fields in `function_group_info` for the meaning of each argument.  */
+#ifndef DEF_SVE_FUNCTION_GS_FPM
+#define DEF_SVE_FUNCTION_GS_FPM(NAME, SHAPE, TYPES, GROUPS, PREDS, FPM_MODE)
+#endif
+
+/* Same as `DEF_SVE_FUNCTION_GS_FPM` above, but with FPM = unused.  */
+#ifndef DEF_SVE_FUNCTION_GS
+#define DEF_SVE_FUNCTION_GS(NAME, SHAPE, TYPES, GROUPS, PREDS) \
+   DEF_SVE_FUNCTION_GS_FPM (NAME, SHAPE, TYPES, GROUPS, PREDS, unused)
+#endif
+
+/* Same as `DEF_SVE_FUNCTION_GS` above, but with GROUPS = none.  */
+#ifndef DEF_SVE_FUNCTION
+#define DEF_SVE_FUNCTION(NAME, SHAPE, TYPES,       PREDS) \
+    DEF_SVE_FUNCTION_GS (NAME, SHAPE, TYPES, none, PREDS)
+#endif
+
 #define REQUIRED_EXTENSIONS ssve (0)
 DEF_SVE_FUNCTION (svabd, binary_opt_n, all_arith, mxz)
 DEF_SVE_FUNCTION (svabs, unary, all_float_and_signed, mxz)
diff --git a/gcc/config/aarch64/aarch64-sve-builtins-sme.def b/gcc/config/aarch64/aarch64-sve-builtins-sme.def
index 4feb47952874..fa2de697e0bc 100644
--- a/gcc/config/aarch64/aarch64-sve-builtins-sme.def
+++ b/gcc/config/aarch64/aarch64-sve-builtins-sme.def
@@ -20,24 +20,28 @@
 /* Code organization: See block comment at the top of
    aarch64-sve-builtins.def.  */
 
+/* Define an SME function group.
+   See `struct function_group_info` for the meaning of each argument.  */
 #ifndef DEF_SME_FUNCTION_GS
 #define DEF_SME_FUNCTION_GS(NAME, SHAPE, TYPES, GROUPS, PREDS) \
   DEF_SME_FUNCTION_GS_FPM (NAME, SHAPE, TYPES, GROUPS, PREDS, unused)
 #endif
 
-#ifndef DEF_SME_FUNCTION
-#define DEF_SME_FUNCTION(NAME, SHAPE, TYPES, PREDS) \
-  DEF_SME_FUNCTION_GS_FPM (NAME, SHAPE, TYPES, none, PREDS, unused)
-#endif
+/* Same as `DEF_SME_FUNCTION_GS` above, but with GROUPS = none.  */
+#define DEF_SME_FUNCTION(NAME, SHAPE, TYPES,       PREDS) \
+    DEF_SME_FUNCTION_GS (NAME, SHAPE, TYPES, none, PREDS)
 
+/* Define an SME function that operates on ZA.
+   See `function_group_info` for the meaning of each argument.  */
 #ifndef DEF_SME_ZA_FUNCTION_GS
 #define DEF_SME_ZA_FUNCTION_GS(NAME, SHAPE, TYPES, GROUP, PREDS) \
-  DEF_SME_ZA_FUNCTION_GS_FPM (NAME, SHAPE, TYPES, GROUP, PREDS, unused)
+   DEF_SME_ZA_FUNCTION_GS_FPM (NAME, SHAPE, TYPES, GROUP, PREDS, unused)
 #endif
 
+/* Same as `DEF_SME_ZA_FUNCTION_GS` above, but with GROUPS = none.  */
 #ifndef DEF_SME_ZA_FUNCTION
-#define DEF_SME_ZA_FUNCTION(NAME, SHAPE, TYPES, PREDS) \
-  DEF_SME_ZA_FUNCTION_GS_FPM (NAME, SHAPE, TYPES, none, PREDS, unused)
+#define DEF_SME_ZA_FUNCTION(NAME, SHAPE, TYPES,       PREDS) \
+DEF_SME_ZA_FUNCTION_GS_FPM (NAME, SHAPE, TYPES, none, PREDS, unused)
 #endif
 
 #define REQUIRED_EXTENSIONS streaming_compatible (0)
diff --git a/gcc/config/aarch64/aarch64-sve-builtins.def b/gcc/config/aarch64/aarch64-sve-builtins.def
index 6df8d41d7f63..85afa6888e45 100644
--- a/gcc/config/aarch64/aarch64-sve-builtins.def
+++ b/gcc/config/aarch64/aarch64-sve-builtins.def
@@ -38,43 +38,61 @@
        streaming mode only.  This usually means it uses the ZA or ZT0 registers,
        or other SME state.  */
 
+/* Define an SVE mode suffix.
+   See the fields in `mode_suffix_info` for the meaning of each argument.  */
 #ifndef DEF_SVE_MODE
-#define DEF_SVE_MODE(A, B, C, D)
+#define DEF_SVE_MODE(NAME, BASE, DISPLACEMENT, UNITS)
 #endif
 
+/* Define an SVE vector or predicate type.
+   See the fields in `vector_type_info` for the meaning of each argument.  */
 #ifndef DEF_SVE_TYPE
-#define DEF_SVE_TYPE(A, B, C, D)
+#define DEF_SVE_TYPE(ACLE_NAME, NCHARS, ABI_NAME, SCALAR_TYPE)
 #endif
 
+/* Define an SVE type suffix.
+   See the fields in `type_suffix_info` for the meaning of each argument.  */
 #ifndef DEF_SVE_TYPE_SUFFIX
-#define DEF_SVE_TYPE_SUFFIX(A, B, C, D, E)
+#define DEF_SVE_TYPE_SUFFIX(NAME, ACLE_TYPE, CLASS, BITS, MODE)
 #endif
 
+/* Define an SME ZA type suffix.
+   See the fields in `type_suffix_info` for the meaning of each argument.  */
 #ifndef DEF_SME_ZA_SUFFIX
-#define DEF_SME_ZA_SUFFIX(A, B, C)
+#define DEF_SME_ZA_SUFFIX(NAME, BITS, MODE)
 #endif
 
+/* Define an SVE group suffix.
+   See the fields in `group_suffix_info` for the meaning of each argument.  */
 #ifndef DEF_SVE_GROUP_SUFFIX
-#define DEF_SVE_GROUP_SUFFIX(A, B, C)
+#define DEF_SVE_GROUP_SUFFIX(NAME, VG, VECTORS_PER_TUPLE)
 #endif
 
+/* Define an SVE function group.
+   See the fields in `function_group_info` for the meaning of each argument.  */
 #ifndef DEF_SVE_FUNCTION_GS_FPM
-#define DEF_SVE_FUNCTION_GS_FPM(A, B, C, D, E, F)
+#define DEF_SVE_FUNCTION_GS_FPM(NAME, SHAPE, TYPES, GROUPS, PREDS, FPM_MODE)
 #endif
 
+/* Same as `DEF_SVE_FUNCTION_GS_FPM` above, but with FPM = unused.  */
 #ifndef DEF_SVE_FUNCTION_GS
-#define DEF_SVE_FUNCTION_GS(A, B, C, D, E) \
-  DEF_SVE_FUNCTION_GS_FPM(A, B, C, D, E, unused)
+#define DEF_SVE_FUNCTION_GS(NAME, SHAPE, TYPES, GROUPS, PREDS) \
+   DEF_SVE_FUNCTION_GS_FPM (NAME, SHAPE, TYPES, GROUPS, PREDS, unused)
 #endif
 
+/* Define an SVE type suffix, with associated 64-bit and 128-bit types for
+   compatability with Neon.
+   See the fields in `type_suffix_info` for the meaning of each argument.  */
 #ifndef DEF_SVE_NEON_TYPE_SUFFIX
-#define DEF_SVE_NEON_TYPE_SUFFIX(A, B, C, D, E, F, G) \
-  DEF_SVE_TYPE_SUFFIX(A, B, C, D, E)
+#define DEF_SVE_NEON_TYPE_SUFFIX(NAME, ACLE_TYPE, CLASS, BITS, MODE, NEON64,  \
+								     NEON128) \
+	    DEF_SVE_TYPE_SUFFIX (NAME, ACLE_TYPE, CLASS, BITS, MODE)
 #endif
 
+/* Same as `DEF_SVE_FUNCTION_GS` above, but with GROUPS = none.  */
 #ifndef DEF_SVE_FUNCTION
-#define DEF_SVE_FUNCTION(NAME, SHAPE, TYPES, PREDS) \
-  DEF_SVE_FUNCTION_GS (NAME, SHAPE, TYPES, none, PREDS)
+#define DEF_SVE_FUNCTION(NAME, SHAPE, TYPES,       PREDS) \
+    DEF_SVE_FUNCTION_GS (NAME, SHAPE, TYPES, none, PREDS)
 #endif
 
 DEF_SVE_MODE (n, none, none, none)