public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-6098] arm: Move arm_simd_info array declaration into header
@ 2021-12-22 14:59 Richard Earnshaw
  0 siblings, 0 replies; only message in thread
From: Richard Earnshaw @ 2021-12-22 14:59 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:8c61cefe2b5091e5361a85768f847732463275d5

commit r12-6098-g8c61cefe2b5091e5361a85768f847732463275d5
Author: Murray Steele <murray.steele@arm.com>
Date:   Wed Dec 22 14:50:00 2021 +0000

    arm: Move arm_simd_info array declaration into header
    
    Move the arm_simd_type and arm_type_qualifiers enums, and
    arm_simd_info struct from arm-builtins.c into arm-builtins.h header.
    
    This is a first step towards internalising the type definitions for
    MVE predicate, vector, and tuple types.  By moving arm_simd_types into
    a header, we allow future patches to use these type trees externally
    to arm-builtins.c, which is a crucial step towards developing an MVE
    intrinsics framework similar to the current SVE implementation.
    
    gcc/ChangeLog:
    
            * config/arm/arm-builtins.c (enum arm_type_qualifiers): Move to
            arm_builtins.h.
            (enum arm_simd_type): Move to arm-builtins.h.
            (struct arm_simd_type_info): Move to arm-builtins.h.
            * config/arm/arm-builtins.h (enum arm_simd_type): Move from
            arm-builtins.c.
            (enum arm_type_qualifiers): Move from arm-builtins.c.
            (struct arm_simd_type_info): Move from arm-builtins.c.

Diff:
---
 gcc/config/arm/arm-builtins.c | 87 +------------------------------------------
 gcc/config/arm/arm-builtins.h | 87 +++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 88 insertions(+), 86 deletions(-)

diff --git a/gcc/config/arm/arm-builtins.c b/gcc/config/arm/arm-builtins.c
index 3a9ff8f26b8..b6bf31349d8 100644
--- a/gcc/config/arm/arm-builtins.c
+++ b/gcc/config/arm/arm-builtins.c
@@ -48,53 +48,6 @@
 
 #define SIMD_MAX_BUILTIN_ARGS 7
 
-enum arm_type_qualifiers
-{
-  /* T foo.  */
-  qualifier_none = 0x0,
-  /* unsigned T foo.  */
-  qualifier_unsigned = 0x1, /* 1 << 0  */
-  /* const T foo.  */
-  qualifier_const = 0x2, /* 1 << 1  */
-  /* T *foo.  */
-  qualifier_pointer = 0x4, /* 1 << 2  */
-  /* const T * foo.  */
-  qualifier_const_pointer = 0x6,
-  /* Used when expanding arguments if an operand could
-     be an immediate.  */
-  qualifier_immediate = 0x8, /* 1 << 3  */
-  qualifier_unsigned_immediate = 0x9,
-  qualifier_maybe_immediate = 0x10, /* 1 << 4  */
-  /* void foo (...).  */
-  qualifier_void = 0x20, /* 1 << 5  */
-  /* Some patterns may have internal operands, this qualifier is an
-     instruction to the initialisation code to skip this operand.  */
-  qualifier_internal = 0x40, /* 1 << 6  */
-  /* Some builtins should use the T_*mode* encoded in a simd_builtin_datum
-     rather than using the type of the operand.  */
-  qualifier_map_mode = 0x80, /* 1 << 7  */
-  /* qualifier_pointer | qualifier_map_mode  */
-  qualifier_pointer_map_mode = 0x84,
-  /* qualifier_const_pointer | qualifier_map_mode  */
-  qualifier_const_pointer_map_mode = 0x86,
-  /* Polynomial types.  */
-  qualifier_poly = 0x100,
-  /* Lane indices - must be within range of previous argument = a vector.  */
-  qualifier_lane_index = 0x200,
-  /* Lane indices for single lane structure loads and stores.  */
-  qualifier_struct_load_store_lane_index = 0x400,
-  /* A void pointer.  */
-  qualifier_void_pointer = 0x800,
-  /* A const void pointer.  */
-  qualifier_const_void_pointer = 0x802,
-  /* Lane indices selected in pairs - must be within range of previous
-     argument = a vector.  */
-  qualifier_lane_pair_index = 0x1000,
-  /* Lane indices selected in quadtuplets - must be within range of previous
-     argument = a vector.  */
-  qualifier_lane_quadtup_index = 0x2000
-};
-
 /*  The qualifier_internal allows generation of a unary builtin from
     a pattern with a third pseudo-operand such as a match_scratch.
     T (T).  */
@@ -1377,50 +1330,12 @@ const char *arm_scalar_builtin_types[] = {
   NULL
 };
 
-#define ENTRY(E, M, Q, S, T, G) E,
-enum arm_simd_type
-{
-#include "arm-simd-builtin-types.def"
-  __TYPE_FINAL
-};
-#undef ENTRY
-
-struct arm_simd_type_info
-{
-  enum arm_simd_type type;
-
-  /* Internal type name.  */
-  const char *name;
-
-  /* Internal type name(mangled).  The mangled names conform to the
-     AAPCS (see "Procedure Call Standard for the ARM Architecture",
-     Appendix A).  To qualify for emission with the mangled names defined in
-     that document, a vector type must not only be of the correct mode but also
-     be of the correct internal Neon vector type (e.g. __simd64_int8_t);
-     these types are registered by arm_init_simd_builtin_types ().  In other
-     words, vector types defined in other ways e.g. via vector_size attribute
-     will get default mangled names.  */
-  const char *mangle;
-
-  /* Internal type.  */
-  tree itype;
-
-  /* Element type.  */
-  tree eltype;
-
-  /* Machine mode the internal type maps to.  */
-  machine_mode mode;
-
-  /* Qualifiers.  */
-  enum arm_type_qualifiers q;
-};
-
 #define ENTRY(E, M, Q, S, T, G)		\
   {E,					\
    "__simd" #S "_" #T "_t",		\
    #G "__simd" #S "_" #T "_t",		\
    NULL_TREE, NULL_TREE, M##mode, qualifier_##Q},
-static struct arm_simd_type_info arm_simd_types [] = {
+struct arm_simd_type_info arm_simd_types [] = {
 #include "arm-simd-builtin-types.def"
 };
 #undef ENTRY
diff --git a/gcc/config/arm/arm-builtins.h b/gcc/config/arm/arm-builtins.h
index bee9f9bb837..a40fa895070 100644
--- a/gcc/config/arm/arm-builtins.h
+++ b/gcc/config/arm/arm-builtins.h
@@ -32,4 +32,91 @@ enum resolver_ident {
 enum resolver_ident arm_describe_resolver (tree);
 unsigned arm_cde_end_args (tree);
 
+#define ENTRY(E, M, Q, S, T, G) E,
+enum arm_simd_type
+{
+#include "arm-simd-builtin-types.def"
+  __TYPE_FINAL
+};
+#undef ENTRY
+
+enum arm_type_qualifiers
+{
+  /* T foo.  */
+  qualifier_none = 0x0,
+  /* unsigned T foo.  */
+  qualifier_unsigned = 0x1, /* 1 << 0  */
+  /* const T foo.  */
+  qualifier_const = 0x2, /* 1 << 1  */
+  /* T *foo.  */
+  qualifier_pointer = 0x4, /* 1 << 2  */
+  /* const T * foo.  */
+  qualifier_const_pointer = 0x6,
+  /* Used when expanding arguments if an operand could
+     be an immediate.  */
+  qualifier_immediate = 0x8, /* 1 << 3  */
+  qualifier_unsigned_immediate = 0x9,
+  qualifier_maybe_immediate = 0x10, /* 1 << 4  */
+  /* void foo (...).  */
+  qualifier_void = 0x20, /* 1 << 5  */
+  /* Some patterns may have internal operands, this qualifier is an
+     instruction to the initialisation code to skip this operand.  */
+  qualifier_internal = 0x40, /* 1 << 6  */
+  /* Some builtins should use the T_*mode* encoded in a simd_builtin_datum
+     rather than using the type of the operand.  */
+  qualifier_map_mode = 0x80, /* 1 << 7  */
+  /* qualifier_pointer | qualifier_map_mode  */
+  qualifier_pointer_map_mode = 0x84,
+  /* qualifier_const_pointer | qualifier_map_mode  */
+  qualifier_const_pointer_map_mode = 0x86,
+  /* Polynomial types.  */
+  qualifier_poly = 0x100,
+  /* Lane indices - must be within range of previous argument = a vector.  */
+  qualifier_lane_index = 0x200,
+  /* Lane indices for single lane structure loads and stores.  */
+  qualifier_struct_load_store_lane_index = 0x400,
+  /* A void pointer.  */
+  qualifier_void_pointer = 0x800,
+  /* A const void pointer.  */
+  qualifier_const_void_pointer = 0x802,
+  /* Lane indices selected in pairs - must be within range of previous
+     argument = a vector.  */
+  qualifier_lane_pair_index = 0x1000,
+  /* Lane indices selected in quadtuplets - must be within range of previous
+     argument = a vector.  */
+  qualifier_lane_quadtup_index = 0x2000
+};
+
+struct arm_simd_type_info
+{
+  enum arm_simd_type type;
+
+  /* Internal type name.  */
+  const char *name;
+
+  /* Internal type name(mangled).  The mangled names conform to the
+     AAPCS (see "Procedure Call Standard for the ARM Architecture",
+     Appendix A).  To qualify for emission with the mangled names defined in
+     that document, a vector type must not only be of the correct mode but also
+     be of the correct internal Neon vector type (e.g. __simd64_int8_t);
+     these types are registered by arm_init_simd_builtin_types ().  In other
+     words, vector types defined in other ways e.g. via vector_size attribute
+     will get default mangled names.  */
+  const char *mangle;
+
+  /* Internal type.  */
+  tree itype;
+
+  /* Element type.  */
+  tree eltype;
+
+  /* Machine mode the internal type maps to.  */
+  machine_mode mode;
+
+  /* Qualifiers.  */
+  enum arm_type_qualifiers q;
+};
+
+extern struct arm_simd_type_info arm_simd_types[];
+
 #endif /* GCC_ARM_BUILTINS_H */


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-12-22 14:59 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-22 14:59 [gcc r12-6098] arm: Move arm_simd_info array declaration into header Richard Earnshaw

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).