1 /* Declarations for determining resolver for a given builtin.
2    Copyright (C) 2020-2022 Free Software Foundation, Inc.
3 
4    This file is part of GCC.
5 
6    GCC is free software; you can redistribute it and/or modify it
7    under the terms of the GNU General Public License as published
8    by the Free Software Foundation; either version 3, or (at your
9    option) any later version.
10 
11    GCC is distributed in the hope that it will be useful, but WITHOUT
12    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13    or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
14    License for more details.
15 
16    Under Section 7 of GPL version 3, you are granted additional
17    permissions described in the GCC Runtime Library Exception, version
18    3.1, as published by the Free Software Foundation.
19 
20    You should have received a copy of the GNU General Public License and
21    a copy of the GCC Runtime Library Exception along with this program;
22    see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
23    <http://www.gnu.org/licenses/>.  */
24 
25 #ifndef GCC_ARM_BUILTINS_H
26 #define GCC_ARM_BUILTINS_H
27 
28 enum resolver_ident {
29     arm_cde_resolver,
30     arm_no_resolver
31 };
32 enum resolver_ident arm_describe_resolver (tree);
33 unsigned arm_cde_end_args (tree);
34 
35 #define ENTRY(E, M, Q, S, T, G) E,
36 enum arm_simd_type
37 {
38 #include "arm-simd-builtin-types.def"
39   __TYPE_FINAL
40 };
41 #undef ENTRY
42 
43 enum arm_type_qualifiers
44 {
45   /* T foo.  */
46   qualifier_none = 0x0,
47   /* unsigned T foo.  */
48   qualifier_unsigned = 0x1, /* 1 << 0  */
49   /* const T foo.  */
50   qualifier_const = 0x2, /* 1 << 1  */
51   /* T *foo.  */
52   qualifier_pointer = 0x4, /* 1 << 2  */
53   /* const T * foo.  */
54   qualifier_const_pointer = 0x6,
55   /* Used when expanding arguments if an operand could
56      be an immediate.  */
57   qualifier_immediate = 0x8, /* 1 << 3  */
58   qualifier_unsigned_immediate = 0x9,
59   qualifier_maybe_immediate = 0x10, /* 1 << 4  */
60   /* void foo (...).  */
61   qualifier_void = 0x20, /* 1 << 5  */
62   /* Some patterns may have internal operands, this qualifier is an
63      instruction to the initialisation code to skip this operand.  */
64   qualifier_internal = 0x40, /* 1 << 6  */
65   /* Some builtins should use the T_*mode* encoded in a simd_builtin_datum
66      rather than using the type of the operand.  */
67   qualifier_map_mode = 0x80, /* 1 << 7  */
68   /* qualifier_pointer | qualifier_map_mode  */
69   qualifier_pointer_map_mode = 0x84,
70   /* qualifier_const_pointer | qualifier_map_mode  */
71   qualifier_const_pointer_map_mode = 0x86,
72   /* Polynomial types.  */
73   qualifier_poly = 0x100,
74   /* Lane indices - must be within range of previous argument = a vector.  */
75   qualifier_lane_index = 0x200,
76   /* Lane indices for single lane structure loads and stores.  */
77   qualifier_struct_load_store_lane_index = 0x400,
78   /* A void pointer.  */
79   qualifier_void_pointer = 0x800,
80   /* A const void pointer.  */
81   qualifier_const_void_pointer = 0x802,
82   /* Lane indices selected in pairs - must be within range of previous
83      argument = a vector.  */
84   qualifier_lane_pair_index = 0x1000,
85   /* Lane indices selected in quadtuplets - must be within range of previous
86      argument = a vector.  */
87   qualifier_lane_quadtup_index = 0x2000,
88   /* MVE vector predicates.  */
89   qualifier_predicate = 0x4000
90 };
91 
92 struct arm_simd_type_info
93 {
94   enum arm_simd_type type;
95 
96   /* Internal type name.  */
97   const char *name;
98 
99   /* Internal type name(mangled).  The mangled names conform to the
100      AAPCS (see "Procedure Call Standard for the ARM Architecture",
101      Appendix A).  To qualify for emission with the mangled names defined in
102      that document, a vector type must not only be of the correct mode but also
103      be of the correct internal Neon vector type (e.g. __simd64_int8_t);
104      these types are registered by arm_init_simd_builtin_types ().  In other
105      words, vector types defined in other ways e.g. via vector_size attribute
106      will get default mangled names.  */
107   const char *mangle;
108 
109   /* Internal type.  */
110   tree itype;
111 
112   /* Element type.  */
113   tree eltype;
114 
115   /* Machine mode the internal type maps to.  */
116   machine_mode mode;
117 
118   /* Qualifiers.  */
119   enum arm_type_qualifiers q;
120 };
121 
122 extern struct arm_simd_type_info arm_simd_types[];
123 
124 #endif /* GCC_ARM_BUILTINS_H */
125