annotate gcc/config/s390/s390-builtins.h @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children 84e7813d76e9
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 /* Common data structures used for builtin handling on S/390.
kono
parents:
diff changeset
2 Copyright (C) 2015-2017 Free Software Foundation, Inc.
kono
parents:
diff changeset
3
kono
parents:
diff changeset
4 Contributed by Andreas Krebbel (Andreas.Krebbel@de.ibm.com).
kono
parents:
diff changeset
5
kono
parents:
diff changeset
6 This file is part of GCC.
kono
parents:
diff changeset
7
kono
parents:
diff changeset
8 GCC is free software; you can redistribute it and/or modify it
kono
parents:
diff changeset
9 under the terms of the GNU General Public License as published by
kono
parents:
diff changeset
10 the Free Software Foundation; either version 3, or (at your option)
kono
parents:
diff changeset
11 any later version.
kono
parents:
diff changeset
12
kono
parents:
diff changeset
13 GCC is distributed in the hope that it will be useful, but WITHOUT
kono
parents:
diff changeset
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
kono
parents:
diff changeset
15 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
kono
parents:
diff changeset
16 License for more details.
kono
parents:
diff changeset
17
kono
parents:
diff changeset
18 You should have received a copy of the GNU General Public License
kono
parents:
diff changeset
19 along with GCC; see the file COPYING3. If not see
kono
parents:
diff changeset
20 <http://www.gnu.org/licenses/>. */
kono
parents:
diff changeset
21
kono
parents:
diff changeset
22 /* This files contains data structure definitions which can be used by
kono
parents:
diff changeset
23 s390-builtins.c as well as s390-c.c. Since the latter is
kono
parents:
diff changeset
24 considered to be part of the front-end we have to be careful not
kono
parents:
diff changeset
25 to use any of tree and rtx like data structures. */
kono
parents:
diff changeset
26
kono
parents:
diff changeset
27 /* Builtin types, data and prototypes. */
kono
parents:
diff changeset
28
kono
parents:
diff changeset
29 enum s390_builtin_type_index
kono
parents:
diff changeset
30 {
kono
parents:
diff changeset
31 #undef DEF_TYPE
kono
parents:
diff changeset
32 #undef DEF_POINTER_TYPE
kono
parents:
diff changeset
33 #undef DEF_DISTINCT_TYPE
kono
parents:
diff changeset
34 #undef DEF_VECTOR_TYPE
kono
parents:
diff changeset
35 #undef DEF_OPAQUE_VECTOR_TYPE
kono
parents:
diff changeset
36 #undef DEF_FN_TYPE
kono
parents:
diff changeset
37 #undef DEF_OV_TYPE
kono
parents:
diff changeset
38 #define DEF_TYPE(INDEX, ...) INDEX,
kono
parents:
diff changeset
39 #define DEF_POINTER_TYPE(INDEX, ...) INDEX,
kono
parents:
diff changeset
40 #define DEF_DISTINCT_TYPE(INDEX, ...) INDEX,
kono
parents:
diff changeset
41 #define DEF_VECTOR_TYPE(INDEX, ...) INDEX,
kono
parents:
diff changeset
42 #define DEF_OPAQUE_VECTOR_TYPE(INDEX, ...) INDEX,
kono
parents:
diff changeset
43 #define DEF_FN_TYPE(...)
kono
parents:
diff changeset
44 #define DEF_OV_TYPE(...)
kono
parents:
diff changeset
45 #include "s390-builtin-types.def"
kono
parents:
diff changeset
46 BT_MAX
kono
parents:
diff changeset
47 };
kono
parents:
diff changeset
48
kono
parents:
diff changeset
49 enum s390_builtin_fn_type_index
kono
parents:
diff changeset
50 {
kono
parents:
diff changeset
51 #undef DEF_TYPE
kono
parents:
diff changeset
52 #undef DEF_POINTER_TYPE
kono
parents:
diff changeset
53 #undef DEF_DISTINCT_TYPE
kono
parents:
diff changeset
54 #undef DEF_VECTOR_TYPE
kono
parents:
diff changeset
55 #undef DEF_OPAQUE_VECTOR_TYPE
kono
parents:
diff changeset
56 #undef DEF_FN_TYPE
kono
parents:
diff changeset
57 #undef DEF_OV_TYPE
kono
parents:
diff changeset
58 #define DEF_TYPE(...)
kono
parents:
diff changeset
59 #define DEF_POINTER_TYPE(...)
kono
parents:
diff changeset
60 #define DEF_DISTINCT_TYPE(...)
kono
parents:
diff changeset
61 #define DEF_VECTOR_TYPE(...)
kono
parents:
diff changeset
62 #define DEF_OPAQUE_VECTOR_TYPE(...)
kono
parents:
diff changeset
63 #define DEF_FN_TYPE(INDEX, ...) INDEX,
kono
parents:
diff changeset
64 #define DEF_OV_TYPE(...)
kono
parents:
diff changeset
65 #include "s390-builtin-types.def"
kono
parents:
diff changeset
66 BT_FN_MAX
kono
parents:
diff changeset
67 };
kono
parents:
diff changeset
68
kono
parents:
diff changeset
69 enum s390_builtin_ov_type_index
kono
parents:
diff changeset
70 {
kono
parents:
diff changeset
71 #undef DEF_TYPE
kono
parents:
diff changeset
72 #undef DEF_POINTER_TYPE
kono
parents:
diff changeset
73 #undef DEF_DISTINCT_TYPE
kono
parents:
diff changeset
74 #undef DEF_VECTOR_TYPE
kono
parents:
diff changeset
75 #undef DEF_OPAQUE_VECTOR_TYPE
kono
parents:
diff changeset
76 #undef DEF_FN_TYPE
kono
parents:
diff changeset
77 #undef DEF_OV_TYPE
kono
parents:
diff changeset
78 #define DEF_TYPE(...)
kono
parents:
diff changeset
79 #define DEF_POINTER_TYPE(...)
kono
parents:
diff changeset
80 #define DEF_DISTINCT_TYPE(...)
kono
parents:
diff changeset
81 #define DEF_VECTOR_TYPE(...)
kono
parents:
diff changeset
82 #define DEF_OPAQUE_VECTOR_TYPE(...)
kono
parents:
diff changeset
83 #define DEF_FN_TYPE(...)
kono
parents:
diff changeset
84 #define DEF_OV_TYPE(INDEX, ...) INDEX,
kono
parents:
diff changeset
85 #include "s390-builtin-types.def"
kono
parents:
diff changeset
86 BT_OV_MAX
kono
parents:
diff changeset
87 };
kono
parents:
diff changeset
88
kono
parents:
diff changeset
89 #define MAX_OV_OPERANDS 6
kono
parents:
diff changeset
90
kono
parents:
diff changeset
91 extern tree s390_builtin_types[BT_MAX];
kono
parents:
diff changeset
92 extern tree s390_builtin_fn_types[BT_FN_MAX];
kono
parents:
diff changeset
93
kono
parents:
diff changeset
94 /* Builtins. */
kono
parents:
diff changeset
95
kono
parents:
diff changeset
96 enum s390_builtins {
kono
parents:
diff changeset
97 #undef B_DEF
kono
parents:
diff changeset
98 #undef OB_DEF
kono
parents:
diff changeset
99 #undef OB_DEF_VAR
kono
parents:
diff changeset
100 #define B_DEF(NAME, ...) S390_BUILTIN_##NAME,
kono
parents:
diff changeset
101 #define OB_DEF(...)
kono
parents:
diff changeset
102 #define OB_DEF_VAR(...)
kono
parents:
diff changeset
103
kono
parents:
diff changeset
104 #include "s390-builtins.def"
kono
parents:
diff changeset
105 S390_BUILTIN_MAX
kono
parents:
diff changeset
106 };
kono
parents:
diff changeset
107
kono
parents:
diff changeset
108
kono
parents:
diff changeset
109 /* Generate an enumeration of all overloaded builtins defined with
kono
parents:
diff changeset
110 OB_DEF in s390-builtins.def. */
kono
parents:
diff changeset
111 enum s390_overloaded_builtins {
kono
parents:
diff changeset
112 #undef B_DEF
kono
parents:
diff changeset
113 #undef OB_DEF
kono
parents:
diff changeset
114 #undef OB_DEF_VAR
kono
parents:
diff changeset
115 #define B_DEF(...)
kono
parents:
diff changeset
116 #define OB_DEF(NAME, ...) S390_OVERLOADED_BUILTIN_##NAME,
kono
parents:
diff changeset
117 #define OB_DEF_VAR(...)
kono
parents:
diff changeset
118 #include "s390-builtins.def"
kono
parents:
diff changeset
119 S390_OVERLOADED_BUILTIN_MAX
kono
parents:
diff changeset
120 };
kono
parents:
diff changeset
121
kono
parents:
diff changeset
122 /* Generate an enumeration of all variants of overloaded builtins
kono
parents:
diff changeset
123 defined with OB_DEF_VAR in s390-builtins.def. */
kono
parents:
diff changeset
124 enum s390_overloaded_builtin_vars {
kono
parents:
diff changeset
125 #undef B_DEF
kono
parents:
diff changeset
126 #undef OB_DEF
kono
parents:
diff changeset
127 #undef OB_DEF_VAR
kono
parents:
diff changeset
128 #define B_DEF(...)
kono
parents:
diff changeset
129 #define OB_DEF(...)
kono
parents:
diff changeset
130 #define OB_DEF_VAR(NAME, ...) S390_OVERLOADED_BUILTIN_VAR_##NAME,
kono
parents:
diff changeset
131 #include "s390-builtins.def"
kono
parents:
diff changeset
132 S390_OVERLOADED_BUILTIN_VAR_MAX
kono
parents:
diff changeset
133 };
kono
parents:
diff changeset
134
kono
parents:
diff changeset
135 #define S390_OVERLOADED_BUILTIN_OFFSET S390_BUILTIN_MAX
kono
parents:
diff changeset
136 #define S390_OVERLOADED_BUILTIN_VAR_OFFSET \
kono
parents:
diff changeset
137 (S390_BUILTIN_MAX + S390_OVERLOADED_BUILTIN_MAX)
kono
parents:
diff changeset
138 #define S390_ALL_BUILTIN_MAX \
kono
parents:
diff changeset
139 (S390_BUILTIN_MAX + S390_OVERLOADED_BUILTIN_MAX + \
kono
parents:
diff changeset
140 S390_OVERLOADED_BUILTIN_VAR_MAX)
kono
parents:
diff changeset
141
kono
parents:
diff changeset
142 extern const unsigned int bflags_builtin[S390_BUILTIN_MAX + 1];
kono
parents:
diff changeset
143 extern const unsigned int opflags_builtin[S390_BUILTIN_MAX + 1];
kono
parents:
diff changeset
144
kono
parents:
diff changeset
145 extern const unsigned int
kono
parents:
diff changeset
146 bflags_overloaded_builtin[S390_OVERLOADED_BUILTIN_MAX + 1];
kono
parents:
diff changeset
147 extern const unsigned int
kono
parents:
diff changeset
148 bflags_overloaded_builtin_var[S390_OVERLOADED_BUILTIN_VAR_MAX + 1];
kono
parents:
diff changeset
149 extern const unsigned int
kono
parents:
diff changeset
150 opflags_overloaded_builtin_var[S390_OVERLOADED_BUILTIN_VAR_MAX + 1];
kono
parents:
diff changeset
151
kono
parents:
diff changeset
152 static inline unsigned int
kono
parents:
diff changeset
153 bflags_for_builtin (int fcode)
kono
parents:
diff changeset
154 {
kono
parents:
diff changeset
155 if (fcode >= S390_OVERLOADED_BUILTIN_VAR_OFFSET)
kono
parents:
diff changeset
156 gcc_unreachable ();
kono
parents:
diff changeset
157 else if (fcode >= S390_OVERLOADED_BUILTIN_OFFSET)
kono
parents:
diff changeset
158 return bflags_overloaded_builtin[fcode - S390_BUILTIN_MAX];
kono
parents:
diff changeset
159 else
kono
parents:
diff changeset
160 return bflags_builtin[fcode];
kono
parents:
diff changeset
161 }
kono
parents:
diff changeset
162
kono
parents:
diff changeset
163 static inline unsigned int
kono
parents:
diff changeset
164 opflags_for_builtin (int fcode)
kono
parents:
diff changeset
165 {
kono
parents:
diff changeset
166 if (fcode >= S390_OVERLOADED_BUILTIN_VAR_OFFSET)
kono
parents:
diff changeset
167 return opflags_overloaded_builtin_var[fcode -
kono
parents:
diff changeset
168 S390_OVERLOADED_BUILTIN_VAR_OFFSET];
kono
parents:
diff changeset
169 else if (fcode >= S390_OVERLOADED_BUILTIN_OFFSET)
kono
parents:
diff changeset
170 gcc_unreachable ();
kono
parents:
diff changeset
171 else
kono
parents:
diff changeset
172 return opflags_builtin[fcode];
kono
parents:
diff changeset
173 }
kono
parents:
diff changeset
174
kono
parents:
diff changeset
175 extern tree s390_builtin_decls[S390_BUILTIN_MAX +
kono
parents:
diff changeset
176 S390_OVERLOADED_BUILTIN_MAX +
kono
parents:
diff changeset
177 S390_OVERLOADED_BUILTIN_VAR_MAX];