Hi gcc-patches mailing list,
[email protected] has requested that the following forgejo pull request
be published on the mailing list.

Created on: 2025-10-02 16:30:31+00:00
Latest update: 2025-10-02 17:44:17+00:00
Changes: 6 changed files, 203 additions, 121 deletions
Head revision: karmea01/gcc-TEST ref km/aarch64-intrinsics-refactors/v1 commit 
d7a359f0e275bbaa03b0819745c02d141ce6c3ca
Base revision: gcc/gcc-TEST ref trunk commit 
60c6f92fb192352d784ab3153a9e11c19a3216a0 r16-4191-g60c6f92fb19235
Merge base: 60c6f92fb192352d784ab3153a9e11c19a3216a0
Full diff url: https://forge.sourceware.org/gcc/gcc-TEST/pulls/90.diff
Discussion:  https://forge.sourceware.org/gcc/gcc-TEST/pulls/90
Requested Reviewers:


Minor refactors and documentation improvements. NFCI

Testing done: `make check-gcc` and `make check-target`

ChangeLog:
* v1: Initial revision


Changed files:
- M: gcc/config/aarch64/aarch64-neon-sve-bridge-builtins.def
- M: gcc/config/aarch64/aarch64-sve-builtins-base.def
- M: gcc/config/aarch64/aarch64-sve-builtins-sme.def
- M: gcc/config/aarch64/aarch64-sve-builtins.cc
- M: gcc/config/aarch64/aarch64-sve-builtins.def
- M: gcc/config/aarch64/aarch64-sve-builtins.h


Karl Meakin (5):
  aarch64: Document `DEF_*` macros
  aarch64: Define `DEF_SVE_TYPE_SUFFIX` in terms of
    `DEF_SVE_NEON_TYPE_SUFFIX`
  aarch64: Use variadic arguments
  aarch64: Delete duplicate `enum aarch64_simd_type` definition
  aarch64: Reformat array initializers

 .../aarch64-neon-sve-bridge-builtins.def      |   4 +-
 .../aarch64/aarch64-sve-builtins-base.def     |  22 +++
 .../aarch64/aarch64-sve-builtins-sme.def      |  24 ++-
 gcc/config/aarch64/aarch64-sve-builtins.cc    | 182 +++++++++++-------
 gcc/config/aarch64/aarch64-sve-builtins.def   |  51 +++--
 gcc/config/aarch64/aarch64-sve-builtins.h     |  21 +-
 6 files changed, 193 insertions(+), 111 deletions(-)

Range-diff against v1:
1:  53cbf218fa2 < -:  ----------- aarch64: Document `DEF_*` macros
6:  5f56d3425e5 ! 1:  466da661aa7 aarch64: Remove redundant `const` from 
`constexpr` variables
    @@ Metadata
     Author: Karl Meakin <[email protected]>
     
      ## Commit message ##
    -    aarch64: Remove redundant `const` from `constexpr` variables
    +    aarch64: Document `DEF_*` macros
     
    -    `constexpr` on a variable definition implies `const`. Also replace
    -    `CONSTEXPR` macro with `constexpr` keyword.
    +    Document all the `DEF_*` macros and their arguments.
     
         gcc/ChangeLog:
     
    -            * config/aarch64/aarch64-sve-builtins.cc (vector_types): Remove
    -            `const` and replace `CONSTEXPR` with `constexpr`.
    -            (mode_suffixes): Likewise.
    -            (type_suffixes): Likewise.
    -            (group_suffixes): Likewise.
    -            (function_groups): Likewise.
    -            (neon_sve_function_groups): Likewise.
    -            (sme_function_groups): Likewise.
    +            * config/aarch64/aarch64-neon-sve-bridge-builtins.def 
(DEF_NEON_SVE_FUNCTION): Document.
    +            * 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.
     
    - ## gcc/config/aarch64/aarch64-sve-builtins.cc ##
    -@@ gcc/config/aarch64/aarch64-sve-builtins.cc: struct 
registered_function_hasher : nofree_ptr_hash <registered_function>
    - 
    - /* Information about each single-predicate or single-vector type.  */
    - /* clang-format off */
    --static CONSTEXPR const vector_type_info vector_types[] = {
    -+static constexpr vector_type_info vector_types[] = {
    - #define DEF_SVE_TYPE(ACLE_NAME, NCHARS, ABI_NAME, SCALAR_TYPE)            
      \
    -   { /* .acle_name    = */ #ACLE_NAME,                                     
      \
    -     /* .abi_name     = */ #ABI_NAME,                                      
      \
    -@@ gcc/config/aarch64/aarch64-sve-builtins.cc: static const char *const 
pred_suffixes[NUM_PREDS + 1] = {
    - 
    - /* Static information about each mode_suffix_index.  */
    - /* clang-format off */
    --CONSTEXPR const mode_suffix_info mode_suffixes[] = {
    -+constexpr mode_suffix_info mode_suffixes[] = {
    - #define DEF_SVE_MODE(NAME, BASE, DISPLACEMENT, UNITS)                     
      \
    -   { /* .string                   = */ "_" #NAME,                          
      \
    -     /* .base_vector_type         = */ VECTOR_TYPE_##BASE,                 
      \
    -@@ gcc/config/aarch64/aarch64-sve-builtins.cc: CONSTEXPR const 
mode_suffix_info mode_suffixes[] = {
    - /* clang-format on */
    - 
    - /* Static information about each type_suffix_index.  */
    --CONSTEXPR const type_suffix_info type_suffixes[NUM_TYPE_SUFFIXES + 1] = {
    -+constexpr type_suffix_info type_suffixes[NUM_TYPE_SUFFIXES + 1] = {
    - #define DEF_SVE_NEON_TYPE_SUFFIX(NAME, ACLE_TYPE, CLASS, BITS, MODE, \
    -                            NEON64, NEON128) \
    -   { "_" #NAME, \
    -@@ gcc/config/aarch64/aarch64-sve-builtins.cc: CONSTEXPR const 
type_suffix_info type_suffixes[NUM_TYPE_SUFFIXES + 1] = {
    -     ARM_NEON_H_TYPES_LAST, \
    -     ARM_NEON_H_TYPES_LAST },
    - #include "aarch64-sve-builtins.def"
    --  { "", NUM_VECTOR_TYPES, TYPE_bool, 0, 0, false, false, false, false,
    --    false, false, 0, VOIDmode, ARM_NEON_H_TYPES_LAST, 
ARM_NEON_H_TYPES_LAST }
    --};
    -+  {"", NUM_VECTOR_TYPES, TYPE_bool, 0, 0, false, false, false, false, 
false,
    -+   false, 0, VOIDmode, ARM_NEON_H_TYPES_LAST, ARM_NEON_H_TYPES_LAST}};
    - 
    - /* clang-format off */
    --CONSTEXPR const group_suffix_info group_suffixes[] = {
    -+constexpr group_suffix_info group_suffixes[] = {
    - #define DEF_SVE_GROUP_SUFFIX(NAME, VG, VECTORS_PER_TUPLE)                 
      \
    -   { /* .string            = */ "_" #NAME,                                 
      \
    -     /* .vectors_per_group = */ VG,                                        
      \
    -@@ gcc/config/aarch64/aarch64-sve-builtins.cc: static const 
predication_index preds_za_m[] = { PRED_za_m, NUM_PREDS };
    - 
    - /* A list of all arm_sve.h functions.  */
    - /* clang-format off */
    --static CONSTEXPR const function_group_info function_groups[] = {
    -+static constexpr function_group_info function_groups[] = {
    - #define DEF_SVE_FUNCTION_GS_FPM(NAME, SHAPE, TYPES, GROUPS, PREDS, 
FPM_MODE) \
    -   { /* .base_name  = */ #NAME, \
    -     /* .base       = */ &functions::NAME, \
    -@@ gcc/config/aarch64/aarch64-sve-builtins.cc: static CONSTEXPR const 
function_group_info function_groups[] = {
    - 
    - /* A list of all arm_neon_sve_bridge.h ACLE functions.  */
    - /* clang-format off */
    --static CONSTEXPR const function_group_info neon_sve_function_groups[] = {
    -+static constexpr function_group_info neon_sve_function_groups[] = {
    - #define DEF_NEON_SVE_FUNCTION(NAME, SHAPE, TYPES, GROUPS, PREDS) \
    -   { /* .base_name  = */ #NAME, \
    -     /* .base       = */ &neon_sve_bridge_functions::NAME, \
    -@@ gcc/config/aarch64/aarch64-sve-builtins.cc: static CONSTEXPR const 
function_group_info neon_sve_function_groups[] = {
    - 
    - /* A list of all arm_sme.h functions.  */
    - /* clang-format off */
    --static CONSTEXPR const function_group_info sme_function_groups[] = {
    -+static constexpr function_group_info sme_function_groups[] = {
    - #define DEF_SME_FUNCTION_GS(NAME, SHAPE, TYPES, GROUPS, PREDS) \
    -   { /* .base_name  = */ #NAME, \
    -     /* .base       = */ &functions::NAME, \
    + ## gcc/config/aarch64/aarch64-neon-sve-bridge-builtins.def ##
    +@@
    +    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)
    +
    + ## gcc/config/aarch64/aarch64-sve-builtins-base.def ##
    +@@
    +    along with GCC; see the file COPYING3.  If not see
    +    <http://www.gnu.org/licenses/>.  */
    + 
    ++/* clang-format off */
    ++
    ++/* 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)
    +@@ gcc/config/aarch64/aarch64-sve-builtins-base.def: DEF_SVE_FUNCTION 
(svuzp2q, binary, all_data, none)
    + DEF_SVE_FUNCTION (svzip1q, binary, all_data, none)
    + DEF_SVE_FUNCTION (svzip2q, binary, all_data, none)
    + #undef REQUIRED_EXTENSIONS
    ++
    ++/* clang-format on */
    +
    + ## gcc/config/aarch64/aarch64-sve-builtins-sme.def ##
    +@@
    +    along with GCC; see the file COPYING3.  If not see
    +    <http://www.gnu.org/licenses/>.  */
    + 
    +-#ifndef DEF_SME_FUNCTION
    +-#define DEF_SME_FUNCTION(NAME, SHAPE, TYPES, PREDS) \
    +-  DEF_SME_FUNCTION_GS (NAME, SHAPE, TYPES, none, PREDS)
    ++/* clang-format off */
    ++
    ++/* Define an SME function.
    ++   See `function_group_info` for the meaning of each argument.  */
    ++#ifndef DEF_SME_FUNCTION_GS
    ++#define DEF_SME_FUNCTION_GS(NAME, SHAPE, TYPES, GROUPS, PREDS)
    + #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_FUNCTION_GS (NAME, SHAPE, TYPES, GROUP, PREDS)
    ++          DEF_SME_FUNCTION_GS (NAME, SHAPE, TYPES, GROUP, PREDS)
    + #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 (NAME, SHAPE, TYPES, none, PREDS)
    ++#define DEF_SME_ZA_FUNCTION(NAME, SHAPE, TYPES,       PREDS) \
    ++    DEF_SME_ZA_FUNCTION_GS (NAME, SHAPE, TYPES, none, PREDS)
    + #endif
    + 
    + #define REQUIRED_EXTENSIONS streaming_compatible (0)
    +@@ gcc/config/aarch64/aarch64-sve-builtins-sme.def: DEF_SME_FUNCTION_GS 
(svluti4_zt,      luti4_zt,      b_integer, x4,   none)
    + #undef DEF_SME_ZA_FUNCTION
    + #undef DEF_SME_ZA_FUNCTION_GS
    + #undef DEF_SME_FUNCTION
    ++
    ++/* clang-format on */
    +
    + ## gcc/config/aarch64/aarch64-sve-builtins.def ##
    +@@
    +    along with GCC; see the file COPYING3.  If not see
    +    <http://www.gnu.org/licenses/>.  */
    + 
    ++/* clang-format off */
    ++
    ++/* 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 column. */
    + #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)
    +@@ gcc/config/aarch64/aarch64-sve-builtins.def: DEF_SVE_GROUP_SUFFIX 
(vg4x4, 4, 4)
    + #undef DEF_SVE_TYPE_SUFFIX
    + #undef DEF_SVE_TYPE
    + #undef DEF_SVE_MODE
    ++
    ++/* clang-format on */
2:  a145e3338b1 = 2:  06d08c8ff03 aarch64: Define `DEF_SVE_TYPE_SUFFIX` in 
terms of `DEF_SVE_NEON_TYPE_SUFFIX`
3:  26c1c878532 = 3:  b5a1ab387a2 aarch64: Use variadic arguments
4:  26762aa10f5 = 4:  ed82150baea aarch64: Delete duplicate `enum 
aarch64_simd_type` definition
5:  b2753cfe76c ! 5:  d7a359f0e27 aarch64: Reformat array initializers to be 
more readable
    @@ Metadata
     Author: Karl Meakin <[email protected]>
     
      ## Commit message ##
    -    aarch64: Reformat array initializers to be more readable
    +    aarch64: Reformat array initializers
     
    -    Spread the initializers out over several lines, and include the names 
of
    -    each field in a comment.
    +    Spread the initializers over several lines, and include the names of
    +    each field in a comment (in lieu of C++20 designated initializers).
    +
    +    Also rename `CONSTEXPR` to `constexpr` and remove `const` (it is
    +    redundant, because `constexpr` implies `const`).
     
         gcc/ChangeLog:
     
    @@ gcc/config/aarch64/aarch64-sve-builtins.cc: struct 
registered_function_hasher :
      };
      
      /* Information about each single-predicate or single-vector type.  */
    -+/* clang-format off */
    - static CONSTEXPR const vector_type_info vector_types[] = {
    +-static CONSTEXPR const vector_type_info vector_types[] = {
     -#define DEF_SVE_TYPE(ACLE_NAME, NCHARS, ABI_NAME, SCALAR_TYPE) \
     -  { #ACLE_NAME, #ABI_NAME, "u" #NCHARS #ABI_NAME },
    -+#define DEF_SVE_TYPE(ACLE_NAME, NCHARS, ABI_NAME, SCALAR_TYPE)            
      \
    -+  { /* .acle_name    = */ #ACLE_NAME,                                     
      \
    -+    /* .abi_name     = */ #ABI_NAME,                                      
      \
    ++/* clang-format off */
    ++static constexpr vector_type_info vector_types[] = {
    ++#define DEF_SVE_TYPE(ACLE_NAME, NCHARS, ABI_NAME, SCALAR_TYPE)            
        \
    ++  { /* .acle_name    = */ #ACLE_NAME,                                     
        \
    ++    /* .abi_name     = */ #ABI_NAME,                                      
        \
     +    /* .mangled_name = */ "u" #NCHARS #ABI_NAME },
      #include "aarch64-sve-builtins.def"
      };
    @@ gcc/config/aarch64/aarch64-sve-builtins.cc: static const char *const 
pred_suffix
      };
      
      /* Static information about each mode_suffix_index.  */
    +-CONSTEXPR const mode_suffix_info mode_suffixes[] = {
     +/* clang-format off */
    - CONSTEXPR const mode_suffix_info mode_suffixes[] = {
    --#define VECTOR_TYPE_none NUM_VECTOR_TYPES
    ++constexpr mode_suffix_info mode_suffixes[] = {
    + #define VECTOR_TYPE_none NUM_VECTOR_TYPES
     -#define DEF_SVE_MODE(NAME, BASE, DISPLACEMENT, UNITS) \
     -  { "_" #NAME, VECTOR_TYPE_##BASE, VECTOR_TYPE_##DISPLACEMENT, 
UNITS_##UNITS },
    -+#define DEF_SVE_MODE(NAME, BASE, DISPLACEMENT, UNITS)                     
      \
    -+  { /* .string                   = */ "_" #NAME,                          
      \
    -+    /* .base_vector_type         = */ VECTOR_TYPE_##BASE,                 
      \
    -+    /* .displacement_vector_type = */ VECTOR_TYPE_##DISPLACEMENT,         
      \
    ++#define DEF_SVE_MODE(NAME, BASE, DISPLACEMENT, UNITS)                     
        \
    ++  { /* .string                   = */ "_" #NAME,                          
\
    ++    /* .base_vector_type         = */ VECTOR_TYPE_##BASE,                 
\
    ++    /* .displacement_vector_type = */ VECTOR_TYPE_##DISPLACEMENT,         
\
     +    /* .displacement_units       = */ UNITS_##UNITS },
      #include "aarch64-sve-builtins.def"
     -#undef VECTOR_TYPE_none
    @@ gcc/config/aarch64/aarch64-sve-builtins.cc: static const char *const 
pred_suffix
     +/* clang-format on */
      
      /* Static information about each type_suffix_index.  */
    - CONSTEXPR const type_suffix_info type_suffixes[NUM_TYPE_SUFFIXES + 1] = {
    -@@ gcc/config/aarch64/aarch64-sve-builtins.cc: CONSTEXPR const 
type_suffix_info type_suffixes[NUM_TYPE_SUFFIXES + 1] = {
    -     false, false, 0, VOIDmode, ARM_NEON_H_TYPES_LAST, 
ARM_NEON_H_TYPES_LAST }
    - };
    - 
    +-CONSTEXPR const type_suffix_info type_suffixes[NUM_TYPE_SUFFIXES + 1] = {
    +-#define DEF_SVE_NEON_TYPE_SUFFIX(NAME, ACLE_TYPE, CLASS, BITS, MODE, \
    +-                           NEON64, NEON128) \
    +-  { "_" #NAME, \
    +-    VECTOR_TYPE_##ACLE_TYPE, \
    +-    TYPE_##CLASS, \
    +-    BITS, \
    +-    BITS / BITS_PER_UNIT, \
    +-    TYPE_##CLASS == TYPE_signed || TYPE_##CLASS == TYPE_unsigned, \
    +-    TYPE_##CLASS == TYPE_unsigned, \
    +-    TYPE_##CLASS == TYPE_float || TYPE_##CLASS == TYPE_bfloat, \
    +-    TYPE_##CLASS != TYPE_bool, \
    +-    TYPE_##CLASS == TYPE_bool, \
    +-    false, \
    +-    0, \
    +-    MODE, \
    +-    NEON64, \
    +-    NEON128 },
    +-#define DEF_SME_ZA_SUFFIX(NAME, BITS, MODE) \
    +-  { "_" #NAME, \
    +-    NUM_VECTOR_TYPES, \
    +-    NUM_TYPE_CLASSES, \
    +-    BITS, \
    +-    BITS / BITS_PER_UNIT, \
    +-    false, \
    +-    false, \
    +-    false, \
    +-    false, \
    +-    false, \
    +-    true, \
    +-    0, \
    +-    MODE, \
    +-    ARM_NEON_H_TYPES_LAST, \
    +-    ARM_NEON_H_TYPES_LAST },
     +/* clang-format off */
    - CONSTEXPR const group_suffix_info group_suffixes[] = {
    ++constexpr type_suffix_info type_suffixes[NUM_TYPE_SUFFIXES + 1] = {
    ++#define DEF_SVE_NEON_TYPE_SUFFIX(NAME, ACLE_TYPE, CLASS, BITS, MODE,      
        \
    ++                           NEON64, NEON128)                               
\
    ++  { /* .string        = */ "_" #NAME,                                     
        \
    ++    /* .vector_type   = */ VECTOR_TYPE_##ACLE_TYPE,                       
        \
    ++    /* .tclass        = */ TYPE_##CLASS,                                  
\
    ++    /* .element_bits  = */ BITS,                                          
\
    ++    /* .element_bytes = */ BITS / BITS_PER_UNIT,                          
\
    ++    /* .integer_p     = */ TYPE_##CLASS == TYPE_signed                    
        \
    ++                  || TYPE_##CLASS == TYPE_unsigned,                       
\
    ++    /* .unsigned_p    = */ TYPE_##CLASS == TYPE_unsigned,                 
\
    ++    /* .float_p       = */ TYPE_##CLASS == TYPE_float                     
        \
    ++                  || TYPE_##CLASS == TYPE_bfloat,                         
\
    ++    /* .vector_p      = */ TYPE_##CLASS != TYPE_bool,                     
        \
    ++    /* .bool_p        = */ TYPE_##CLASS == TYPE_bool,                     
        \
    ++    /* .za_p          = */ false,                                         
\
    ++    /* .spare         = */ 0,                                             
        \
    ++    /* .vector_mode   = */ MODE,                                          
\
    ++    /* .neon64_type   = */ NEON64,                                        
        \
    ++    /* .neon128_type  = */ NEON128 },
    ++#define DEF_SME_ZA_SUFFIX(NAME, BITS, MODE)                               
        \
    ++  { /* .string        = */ "_" #NAME,                                     
        \
    ++    /* .vector_type   = */ NUM_VECTOR_TYPES,                              
        \
    ++    /* .tclass        = */ NUM_TYPE_CLASSES,                              
        \
    ++    /* .element_bits  = */ BITS,                                          
\
    ++    /* .element_bytes = */ BITS / BITS_PER_UNIT,                          
\
    ++    /* .integer_p     = */ false,                                         
\
    ++    /* .unsigned_p    = */ false,                                         
\
    ++    /* .float_p       = */ false,                                         
\
    ++    /* .vector_p      = */ false,                                         
\
    ++    /* .bool_p        = */ false,                                         
\
    ++    /* .za_p          = */ true,                                          
\
    ++    /* .spare         = */ 0,                                             
        \
    ++    /* .vector_mode   = */ MODE,                                          
\
    ++    /* .neon64_type   = */ ARM_NEON_H_TYPES_LAST,                         
\
    ++    /* .neon128_type  = */ ARM_NEON_H_TYPES_LAST },
    + #include "aarch64-sve-builtins.def"
    +-  { "", NUM_VECTOR_TYPES, TYPE_bool, 0, 0, false, false, false, false,
    +-    false, false, 0, VOIDmode, ARM_NEON_H_TYPES_LAST, 
ARM_NEON_H_TYPES_LAST }
    +-};
    +-
    +-CONSTEXPR const group_suffix_info group_suffixes[] = {
     -#define DEF_SVE_GROUP_SUFFIX(NAME, VG, VECTORS_PER_TUPLE) \
     -  { "_" #NAME, VG, VECTORS_PER_TUPLE },
    -+#define DEF_SVE_GROUP_SUFFIX(NAME, VG, VECTORS_PER_TUPLE)                 
      \
    -+  { /* .string            = */ "_" #NAME,                                 
      \
    -+    /* .vectors_per_group = */ VG,                                        
      \
    ++  {"", NUM_VECTOR_TYPES, TYPE_bool, 0, 0, false, false, false, false, 
false,
    ++   false, 0, VOIDmode, ARM_NEON_H_TYPES_LAST, ARM_NEON_H_TYPES_LAST}};
    ++/* clang-format on */
    ++
    ++/* clang-format off */
    ++constexpr group_suffix_info group_suffixes[] = {
    ++#define DEF_SVE_GROUP_SUFFIX(NAME, VG, VECTORS_PER_TUPLE)                 
\
    ++  { /* .string              = */ "_" #NAME,                               
        \
    ++    /* .vectors_per_group = */ VG,                                        
        \
     +    /* .vectors_per_tuple = */ VECTORS_PER_TUPLE },
      #include "aarch64-sve-builtins.def"
        { "", 0, 1 }
    @@ gcc/config/aarch64/aarch64-sve-builtins.cc: static const 
predication_index preds
      #define SSVE(X) SVE_AND_SME (X, X)
      
      /* A list of all arm_sve.h functions.  */
    -+/* clang-format off */
    - static CONSTEXPR const function_group_info function_groups[] = {
    - #define DEF_SVE_FUNCTION_GS_FPM(NAME, SHAPE, TYPES, GROUPS, PREDS, 
FPM_MODE) \
    +-static CONSTEXPR const function_group_info function_groups[] = {
    +-#define DEF_SVE_FUNCTION_GS_FPM(NAME, SHAPE, TYPES, GROUPS, PREDS, 
FPM_MODE) \
     -  { #NAME, &functions::NAME, &shapes::SHAPE, types_##TYPES, 
groups_##GROUPS, \
     -    preds_##PREDS, aarch64_required_extensions::REQUIRED_EXTENSIONS, \
     -    FPM_##FPM_MODE },
    -+  { /* .base_name  = */ #NAME, \
    -+    /* .base       = */ &functions::NAME, \
    -+    /* .shape      = */ &shapes::SHAPE, \
    -+    /* .types      = */ types_##TYPES, \
    -+    /* .groups     = */ groups_##GROUPS, \
    -+    /* .preds      = */ preds_##PREDS, \
    -+    /* .extensions = */ aarch64_required_extensions::REQUIRED_EXTENSIONS, 
\
    ++/* clang-format off */
    ++static constexpr function_group_info function_groups[] = {
    ++#define DEF_SVE_FUNCTION_GS_FPM(NAME, SHAPE, TYPES, GROUPS, PREDS, 
FPM_MODE)      \
    ++  { /* .base_name  = */ #NAME,                                            
        \
    ++    /* .base       = */ &functions::NAME,                                 
\
    ++    /* .shape      = */ &shapes::SHAPE,                                   
        \
    ++    /* .types      = */ types_##TYPES,                                    
        \
    ++    /* .groups     = */ groups_##GROUPS,                                  
\
    ++    /* .preds      = */ preds_##PREDS,                                    
        \
    ++    /* .extensions = */ aarch64_required_extensions::REQUIRED_EXTENSIONS, 
\
     +    /* .fpm_mode   = */ FPM_##FPM_MODE },
      #include "aarch64-sve-builtins.def"
      };
     +/* clang-format on */
      
      /* A list of all arm_neon_sve_bridge.h ACLE functions.  */
    -+/* clang-format off */
    - static CONSTEXPR const function_group_info neon_sve_function_groups[] = {
    - #define DEF_NEON_SVE_FUNCTION(NAME, SHAPE, TYPES, GROUPS, PREDS) \
    +-static CONSTEXPR const function_group_info neon_sve_function_groups[] = {
    +-#define DEF_NEON_SVE_FUNCTION(NAME, SHAPE, TYPES, GROUPS, PREDS) \
     -  { #NAME, &neon_sve_bridge_functions::NAME, &shapes::SHAPE, 
types_##TYPES, \
     -    groups_##GROUPS, preds_##PREDS, aarch64_required_extensions::ssve 
(0), \
     -    FPM_unused },
    -+  { /* .base_name  = */ #NAME, \
    -+    /* .base       = */ &neon_sve_bridge_functions::NAME, \
    -+    /* .shape      = */ &shapes::SHAPE, \
    -+    /* .types      = */ types_##TYPES, \
    -+    /* .groups     = */ groups_##GROUPS, \
    -+    /* .preds      = */ preds_##PREDS, \
    -+    /* .extensions = */ aarch64_required_extensions::ssve (0), \
    ++/* clang-format off */
    ++static constexpr function_group_info neon_sve_function_groups[] = {
    ++#define DEF_NEON_SVE_FUNCTION(NAME, SHAPE, TYPES, GROUPS, PREDS)          
\
    ++  { /* .base_name  = */ #NAME,                                            
        \
    ++    /* .base       = */ &neon_sve_bridge_functions::NAME,                 
\
    ++    /* .shape      = */ &shapes::SHAPE,                                   
        \
    ++    /* .types      = */ types_##TYPES,                                    
        \
    ++    /* .groups     = */ groups_##GROUPS,                                  
\
    ++    /* .preds      = */ preds_##PREDS,                                    
        \
    ++    /* .extensions = */ aarch64_required_extensions::ssve (0),            
        \
     +    /* .fpm_mode   = */ FPM_unused },
      #include "aarch64-neon-sve-bridge-builtins.def"
      };
     +/* clang-format on */
      
      /* A list of all arm_sme.h functions.  */
    -+/* clang-format off */
    - static CONSTEXPR const function_group_info sme_function_groups[] = {
    - #define DEF_SME_FUNCTION_GS(NAME, SHAPE, TYPES, GROUPS, PREDS) \
    +-static CONSTEXPR const function_group_info sme_function_groups[] = {
    +-#define DEF_SME_FUNCTION_GS(NAME, SHAPE, TYPES, GROUPS, PREDS) \
     -  { #NAME, &functions::NAME, &shapes::SHAPE, types_##TYPES, 
groups_##GROUPS, \
     -    preds_##PREDS, aarch64_required_extensions::REQUIRED_EXTENSIONS, \
     -    FPM_unused },
    -+  { /* .base_name  = */ #NAME, \
    -+    /* .base       = */ &functions::NAME, \
    -+    /* .shape      = */ &shapes::SHAPE, \
    -+    /* .types      = */ types_##TYPES, \
    -+    /* .groups     = */ groups_##GROUPS, \
    -+    /* .preds      = */ preds_##PREDS, \
    -+    /* .extensions = */ aarch64_required_extensions::REQUIRED_EXTENSIONS, 
\
    -+    /* .fpm_mode   = */ FPM_unused },
    - #define DEF_SME_ZA_FUNCTION_GS(NAME, SHAPE, TYPES, GROUPS, PREDS) \
    +-#define DEF_SME_ZA_FUNCTION_GS(NAME, SHAPE, TYPES, GROUPS, PREDS) \
     -  { #NAME, &functions::NAME##_za, &shapes::SHAPE, types_##TYPES, \
     -    groups_##GROUPS, preds_##PREDS, \
     -    aarch64_required_extensions::REQUIRED_EXTENSIONS \
     -      .and_also (AARCH64_FL_ZA_ON), FPM_unused },
    -+  { /* .base_name  = */ #NAME,\
    -+    /* .base       = */ &functions::NAME##_za, \
    -+    /* .shape      = */ &shapes::SHAPE, \
    -+    /* .types      = */ types_##TYPES, \
    -+    /* .groups     = */ groups_##GROUPS, \
    -+    /* .preds      = */ preds_##PREDS, \
    -+    /* .extensions = */ aarch64_required_extensions::REQUIRED_EXTENSIONS \
    -+                          .and_also (AARCH64_FL_ZA_ON), \
    ++/* clang-format off */
    ++static constexpr function_group_info sme_function_groups[] = {
    ++#define DEF_SME_FUNCTION_GS(NAME, SHAPE, TYPES, GROUPS, PREDS)            
        \
    ++  { /* .base_name  = */ #NAME,                                            
        \
    ++    /* .base       = */ &functions::NAME,                                 
\
    ++    /* .shape      = */ &shapes::SHAPE,                                   
        \
    ++    /* .types      = */ types_##TYPES,                                    
        \
    ++    /* .groups     = */ groups_##GROUPS,                                  
\
    ++    /* .preds      = */ preds_##PREDS,                                    
        \
    ++    /* .extensions = */ aarch64_required_extensions::REQUIRED_EXTENSIONS, 
\
    ++    /* .fpm_mode   = */ FPM_unused },
    ++#define DEF_SME_ZA_FUNCTION_GS(NAME, SHAPE, TYPES, GROUPS, PREDS)         
\
    ++  { /* .base_name  = */ #NAME,                                            
        \
    ++    /* .base       = */ &functions::NAME##_za,                            
        \
    ++    /* .shape      = */ &shapes::SHAPE,                                   
        \
    ++    /* .types      = */ types_##TYPES,                                    
        \
    ++    /* .groups     = */ groups_##GROUPS,                                  
\
    ++    /* .preds      = */ preds_##PREDS,                                    
        \
    ++    /* .extensions = */ aarch64_required_extensions::REQUIRED_EXTENSIONS  
\
    ++                          .and_also (AARCH64_FL_ZA_ON),                   
        \
     +    /* .fpm_mode   = */ FPM_unused },
      #include "aarch64-sve-builtins-sme.def"
      };
-- 
2.50.1

Reply via email to