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