annotate gcc/config/arm/arm-builtins.c @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents 84e7813d76e9
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 /* Description of builtins used by the ARM backend.
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
2 Copyright (C) 2014-2020 Free Software Foundation, Inc.
111
kono
parents:
diff changeset
3
kono
parents:
diff changeset
4 This file is part of GCC.
kono
parents:
diff changeset
5
kono
parents:
diff changeset
6 GCC is free software; you can redistribute it and/or modify it
kono
parents:
diff changeset
7 under the terms of the GNU General Public License as published
kono
parents:
diff changeset
8 by the Free Software Foundation; either version 3, or (at your
kono
parents:
diff changeset
9 option) any later version.
kono
parents:
diff changeset
10
kono
parents:
diff changeset
11 GCC is distributed in the hope that it will be useful, but WITHOUT
kono
parents:
diff changeset
12 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
kono
parents:
diff changeset
13 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
kono
parents:
diff changeset
14 License for more details.
kono
parents:
diff changeset
15
kono
parents:
diff changeset
16 You should have received a copy of the GNU General Public License
kono
parents:
diff changeset
17 along with GCC; see the file COPYING3. If not see
kono
parents:
diff changeset
18 <http://www.gnu.org/licenses/>. */
kono
parents:
diff changeset
19
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
20 #define IN_TARGET_CODE 1
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
21
111
kono
parents:
diff changeset
22 #include "config.h"
kono
parents:
diff changeset
23 #include "system.h"
kono
parents:
diff changeset
24 #include "coretypes.h"
kono
parents:
diff changeset
25 #include "target.h"
kono
parents:
diff changeset
26 #include "function.h"
kono
parents:
diff changeset
27 #include "rtl.h"
kono
parents:
diff changeset
28 #include "tree.h"
kono
parents:
diff changeset
29 #include "gimple-expr.h"
kono
parents:
diff changeset
30 #include "memmodel.h"
kono
parents:
diff changeset
31 #include "tm_p.h"
kono
parents:
diff changeset
32 #include "profile-count.h"
kono
parents:
diff changeset
33 #include "optabs.h"
kono
parents:
diff changeset
34 #include "emit-rtl.h"
kono
parents:
diff changeset
35 #include "recog.h"
kono
parents:
diff changeset
36 #include "diagnostic-core.h"
kono
parents:
diff changeset
37 #include "fold-const.h"
kono
parents:
diff changeset
38 #include "stor-layout.h"
kono
parents:
diff changeset
39 #include "explow.h"
kono
parents:
diff changeset
40 #include "expr.h"
kono
parents:
diff changeset
41 #include "langhooks.h"
kono
parents:
diff changeset
42 #include "case-cfn-macros.h"
kono
parents:
diff changeset
43 #include "sbitmap.h"
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
44 #include "stringpool.h"
111
kono
parents:
diff changeset
45
kono
parents:
diff changeset
46 #define SIMD_MAX_BUILTIN_ARGS 7
kono
parents:
diff changeset
47
kono
parents:
diff changeset
48 enum arm_type_qualifiers
kono
parents:
diff changeset
49 {
kono
parents:
diff changeset
50 /* T foo. */
kono
parents:
diff changeset
51 qualifier_none = 0x0,
kono
parents:
diff changeset
52 /* unsigned T foo. */
kono
parents:
diff changeset
53 qualifier_unsigned = 0x1, /* 1 << 0 */
kono
parents:
diff changeset
54 /* const T foo. */
kono
parents:
diff changeset
55 qualifier_const = 0x2, /* 1 << 1 */
kono
parents:
diff changeset
56 /* T *foo. */
kono
parents:
diff changeset
57 qualifier_pointer = 0x4, /* 1 << 2 */
kono
parents:
diff changeset
58 /* const T * foo. */
kono
parents:
diff changeset
59 qualifier_const_pointer = 0x6,
kono
parents:
diff changeset
60 /* Used when expanding arguments if an operand could
kono
parents:
diff changeset
61 be an immediate. */
kono
parents:
diff changeset
62 qualifier_immediate = 0x8, /* 1 << 3 */
kono
parents:
diff changeset
63 qualifier_unsigned_immediate = 0x9,
kono
parents:
diff changeset
64 qualifier_maybe_immediate = 0x10, /* 1 << 4 */
kono
parents:
diff changeset
65 /* void foo (...). */
kono
parents:
diff changeset
66 qualifier_void = 0x20, /* 1 << 5 */
kono
parents:
diff changeset
67 /* Some patterns may have internal operands, this qualifier is an
kono
parents:
diff changeset
68 instruction to the initialisation code to skip this operand. */
kono
parents:
diff changeset
69 qualifier_internal = 0x40, /* 1 << 6 */
kono
parents:
diff changeset
70 /* Some builtins should use the T_*mode* encoded in a simd_builtin_datum
kono
parents:
diff changeset
71 rather than using the type of the operand. */
kono
parents:
diff changeset
72 qualifier_map_mode = 0x80, /* 1 << 7 */
kono
parents:
diff changeset
73 /* qualifier_pointer | qualifier_map_mode */
kono
parents:
diff changeset
74 qualifier_pointer_map_mode = 0x84,
kono
parents:
diff changeset
75 /* qualifier_const_pointer | qualifier_map_mode */
kono
parents:
diff changeset
76 qualifier_const_pointer_map_mode = 0x86,
kono
parents:
diff changeset
77 /* Polynomial types. */
kono
parents:
diff changeset
78 qualifier_poly = 0x100,
kono
parents:
diff changeset
79 /* Lane indices - must be within range of previous argument = a vector. */
kono
parents:
diff changeset
80 qualifier_lane_index = 0x200,
kono
parents:
diff changeset
81 /* Lane indices for single lane structure loads and stores. */
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
82 qualifier_struct_load_store_lane_index = 0x400,
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
83 /* A void pointer. */
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
84 qualifier_void_pointer = 0x800,
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
85 /* A const void pointer. */
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
86 qualifier_const_void_pointer = 0x802,
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
87 /* Lane indices selected in pairs - must be within range of previous
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
88 argument = a vector. */
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
89 qualifier_lane_pair_index = 0x1000,
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
90 /* Lane indices selected in quadtuplets - must be within range of previous
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
91 argument = a vector. */
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
92 qualifier_lane_quadtup_index = 0x2000
111
kono
parents:
diff changeset
93 };
kono
parents:
diff changeset
94
kono
parents:
diff changeset
95 /* The qualifier_internal allows generation of a unary builtin from
kono
parents:
diff changeset
96 a pattern with a third pseudo-operand such as a match_scratch.
kono
parents:
diff changeset
97 T (T). */
kono
parents:
diff changeset
98 static enum arm_type_qualifiers
kono
parents:
diff changeset
99 arm_unop_qualifiers[SIMD_MAX_BUILTIN_ARGS]
kono
parents:
diff changeset
100 = { qualifier_none, qualifier_none, qualifier_internal };
kono
parents:
diff changeset
101 #define UNOP_QUALIFIERS (arm_unop_qualifiers)
kono
parents:
diff changeset
102
kono
parents:
diff changeset
103 /* unsigned T (unsigned T). */
kono
parents:
diff changeset
104 static enum arm_type_qualifiers
kono
parents:
diff changeset
105 arm_bswap_qualifiers[SIMD_MAX_BUILTIN_ARGS]
kono
parents:
diff changeset
106 = { qualifier_unsigned, qualifier_unsigned };
kono
parents:
diff changeset
107 #define BSWAP_QUALIFIERS (arm_bswap_qualifiers)
kono
parents:
diff changeset
108
kono
parents:
diff changeset
109 /* T (T, T [maybe_immediate]). */
kono
parents:
diff changeset
110 static enum arm_type_qualifiers
kono
parents:
diff changeset
111 arm_binop_qualifiers[SIMD_MAX_BUILTIN_ARGS]
kono
parents:
diff changeset
112 = { qualifier_none, qualifier_none, qualifier_maybe_immediate };
kono
parents:
diff changeset
113 #define BINOP_QUALIFIERS (arm_binop_qualifiers)
kono
parents:
diff changeset
114
kono
parents:
diff changeset
115 /* T (T, T, T). */
kono
parents:
diff changeset
116 static enum arm_type_qualifiers
kono
parents:
diff changeset
117 arm_ternop_qualifiers[SIMD_MAX_BUILTIN_ARGS]
kono
parents:
diff changeset
118 = { qualifier_none, qualifier_none, qualifier_none, qualifier_none };
kono
parents:
diff changeset
119 #define TERNOP_QUALIFIERS (arm_ternop_qualifiers)
kono
parents:
diff changeset
120
kono
parents:
diff changeset
121 /* unsigned T (unsigned T, unsigned T, unsigned T). */
kono
parents:
diff changeset
122 static enum arm_type_qualifiers
kono
parents:
diff changeset
123 arm_unsigned_uternop_qualifiers[SIMD_MAX_BUILTIN_ARGS]
kono
parents:
diff changeset
124 = { qualifier_unsigned, qualifier_unsigned, qualifier_unsigned,
kono
parents:
diff changeset
125 qualifier_unsigned };
kono
parents:
diff changeset
126 #define UTERNOP_QUALIFIERS (arm_unsigned_uternop_qualifiers)
kono
parents:
diff changeset
127
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
128 /* T (T, unsigned T, T). */
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
129 static enum arm_type_qualifiers
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
130 arm_usternop_qualifiers[SIMD_MAX_BUILTIN_ARGS]
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
131 = { qualifier_none, qualifier_none, qualifier_unsigned,
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
132 qualifier_none };
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
133 #define USTERNOP_QUALIFIERS (arm_usternop_qualifiers)
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
134
111
kono
parents:
diff changeset
135 /* T (T, immediate). */
kono
parents:
diff changeset
136 static enum arm_type_qualifiers
kono
parents:
diff changeset
137 arm_binop_imm_qualifiers[SIMD_MAX_BUILTIN_ARGS]
kono
parents:
diff changeset
138 = { qualifier_none, qualifier_none, qualifier_immediate };
kono
parents:
diff changeset
139 #define BINOP_IMM_QUALIFIERS (arm_binop_imm_qualifiers)
kono
parents:
diff changeset
140
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
141 /* T (T, unsigned immediate). */
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
142 static enum arm_type_qualifiers
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
143 arm_sat_binop_imm_qualifiers[SIMD_MAX_BUILTIN_ARGS]
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
144 = { qualifier_unsigned, qualifier_none, qualifier_unsigned_immediate };
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
145 #define SAT_BINOP_UNSIGNED_IMM_QUALIFIERS \
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
146 (arm_sat_binop_imm_qualifiers)
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
147
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
148 /* unsigned T (T, unsigned immediate). */
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
149 static enum arm_type_qualifiers
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
150 arm_unsigned_sat_binop_unsigned_imm_qualifiers[SIMD_MAX_BUILTIN_ARGS]
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
151 = { qualifier_unsigned, qualifier_none, qualifier_unsigned_immediate };
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
152 #define UNSIGNED_SAT_BINOP_UNSIGNED_IMM_QUALIFIERS \
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
153 (arm_unsigned_sat_binop_unsigned_imm_qualifiers)
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
154
111
kono
parents:
diff changeset
155 /* T (T, lane index). */
kono
parents:
diff changeset
156 static enum arm_type_qualifiers
kono
parents:
diff changeset
157 arm_getlane_qualifiers[SIMD_MAX_BUILTIN_ARGS]
kono
parents:
diff changeset
158 = { qualifier_none, qualifier_none, qualifier_lane_index };
kono
parents:
diff changeset
159 #define GETLANE_QUALIFIERS (arm_getlane_qualifiers)
kono
parents:
diff changeset
160
kono
parents:
diff changeset
161 /* T (T, T, T, immediate). */
kono
parents:
diff changeset
162 static enum arm_type_qualifiers
kono
parents:
diff changeset
163 arm_mac_n_qualifiers[SIMD_MAX_BUILTIN_ARGS]
kono
parents:
diff changeset
164 = { qualifier_none, qualifier_none, qualifier_none,
kono
parents:
diff changeset
165 qualifier_none, qualifier_immediate };
kono
parents:
diff changeset
166 #define MAC_N_QUALIFIERS (arm_mac_n_qualifiers)
kono
parents:
diff changeset
167
kono
parents:
diff changeset
168 /* T (T, T, T, lane index). */
kono
parents:
diff changeset
169 static enum arm_type_qualifiers
kono
parents:
diff changeset
170 arm_mac_lane_qualifiers[SIMD_MAX_BUILTIN_ARGS]
kono
parents:
diff changeset
171 = { qualifier_none, qualifier_none, qualifier_none,
kono
parents:
diff changeset
172 qualifier_none, qualifier_lane_index };
kono
parents:
diff changeset
173 #define MAC_LANE_QUALIFIERS (arm_mac_lane_qualifiers)
kono
parents:
diff changeset
174
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
175 /* T (T, T, T, lane pair index). */
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
176 static enum arm_type_qualifiers
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
177 arm_mac_lane_pair_qualifiers[SIMD_MAX_BUILTIN_ARGS]
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
178 = { qualifier_none, qualifier_none, qualifier_none,
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
179 qualifier_none, qualifier_lane_pair_index };
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
180 #define MAC_LANE_PAIR_QUALIFIERS (arm_mac_lane_pair_qualifiers)
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
181
111
kono
parents:
diff changeset
182 /* unsigned T (unsigned T, unsigned T, unsigend T, lane index). */
kono
parents:
diff changeset
183 static enum arm_type_qualifiers
kono
parents:
diff changeset
184 arm_umac_lane_qualifiers[SIMD_MAX_BUILTIN_ARGS]
kono
parents:
diff changeset
185 = { qualifier_unsigned, qualifier_unsigned, qualifier_unsigned,
kono
parents:
diff changeset
186 qualifier_unsigned, qualifier_lane_index };
kono
parents:
diff changeset
187 #define UMAC_LANE_QUALIFIERS (arm_umac_lane_qualifiers)
kono
parents:
diff changeset
188
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
189 /* T (T, unsigned T, T, lane index). */
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
190 static enum arm_type_qualifiers
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
191 arm_usmac_lane_quadtup_qualifiers[SIMD_MAX_BUILTIN_ARGS]
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
192 = { qualifier_none, qualifier_none, qualifier_unsigned,
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
193 qualifier_none, qualifier_lane_quadtup_index };
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
194 #define USMAC_LANE_QUADTUP_QUALIFIERS (arm_usmac_lane_quadtup_qualifiers)
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
195
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
196 /* T (T, T, unsigend T, lane index). */
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
197 static enum arm_type_qualifiers
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
198 arm_sumac_lane_quadtup_qualifiers[SIMD_MAX_BUILTIN_ARGS]
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
199 = { qualifier_none, qualifier_none, qualifier_none,
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
200 qualifier_unsigned, qualifier_lane_quadtup_index };
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
201 #define SUMAC_LANE_QUADTUP_QUALIFIERS (arm_sumac_lane_quadtup_qualifiers)
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
202
111
kono
parents:
diff changeset
203 /* T (T, T, immediate). */
kono
parents:
diff changeset
204 static enum arm_type_qualifiers
kono
parents:
diff changeset
205 arm_ternop_imm_qualifiers[SIMD_MAX_BUILTIN_ARGS]
kono
parents:
diff changeset
206 = { qualifier_none, qualifier_none, qualifier_none, qualifier_immediate };
kono
parents:
diff changeset
207 #define TERNOP_IMM_QUALIFIERS (arm_ternop_imm_qualifiers)
kono
parents:
diff changeset
208
kono
parents:
diff changeset
209 /* T (T, T, lane index). */
kono
parents:
diff changeset
210 static enum arm_type_qualifiers
kono
parents:
diff changeset
211 arm_setlane_qualifiers[SIMD_MAX_BUILTIN_ARGS]
kono
parents:
diff changeset
212 = { qualifier_none, qualifier_none, qualifier_none, qualifier_lane_index };
kono
parents:
diff changeset
213 #define SETLANE_QUALIFIERS (arm_setlane_qualifiers)
kono
parents:
diff changeset
214
kono
parents:
diff changeset
215 /* T (T, T). */
kono
parents:
diff changeset
216 static enum arm_type_qualifiers
kono
parents:
diff changeset
217 arm_combine_qualifiers[SIMD_MAX_BUILTIN_ARGS]
kono
parents:
diff changeset
218 = { qualifier_none, qualifier_none, qualifier_none };
kono
parents:
diff changeset
219 #define COMBINE_QUALIFIERS (arm_combine_qualifiers)
kono
parents:
diff changeset
220
kono
parents:
diff changeset
221 /* T ([T element type] *). */
kono
parents:
diff changeset
222 static enum arm_type_qualifiers
kono
parents:
diff changeset
223 arm_load1_qualifiers[SIMD_MAX_BUILTIN_ARGS]
kono
parents:
diff changeset
224 = { qualifier_none, qualifier_const_pointer_map_mode };
kono
parents:
diff changeset
225 #define LOAD1_QUALIFIERS (arm_load1_qualifiers)
kono
parents:
diff changeset
226
kono
parents:
diff changeset
227 /* T ([T element type] *, T, immediate). */
kono
parents:
diff changeset
228 static enum arm_type_qualifiers
kono
parents:
diff changeset
229 arm_load1_lane_qualifiers[SIMD_MAX_BUILTIN_ARGS]
kono
parents:
diff changeset
230 = { qualifier_none, qualifier_const_pointer_map_mode,
kono
parents:
diff changeset
231 qualifier_none, qualifier_struct_load_store_lane_index };
kono
parents:
diff changeset
232 #define LOAD1LANE_QUALIFIERS (arm_load1_lane_qualifiers)
kono
parents:
diff changeset
233
kono
parents:
diff changeset
234 /* unsigned T (unsigned T, unsigned T, unsigned T). */
kono
parents:
diff changeset
235 static enum arm_type_qualifiers
kono
parents:
diff changeset
236 arm_unsigned_binop_qualifiers[SIMD_MAX_BUILTIN_ARGS]
kono
parents:
diff changeset
237 = { qualifier_unsigned, qualifier_unsigned, qualifier_unsigned,
kono
parents:
diff changeset
238 qualifier_unsigned };
kono
parents:
diff changeset
239 #define UBINOP_QUALIFIERS (arm_unsigned_binop_qualifiers)
kono
parents:
diff changeset
240
kono
parents:
diff changeset
241 /* void (unsigned immediate, unsigned immediate, unsigned immediate,
kono
parents:
diff changeset
242 unsigned immediate, unsigned immediate, unsigned immediate). */
kono
parents:
diff changeset
243 static enum arm_type_qualifiers
kono
parents:
diff changeset
244 arm_cdp_qualifiers[SIMD_MAX_BUILTIN_ARGS]
kono
parents:
diff changeset
245 = { qualifier_void, qualifier_unsigned_immediate,
kono
parents:
diff changeset
246 qualifier_unsigned_immediate,
kono
parents:
diff changeset
247 qualifier_unsigned_immediate,
kono
parents:
diff changeset
248 qualifier_unsigned_immediate,
kono
parents:
diff changeset
249 qualifier_unsigned_immediate,
kono
parents:
diff changeset
250 qualifier_unsigned_immediate };
kono
parents:
diff changeset
251 #define CDP_QUALIFIERS \
kono
parents:
diff changeset
252 (arm_cdp_qualifiers)
kono
parents:
diff changeset
253
kono
parents:
diff changeset
254 /* void (unsigned immediate, unsigned immediate, const void *). */
kono
parents:
diff changeset
255 static enum arm_type_qualifiers
kono
parents:
diff changeset
256 arm_ldc_qualifiers[SIMD_MAX_BUILTIN_ARGS]
kono
parents:
diff changeset
257 = { qualifier_void, qualifier_unsigned_immediate,
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
258 qualifier_unsigned_immediate, qualifier_const_void_pointer };
111
kono
parents:
diff changeset
259 #define LDC_QUALIFIERS \
kono
parents:
diff changeset
260 (arm_ldc_qualifiers)
kono
parents:
diff changeset
261
kono
parents:
diff changeset
262 /* void (unsigned immediate, unsigned immediate, void *). */
kono
parents:
diff changeset
263 static enum arm_type_qualifiers
kono
parents:
diff changeset
264 arm_stc_qualifiers[SIMD_MAX_BUILTIN_ARGS]
kono
parents:
diff changeset
265 = { qualifier_void, qualifier_unsigned_immediate,
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
266 qualifier_unsigned_immediate, qualifier_void_pointer };
111
kono
parents:
diff changeset
267 #define STC_QUALIFIERS \
kono
parents:
diff changeset
268 (arm_stc_qualifiers)
kono
parents:
diff changeset
269
kono
parents:
diff changeset
270 /* void (unsigned immediate, unsigned immediate, T, unsigned immediate,
kono
parents:
diff changeset
271 unsigned immediate, unsigned immediate). */
kono
parents:
diff changeset
272 static enum arm_type_qualifiers
kono
parents:
diff changeset
273 arm_mcr_qualifiers[SIMD_MAX_BUILTIN_ARGS]
kono
parents:
diff changeset
274 = { qualifier_void, qualifier_unsigned_immediate,
kono
parents:
diff changeset
275 qualifier_unsigned_immediate, qualifier_none,
kono
parents:
diff changeset
276 qualifier_unsigned_immediate, qualifier_unsigned_immediate,
kono
parents:
diff changeset
277 qualifier_unsigned_immediate };
kono
parents:
diff changeset
278 #define MCR_QUALIFIERS \
kono
parents:
diff changeset
279 (arm_mcr_qualifiers)
kono
parents:
diff changeset
280
kono
parents:
diff changeset
281 /* T (unsigned immediate, unsigned immediate, unsigned immediate,
kono
parents:
diff changeset
282 unsigned immediate, unsigned immediate). */
kono
parents:
diff changeset
283 static enum arm_type_qualifiers
kono
parents:
diff changeset
284 arm_mrc_qualifiers[SIMD_MAX_BUILTIN_ARGS]
kono
parents:
diff changeset
285 = { qualifier_none, qualifier_unsigned_immediate,
kono
parents:
diff changeset
286 qualifier_unsigned_immediate, qualifier_unsigned_immediate,
kono
parents:
diff changeset
287 qualifier_unsigned_immediate, qualifier_unsigned_immediate };
kono
parents:
diff changeset
288 #define MRC_QUALIFIERS \
kono
parents:
diff changeset
289 (arm_mrc_qualifiers)
kono
parents:
diff changeset
290
kono
parents:
diff changeset
291 /* void (unsigned immediate, unsigned immediate, T, unsigned immediate). */
kono
parents:
diff changeset
292 static enum arm_type_qualifiers
kono
parents:
diff changeset
293 arm_mcrr_qualifiers[SIMD_MAX_BUILTIN_ARGS]
kono
parents:
diff changeset
294 = { qualifier_void, qualifier_unsigned_immediate,
kono
parents:
diff changeset
295 qualifier_unsigned_immediate, qualifier_none,
kono
parents:
diff changeset
296 qualifier_unsigned_immediate };
kono
parents:
diff changeset
297 #define MCRR_QUALIFIERS \
kono
parents:
diff changeset
298 (arm_mcrr_qualifiers)
kono
parents:
diff changeset
299
kono
parents:
diff changeset
300 /* T (unsigned immediate, unsigned immediate, unsigned immediate). */
kono
parents:
diff changeset
301 static enum arm_type_qualifiers
kono
parents:
diff changeset
302 arm_mrrc_qualifiers[SIMD_MAX_BUILTIN_ARGS]
kono
parents:
diff changeset
303 = { qualifier_none, qualifier_unsigned_immediate,
kono
parents:
diff changeset
304 qualifier_unsigned_immediate, qualifier_unsigned_immediate };
kono
parents:
diff changeset
305 #define MRRC_QUALIFIERS \
kono
parents:
diff changeset
306 (arm_mrrc_qualifiers)
kono
parents:
diff changeset
307
kono
parents:
diff changeset
308 /* The first argument (return type) of a store should be void type,
kono
parents:
diff changeset
309 which we represent with qualifier_void. Their first operand will be
kono
parents:
diff changeset
310 a DImode pointer to the location to store to, so we must use
kono
parents:
diff changeset
311 qualifier_map_mode | qualifier_pointer to build a pointer to the
kono
parents:
diff changeset
312 element type of the vector.
kono
parents:
diff changeset
313
kono
parents:
diff changeset
314 void ([T element type] *, T). */
kono
parents:
diff changeset
315 static enum arm_type_qualifiers
kono
parents:
diff changeset
316 arm_store1_qualifiers[SIMD_MAX_BUILTIN_ARGS]
kono
parents:
diff changeset
317 = { qualifier_void, qualifier_pointer_map_mode, qualifier_none };
kono
parents:
diff changeset
318 #define STORE1_QUALIFIERS (arm_store1_qualifiers)
kono
parents:
diff changeset
319
kono
parents:
diff changeset
320 /* void ([T element type] *, T, immediate). */
kono
parents:
diff changeset
321 static enum arm_type_qualifiers
kono
parents:
diff changeset
322 arm_storestruct_lane_qualifiers[SIMD_MAX_BUILTIN_ARGS]
kono
parents:
diff changeset
323 = { qualifier_void, qualifier_pointer_map_mode,
kono
parents:
diff changeset
324 qualifier_none, qualifier_struct_load_store_lane_index };
kono
parents:
diff changeset
325 #define STORE1LANE_QUALIFIERS (arm_storestruct_lane_qualifiers)
kono
parents:
diff changeset
326
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
327 /* int (void). */
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
328 static enum arm_type_qualifiers
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
329 arm_sat_occurred_qualifiers[SIMD_MAX_BUILTIN_ARGS]
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
330 = { qualifier_none, qualifier_void };
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
331 #define SAT_OCCURRED_QUALIFIERS (arm_sat_occurred_qualifiers)
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
332
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
333 /* void (int). */
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
334 static enum arm_type_qualifiers
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
335 arm_set_sat_qualifiers[SIMD_MAX_BUILTIN_ARGS]
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
336 = { qualifier_void, qualifier_none };
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
337 #define SET_SAT_QUALIFIERS (arm_set_sat_qualifiers)
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
338
111
kono
parents:
diff changeset
339 #define v8qi_UP E_V8QImode
kono
parents:
diff changeset
340 #define v4hi_UP E_V4HImode
kono
parents:
diff changeset
341 #define v4hf_UP E_V4HFmode
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
342 #define v4bf_UP E_V4BFmode
111
kono
parents:
diff changeset
343 #define v2si_UP E_V2SImode
kono
parents:
diff changeset
344 #define v2sf_UP E_V2SFmode
kono
parents:
diff changeset
345 #define di_UP E_DImode
kono
parents:
diff changeset
346 #define v16qi_UP E_V16QImode
kono
parents:
diff changeset
347 #define v8hi_UP E_V8HImode
kono
parents:
diff changeset
348 #define v8hf_UP E_V8HFmode
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
349 #define v8bf_UP E_V8BFmode
111
kono
parents:
diff changeset
350 #define v4si_UP E_V4SImode
kono
parents:
diff changeset
351 #define v4sf_UP E_V4SFmode
kono
parents:
diff changeset
352 #define v2di_UP E_V2DImode
kono
parents:
diff changeset
353 #define ti_UP E_TImode
kono
parents:
diff changeset
354 #define ei_UP E_EImode
kono
parents:
diff changeset
355 #define oi_UP E_OImode
kono
parents:
diff changeset
356 #define hf_UP E_HFmode
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
357 #define bf_UP E_BFmode
111
kono
parents:
diff changeset
358 #define si_UP E_SImode
kono
parents:
diff changeset
359 #define void_UP E_VOIDmode
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
360 #define sf_UP E_SFmode
111
kono
parents:
diff changeset
361 #define UP(X) X##_UP
kono
parents:
diff changeset
362
kono
parents:
diff changeset
363 typedef struct {
kono
parents:
diff changeset
364 const char *name;
kono
parents:
diff changeset
365 machine_mode mode;
kono
parents:
diff changeset
366 const enum insn_code code;
kono
parents:
diff changeset
367 unsigned int fcode;
kono
parents:
diff changeset
368 enum arm_type_qualifiers *qualifiers;
kono
parents:
diff changeset
369 } arm_builtin_datum;
kono
parents:
diff changeset
370
kono
parents:
diff changeset
371 #define CF(N,X) CODE_FOR_neon_##N##X
kono
parents:
diff changeset
372
kono
parents:
diff changeset
373 #define VAR1(T, N, A) \
kono
parents:
diff changeset
374 {#N #A, UP (A), CF (N, A), 0, T##_QUALIFIERS},
kono
parents:
diff changeset
375 #define VAR2(T, N, A, B) \
kono
parents:
diff changeset
376 VAR1 (T, N, A) \
kono
parents:
diff changeset
377 VAR1 (T, N, B)
kono
parents:
diff changeset
378 #define VAR3(T, N, A, B, C) \
kono
parents:
diff changeset
379 VAR2 (T, N, A, B) \
kono
parents:
diff changeset
380 VAR1 (T, N, C)
kono
parents:
diff changeset
381 #define VAR4(T, N, A, B, C, D) \
kono
parents:
diff changeset
382 VAR3 (T, N, A, B, C) \
kono
parents:
diff changeset
383 VAR1 (T, N, D)
kono
parents:
diff changeset
384 #define VAR5(T, N, A, B, C, D, E) \
kono
parents:
diff changeset
385 VAR4 (T, N, A, B, C, D) \
kono
parents:
diff changeset
386 VAR1 (T, N, E)
kono
parents:
diff changeset
387 #define VAR6(T, N, A, B, C, D, E, F) \
kono
parents:
diff changeset
388 VAR5 (T, N, A, B, C, D, E) \
kono
parents:
diff changeset
389 VAR1 (T, N, F)
kono
parents:
diff changeset
390 #define VAR7(T, N, A, B, C, D, E, F, G) \
kono
parents:
diff changeset
391 VAR6 (T, N, A, B, C, D, E, F) \
kono
parents:
diff changeset
392 VAR1 (T, N, G)
kono
parents:
diff changeset
393 #define VAR8(T, N, A, B, C, D, E, F, G, H) \
kono
parents:
diff changeset
394 VAR7 (T, N, A, B, C, D, E, F, G) \
kono
parents:
diff changeset
395 VAR1 (T, N, H)
kono
parents:
diff changeset
396 #define VAR9(T, N, A, B, C, D, E, F, G, H, I) \
kono
parents:
diff changeset
397 VAR8 (T, N, A, B, C, D, E, F, G, H) \
kono
parents:
diff changeset
398 VAR1 (T, N, I)
kono
parents:
diff changeset
399 #define VAR10(T, N, A, B, C, D, E, F, G, H, I, J) \
kono
parents:
diff changeset
400 VAR9 (T, N, A, B, C, D, E, F, G, H, I) \
kono
parents:
diff changeset
401 VAR1 (T, N, J)
kono
parents:
diff changeset
402 #define VAR11(T, N, A, B, C, D, E, F, G, H, I, J, K) \
kono
parents:
diff changeset
403 VAR10 (T, N, A, B, C, D, E, F, G, H, I, J) \
kono
parents:
diff changeset
404 VAR1 (T, N, K)
kono
parents:
diff changeset
405 #define VAR12(T, N, A, B, C, D, E, F, G, H, I, J, K, L) \
kono
parents:
diff changeset
406 VAR11 (T, N, A, B, C, D, E, F, G, H, I, J, K) \
kono
parents:
diff changeset
407 VAR1 (T, N, L)
kono
parents:
diff changeset
408
kono
parents:
diff changeset
409 /* The builtin data can be found in arm_neon_builtins.def, arm_vfp_builtins.def
kono
parents:
diff changeset
410 and arm_acle_builtins.def. The entries in arm_neon_builtins.def require
kono
parents:
diff changeset
411 TARGET_NEON to be true. The feature tests are checked when the builtins are
kono
parents:
diff changeset
412 expanded.
kono
parents:
diff changeset
413
kono
parents:
diff changeset
414 The mode entries in the following table correspond to the "key" type of the
kono
parents:
diff changeset
415 instruction variant, i.e. equivalent to that which would be specified after
kono
parents:
diff changeset
416 the assembler mnemonic for neon instructions, which usually refers to the
kono
parents:
diff changeset
417 last vector operand. The modes listed per instruction should be the same as
kono
parents:
diff changeset
418 those defined for that instruction's pattern, for instance in neon.md. */
kono
parents:
diff changeset
419
kono
parents:
diff changeset
420 static arm_builtin_datum vfp_builtin_data[] =
kono
parents:
diff changeset
421 {
kono
parents:
diff changeset
422 #include "arm_vfp_builtins.def"
kono
parents:
diff changeset
423 };
kono
parents:
diff changeset
424
kono
parents:
diff changeset
425 static arm_builtin_datum neon_builtin_data[] =
kono
parents:
diff changeset
426 {
kono
parents:
diff changeset
427 #include "arm_neon_builtins.def"
kono
parents:
diff changeset
428 };
kono
parents:
diff changeset
429
kono
parents:
diff changeset
430 #undef CF
kono
parents:
diff changeset
431 #undef VAR1
kono
parents:
diff changeset
432 #define VAR1(T, N, A) \
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
433 {#N, UP (A), CODE_FOR_arm_##N, 0, T##_QUALIFIERS},
111
kono
parents:
diff changeset
434
kono
parents:
diff changeset
435 static arm_builtin_datum acle_builtin_data[] =
kono
parents:
diff changeset
436 {
kono
parents:
diff changeset
437 #include "arm_acle_builtins.def"
kono
parents:
diff changeset
438 };
kono
parents:
diff changeset
439
kono
parents:
diff changeset
440 #undef VAR1
kono
parents:
diff changeset
441
kono
parents:
diff changeset
442 #define VAR1(T, N, X) \
kono
parents:
diff changeset
443 ARM_BUILTIN_NEON_##N##X,
kono
parents:
diff changeset
444
kono
parents:
diff changeset
445 enum arm_builtins
kono
parents:
diff changeset
446 {
kono
parents:
diff changeset
447 ARM_BUILTIN_GETWCGR0,
kono
parents:
diff changeset
448 ARM_BUILTIN_GETWCGR1,
kono
parents:
diff changeset
449 ARM_BUILTIN_GETWCGR2,
kono
parents:
diff changeset
450 ARM_BUILTIN_GETWCGR3,
kono
parents:
diff changeset
451
kono
parents:
diff changeset
452 ARM_BUILTIN_SETWCGR0,
kono
parents:
diff changeset
453 ARM_BUILTIN_SETWCGR1,
kono
parents:
diff changeset
454 ARM_BUILTIN_SETWCGR2,
kono
parents:
diff changeset
455 ARM_BUILTIN_SETWCGR3,
kono
parents:
diff changeset
456
kono
parents:
diff changeset
457 ARM_BUILTIN_WZERO,
kono
parents:
diff changeset
458
kono
parents:
diff changeset
459 ARM_BUILTIN_WAVG2BR,
kono
parents:
diff changeset
460 ARM_BUILTIN_WAVG2HR,
kono
parents:
diff changeset
461 ARM_BUILTIN_WAVG2B,
kono
parents:
diff changeset
462 ARM_BUILTIN_WAVG2H,
kono
parents:
diff changeset
463
kono
parents:
diff changeset
464 ARM_BUILTIN_WACCB,
kono
parents:
diff changeset
465 ARM_BUILTIN_WACCH,
kono
parents:
diff changeset
466 ARM_BUILTIN_WACCW,
kono
parents:
diff changeset
467
kono
parents:
diff changeset
468 ARM_BUILTIN_WMACS,
kono
parents:
diff changeset
469 ARM_BUILTIN_WMACSZ,
kono
parents:
diff changeset
470 ARM_BUILTIN_WMACU,
kono
parents:
diff changeset
471 ARM_BUILTIN_WMACUZ,
kono
parents:
diff changeset
472
kono
parents:
diff changeset
473 ARM_BUILTIN_WSADB,
kono
parents:
diff changeset
474 ARM_BUILTIN_WSADBZ,
kono
parents:
diff changeset
475 ARM_BUILTIN_WSADH,
kono
parents:
diff changeset
476 ARM_BUILTIN_WSADHZ,
kono
parents:
diff changeset
477
kono
parents:
diff changeset
478 ARM_BUILTIN_WALIGNI,
kono
parents:
diff changeset
479 ARM_BUILTIN_WALIGNR0,
kono
parents:
diff changeset
480 ARM_BUILTIN_WALIGNR1,
kono
parents:
diff changeset
481 ARM_BUILTIN_WALIGNR2,
kono
parents:
diff changeset
482 ARM_BUILTIN_WALIGNR3,
kono
parents:
diff changeset
483
kono
parents:
diff changeset
484 ARM_BUILTIN_TMIA,
kono
parents:
diff changeset
485 ARM_BUILTIN_TMIAPH,
kono
parents:
diff changeset
486 ARM_BUILTIN_TMIABB,
kono
parents:
diff changeset
487 ARM_BUILTIN_TMIABT,
kono
parents:
diff changeset
488 ARM_BUILTIN_TMIATB,
kono
parents:
diff changeset
489 ARM_BUILTIN_TMIATT,
kono
parents:
diff changeset
490
kono
parents:
diff changeset
491 ARM_BUILTIN_TMOVMSKB,
kono
parents:
diff changeset
492 ARM_BUILTIN_TMOVMSKH,
kono
parents:
diff changeset
493 ARM_BUILTIN_TMOVMSKW,
kono
parents:
diff changeset
494
kono
parents:
diff changeset
495 ARM_BUILTIN_TBCSTB,
kono
parents:
diff changeset
496 ARM_BUILTIN_TBCSTH,
kono
parents:
diff changeset
497 ARM_BUILTIN_TBCSTW,
kono
parents:
diff changeset
498
kono
parents:
diff changeset
499 ARM_BUILTIN_WMADDS,
kono
parents:
diff changeset
500 ARM_BUILTIN_WMADDU,
kono
parents:
diff changeset
501
kono
parents:
diff changeset
502 ARM_BUILTIN_WPACKHSS,
kono
parents:
diff changeset
503 ARM_BUILTIN_WPACKWSS,
kono
parents:
diff changeset
504 ARM_BUILTIN_WPACKDSS,
kono
parents:
diff changeset
505 ARM_BUILTIN_WPACKHUS,
kono
parents:
diff changeset
506 ARM_BUILTIN_WPACKWUS,
kono
parents:
diff changeset
507 ARM_BUILTIN_WPACKDUS,
kono
parents:
diff changeset
508
kono
parents:
diff changeset
509 ARM_BUILTIN_WADDB,
kono
parents:
diff changeset
510 ARM_BUILTIN_WADDH,
kono
parents:
diff changeset
511 ARM_BUILTIN_WADDW,
kono
parents:
diff changeset
512 ARM_BUILTIN_WADDSSB,
kono
parents:
diff changeset
513 ARM_BUILTIN_WADDSSH,
kono
parents:
diff changeset
514 ARM_BUILTIN_WADDSSW,
kono
parents:
diff changeset
515 ARM_BUILTIN_WADDUSB,
kono
parents:
diff changeset
516 ARM_BUILTIN_WADDUSH,
kono
parents:
diff changeset
517 ARM_BUILTIN_WADDUSW,
kono
parents:
diff changeset
518 ARM_BUILTIN_WSUBB,
kono
parents:
diff changeset
519 ARM_BUILTIN_WSUBH,
kono
parents:
diff changeset
520 ARM_BUILTIN_WSUBW,
kono
parents:
diff changeset
521 ARM_BUILTIN_WSUBSSB,
kono
parents:
diff changeset
522 ARM_BUILTIN_WSUBSSH,
kono
parents:
diff changeset
523 ARM_BUILTIN_WSUBSSW,
kono
parents:
diff changeset
524 ARM_BUILTIN_WSUBUSB,
kono
parents:
diff changeset
525 ARM_BUILTIN_WSUBUSH,
kono
parents:
diff changeset
526 ARM_BUILTIN_WSUBUSW,
kono
parents:
diff changeset
527
kono
parents:
diff changeset
528 ARM_BUILTIN_WAND,
kono
parents:
diff changeset
529 ARM_BUILTIN_WANDN,
kono
parents:
diff changeset
530 ARM_BUILTIN_WOR,
kono
parents:
diff changeset
531 ARM_BUILTIN_WXOR,
kono
parents:
diff changeset
532
kono
parents:
diff changeset
533 ARM_BUILTIN_WCMPEQB,
kono
parents:
diff changeset
534 ARM_BUILTIN_WCMPEQH,
kono
parents:
diff changeset
535 ARM_BUILTIN_WCMPEQW,
kono
parents:
diff changeset
536 ARM_BUILTIN_WCMPGTUB,
kono
parents:
diff changeset
537 ARM_BUILTIN_WCMPGTUH,
kono
parents:
diff changeset
538 ARM_BUILTIN_WCMPGTUW,
kono
parents:
diff changeset
539 ARM_BUILTIN_WCMPGTSB,
kono
parents:
diff changeset
540 ARM_BUILTIN_WCMPGTSH,
kono
parents:
diff changeset
541 ARM_BUILTIN_WCMPGTSW,
kono
parents:
diff changeset
542
kono
parents:
diff changeset
543 ARM_BUILTIN_TEXTRMSB,
kono
parents:
diff changeset
544 ARM_BUILTIN_TEXTRMSH,
kono
parents:
diff changeset
545 ARM_BUILTIN_TEXTRMSW,
kono
parents:
diff changeset
546 ARM_BUILTIN_TEXTRMUB,
kono
parents:
diff changeset
547 ARM_BUILTIN_TEXTRMUH,
kono
parents:
diff changeset
548 ARM_BUILTIN_TEXTRMUW,
kono
parents:
diff changeset
549 ARM_BUILTIN_TINSRB,
kono
parents:
diff changeset
550 ARM_BUILTIN_TINSRH,
kono
parents:
diff changeset
551 ARM_BUILTIN_TINSRW,
kono
parents:
diff changeset
552
kono
parents:
diff changeset
553 ARM_BUILTIN_WMAXSW,
kono
parents:
diff changeset
554 ARM_BUILTIN_WMAXSH,
kono
parents:
diff changeset
555 ARM_BUILTIN_WMAXSB,
kono
parents:
diff changeset
556 ARM_BUILTIN_WMAXUW,
kono
parents:
diff changeset
557 ARM_BUILTIN_WMAXUH,
kono
parents:
diff changeset
558 ARM_BUILTIN_WMAXUB,
kono
parents:
diff changeset
559 ARM_BUILTIN_WMINSW,
kono
parents:
diff changeset
560 ARM_BUILTIN_WMINSH,
kono
parents:
diff changeset
561 ARM_BUILTIN_WMINSB,
kono
parents:
diff changeset
562 ARM_BUILTIN_WMINUW,
kono
parents:
diff changeset
563 ARM_BUILTIN_WMINUH,
kono
parents:
diff changeset
564 ARM_BUILTIN_WMINUB,
kono
parents:
diff changeset
565
kono
parents:
diff changeset
566 ARM_BUILTIN_WMULUM,
kono
parents:
diff changeset
567 ARM_BUILTIN_WMULSM,
kono
parents:
diff changeset
568 ARM_BUILTIN_WMULUL,
kono
parents:
diff changeset
569
kono
parents:
diff changeset
570 ARM_BUILTIN_PSADBH,
kono
parents:
diff changeset
571 ARM_BUILTIN_WSHUFH,
kono
parents:
diff changeset
572
kono
parents:
diff changeset
573 ARM_BUILTIN_WSLLH,
kono
parents:
diff changeset
574 ARM_BUILTIN_WSLLW,
kono
parents:
diff changeset
575 ARM_BUILTIN_WSLLD,
kono
parents:
diff changeset
576 ARM_BUILTIN_WSRAH,
kono
parents:
diff changeset
577 ARM_BUILTIN_WSRAW,
kono
parents:
diff changeset
578 ARM_BUILTIN_WSRAD,
kono
parents:
diff changeset
579 ARM_BUILTIN_WSRLH,
kono
parents:
diff changeset
580 ARM_BUILTIN_WSRLW,
kono
parents:
diff changeset
581 ARM_BUILTIN_WSRLD,
kono
parents:
diff changeset
582 ARM_BUILTIN_WRORH,
kono
parents:
diff changeset
583 ARM_BUILTIN_WRORW,
kono
parents:
diff changeset
584 ARM_BUILTIN_WRORD,
kono
parents:
diff changeset
585 ARM_BUILTIN_WSLLHI,
kono
parents:
diff changeset
586 ARM_BUILTIN_WSLLWI,
kono
parents:
diff changeset
587 ARM_BUILTIN_WSLLDI,
kono
parents:
diff changeset
588 ARM_BUILTIN_WSRAHI,
kono
parents:
diff changeset
589 ARM_BUILTIN_WSRAWI,
kono
parents:
diff changeset
590 ARM_BUILTIN_WSRADI,
kono
parents:
diff changeset
591 ARM_BUILTIN_WSRLHI,
kono
parents:
diff changeset
592 ARM_BUILTIN_WSRLWI,
kono
parents:
diff changeset
593 ARM_BUILTIN_WSRLDI,
kono
parents:
diff changeset
594 ARM_BUILTIN_WRORHI,
kono
parents:
diff changeset
595 ARM_BUILTIN_WRORWI,
kono
parents:
diff changeset
596 ARM_BUILTIN_WRORDI,
kono
parents:
diff changeset
597
kono
parents:
diff changeset
598 ARM_BUILTIN_WUNPCKIHB,
kono
parents:
diff changeset
599 ARM_BUILTIN_WUNPCKIHH,
kono
parents:
diff changeset
600 ARM_BUILTIN_WUNPCKIHW,
kono
parents:
diff changeset
601 ARM_BUILTIN_WUNPCKILB,
kono
parents:
diff changeset
602 ARM_BUILTIN_WUNPCKILH,
kono
parents:
diff changeset
603 ARM_BUILTIN_WUNPCKILW,
kono
parents:
diff changeset
604
kono
parents:
diff changeset
605 ARM_BUILTIN_WUNPCKEHSB,
kono
parents:
diff changeset
606 ARM_BUILTIN_WUNPCKEHSH,
kono
parents:
diff changeset
607 ARM_BUILTIN_WUNPCKEHSW,
kono
parents:
diff changeset
608 ARM_BUILTIN_WUNPCKEHUB,
kono
parents:
diff changeset
609 ARM_BUILTIN_WUNPCKEHUH,
kono
parents:
diff changeset
610 ARM_BUILTIN_WUNPCKEHUW,
kono
parents:
diff changeset
611 ARM_BUILTIN_WUNPCKELSB,
kono
parents:
diff changeset
612 ARM_BUILTIN_WUNPCKELSH,
kono
parents:
diff changeset
613 ARM_BUILTIN_WUNPCKELSW,
kono
parents:
diff changeset
614 ARM_BUILTIN_WUNPCKELUB,
kono
parents:
diff changeset
615 ARM_BUILTIN_WUNPCKELUH,
kono
parents:
diff changeset
616 ARM_BUILTIN_WUNPCKELUW,
kono
parents:
diff changeset
617
kono
parents:
diff changeset
618 ARM_BUILTIN_WABSB,
kono
parents:
diff changeset
619 ARM_BUILTIN_WABSH,
kono
parents:
diff changeset
620 ARM_BUILTIN_WABSW,
kono
parents:
diff changeset
621
kono
parents:
diff changeset
622 ARM_BUILTIN_WADDSUBHX,
kono
parents:
diff changeset
623 ARM_BUILTIN_WSUBADDHX,
kono
parents:
diff changeset
624
kono
parents:
diff changeset
625 ARM_BUILTIN_WABSDIFFB,
kono
parents:
diff changeset
626 ARM_BUILTIN_WABSDIFFH,
kono
parents:
diff changeset
627 ARM_BUILTIN_WABSDIFFW,
kono
parents:
diff changeset
628
kono
parents:
diff changeset
629 ARM_BUILTIN_WADDCH,
kono
parents:
diff changeset
630 ARM_BUILTIN_WADDCW,
kono
parents:
diff changeset
631
kono
parents:
diff changeset
632 ARM_BUILTIN_WAVG4,
kono
parents:
diff changeset
633 ARM_BUILTIN_WAVG4R,
kono
parents:
diff changeset
634
kono
parents:
diff changeset
635 ARM_BUILTIN_WMADDSX,
kono
parents:
diff changeset
636 ARM_BUILTIN_WMADDUX,
kono
parents:
diff changeset
637
kono
parents:
diff changeset
638 ARM_BUILTIN_WMADDSN,
kono
parents:
diff changeset
639 ARM_BUILTIN_WMADDUN,
kono
parents:
diff changeset
640
kono
parents:
diff changeset
641 ARM_BUILTIN_WMULWSM,
kono
parents:
diff changeset
642 ARM_BUILTIN_WMULWUM,
kono
parents:
diff changeset
643
kono
parents:
diff changeset
644 ARM_BUILTIN_WMULWSMR,
kono
parents:
diff changeset
645 ARM_BUILTIN_WMULWUMR,
kono
parents:
diff changeset
646
kono
parents:
diff changeset
647 ARM_BUILTIN_WMULWL,
kono
parents:
diff changeset
648
kono
parents:
diff changeset
649 ARM_BUILTIN_WMULSMR,
kono
parents:
diff changeset
650 ARM_BUILTIN_WMULUMR,
kono
parents:
diff changeset
651
kono
parents:
diff changeset
652 ARM_BUILTIN_WQMULM,
kono
parents:
diff changeset
653 ARM_BUILTIN_WQMULMR,
kono
parents:
diff changeset
654
kono
parents:
diff changeset
655 ARM_BUILTIN_WQMULWM,
kono
parents:
diff changeset
656 ARM_BUILTIN_WQMULWMR,
kono
parents:
diff changeset
657
kono
parents:
diff changeset
658 ARM_BUILTIN_WADDBHUSM,
kono
parents:
diff changeset
659 ARM_BUILTIN_WADDBHUSL,
kono
parents:
diff changeset
660
kono
parents:
diff changeset
661 ARM_BUILTIN_WQMIABB,
kono
parents:
diff changeset
662 ARM_BUILTIN_WQMIABT,
kono
parents:
diff changeset
663 ARM_BUILTIN_WQMIATB,
kono
parents:
diff changeset
664 ARM_BUILTIN_WQMIATT,
kono
parents:
diff changeset
665
kono
parents:
diff changeset
666 ARM_BUILTIN_WQMIABBN,
kono
parents:
diff changeset
667 ARM_BUILTIN_WQMIABTN,
kono
parents:
diff changeset
668 ARM_BUILTIN_WQMIATBN,
kono
parents:
diff changeset
669 ARM_BUILTIN_WQMIATTN,
kono
parents:
diff changeset
670
kono
parents:
diff changeset
671 ARM_BUILTIN_WMIABB,
kono
parents:
diff changeset
672 ARM_BUILTIN_WMIABT,
kono
parents:
diff changeset
673 ARM_BUILTIN_WMIATB,
kono
parents:
diff changeset
674 ARM_BUILTIN_WMIATT,
kono
parents:
diff changeset
675
kono
parents:
diff changeset
676 ARM_BUILTIN_WMIABBN,
kono
parents:
diff changeset
677 ARM_BUILTIN_WMIABTN,
kono
parents:
diff changeset
678 ARM_BUILTIN_WMIATBN,
kono
parents:
diff changeset
679 ARM_BUILTIN_WMIATTN,
kono
parents:
diff changeset
680
kono
parents:
diff changeset
681 ARM_BUILTIN_WMIAWBB,
kono
parents:
diff changeset
682 ARM_BUILTIN_WMIAWBT,
kono
parents:
diff changeset
683 ARM_BUILTIN_WMIAWTB,
kono
parents:
diff changeset
684 ARM_BUILTIN_WMIAWTT,
kono
parents:
diff changeset
685
kono
parents:
diff changeset
686 ARM_BUILTIN_WMIAWBBN,
kono
parents:
diff changeset
687 ARM_BUILTIN_WMIAWBTN,
kono
parents:
diff changeset
688 ARM_BUILTIN_WMIAWTBN,
kono
parents:
diff changeset
689 ARM_BUILTIN_WMIAWTTN,
kono
parents:
diff changeset
690
kono
parents:
diff changeset
691 ARM_BUILTIN_WMERGE,
kono
parents:
diff changeset
692
kono
parents:
diff changeset
693 ARM_BUILTIN_GET_FPSCR,
kono
parents:
diff changeset
694 ARM_BUILTIN_SET_FPSCR,
kono
parents:
diff changeset
695
kono
parents:
diff changeset
696 ARM_BUILTIN_CMSE_NONSECURE_CALLER,
kono
parents:
diff changeset
697
kono
parents:
diff changeset
698 #undef CRYPTO1
kono
parents:
diff changeset
699 #undef CRYPTO2
kono
parents:
diff changeset
700 #undef CRYPTO3
kono
parents:
diff changeset
701
kono
parents:
diff changeset
702 #define CRYPTO1(L, U, M1, M2) \
kono
parents:
diff changeset
703 ARM_BUILTIN_CRYPTO_##U,
kono
parents:
diff changeset
704 #define CRYPTO2(L, U, M1, M2, M3) \
kono
parents:
diff changeset
705 ARM_BUILTIN_CRYPTO_##U,
kono
parents:
diff changeset
706 #define CRYPTO3(L, U, M1, M2, M3, M4) \
kono
parents:
diff changeset
707 ARM_BUILTIN_CRYPTO_##U,
kono
parents:
diff changeset
708
kono
parents:
diff changeset
709 ARM_BUILTIN_CRYPTO_BASE,
kono
parents:
diff changeset
710
kono
parents:
diff changeset
711 #include "crypto.def"
kono
parents:
diff changeset
712
kono
parents:
diff changeset
713 #undef CRYPTO1
kono
parents:
diff changeset
714 #undef CRYPTO2
kono
parents:
diff changeset
715 #undef CRYPTO3
kono
parents:
diff changeset
716
kono
parents:
diff changeset
717 ARM_BUILTIN_VFP_BASE,
kono
parents:
diff changeset
718
kono
parents:
diff changeset
719 #include "arm_vfp_builtins.def"
kono
parents:
diff changeset
720
kono
parents:
diff changeset
721 ARM_BUILTIN_NEON_BASE,
kono
parents:
diff changeset
722 ARM_BUILTIN_NEON_LANE_CHECK = ARM_BUILTIN_NEON_BASE,
kono
parents:
diff changeset
723
kono
parents:
diff changeset
724 #include "arm_neon_builtins.def"
kono
parents:
diff changeset
725
kono
parents:
diff changeset
726 #undef VAR1
kono
parents:
diff changeset
727 #define VAR1(T, N, X) \
kono
parents:
diff changeset
728 ARM_BUILTIN_##N,
kono
parents:
diff changeset
729
kono
parents:
diff changeset
730 ARM_BUILTIN_ACLE_BASE,
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
731 ARM_BUILTIN_SAT_IMM_CHECK = ARM_BUILTIN_ACLE_BASE,
111
kono
parents:
diff changeset
732
kono
parents:
diff changeset
733 #include "arm_acle_builtins.def"
kono
parents:
diff changeset
734
kono
parents:
diff changeset
735 ARM_BUILTIN_MAX
kono
parents:
diff changeset
736 };
kono
parents:
diff changeset
737
kono
parents:
diff changeset
738 #define ARM_BUILTIN_VFP_PATTERN_START \
kono
parents:
diff changeset
739 (ARM_BUILTIN_VFP_BASE + 1)
kono
parents:
diff changeset
740
kono
parents:
diff changeset
741 #define ARM_BUILTIN_NEON_PATTERN_START \
kono
parents:
diff changeset
742 (ARM_BUILTIN_NEON_BASE + 1)
kono
parents:
diff changeset
743
kono
parents:
diff changeset
744 #define ARM_BUILTIN_ACLE_PATTERN_START \
kono
parents:
diff changeset
745 (ARM_BUILTIN_ACLE_BASE + 1)
kono
parents:
diff changeset
746
kono
parents:
diff changeset
747 #undef CF
kono
parents:
diff changeset
748 #undef VAR1
kono
parents:
diff changeset
749 #undef VAR2
kono
parents:
diff changeset
750 #undef VAR3
kono
parents:
diff changeset
751 #undef VAR4
kono
parents:
diff changeset
752 #undef VAR5
kono
parents:
diff changeset
753 #undef VAR6
kono
parents:
diff changeset
754 #undef VAR7
kono
parents:
diff changeset
755 #undef VAR8
kono
parents:
diff changeset
756 #undef VAR9
kono
parents:
diff changeset
757 #undef VAR10
kono
parents:
diff changeset
758
kono
parents:
diff changeset
759 static GTY(()) tree arm_builtin_decls[ARM_BUILTIN_MAX];
kono
parents:
diff changeset
760
kono
parents:
diff changeset
761 #define NUM_DREG_TYPES 5
kono
parents:
diff changeset
762 #define NUM_QREG_TYPES 6
kono
parents:
diff changeset
763
kono
parents:
diff changeset
764 /* Internal scalar builtin types. These types are used to support
kono
parents:
diff changeset
765 neon intrinsic builtins. They are _not_ user-visible types. Therefore
kono
parents:
diff changeset
766 the mangling for these types are implementation defined. */
kono
parents:
diff changeset
767 const char *arm_scalar_builtin_types[] = {
kono
parents:
diff changeset
768 "__builtin_neon_qi",
kono
parents:
diff changeset
769 "__builtin_neon_hi",
kono
parents:
diff changeset
770 "__builtin_neon_si",
kono
parents:
diff changeset
771 "__builtin_neon_sf",
kono
parents:
diff changeset
772 "__builtin_neon_di",
kono
parents:
diff changeset
773 "__builtin_neon_df",
kono
parents:
diff changeset
774 "__builtin_neon_ti",
kono
parents:
diff changeset
775 "__builtin_neon_uqi",
kono
parents:
diff changeset
776 "__builtin_neon_uhi",
kono
parents:
diff changeset
777 "__builtin_neon_usi",
kono
parents:
diff changeset
778 "__builtin_neon_udi",
kono
parents:
diff changeset
779 "__builtin_neon_ei",
kono
parents:
diff changeset
780 "__builtin_neon_oi",
kono
parents:
diff changeset
781 "__builtin_neon_ci",
kono
parents:
diff changeset
782 "__builtin_neon_xi",
kono
parents:
diff changeset
783 NULL
kono
parents:
diff changeset
784 };
kono
parents:
diff changeset
785
kono
parents:
diff changeset
786 #define ENTRY(E, M, Q, S, T, G) E,
kono
parents:
diff changeset
787 enum arm_simd_type
kono
parents:
diff changeset
788 {
kono
parents:
diff changeset
789 #include "arm-simd-builtin-types.def"
kono
parents:
diff changeset
790 __TYPE_FINAL
kono
parents:
diff changeset
791 };
kono
parents:
diff changeset
792 #undef ENTRY
kono
parents:
diff changeset
793
kono
parents:
diff changeset
794 struct arm_simd_type_info
kono
parents:
diff changeset
795 {
kono
parents:
diff changeset
796 enum arm_simd_type type;
kono
parents:
diff changeset
797
kono
parents:
diff changeset
798 /* Internal type name. */
kono
parents:
diff changeset
799 const char *name;
kono
parents:
diff changeset
800
kono
parents:
diff changeset
801 /* Internal type name(mangled). The mangled names conform to the
kono
parents:
diff changeset
802 AAPCS (see "Procedure Call Standard for the ARM Architecture",
kono
parents:
diff changeset
803 Appendix A). To qualify for emission with the mangled names defined in
kono
parents:
diff changeset
804 that document, a vector type must not only be of the correct mode but also
kono
parents:
diff changeset
805 be of the correct internal Neon vector type (e.g. __simd64_int8_t);
kono
parents:
diff changeset
806 these types are registered by arm_init_simd_builtin_types (). In other
kono
parents:
diff changeset
807 words, vector types defined in other ways e.g. via vector_size attribute
kono
parents:
diff changeset
808 will get default mangled names. */
kono
parents:
diff changeset
809 const char *mangle;
kono
parents:
diff changeset
810
kono
parents:
diff changeset
811 /* Internal type. */
kono
parents:
diff changeset
812 tree itype;
kono
parents:
diff changeset
813
kono
parents:
diff changeset
814 /* Element type. */
kono
parents:
diff changeset
815 tree eltype;
kono
parents:
diff changeset
816
kono
parents:
diff changeset
817 /* Machine mode the internal type maps to. */
kono
parents:
diff changeset
818 machine_mode mode;
kono
parents:
diff changeset
819
kono
parents:
diff changeset
820 /* Qualifiers. */
kono
parents:
diff changeset
821 enum arm_type_qualifiers q;
kono
parents:
diff changeset
822 };
kono
parents:
diff changeset
823
kono
parents:
diff changeset
824 #define ENTRY(E, M, Q, S, T, G) \
kono
parents:
diff changeset
825 {E, \
kono
parents:
diff changeset
826 "__simd" #S "_" #T "_t", \
kono
parents:
diff changeset
827 #G "__simd" #S "_" #T "_t", \
kono
parents:
diff changeset
828 NULL_TREE, NULL_TREE, M##mode, qualifier_##Q},
kono
parents:
diff changeset
829 static struct arm_simd_type_info arm_simd_types [] = {
kono
parents:
diff changeset
830 #include "arm-simd-builtin-types.def"
kono
parents:
diff changeset
831 };
kono
parents:
diff changeset
832 #undef ENTRY
kono
parents:
diff changeset
833
kono
parents:
diff changeset
834 /* The user-visible __fp16 type. */
kono
parents:
diff changeset
835 tree arm_fp16_type_node = NULL_TREE;
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
836
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
837 /* Back-end node type for brain float (bfloat) types. */
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
838 tree arm_bf16_type_node = NULL_TREE;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
839 tree arm_bf16_ptr_type_node = NULL_TREE;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
840
111
kono
parents:
diff changeset
841 static tree arm_simd_intOI_type_node = NULL_TREE;
kono
parents:
diff changeset
842 static tree arm_simd_intEI_type_node = NULL_TREE;
kono
parents:
diff changeset
843 static tree arm_simd_intCI_type_node = NULL_TREE;
kono
parents:
diff changeset
844 static tree arm_simd_intXI_type_node = NULL_TREE;
kono
parents:
diff changeset
845 static tree arm_simd_polyQI_type_node = NULL_TREE;
kono
parents:
diff changeset
846 static tree arm_simd_polyHI_type_node = NULL_TREE;
kono
parents:
diff changeset
847 static tree arm_simd_polyDI_type_node = NULL_TREE;
kono
parents:
diff changeset
848 static tree arm_simd_polyTI_type_node = NULL_TREE;
kono
parents:
diff changeset
849
kono
parents:
diff changeset
850 static const char *
kono
parents:
diff changeset
851 arm_mangle_builtin_scalar_type (const_tree type)
kono
parents:
diff changeset
852 {
kono
parents:
diff changeset
853 int i = 0;
kono
parents:
diff changeset
854
kono
parents:
diff changeset
855 while (arm_scalar_builtin_types[i] != NULL)
kono
parents:
diff changeset
856 {
kono
parents:
diff changeset
857 const char *name = arm_scalar_builtin_types[i];
kono
parents:
diff changeset
858
kono
parents:
diff changeset
859 if (TREE_CODE (TYPE_NAME (type)) == TYPE_DECL
kono
parents:
diff changeset
860 && DECL_NAME (TYPE_NAME (type))
kono
parents:
diff changeset
861 && !strcmp (IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (type))), name))
kono
parents:
diff changeset
862 return arm_scalar_builtin_types[i];
kono
parents:
diff changeset
863 i++;
kono
parents:
diff changeset
864 }
kono
parents:
diff changeset
865 return NULL;
kono
parents:
diff changeset
866 }
kono
parents:
diff changeset
867
kono
parents:
diff changeset
868 static const char *
kono
parents:
diff changeset
869 arm_mangle_builtin_vector_type (const_tree type)
kono
parents:
diff changeset
870 {
kono
parents:
diff changeset
871 int i;
kono
parents:
diff changeset
872 int nelts = sizeof (arm_simd_types) / sizeof (arm_simd_types[0]);
kono
parents:
diff changeset
873
kono
parents:
diff changeset
874 for (i = 0; i < nelts; i++)
kono
parents:
diff changeset
875 if (arm_simd_types[i].mode == TYPE_MODE (type)
kono
parents:
diff changeset
876 && TYPE_NAME (type)
kono
parents:
diff changeset
877 && TREE_CODE (TYPE_NAME (type)) == TYPE_DECL
kono
parents:
diff changeset
878 && DECL_NAME (TYPE_NAME (type))
kono
parents:
diff changeset
879 && !strcmp
kono
parents:
diff changeset
880 (IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (type))),
kono
parents:
diff changeset
881 arm_simd_types[i].name))
kono
parents:
diff changeset
882 return arm_simd_types[i].mangle;
kono
parents:
diff changeset
883
kono
parents:
diff changeset
884 return NULL;
kono
parents:
diff changeset
885 }
kono
parents:
diff changeset
886
kono
parents:
diff changeset
887 const char *
kono
parents:
diff changeset
888 arm_mangle_builtin_type (const_tree type)
kono
parents:
diff changeset
889 {
kono
parents:
diff changeset
890 const char *mangle;
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
891 /* Walk through all the Arm builtins types tables to filter out the
111
kono
parents:
diff changeset
892 incoming type. */
kono
parents:
diff changeset
893 if ((mangle = arm_mangle_builtin_vector_type (type))
kono
parents:
diff changeset
894 || (mangle = arm_mangle_builtin_scalar_type (type)))
kono
parents:
diff changeset
895 return mangle;
kono
parents:
diff changeset
896
kono
parents:
diff changeset
897 return NULL;
kono
parents:
diff changeset
898 }
kono
parents:
diff changeset
899
kono
parents:
diff changeset
900 static tree
kono
parents:
diff changeset
901 arm_simd_builtin_std_type (machine_mode mode,
kono
parents:
diff changeset
902 enum arm_type_qualifiers q)
kono
parents:
diff changeset
903 {
kono
parents:
diff changeset
904 #define QUAL_TYPE(M) \
kono
parents:
diff changeset
905 ((q == qualifier_none) ? int##M##_type_node : unsigned_int##M##_type_node);
kono
parents:
diff changeset
906 switch (mode)
kono
parents:
diff changeset
907 {
kono
parents:
diff changeset
908 case E_QImode:
kono
parents:
diff changeset
909 return QUAL_TYPE (QI);
kono
parents:
diff changeset
910 case E_HImode:
kono
parents:
diff changeset
911 return QUAL_TYPE (HI);
kono
parents:
diff changeset
912 case E_SImode:
kono
parents:
diff changeset
913 return QUAL_TYPE (SI);
kono
parents:
diff changeset
914 case E_DImode:
kono
parents:
diff changeset
915 return QUAL_TYPE (DI);
kono
parents:
diff changeset
916 case E_TImode:
kono
parents:
diff changeset
917 return QUAL_TYPE (TI);
kono
parents:
diff changeset
918 case E_OImode:
kono
parents:
diff changeset
919 return arm_simd_intOI_type_node;
kono
parents:
diff changeset
920 case E_EImode:
kono
parents:
diff changeset
921 return arm_simd_intEI_type_node;
kono
parents:
diff changeset
922 case E_CImode:
kono
parents:
diff changeset
923 return arm_simd_intCI_type_node;
kono
parents:
diff changeset
924 case E_XImode:
kono
parents:
diff changeset
925 return arm_simd_intXI_type_node;
kono
parents:
diff changeset
926 case E_HFmode:
kono
parents:
diff changeset
927 return arm_fp16_type_node;
kono
parents:
diff changeset
928 case E_SFmode:
kono
parents:
diff changeset
929 return float_type_node;
kono
parents:
diff changeset
930 case E_DFmode:
kono
parents:
diff changeset
931 return double_type_node;
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
932 case E_BFmode:
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
933 return arm_bf16_type_node;
111
kono
parents:
diff changeset
934 default:
kono
parents:
diff changeset
935 gcc_unreachable ();
kono
parents:
diff changeset
936 }
kono
parents:
diff changeset
937 #undef QUAL_TYPE
kono
parents:
diff changeset
938 }
kono
parents:
diff changeset
939
kono
parents:
diff changeset
940 static tree
kono
parents:
diff changeset
941 arm_lookup_simd_builtin_type (machine_mode mode,
kono
parents:
diff changeset
942 enum arm_type_qualifiers q)
kono
parents:
diff changeset
943 {
kono
parents:
diff changeset
944 int i;
kono
parents:
diff changeset
945 int nelts = sizeof (arm_simd_types) / sizeof (arm_simd_types[0]);
kono
parents:
diff changeset
946
kono
parents:
diff changeset
947 /* Non-poly scalar modes map to standard types not in the table. */
kono
parents:
diff changeset
948 if (q != qualifier_poly && !VECTOR_MODE_P (mode))
kono
parents:
diff changeset
949 return arm_simd_builtin_std_type (mode, q);
kono
parents:
diff changeset
950
kono
parents:
diff changeset
951 for (i = 0; i < nelts; i++)
kono
parents:
diff changeset
952 if (arm_simd_types[i].mode == mode
kono
parents:
diff changeset
953 && arm_simd_types[i].q == q)
kono
parents:
diff changeset
954 return arm_simd_types[i].itype;
kono
parents:
diff changeset
955
kono
parents:
diff changeset
956 /* Note that we won't have caught the underlying type for poly64x2_t
kono
parents:
diff changeset
957 in the above table. This gets default mangling. */
kono
parents:
diff changeset
958
kono
parents:
diff changeset
959 return NULL_TREE;
kono
parents:
diff changeset
960 }
kono
parents:
diff changeset
961
kono
parents:
diff changeset
962 static tree
kono
parents:
diff changeset
963 arm_simd_builtin_type (machine_mode mode, bool unsigned_p, bool poly_p)
kono
parents:
diff changeset
964 {
kono
parents:
diff changeset
965 if (poly_p)
kono
parents:
diff changeset
966 return arm_lookup_simd_builtin_type (mode, qualifier_poly);
kono
parents:
diff changeset
967 else if (unsigned_p)
kono
parents:
diff changeset
968 return arm_lookup_simd_builtin_type (mode, qualifier_unsigned);
kono
parents:
diff changeset
969 else
kono
parents:
diff changeset
970 return arm_lookup_simd_builtin_type (mode, qualifier_none);
kono
parents:
diff changeset
971 }
kono
parents:
diff changeset
972
kono
parents:
diff changeset
973 static void
kono
parents:
diff changeset
974 arm_init_simd_builtin_types (void)
kono
parents:
diff changeset
975 {
kono
parents:
diff changeset
976 int i;
kono
parents:
diff changeset
977 int nelts = sizeof (arm_simd_types) / sizeof (arm_simd_types[0]);
kono
parents:
diff changeset
978 tree tdecl;
kono
parents:
diff changeset
979
kono
parents:
diff changeset
980 /* Poly types are a world of their own. In order to maintain legacy
kono
parents:
diff changeset
981 ABI, they get initialized using the old interface, and don't get
kono
parents:
diff changeset
982 an entry in our mangling table, consequently, they get default
kono
parents:
diff changeset
983 mangling. As a further gotcha, poly8_t and poly16_t are signed
kono
parents:
diff changeset
984 types, poly64_t and poly128_t are unsigned types. */
kono
parents:
diff changeset
985 arm_simd_polyQI_type_node
kono
parents:
diff changeset
986 = build_distinct_type_copy (intQI_type_node);
kono
parents:
diff changeset
987 (*lang_hooks.types.register_builtin_type) (arm_simd_polyQI_type_node,
kono
parents:
diff changeset
988 "__builtin_neon_poly8");
kono
parents:
diff changeset
989 arm_simd_polyHI_type_node
kono
parents:
diff changeset
990 = build_distinct_type_copy (intHI_type_node);
kono
parents:
diff changeset
991 (*lang_hooks.types.register_builtin_type) (arm_simd_polyHI_type_node,
kono
parents:
diff changeset
992 "__builtin_neon_poly16");
kono
parents:
diff changeset
993 arm_simd_polyDI_type_node
kono
parents:
diff changeset
994 = build_distinct_type_copy (unsigned_intDI_type_node);
kono
parents:
diff changeset
995 (*lang_hooks.types.register_builtin_type) (arm_simd_polyDI_type_node,
kono
parents:
diff changeset
996 "__builtin_neon_poly64");
kono
parents:
diff changeset
997 arm_simd_polyTI_type_node
kono
parents:
diff changeset
998 = build_distinct_type_copy (unsigned_intTI_type_node);
kono
parents:
diff changeset
999 (*lang_hooks.types.register_builtin_type) (arm_simd_polyTI_type_node,
kono
parents:
diff changeset
1000 "__builtin_neon_poly128");
kono
parents:
diff changeset
1001
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
1002 /* Prevent front-ends from transforming poly vectors into string
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
1003 literals. */
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
1004 TYPE_STRING_FLAG (arm_simd_polyQI_type_node) = false;
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
1005 TYPE_STRING_FLAG (arm_simd_polyHI_type_node) = false;
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
1006
111
kono
parents:
diff changeset
1007 /* Init all the element types built by the front-end. */
kono
parents:
diff changeset
1008 arm_simd_types[Int8x8_t].eltype = intQI_type_node;
kono
parents:
diff changeset
1009 arm_simd_types[Int8x16_t].eltype = intQI_type_node;
kono
parents:
diff changeset
1010 arm_simd_types[Int16x4_t].eltype = intHI_type_node;
kono
parents:
diff changeset
1011 arm_simd_types[Int16x8_t].eltype = intHI_type_node;
kono
parents:
diff changeset
1012 arm_simd_types[Int32x2_t].eltype = intSI_type_node;
kono
parents:
diff changeset
1013 arm_simd_types[Int32x4_t].eltype = intSI_type_node;
kono
parents:
diff changeset
1014 arm_simd_types[Int64x2_t].eltype = intDI_type_node;
kono
parents:
diff changeset
1015 arm_simd_types[Uint8x8_t].eltype = unsigned_intQI_type_node;
kono
parents:
diff changeset
1016 arm_simd_types[Uint8x16_t].eltype = unsigned_intQI_type_node;
kono
parents:
diff changeset
1017 arm_simd_types[Uint16x4_t].eltype = unsigned_intHI_type_node;
kono
parents:
diff changeset
1018 arm_simd_types[Uint16x8_t].eltype = unsigned_intHI_type_node;
kono
parents:
diff changeset
1019 arm_simd_types[Uint32x2_t].eltype = unsigned_intSI_type_node;
kono
parents:
diff changeset
1020 arm_simd_types[Uint32x4_t].eltype = unsigned_intSI_type_node;
kono
parents:
diff changeset
1021 arm_simd_types[Uint64x2_t].eltype = unsigned_intDI_type_node;
kono
parents:
diff changeset
1022
kono
parents:
diff changeset
1023 /* Init poly vector element types with scalar poly types. */
kono
parents:
diff changeset
1024 arm_simd_types[Poly8x8_t].eltype = arm_simd_polyQI_type_node;
kono
parents:
diff changeset
1025 arm_simd_types[Poly8x16_t].eltype = arm_simd_polyQI_type_node;
kono
parents:
diff changeset
1026 arm_simd_types[Poly16x4_t].eltype = arm_simd_polyHI_type_node;
kono
parents:
diff changeset
1027 arm_simd_types[Poly16x8_t].eltype = arm_simd_polyHI_type_node;
kono
parents:
diff changeset
1028 /* Note: poly64x2_t is defined in arm_neon.h, to ensure it gets default
kono
parents:
diff changeset
1029 mangling. */
kono
parents:
diff changeset
1030
kono
parents:
diff changeset
1031 /* Continue with standard types. */
kono
parents:
diff changeset
1032 /* The __builtin_simd{64,128}_float16 types are kept private unless
kono
parents:
diff changeset
1033 we have a scalar __fp16 type. */
kono
parents:
diff changeset
1034 arm_simd_types[Float16x4_t].eltype = arm_fp16_type_node;
kono
parents:
diff changeset
1035 arm_simd_types[Float16x8_t].eltype = arm_fp16_type_node;
kono
parents:
diff changeset
1036 arm_simd_types[Float32x2_t].eltype = float_type_node;
kono
parents:
diff changeset
1037 arm_simd_types[Float32x4_t].eltype = float_type_node;
kono
parents:
diff changeset
1038
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1039 /* Init Bfloat vector types with underlying __bf16 scalar type. */
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1040 arm_simd_types[Bfloat16x4_t].eltype = arm_bf16_type_node;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1041 arm_simd_types[Bfloat16x8_t].eltype = arm_bf16_type_node;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1042
111
kono
parents:
diff changeset
1043 for (i = 0; i < nelts; i++)
kono
parents:
diff changeset
1044 {
kono
parents:
diff changeset
1045 tree eltype = arm_simd_types[i].eltype;
kono
parents:
diff changeset
1046 machine_mode mode = arm_simd_types[i].mode;
kono
parents:
diff changeset
1047
kono
parents:
diff changeset
1048 if (arm_simd_types[i].itype == NULL)
kono
parents:
diff changeset
1049 arm_simd_types[i].itype =
kono
parents:
diff changeset
1050 build_distinct_type_copy
kono
parents:
diff changeset
1051 (build_vector_type (eltype, GET_MODE_NUNITS (mode)));
kono
parents:
diff changeset
1052
kono
parents:
diff changeset
1053 tdecl = add_builtin_type (arm_simd_types[i].name,
kono
parents:
diff changeset
1054 arm_simd_types[i].itype);
kono
parents:
diff changeset
1055 TYPE_NAME (arm_simd_types[i].itype) = tdecl;
kono
parents:
diff changeset
1056 SET_TYPE_STRUCTURAL_EQUALITY (arm_simd_types[i].itype);
kono
parents:
diff changeset
1057 }
kono
parents:
diff changeset
1058
kono
parents:
diff changeset
1059 #define AARCH_BUILD_SIGNED_TYPE(mode) \
kono
parents:
diff changeset
1060 make_signed_type (GET_MODE_PRECISION (mode));
kono
parents:
diff changeset
1061 arm_simd_intOI_type_node = AARCH_BUILD_SIGNED_TYPE (OImode);
kono
parents:
diff changeset
1062 arm_simd_intEI_type_node = AARCH_BUILD_SIGNED_TYPE (EImode);
kono
parents:
diff changeset
1063 arm_simd_intCI_type_node = AARCH_BUILD_SIGNED_TYPE (CImode);
kono
parents:
diff changeset
1064 arm_simd_intXI_type_node = AARCH_BUILD_SIGNED_TYPE (XImode);
kono
parents:
diff changeset
1065 #undef AARCH_BUILD_SIGNED_TYPE
kono
parents:
diff changeset
1066
kono
parents:
diff changeset
1067 tdecl = add_builtin_type
kono
parents:
diff changeset
1068 ("__builtin_neon_ei" , arm_simd_intEI_type_node);
kono
parents:
diff changeset
1069 TYPE_NAME (arm_simd_intEI_type_node) = tdecl;
kono
parents:
diff changeset
1070 tdecl = add_builtin_type
kono
parents:
diff changeset
1071 ("__builtin_neon_oi" , arm_simd_intOI_type_node);
kono
parents:
diff changeset
1072 TYPE_NAME (arm_simd_intOI_type_node) = tdecl;
kono
parents:
diff changeset
1073 tdecl = add_builtin_type
kono
parents:
diff changeset
1074 ("__builtin_neon_ci" , arm_simd_intCI_type_node);
kono
parents:
diff changeset
1075 TYPE_NAME (arm_simd_intCI_type_node) = tdecl;
kono
parents:
diff changeset
1076 tdecl = add_builtin_type
kono
parents:
diff changeset
1077 ("__builtin_neon_xi" , arm_simd_intXI_type_node);
kono
parents:
diff changeset
1078 TYPE_NAME (arm_simd_intXI_type_node) = tdecl;
kono
parents:
diff changeset
1079 }
kono
parents:
diff changeset
1080
kono
parents:
diff changeset
1081 static void
kono
parents:
diff changeset
1082 arm_init_simd_builtin_scalar_types (void)
kono
parents:
diff changeset
1083 {
kono
parents:
diff changeset
1084 /* Define typedefs for all the standard scalar types. */
kono
parents:
diff changeset
1085 (*lang_hooks.types.register_builtin_type) (intQI_type_node,
kono
parents:
diff changeset
1086 "__builtin_neon_qi");
kono
parents:
diff changeset
1087 (*lang_hooks.types.register_builtin_type) (intHI_type_node,
kono
parents:
diff changeset
1088 "__builtin_neon_hi");
kono
parents:
diff changeset
1089 (*lang_hooks.types.register_builtin_type) (intSI_type_node,
kono
parents:
diff changeset
1090 "__builtin_neon_si");
kono
parents:
diff changeset
1091 (*lang_hooks.types.register_builtin_type) (float_type_node,
kono
parents:
diff changeset
1092 "__builtin_neon_sf");
kono
parents:
diff changeset
1093 (*lang_hooks.types.register_builtin_type) (intDI_type_node,
kono
parents:
diff changeset
1094 "__builtin_neon_di");
kono
parents:
diff changeset
1095 (*lang_hooks.types.register_builtin_type) (double_type_node,
kono
parents:
diff changeset
1096 "__builtin_neon_df");
kono
parents:
diff changeset
1097 (*lang_hooks.types.register_builtin_type) (intTI_type_node,
kono
parents:
diff changeset
1098 "__builtin_neon_ti");
kono
parents:
diff changeset
1099
kono
parents:
diff changeset
1100 /* Unsigned integer types for various mode sizes. */
kono
parents:
diff changeset
1101 (*lang_hooks.types.register_builtin_type) (unsigned_intQI_type_node,
kono
parents:
diff changeset
1102 "__builtin_neon_uqi");
kono
parents:
diff changeset
1103 (*lang_hooks.types.register_builtin_type) (unsigned_intHI_type_node,
kono
parents:
diff changeset
1104 "__builtin_neon_uhi");
kono
parents:
diff changeset
1105 (*lang_hooks.types.register_builtin_type) (unsigned_intSI_type_node,
kono
parents:
diff changeset
1106 "__builtin_neon_usi");
kono
parents:
diff changeset
1107 (*lang_hooks.types.register_builtin_type) (unsigned_intDI_type_node,
kono
parents:
diff changeset
1108 "__builtin_neon_udi");
kono
parents:
diff changeset
1109 (*lang_hooks.types.register_builtin_type) (unsigned_intTI_type_node,
kono
parents:
diff changeset
1110 "__builtin_neon_uti");
kono
parents:
diff changeset
1111 }
kono
parents:
diff changeset
1112
kono
parents:
diff changeset
1113 /* Set up a builtin. It will use information stored in the argument struct D to
kono
parents:
diff changeset
1114 derive the builtin's type signature and name. It will append the name in D
kono
parents:
diff changeset
1115 to the PREFIX passed and use these to create a builtin declaration that is
kono
parents:
diff changeset
1116 then stored in 'arm_builtin_decls' under index FCODE. This FCODE is also
kono
parents:
diff changeset
1117 written back to D for future use. */
kono
parents:
diff changeset
1118
kono
parents:
diff changeset
1119 static void
kono
parents:
diff changeset
1120 arm_init_builtin (unsigned int fcode, arm_builtin_datum *d,
kono
parents:
diff changeset
1121 const char * prefix)
kono
parents:
diff changeset
1122 {
kono
parents:
diff changeset
1123 bool print_type_signature_p = false;
kono
parents:
diff changeset
1124 char type_signature[SIMD_MAX_BUILTIN_ARGS] = { 0 };
kono
parents:
diff changeset
1125 char namebuf[60];
kono
parents:
diff changeset
1126 tree ftype = NULL;
kono
parents:
diff changeset
1127 tree fndecl = NULL;
kono
parents:
diff changeset
1128
kono
parents:
diff changeset
1129 d->fcode = fcode;
kono
parents:
diff changeset
1130
kono
parents:
diff changeset
1131 /* We must track two variables here. op_num is
kono
parents:
diff changeset
1132 the operand number as in the RTL pattern. This is
kono
parents:
diff changeset
1133 required to access the mode (e.g. V4SF mode) of the
kono
parents:
diff changeset
1134 argument, from which the base type can be derived.
kono
parents:
diff changeset
1135 arg_num is an index in to the qualifiers data, which
kono
parents:
diff changeset
1136 gives qualifiers to the type (e.g. const unsigned).
kono
parents:
diff changeset
1137 The reason these two variables may differ by one is the
kono
parents:
diff changeset
1138 void return type. While all return types take the 0th entry
kono
parents:
diff changeset
1139 in the qualifiers array, there is no operand for them in the
kono
parents:
diff changeset
1140 RTL pattern. */
kono
parents:
diff changeset
1141 int op_num = insn_data[d->code].n_operands - 1;
kono
parents:
diff changeset
1142 int arg_num = d->qualifiers[0] & qualifier_void
kono
parents:
diff changeset
1143 ? op_num + 1
kono
parents:
diff changeset
1144 : op_num;
kono
parents:
diff changeset
1145 tree return_type = void_type_node, args = void_list_node;
kono
parents:
diff changeset
1146 tree eltype;
kono
parents:
diff changeset
1147
kono
parents:
diff changeset
1148 /* Build a function type directly from the insn_data for this
kono
parents:
diff changeset
1149 builtin. The build_function_type () function takes care of
kono
parents:
diff changeset
1150 removing duplicates for us. */
kono
parents:
diff changeset
1151 for (; op_num >= 0; arg_num--, op_num--)
kono
parents:
diff changeset
1152 {
kono
parents:
diff changeset
1153 machine_mode op_mode = insn_data[d->code].operand[op_num].mode;
kono
parents:
diff changeset
1154 enum arm_type_qualifiers qualifiers = d->qualifiers[arg_num];
kono
parents:
diff changeset
1155
kono
parents:
diff changeset
1156 if (qualifiers & qualifier_unsigned)
kono
parents:
diff changeset
1157 {
kono
parents:
diff changeset
1158 type_signature[arg_num] = 'u';
kono
parents:
diff changeset
1159 print_type_signature_p = true;
kono
parents:
diff changeset
1160 }
kono
parents:
diff changeset
1161 else if (qualifiers & qualifier_poly)
kono
parents:
diff changeset
1162 {
kono
parents:
diff changeset
1163 type_signature[arg_num] = 'p';
kono
parents:
diff changeset
1164 print_type_signature_p = true;
kono
parents:
diff changeset
1165 }
kono
parents:
diff changeset
1166 else
kono
parents:
diff changeset
1167 type_signature[arg_num] = 's';
kono
parents:
diff changeset
1168
kono
parents:
diff changeset
1169 /* Skip an internal operand for vget_{low, high}. */
kono
parents:
diff changeset
1170 if (qualifiers & qualifier_internal)
kono
parents:
diff changeset
1171 continue;
kono
parents:
diff changeset
1172
kono
parents:
diff changeset
1173 /* Some builtins have different user-facing types
kono
parents:
diff changeset
1174 for certain arguments, encoded in d->mode. */
kono
parents:
diff changeset
1175 if (qualifiers & qualifier_map_mode)
kono
parents:
diff changeset
1176 op_mode = d->mode;
kono
parents:
diff changeset
1177
kono
parents:
diff changeset
1178 /* For pointers, we want a pointer to the basic type
kono
parents:
diff changeset
1179 of the vector. */
kono
parents:
diff changeset
1180 if (qualifiers & qualifier_pointer && VECTOR_MODE_P (op_mode))
kono
parents:
diff changeset
1181 op_mode = GET_MODE_INNER (op_mode);
kono
parents:
diff changeset
1182
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
1183 /* For void pointers we already have nodes constructed by the midend. */
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
1184 if (qualifiers & qualifier_void_pointer)
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
1185 eltype = qualifiers & qualifier_const
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
1186 ? const_ptr_type_node : ptr_type_node;
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
1187 else
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
1188 {
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
1189 eltype
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
1190 = arm_simd_builtin_type (op_mode,
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
1191 (qualifiers & qualifier_unsigned) != 0,
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
1192 (qualifiers & qualifier_poly) != 0);
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
1193 gcc_assert (eltype != NULL);
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
1194
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
1195 /* Add qualifiers. */
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
1196 if (qualifiers & qualifier_const)
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
1197 eltype = build_qualified_type (eltype, TYPE_QUAL_CONST);
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
1198
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
1199 if (qualifiers & qualifier_pointer)
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
1200 eltype = build_pointer_type (eltype);
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
1201 }
111
kono
parents:
diff changeset
1202 /* If we have reached arg_num == 0, we are at a non-void
kono
parents:
diff changeset
1203 return type. Otherwise, we are still processing
kono
parents:
diff changeset
1204 arguments. */
kono
parents:
diff changeset
1205 if (arg_num == 0)
kono
parents:
diff changeset
1206 return_type = eltype;
kono
parents:
diff changeset
1207 else
kono
parents:
diff changeset
1208 args = tree_cons (NULL_TREE, eltype, args);
kono
parents:
diff changeset
1209 }
kono
parents:
diff changeset
1210
kono
parents:
diff changeset
1211 ftype = build_function_type (return_type, args);
kono
parents:
diff changeset
1212
kono
parents:
diff changeset
1213 gcc_assert (ftype != NULL);
kono
parents:
diff changeset
1214
kono
parents:
diff changeset
1215 if (print_type_signature_p
kono
parents:
diff changeset
1216 && IN_RANGE (fcode, ARM_BUILTIN_VFP_BASE, ARM_BUILTIN_ACLE_BASE - 1))
kono
parents:
diff changeset
1217 snprintf (namebuf, sizeof (namebuf), "%s_%s_%s",
kono
parents:
diff changeset
1218 prefix, d->name, type_signature);
kono
parents:
diff changeset
1219 else
kono
parents:
diff changeset
1220 snprintf (namebuf, sizeof (namebuf), "%s_%s",
kono
parents:
diff changeset
1221 prefix, d->name);
kono
parents:
diff changeset
1222
kono
parents:
diff changeset
1223 fndecl = add_builtin_function (namebuf, ftype, fcode, BUILT_IN_MD,
kono
parents:
diff changeset
1224 NULL, NULL_TREE);
kono
parents:
diff changeset
1225 arm_builtin_decls[fcode] = fndecl;
kono
parents:
diff changeset
1226 }
kono
parents:
diff changeset
1227
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1228 /* Initialize the backend REAL_TYPE type supporting bfloat types. */
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1229 static void
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1230 arm_init_bf16_types (void)
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1231 {
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1232 arm_bf16_type_node = make_node (REAL_TYPE);
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1233 TYPE_PRECISION (arm_bf16_type_node) = 16;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1234 SET_TYPE_MODE (arm_bf16_type_node, BFmode);
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1235 layout_type (arm_bf16_type_node);
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1236
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1237 lang_hooks.types.register_builtin_type (arm_bf16_type_node, "__bf16");
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1238 arm_bf16_ptr_type_node = build_pointer_type (arm_bf16_type_node);
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1239 }
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1240
111
kono
parents:
diff changeset
1241 /* Set up ACLE builtins, even builtins for instructions that are not
kono
parents:
diff changeset
1242 in the current target ISA to allow the user to compile particular modules
kono
parents:
diff changeset
1243 with different target specific options that differ from the command line
kono
parents:
diff changeset
1244 options. Such builtins will be rejected in arm_expand_builtin. */
kono
parents:
diff changeset
1245
kono
parents:
diff changeset
1246 static void
kono
parents:
diff changeset
1247 arm_init_acle_builtins (void)
kono
parents:
diff changeset
1248 {
kono
parents:
diff changeset
1249 unsigned int i, fcode = ARM_BUILTIN_ACLE_PATTERN_START;
kono
parents:
diff changeset
1250
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1251 tree sat_check_fpr = build_function_type_list (void_type_node,
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1252 intSI_type_node,
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1253 intSI_type_node,
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1254 intSI_type_node,
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1255 NULL);
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1256 arm_builtin_decls[ARM_BUILTIN_SAT_IMM_CHECK]
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1257 = add_builtin_function ("__builtin_sat_imm_check", sat_check_fpr,
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1258 ARM_BUILTIN_SAT_IMM_CHECK, BUILT_IN_MD,
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1259 NULL, NULL_TREE);
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1260
111
kono
parents:
diff changeset
1261 for (i = 0; i < ARRAY_SIZE (acle_builtin_data); i++, fcode++)
kono
parents:
diff changeset
1262 {
kono
parents:
diff changeset
1263 arm_builtin_datum *d = &acle_builtin_data[i];
kono
parents:
diff changeset
1264 arm_init_builtin (fcode, d, "__builtin_arm");
kono
parents:
diff changeset
1265 }
kono
parents:
diff changeset
1266 }
kono
parents:
diff changeset
1267
kono
parents:
diff changeset
1268 /* Set up all the NEON builtins, even builtins for instructions that are not
kono
parents:
diff changeset
1269 in the current target ISA to allow the user to compile particular modules
kono
parents:
diff changeset
1270 with different target specific options that differ from the command line
kono
parents:
diff changeset
1271 options. Such builtins will be rejected in arm_expand_builtin. */
kono
parents:
diff changeset
1272
kono
parents:
diff changeset
1273 static void
kono
parents:
diff changeset
1274 arm_init_neon_builtins (void)
kono
parents:
diff changeset
1275 {
kono
parents:
diff changeset
1276 unsigned int i, fcode = ARM_BUILTIN_NEON_PATTERN_START;
kono
parents:
diff changeset
1277
kono
parents:
diff changeset
1278 arm_init_simd_builtin_types ();
kono
parents:
diff changeset
1279
kono
parents:
diff changeset
1280 /* Strong-typing hasn't been implemented for all AdvSIMD builtin intrinsics.
kono
parents:
diff changeset
1281 Therefore we need to preserve the old __builtin scalar types. It can be
kono
parents:
diff changeset
1282 removed once all the intrinsics become strongly typed using the qualifier
kono
parents:
diff changeset
1283 system. */
kono
parents:
diff changeset
1284 arm_init_simd_builtin_scalar_types ();
kono
parents:
diff changeset
1285
kono
parents:
diff changeset
1286 tree lane_check_fpr = build_function_type_list (void_type_node,
kono
parents:
diff changeset
1287 intSI_type_node,
kono
parents:
diff changeset
1288 intSI_type_node,
kono
parents:
diff changeset
1289 NULL);
kono
parents:
diff changeset
1290 arm_builtin_decls[ARM_BUILTIN_NEON_LANE_CHECK] =
kono
parents:
diff changeset
1291 add_builtin_function ("__builtin_arm_lane_check", lane_check_fpr,
kono
parents:
diff changeset
1292 ARM_BUILTIN_NEON_LANE_CHECK, BUILT_IN_MD,
kono
parents:
diff changeset
1293 NULL, NULL_TREE);
kono
parents:
diff changeset
1294
kono
parents:
diff changeset
1295 for (i = 0; i < ARRAY_SIZE (neon_builtin_data); i++, fcode++)
kono
parents:
diff changeset
1296 {
kono
parents:
diff changeset
1297 arm_builtin_datum *d = &neon_builtin_data[i];
kono
parents:
diff changeset
1298 arm_init_builtin (fcode, d, "__builtin_neon");
kono
parents:
diff changeset
1299 }
kono
parents:
diff changeset
1300 }
kono
parents:
diff changeset
1301
kono
parents:
diff changeset
1302 /* Set up all the scalar floating point builtins. */
kono
parents:
diff changeset
1303
kono
parents:
diff changeset
1304 static void
kono
parents:
diff changeset
1305 arm_init_vfp_builtins (void)
kono
parents:
diff changeset
1306 {
kono
parents:
diff changeset
1307 unsigned int i, fcode = ARM_BUILTIN_VFP_PATTERN_START;
kono
parents:
diff changeset
1308
kono
parents:
diff changeset
1309 for (i = 0; i < ARRAY_SIZE (vfp_builtin_data); i++, fcode++)
kono
parents:
diff changeset
1310 {
kono
parents:
diff changeset
1311 arm_builtin_datum *d = &vfp_builtin_data[i];
kono
parents:
diff changeset
1312 arm_init_builtin (fcode, d, "__builtin_neon");
kono
parents:
diff changeset
1313 }
kono
parents:
diff changeset
1314 }
kono
parents:
diff changeset
1315
kono
parents:
diff changeset
1316 static void
kono
parents:
diff changeset
1317 arm_init_crypto_builtins (void)
kono
parents:
diff changeset
1318 {
kono
parents:
diff changeset
1319 tree V16UQI_type_node
kono
parents:
diff changeset
1320 = arm_simd_builtin_type (V16QImode, true, false);
kono
parents:
diff changeset
1321
kono
parents:
diff changeset
1322 tree V4USI_type_node
kono
parents:
diff changeset
1323 = arm_simd_builtin_type (V4SImode, true, false);
kono
parents:
diff changeset
1324
kono
parents:
diff changeset
1325 tree v16uqi_ftype_v16uqi
kono
parents:
diff changeset
1326 = build_function_type_list (V16UQI_type_node, V16UQI_type_node,
kono
parents:
diff changeset
1327 NULL_TREE);
kono
parents:
diff changeset
1328
kono
parents:
diff changeset
1329 tree v16uqi_ftype_v16uqi_v16uqi
kono
parents:
diff changeset
1330 = build_function_type_list (V16UQI_type_node, V16UQI_type_node,
kono
parents:
diff changeset
1331 V16UQI_type_node, NULL_TREE);
kono
parents:
diff changeset
1332
kono
parents:
diff changeset
1333 tree v4usi_ftype_v4usi
kono
parents:
diff changeset
1334 = build_function_type_list (V4USI_type_node, V4USI_type_node,
kono
parents:
diff changeset
1335 NULL_TREE);
kono
parents:
diff changeset
1336
kono
parents:
diff changeset
1337 tree v4usi_ftype_v4usi_v4usi
kono
parents:
diff changeset
1338 = build_function_type_list (V4USI_type_node, V4USI_type_node,
kono
parents:
diff changeset
1339 V4USI_type_node, NULL_TREE);
kono
parents:
diff changeset
1340
kono
parents:
diff changeset
1341 tree v4usi_ftype_v4usi_v4usi_v4usi
kono
parents:
diff changeset
1342 = build_function_type_list (V4USI_type_node, V4USI_type_node,
kono
parents:
diff changeset
1343 V4USI_type_node, V4USI_type_node,
kono
parents:
diff changeset
1344 NULL_TREE);
kono
parents:
diff changeset
1345
kono
parents:
diff changeset
1346 tree uti_ftype_udi_udi
kono
parents:
diff changeset
1347 = build_function_type_list (unsigned_intTI_type_node,
kono
parents:
diff changeset
1348 unsigned_intDI_type_node,
kono
parents:
diff changeset
1349 unsigned_intDI_type_node,
kono
parents:
diff changeset
1350 NULL_TREE);
kono
parents:
diff changeset
1351
kono
parents:
diff changeset
1352 #undef CRYPTO1
kono
parents:
diff changeset
1353 #undef CRYPTO2
kono
parents:
diff changeset
1354 #undef CRYPTO3
kono
parents:
diff changeset
1355 #undef C
kono
parents:
diff changeset
1356 #undef N
kono
parents:
diff changeset
1357 #undef CF
kono
parents:
diff changeset
1358 #undef FT1
kono
parents:
diff changeset
1359 #undef FT2
kono
parents:
diff changeset
1360 #undef FT3
kono
parents:
diff changeset
1361
kono
parents:
diff changeset
1362 #define C(U) \
kono
parents:
diff changeset
1363 ARM_BUILTIN_CRYPTO_##U
kono
parents:
diff changeset
1364 #define N(L) \
kono
parents:
diff changeset
1365 "__builtin_arm_crypto_"#L
kono
parents:
diff changeset
1366 #define FT1(R, A) \
kono
parents:
diff changeset
1367 R##_ftype_##A
kono
parents:
diff changeset
1368 #define FT2(R, A1, A2) \
kono
parents:
diff changeset
1369 R##_ftype_##A1##_##A2
kono
parents:
diff changeset
1370 #define FT3(R, A1, A2, A3) \
kono
parents:
diff changeset
1371 R##_ftype_##A1##_##A2##_##A3
kono
parents:
diff changeset
1372 #define CRYPTO1(L, U, R, A) \
kono
parents:
diff changeset
1373 arm_builtin_decls[C (U)] \
kono
parents:
diff changeset
1374 = add_builtin_function (N (L), FT1 (R, A), \
kono
parents:
diff changeset
1375 C (U), BUILT_IN_MD, NULL, NULL_TREE);
kono
parents:
diff changeset
1376 #define CRYPTO2(L, U, R, A1, A2) \
kono
parents:
diff changeset
1377 arm_builtin_decls[C (U)] \
kono
parents:
diff changeset
1378 = add_builtin_function (N (L), FT2 (R, A1, A2), \
kono
parents:
diff changeset
1379 C (U), BUILT_IN_MD, NULL, NULL_TREE);
kono
parents:
diff changeset
1380
kono
parents:
diff changeset
1381 #define CRYPTO3(L, U, R, A1, A2, A3) \
kono
parents:
diff changeset
1382 arm_builtin_decls[C (U)] \
kono
parents:
diff changeset
1383 = add_builtin_function (N (L), FT3 (R, A1, A2, A3), \
kono
parents:
diff changeset
1384 C (U), BUILT_IN_MD, NULL, NULL_TREE);
kono
parents:
diff changeset
1385 #include "crypto.def"
kono
parents:
diff changeset
1386
kono
parents:
diff changeset
1387 #undef CRYPTO1
kono
parents:
diff changeset
1388 #undef CRYPTO2
kono
parents:
diff changeset
1389 #undef CRYPTO3
kono
parents:
diff changeset
1390 #undef C
kono
parents:
diff changeset
1391 #undef N
kono
parents:
diff changeset
1392 #undef FT1
kono
parents:
diff changeset
1393 #undef FT2
kono
parents:
diff changeset
1394 #undef FT3
kono
parents:
diff changeset
1395 }
kono
parents:
diff changeset
1396
kono
parents:
diff changeset
1397 #undef NUM_DREG_TYPES
kono
parents:
diff changeset
1398 #undef NUM_QREG_TYPES
kono
parents:
diff changeset
1399
kono
parents:
diff changeset
1400 #define def_mbuiltin(FLAG, NAME, TYPE, CODE) \
kono
parents:
diff changeset
1401 do \
kono
parents:
diff changeset
1402 { \
kono
parents:
diff changeset
1403 if (FLAG == isa_nobit \
kono
parents:
diff changeset
1404 || bitmap_bit_p (arm_active_target.isa, FLAG)) \
kono
parents:
diff changeset
1405 { \
kono
parents:
diff changeset
1406 tree bdecl; \
kono
parents:
diff changeset
1407 bdecl = add_builtin_function ((NAME), (TYPE), (CODE), \
kono
parents:
diff changeset
1408 BUILT_IN_MD, NULL, NULL_TREE); \
kono
parents:
diff changeset
1409 arm_builtin_decls[CODE] = bdecl; \
kono
parents:
diff changeset
1410 } \
kono
parents:
diff changeset
1411 } \
kono
parents:
diff changeset
1412 while (0)
kono
parents:
diff changeset
1413
kono
parents:
diff changeset
1414 struct builtin_description
kono
parents:
diff changeset
1415 {
kono
parents:
diff changeset
1416 const enum isa_feature feature;
kono
parents:
diff changeset
1417 const enum insn_code icode;
kono
parents:
diff changeset
1418 const char * const name;
kono
parents:
diff changeset
1419 const enum arm_builtins code;
kono
parents:
diff changeset
1420 const enum rtx_code comparison;
kono
parents:
diff changeset
1421 const unsigned int flag;
kono
parents:
diff changeset
1422 };
kono
parents:
diff changeset
1423
kono
parents:
diff changeset
1424 static const struct builtin_description bdesc_2arg[] =
kono
parents:
diff changeset
1425 {
kono
parents:
diff changeset
1426 #define IWMMXT_BUILTIN(code, string, builtin) \
kono
parents:
diff changeset
1427 { isa_bit_iwmmxt, CODE_FOR_##code, \
kono
parents:
diff changeset
1428 "__builtin_arm_" string, \
kono
parents:
diff changeset
1429 ARM_BUILTIN_##builtin, UNKNOWN, 0 },
kono
parents:
diff changeset
1430
kono
parents:
diff changeset
1431 #define IWMMXT2_BUILTIN(code, string, builtin) \
kono
parents:
diff changeset
1432 { isa_bit_iwmmxt2, CODE_FOR_##code, \
kono
parents:
diff changeset
1433 "__builtin_arm_" string, \
kono
parents:
diff changeset
1434 ARM_BUILTIN_##builtin, UNKNOWN, 0 },
kono
parents:
diff changeset
1435
kono
parents:
diff changeset
1436 IWMMXT_BUILTIN (addv8qi3, "waddb", WADDB)
kono
parents:
diff changeset
1437 IWMMXT_BUILTIN (addv4hi3, "waddh", WADDH)
kono
parents:
diff changeset
1438 IWMMXT_BUILTIN (addv2si3, "waddw", WADDW)
kono
parents:
diff changeset
1439 IWMMXT_BUILTIN (subv8qi3, "wsubb", WSUBB)
kono
parents:
diff changeset
1440 IWMMXT_BUILTIN (subv4hi3, "wsubh", WSUBH)
kono
parents:
diff changeset
1441 IWMMXT_BUILTIN (subv2si3, "wsubw", WSUBW)
kono
parents:
diff changeset
1442 IWMMXT_BUILTIN (ssaddv8qi3, "waddbss", WADDSSB)
kono
parents:
diff changeset
1443 IWMMXT_BUILTIN (ssaddv4hi3, "waddhss", WADDSSH)
kono
parents:
diff changeset
1444 IWMMXT_BUILTIN (ssaddv2si3, "waddwss", WADDSSW)
kono
parents:
diff changeset
1445 IWMMXT_BUILTIN (sssubv8qi3, "wsubbss", WSUBSSB)
kono
parents:
diff changeset
1446 IWMMXT_BUILTIN (sssubv4hi3, "wsubhss", WSUBSSH)
kono
parents:
diff changeset
1447 IWMMXT_BUILTIN (sssubv2si3, "wsubwss", WSUBSSW)
kono
parents:
diff changeset
1448 IWMMXT_BUILTIN (usaddv8qi3, "waddbus", WADDUSB)
kono
parents:
diff changeset
1449 IWMMXT_BUILTIN (usaddv4hi3, "waddhus", WADDUSH)
kono
parents:
diff changeset
1450 IWMMXT_BUILTIN (usaddv2si3, "waddwus", WADDUSW)
kono
parents:
diff changeset
1451 IWMMXT_BUILTIN (ussubv8qi3, "wsubbus", WSUBUSB)
kono
parents:
diff changeset
1452 IWMMXT_BUILTIN (ussubv4hi3, "wsubhus", WSUBUSH)
kono
parents:
diff changeset
1453 IWMMXT_BUILTIN (ussubv2si3, "wsubwus", WSUBUSW)
kono
parents:
diff changeset
1454 IWMMXT_BUILTIN (mulv4hi3, "wmulul", WMULUL)
kono
parents:
diff changeset
1455 IWMMXT_BUILTIN (smulv4hi3_highpart, "wmulsm", WMULSM)
kono
parents:
diff changeset
1456 IWMMXT_BUILTIN (umulv4hi3_highpart, "wmulum", WMULUM)
kono
parents:
diff changeset
1457 IWMMXT_BUILTIN (eqv8qi3, "wcmpeqb", WCMPEQB)
kono
parents:
diff changeset
1458 IWMMXT_BUILTIN (eqv4hi3, "wcmpeqh", WCMPEQH)
kono
parents:
diff changeset
1459 IWMMXT_BUILTIN (eqv2si3, "wcmpeqw", WCMPEQW)
kono
parents:
diff changeset
1460 IWMMXT_BUILTIN (gtuv8qi3, "wcmpgtub", WCMPGTUB)
kono
parents:
diff changeset
1461 IWMMXT_BUILTIN (gtuv4hi3, "wcmpgtuh", WCMPGTUH)
kono
parents:
diff changeset
1462 IWMMXT_BUILTIN (gtuv2si3, "wcmpgtuw", WCMPGTUW)
kono
parents:
diff changeset
1463 IWMMXT_BUILTIN (gtv8qi3, "wcmpgtsb", WCMPGTSB)
kono
parents:
diff changeset
1464 IWMMXT_BUILTIN (gtv4hi3, "wcmpgtsh", WCMPGTSH)
kono
parents:
diff changeset
1465 IWMMXT_BUILTIN (gtv2si3, "wcmpgtsw", WCMPGTSW)
kono
parents:
diff changeset
1466 IWMMXT_BUILTIN (umaxv8qi3, "wmaxub", WMAXUB)
kono
parents:
diff changeset
1467 IWMMXT_BUILTIN (smaxv8qi3, "wmaxsb", WMAXSB)
kono
parents:
diff changeset
1468 IWMMXT_BUILTIN (umaxv4hi3, "wmaxuh", WMAXUH)
kono
parents:
diff changeset
1469 IWMMXT_BUILTIN (smaxv4hi3, "wmaxsh", WMAXSH)
kono
parents:
diff changeset
1470 IWMMXT_BUILTIN (umaxv2si3, "wmaxuw", WMAXUW)
kono
parents:
diff changeset
1471 IWMMXT_BUILTIN (smaxv2si3, "wmaxsw", WMAXSW)
kono
parents:
diff changeset
1472 IWMMXT_BUILTIN (uminv8qi3, "wminub", WMINUB)
kono
parents:
diff changeset
1473 IWMMXT_BUILTIN (sminv8qi3, "wminsb", WMINSB)
kono
parents:
diff changeset
1474 IWMMXT_BUILTIN (uminv4hi3, "wminuh", WMINUH)
kono
parents:
diff changeset
1475 IWMMXT_BUILTIN (sminv4hi3, "wminsh", WMINSH)
kono
parents:
diff changeset
1476 IWMMXT_BUILTIN (uminv2si3, "wminuw", WMINUW)
kono
parents:
diff changeset
1477 IWMMXT_BUILTIN (sminv2si3, "wminsw", WMINSW)
kono
parents:
diff changeset
1478 IWMMXT_BUILTIN (iwmmxt_anddi3, "wand", WAND)
kono
parents:
diff changeset
1479 IWMMXT_BUILTIN (iwmmxt_nanddi3, "wandn", WANDN)
kono
parents:
diff changeset
1480 IWMMXT_BUILTIN (iwmmxt_iordi3, "wor", WOR)
kono
parents:
diff changeset
1481 IWMMXT_BUILTIN (iwmmxt_xordi3, "wxor", WXOR)
kono
parents:
diff changeset
1482 IWMMXT_BUILTIN (iwmmxt_uavgv8qi3, "wavg2b", WAVG2B)
kono
parents:
diff changeset
1483 IWMMXT_BUILTIN (iwmmxt_uavgv4hi3, "wavg2h", WAVG2H)
kono
parents:
diff changeset
1484 IWMMXT_BUILTIN (iwmmxt_uavgrndv8qi3, "wavg2br", WAVG2BR)
kono
parents:
diff changeset
1485 IWMMXT_BUILTIN (iwmmxt_uavgrndv4hi3, "wavg2hr", WAVG2HR)
kono
parents:
diff changeset
1486 IWMMXT_BUILTIN (iwmmxt_wunpckilb, "wunpckilb", WUNPCKILB)
kono
parents:
diff changeset
1487 IWMMXT_BUILTIN (iwmmxt_wunpckilh, "wunpckilh", WUNPCKILH)
kono
parents:
diff changeset
1488 IWMMXT_BUILTIN (iwmmxt_wunpckilw, "wunpckilw", WUNPCKILW)
kono
parents:
diff changeset
1489 IWMMXT_BUILTIN (iwmmxt_wunpckihb, "wunpckihb", WUNPCKIHB)
kono
parents:
diff changeset
1490 IWMMXT_BUILTIN (iwmmxt_wunpckihh, "wunpckihh", WUNPCKIHH)
kono
parents:
diff changeset
1491 IWMMXT_BUILTIN (iwmmxt_wunpckihw, "wunpckihw", WUNPCKIHW)
kono
parents:
diff changeset
1492 IWMMXT2_BUILTIN (iwmmxt_waddsubhx, "waddsubhx", WADDSUBHX)
kono
parents:
diff changeset
1493 IWMMXT2_BUILTIN (iwmmxt_wsubaddhx, "wsubaddhx", WSUBADDHX)
kono
parents:
diff changeset
1494 IWMMXT2_BUILTIN (iwmmxt_wabsdiffb, "wabsdiffb", WABSDIFFB)
kono
parents:
diff changeset
1495 IWMMXT2_BUILTIN (iwmmxt_wabsdiffh, "wabsdiffh", WABSDIFFH)
kono
parents:
diff changeset
1496 IWMMXT2_BUILTIN (iwmmxt_wabsdiffw, "wabsdiffw", WABSDIFFW)
kono
parents:
diff changeset
1497 IWMMXT2_BUILTIN (iwmmxt_avg4, "wavg4", WAVG4)
kono
parents:
diff changeset
1498 IWMMXT2_BUILTIN (iwmmxt_avg4r, "wavg4r", WAVG4R)
kono
parents:
diff changeset
1499 IWMMXT2_BUILTIN (iwmmxt_wmulwsm, "wmulwsm", WMULWSM)
kono
parents:
diff changeset
1500 IWMMXT2_BUILTIN (iwmmxt_wmulwum, "wmulwum", WMULWUM)
kono
parents:
diff changeset
1501 IWMMXT2_BUILTIN (iwmmxt_wmulwsmr, "wmulwsmr", WMULWSMR)
kono
parents:
diff changeset
1502 IWMMXT2_BUILTIN (iwmmxt_wmulwumr, "wmulwumr", WMULWUMR)
kono
parents:
diff changeset
1503 IWMMXT2_BUILTIN (iwmmxt_wmulwl, "wmulwl", WMULWL)
kono
parents:
diff changeset
1504 IWMMXT2_BUILTIN (iwmmxt_wmulsmr, "wmulsmr", WMULSMR)
kono
parents:
diff changeset
1505 IWMMXT2_BUILTIN (iwmmxt_wmulumr, "wmulumr", WMULUMR)
kono
parents:
diff changeset
1506 IWMMXT2_BUILTIN (iwmmxt_wqmulm, "wqmulm", WQMULM)
kono
parents:
diff changeset
1507 IWMMXT2_BUILTIN (iwmmxt_wqmulmr, "wqmulmr", WQMULMR)
kono
parents:
diff changeset
1508 IWMMXT2_BUILTIN (iwmmxt_wqmulwm, "wqmulwm", WQMULWM)
kono
parents:
diff changeset
1509 IWMMXT2_BUILTIN (iwmmxt_wqmulwmr, "wqmulwmr", WQMULWMR)
kono
parents:
diff changeset
1510 IWMMXT_BUILTIN (iwmmxt_walignr0, "walignr0", WALIGNR0)
kono
parents:
diff changeset
1511 IWMMXT_BUILTIN (iwmmxt_walignr1, "walignr1", WALIGNR1)
kono
parents:
diff changeset
1512 IWMMXT_BUILTIN (iwmmxt_walignr2, "walignr2", WALIGNR2)
kono
parents:
diff changeset
1513 IWMMXT_BUILTIN (iwmmxt_walignr3, "walignr3", WALIGNR3)
kono
parents:
diff changeset
1514
kono
parents:
diff changeset
1515 #define IWMMXT_BUILTIN2(code, builtin) \
kono
parents:
diff changeset
1516 { isa_bit_iwmmxt, CODE_FOR_##code, NULL, \
kono
parents:
diff changeset
1517 ARM_BUILTIN_##builtin, UNKNOWN, 0 },
kono
parents:
diff changeset
1518
kono
parents:
diff changeset
1519 #define IWMMXT2_BUILTIN2(code, builtin) \
kono
parents:
diff changeset
1520 { isa_bit_iwmmxt2, CODE_FOR_##code, NULL, \
kono
parents:
diff changeset
1521 ARM_BUILTIN_##builtin, UNKNOWN, 0 },
kono
parents:
diff changeset
1522
kono
parents:
diff changeset
1523 IWMMXT2_BUILTIN2 (iwmmxt_waddbhusm, WADDBHUSM)
kono
parents:
diff changeset
1524 IWMMXT2_BUILTIN2 (iwmmxt_waddbhusl, WADDBHUSL)
kono
parents:
diff changeset
1525 IWMMXT_BUILTIN2 (iwmmxt_wpackhss, WPACKHSS)
kono
parents:
diff changeset
1526 IWMMXT_BUILTIN2 (iwmmxt_wpackwss, WPACKWSS)
kono
parents:
diff changeset
1527 IWMMXT_BUILTIN2 (iwmmxt_wpackdss, WPACKDSS)
kono
parents:
diff changeset
1528 IWMMXT_BUILTIN2 (iwmmxt_wpackhus, WPACKHUS)
kono
parents:
diff changeset
1529 IWMMXT_BUILTIN2 (iwmmxt_wpackwus, WPACKWUS)
kono
parents:
diff changeset
1530 IWMMXT_BUILTIN2 (iwmmxt_wpackdus, WPACKDUS)
kono
parents:
diff changeset
1531 IWMMXT_BUILTIN2 (iwmmxt_wmacuz, WMACUZ)
kono
parents:
diff changeset
1532 IWMMXT_BUILTIN2 (iwmmxt_wmacsz, WMACSZ)
kono
parents:
diff changeset
1533
kono
parents:
diff changeset
1534
kono
parents:
diff changeset
1535 #define FP_BUILTIN(L, U) \
kono
parents:
diff changeset
1536 {isa_nobit, CODE_FOR_##L, "__builtin_arm_"#L, ARM_BUILTIN_##U, \
kono
parents:
diff changeset
1537 UNKNOWN, 0},
kono
parents:
diff changeset
1538
kono
parents:
diff changeset
1539 FP_BUILTIN (get_fpscr, GET_FPSCR)
kono
parents:
diff changeset
1540 FP_BUILTIN (set_fpscr, SET_FPSCR)
kono
parents:
diff changeset
1541 #undef FP_BUILTIN
kono
parents:
diff changeset
1542
kono
parents:
diff changeset
1543 #define CRYPTO_BUILTIN(L, U) \
kono
parents:
diff changeset
1544 {isa_nobit, CODE_FOR_crypto_##L, "__builtin_arm_crypto_"#L, \
kono
parents:
diff changeset
1545 ARM_BUILTIN_CRYPTO_##U, UNKNOWN, 0},
kono
parents:
diff changeset
1546 #undef CRYPTO1
kono
parents:
diff changeset
1547 #undef CRYPTO2
kono
parents:
diff changeset
1548 #undef CRYPTO3
kono
parents:
diff changeset
1549 #define CRYPTO2(L, U, R, A1, A2) CRYPTO_BUILTIN (L, U)
kono
parents:
diff changeset
1550 #define CRYPTO1(L, U, R, A)
kono
parents:
diff changeset
1551 #define CRYPTO3(L, U, R, A1, A2, A3)
kono
parents:
diff changeset
1552 #include "crypto.def"
kono
parents:
diff changeset
1553 #undef CRYPTO1
kono
parents:
diff changeset
1554 #undef CRYPTO2
kono
parents:
diff changeset
1555 #undef CRYPTO3
kono
parents:
diff changeset
1556
kono
parents:
diff changeset
1557 };
kono
parents:
diff changeset
1558
kono
parents:
diff changeset
1559 static const struct builtin_description bdesc_1arg[] =
kono
parents:
diff changeset
1560 {
kono
parents:
diff changeset
1561 IWMMXT_BUILTIN (iwmmxt_tmovmskb, "tmovmskb", TMOVMSKB)
kono
parents:
diff changeset
1562 IWMMXT_BUILTIN (iwmmxt_tmovmskh, "tmovmskh", TMOVMSKH)
kono
parents:
diff changeset
1563 IWMMXT_BUILTIN (iwmmxt_tmovmskw, "tmovmskw", TMOVMSKW)
kono
parents:
diff changeset
1564 IWMMXT_BUILTIN (iwmmxt_waccb, "waccb", WACCB)
kono
parents:
diff changeset
1565 IWMMXT_BUILTIN (iwmmxt_wacch, "wacch", WACCH)
kono
parents:
diff changeset
1566 IWMMXT_BUILTIN (iwmmxt_waccw, "waccw", WACCW)
kono
parents:
diff changeset
1567 IWMMXT_BUILTIN (iwmmxt_wunpckehub, "wunpckehub", WUNPCKEHUB)
kono
parents:
diff changeset
1568 IWMMXT_BUILTIN (iwmmxt_wunpckehuh, "wunpckehuh", WUNPCKEHUH)
kono
parents:
diff changeset
1569 IWMMXT_BUILTIN (iwmmxt_wunpckehuw, "wunpckehuw", WUNPCKEHUW)
kono
parents:
diff changeset
1570 IWMMXT_BUILTIN (iwmmxt_wunpckehsb, "wunpckehsb", WUNPCKEHSB)
kono
parents:
diff changeset
1571 IWMMXT_BUILTIN (iwmmxt_wunpckehsh, "wunpckehsh", WUNPCKEHSH)
kono
parents:
diff changeset
1572 IWMMXT_BUILTIN (iwmmxt_wunpckehsw, "wunpckehsw", WUNPCKEHSW)
kono
parents:
diff changeset
1573 IWMMXT_BUILTIN (iwmmxt_wunpckelub, "wunpckelub", WUNPCKELUB)
kono
parents:
diff changeset
1574 IWMMXT_BUILTIN (iwmmxt_wunpckeluh, "wunpckeluh", WUNPCKELUH)
kono
parents:
diff changeset
1575 IWMMXT_BUILTIN (iwmmxt_wunpckeluw, "wunpckeluw", WUNPCKELUW)
kono
parents:
diff changeset
1576 IWMMXT_BUILTIN (iwmmxt_wunpckelsb, "wunpckelsb", WUNPCKELSB)
kono
parents:
diff changeset
1577 IWMMXT_BUILTIN (iwmmxt_wunpckelsh, "wunpckelsh", WUNPCKELSH)
kono
parents:
diff changeset
1578 IWMMXT_BUILTIN (iwmmxt_wunpckelsw, "wunpckelsw", WUNPCKELSW)
kono
parents:
diff changeset
1579 IWMMXT2_BUILTIN (iwmmxt_wabsv8qi3, "wabsb", WABSB)
kono
parents:
diff changeset
1580 IWMMXT2_BUILTIN (iwmmxt_wabsv4hi3, "wabsh", WABSH)
kono
parents:
diff changeset
1581 IWMMXT2_BUILTIN (iwmmxt_wabsv2si3, "wabsw", WABSW)
kono
parents:
diff changeset
1582 IWMMXT_BUILTIN (tbcstv8qi, "tbcstb", TBCSTB)
kono
parents:
diff changeset
1583 IWMMXT_BUILTIN (tbcstv4hi, "tbcsth", TBCSTH)
kono
parents:
diff changeset
1584 IWMMXT_BUILTIN (tbcstv2si, "tbcstw", TBCSTW)
kono
parents:
diff changeset
1585
kono
parents:
diff changeset
1586 #define CRYPTO1(L, U, R, A) CRYPTO_BUILTIN (L, U)
kono
parents:
diff changeset
1587 #define CRYPTO2(L, U, R, A1, A2)
kono
parents:
diff changeset
1588 #define CRYPTO3(L, U, R, A1, A2, A3)
kono
parents:
diff changeset
1589 #include "crypto.def"
kono
parents:
diff changeset
1590 #undef CRYPTO1
kono
parents:
diff changeset
1591 #undef CRYPTO2
kono
parents:
diff changeset
1592 #undef CRYPTO3
kono
parents:
diff changeset
1593 };
kono
parents:
diff changeset
1594
kono
parents:
diff changeset
1595 static const struct builtin_description bdesc_3arg[] =
kono
parents:
diff changeset
1596 {
kono
parents:
diff changeset
1597 #define CRYPTO3(L, U, R, A1, A2, A3) CRYPTO_BUILTIN (L, U)
kono
parents:
diff changeset
1598 #define CRYPTO1(L, U, R, A)
kono
parents:
diff changeset
1599 #define CRYPTO2(L, U, R, A1, A2)
kono
parents:
diff changeset
1600 #include "crypto.def"
kono
parents:
diff changeset
1601 #undef CRYPTO1
kono
parents:
diff changeset
1602 #undef CRYPTO2
kono
parents:
diff changeset
1603 #undef CRYPTO3
kono
parents:
diff changeset
1604 };
kono
parents:
diff changeset
1605 #undef CRYPTO_BUILTIN
kono
parents:
diff changeset
1606
kono
parents:
diff changeset
1607 /* Set up all the iWMMXt builtins. This is not called if
kono
parents:
diff changeset
1608 TARGET_IWMMXT is zero. */
kono
parents:
diff changeset
1609
kono
parents:
diff changeset
1610 static void
kono
parents:
diff changeset
1611 arm_init_iwmmxt_builtins (void)
kono
parents:
diff changeset
1612 {
kono
parents:
diff changeset
1613 const struct builtin_description * d;
kono
parents:
diff changeset
1614 size_t i;
kono
parents:
diff changeset
1615
kono
parents:
diff changeset
1616 tree V2SI_type_node = build_vector_type_for_mode (intSI_type_node, V2SImode);
kono
parents:
diff changeset
1617 tree V4HI_type_node = build_vector_type_for_mode (intHI_type_node, V4HImode);
kono
parents:
diff changeset
1618 tree V8QI_type_node = build_vector_type_for_mode (intQI_type_node, V8QImode);
kono
parents:
diff changeset
1619
kono
parents:
diff changeset
1620 tree v8qi_ftype_v8qi_v8qi_int
kono
parents:
diff changeset
1621 = build_function_type_list (V8QI_type_node,
kono
parents:
diff changeset
1622 V8QI_type_node, V8QI_type_node,
kono
parents:
diff changeset
1623 integer_type_node, NULL_TREE);
kono
parents:
diff changeset
1624 tree v4hi_ftype_v4hi_int
kono
parents:
diff changeset
1625 = build_function_type_list (V4HI_type_node,
kono
parents:
diff changeset
1626 V4HI_type_node, integer_type_node, NULL_TREE);
kono
parents:
diff changeset
1627 tree v2si_ftype_v2si_int
kono
parents:
diff changeset
1628 = build_function_type_list (V2SI_type_node,
kono
parents:
diff changeset
1629 V2SI_type_node, integer_type_node, NULL_TREE);
kono
parents:
diff changeset
1630 tree v2si_ftype_di_di
kono
parents:
diff changeset
1631 = build_function_type_list (V2SI_type_node,
kono
parents:
diff changeset
1632 long_long_integer_type_node,
kono
parents:
diff changeset
1633 long_long_integer_type_node,
kono
parents:
diff changeset
1634 NULL_TREE);
kono
parents:
diff changeset
1635 tree di_ftype_di_int
kono
parents:
diff changeset
1636 = build_function_type_list (long_long_integer_type_node,
kono
parents:
diff changeset
1637 long_long_integer_type_node,
kono
parents:
diff changeset
1638 integer_type_node, NULL_TREE);
kono
parents:
diff changeset
1639 tree di_ftype_di_int_int
kono
parents:
diff changeset
1640 = build_function_type_list (long_long_integer_type_node,
kono
parents:
diff changeset
1641 long_long_integer_type_node,
kono
parents:
diff changeset
1642 integer_type_node,
kono
parents:
diff changeset
1643 integer_type_node, NULL_TREE);
kono
parents:
diff changeset
1644 tree int_ftype_v8qi
kono
parents:
diff changeset
1645 = build_function_type_list (integer_type_node,
kono
parents:
diff changeset
1646 V8QI_type_node, NULL_TREE);
kono
parents:
diff changeset
1647 tree int_ftype_v4hi
kono
parents:
diff changeset
1648 = build_function_type_list (integer_type_node,
kono
parents:
diff changeset
1649 V4HI_type_node, NULL_TREE);
kono
parents:
diff changeset
1650 tree int_ftype_v2si
kono
parents:
diff changeset
1651 = build_function_type_list (integer_type_node,
kono
parents:
diff changeset
1652 V2SI_type_node, NULL_TREE);
kono
parents:
diff changeset
1653 tree int_ftype_v8qi_int
kono
parents:
diff changeset
1654 = build_function_type_list (integer_type_node,
kono
parents:
diff changeset
1655 V8QI_type_node, integer_type_node, NULL_TREE);
kono
parents:
diff changeset
1656 tree int_ftype_v4hi_int
kono
parents:
diff changeset
1657 = build_function_type_list (integer_type_node,
kono
parents:
diff changeset
1658 V4HI_type_node, integer_type_node, NULL_TREE);
kono
parents:
diff changeset
1659 tree int_ftype_v2si_int
kono
parents:
diff changeset
1660 = build_function_type_list (integer_type_node,
kono
parents:
diff changeset
1661 V2SI_type_node, integer_type_node, NULL_TREE);
kono
parents:
diff changeset
1662 tree v8qi_ftype_v8qi_int_int
kono
parents:
diff changeset
1663 = build_function_type_list (V8QI_type_node,
kono
parents:
diff changeset
1664 V8QI_type_node, integer_type_node,
kono
parents:
diff changeset
1665 integer_type_node, NULL_TREE);
kono
parents:
diff changeset
1666 tree v4hi_ftype_v4hi_int_int
kono
parents:
diff changeset
1667 = build_function_type_list (V4HI_type_node,
kono
parents:
diff changeset
1668 V4HI_type_node, integer_type_node,
kono
parents:
diff changeset
1669 integer_type_node, NULL_TREE);
kono
parents:
diff changeset
1670 tree v2si_ftype_v2si_int_int
kono
parents:
diff changeset
1671 = build_function_type_list (V2SI_type_node,
kono
parents:
diff changeset
1672 V2SI_type_node, integer_type_node,
kono
parents:
diff changeset
1673 integer_type_node, NULL_TREE);
kono
parents:
diff changeset
1674 /* Miscellaneous. */
kono
parents:
diff changeset
1675 tree v8qi_ftype_v4hi_v4hi
kono
parents:
diff changeset
1676 = build_function_type_list (V8QI_type_node,
kono
parents:
diff changeset
1677 V4HI_type_node, V4HI_type_node, NULL_TREE);
kono
parents:
diff changeset
1678 tree v4hi_ftype_v2si_v2si
kono
parents:
diff changeset
1679 = build_function_type_list (V4HI_type_node,
kono
parents:
diff changeset
1680 V2SI_type_node, V2SI_type_node, NULL_TREE);
kono
parents:
diff changeset
1681 tree v8qi_ftype_v4hi_v8qi
kono
parents:
diff changeset
1682 = build_function_type_list (V8QI_type_node,
kono
parents:
diff changeset
1683 V4HI_type_node, V8QI_type_node, NULL_TREE);
kono
parents:
diff changeset
1684 tree v2si_ftype_v4hi_v4hi
kono
parents:
diff changeset
1685 = build_function_type_list (V2SI_type_node,
kono
parents:
diff changeset
1686 V4HI_type_node, V4HI_type_node, NULL_TREE);
kono
parents:
diff changeset
1687 tree v2si_ftype_v8qi_v8qi
kono
parents:
diff changeset
1688 = build_function_type_list (V2SI_type_node,
kono
parents:
diff changeset
1689 V8QI_type_node, V8QI_type_node, NULL_TREE);
kono
parents:
diff changeset
1690 tree v4hi_ftype_v4hi_di
kono
parents:
diff changeset
1691 = build_function_type_list (V4HI_type_node,
kono
parents:
diff changeset
1692 V4HI_type_node, long_long_integer_type_node,
kono
parents:
diff changeset
1693 NULL_TREE);
kono
parents:
diff changeset
1694 tree v2si_ftype_v2si_di
kono
parents:
diff changeset
1695 = build_function_type_list (V2SI_type_node,
kono
parents:
diff changeset
1696 V2SI_type_node, long_long_integer_type_node,
kono
parents:
diff changeset
1697 NULL_TREE);
kono
parents:
diff changeset
1698 tree di_ftype_void
kono
parents:
diff changeset
1699 = build_function_type_list (long_long_unsigned_type_node, NULL_TREE);
kono
parents:
diff changeset
1700 tree int_ftype_void
kono
parents:
diff changeset
1701 = build_function_type_list (integer_type_node, NULL_TREE);
kono
parents:
diff changeset
1702 tree di_ftype_v8qi
kono
parents:
diff changeset
1703 = build_function_type_list (long_long_integer_type_node,
kono
parents:
diff changeset
1704 V8QI_type_node, NULL_TREE);
kono
parents:
diff changeset
1705 tree di_ftype_v4hi
kono
parents:
diff changeset
1706 = build_function_type_list (long_long_integer_type_node,
kono
parents:
diff changeset
1707 V4HI_type_node, NULL_TREE);
kono
parents:
diff changeset
1708 tree di_ftype_v2si
kono
parents:
diff changeset
1709 = build_function_type_list (long_long_integer_type_node,
kono
parents:
diff changeset
1710 V2SI_type_node, NULL_TREE);
kono
parents:
diff changeset
1711 tree v2si_ftype_v4hi
kono
parents:
diff changeset
1712 = build_function_type_list (V2SI_type_node,
kono
parents:
diff changeset
1713 V4HI_type_node, NULL_TREE);
kono
parents:
diff changeset
1714 tree v4hi_ftype_v8qi
kono
parents:
diff changeset
1715 = build_function_type_list (V4HI_type_node,
kono
parents:
diff changeset
1716 V8QI_type_node, NULL_TREE);
kono
parents:
diff changeset
1717 tree v8qi_ftype_v8qi
kono
parents:
diff changeset
1718 = build_function_type_list (V8QI_type_node,
kono
parents:
diff changeset
1719 V8QI_type_node, NULL_TREE);
kono
parents:
diff changeset
1720 tree v4hi_ftype_v4hi
kono
parents:
diff changeset
1721 = build_function_type_list (V4HI_type_node,
kono
parents:
diff changeset
1722 V4HI_type_node, NULL_TREE);
kono
parents:
diff changeset
1723 tree v2si_ftype_v2si
kono
parents:
diff changeset
1724 = build_function_type_list (V2SI_type_node,
kono
parents:
diff changeset
1725 V2SI_type_node, NULL_TREE);
kono
parents:
diff changeset
1726
kono
parents:
diff changeset
1727 tree di_ftype_di_v4hi_v4hi
kono
parents:
diff changeset
1728 = build_function_type_list (long_long_unsigned_type_node,
kono
parents:
diff changeset
1729 long_long_unsigned_type_node,
kono
parents:
diff changeset
1730 V4HI_type_node, V4HI_type_node,
kono
parents:
diff changeset
1731 NULL_TREE);
kono
parents:
diff changeset
1732
kono
parents:
diff changeset
1733 tree di_ftype_v4hi_v4hi
kono
parents:
diff changeset
1734 = build_function_type_list (long_long_unsigned_type_node,
kono
parents:
diff changeset
1735 V4HI_type_node,V4HI_type_node,
kono
parents:
diff changeset
1736 NULL_TREE);
kono
parents:
diff changeset
1737
kono
parents:
diff changeset
1738 tree v2si_ftype_v2si_v4hi_v4hi
kono
parents:
diff changeset
1739 = build_function_type_list (V2SI_type_node,
kono
parents:
diff changeset
1740 V2SI_type_node, V4HI_type_node,
kono
parents:
diff changeset
1741 V4HI_type_node, NULL_TREE);
kono
parents:
diff changeset
1742
kono
parents:
diff changeset
1743 tree v2si_ftype_v2si_v8qi_v8qi
kono
parents:
diff changeset
1744 = build_function_type_list (V2SI_type_node,
kono
parents:
diff changeset
1745 V2SI_type_node, V8QI_type_node,
kono
parents:
diff changeset
1746 V8QI_type_node, NULL_TREE);
kono
parents:
diff changeset
1747
kono
parents:
diff changeset
1748 tree di_ftype_di_v2si_v2si
kono
parents:
diff changeset
1749 = build_function_type_list (long_long_unsigned_type_node,
kono
parents:
diff changeset
1750 long_long_unsigned_type_node,
kono
parents:
diff changeset
1751 V2SI_type_node, V2SI_type_node,
kono
parents:
diff changeset
1752 NULL_TREE);
kono
parents:
diff changeset
1753
kono
parents:
diff changeset
1754 tree di_ftype_di_di_int
kono
parents:
diff changeset
1755 = build_function_type_list (long_long_unsigned_type_node,
kono
parents:
diff changeset
1756 long_long_unsigned_type_node,
kono
parents:
diff changeset
1757 long_long_unsigned_type_node,
kono
parents:
diff changeset
1758 integer_type_node, NULL_TREE);
kono
parents:
diff changeset
1759
kono
parents:
diff changeset
1760 tree void_ftype_int
kono
parents:
diff changeset
1761 = build_function_type_list (void_type_node,
kono
parents:
diff changeset
1762 integer_type_node, NULL_TREE);
kono
parents:
diff changeset
1763
kono
parents:
diff changeset
1764 tree v8qi_ftype_char
kono
parents:
diff changeset
1765 = build_function_type_list (V8QI_type_node,
kono
parents:
diff changeset
1766 signed_char_type_node, NULL_TREE);
kono
parents:
diff changeset
1767
kono
parents:
diff changeset
1768 tree v4hi_ftype_short
kono
parents:
diff changeset
1769 = build_function_type_list (V4HI_type_node,
kono
parents:
diff changeset
1770 short_integer_type_node, NULL_TREE);
kono
parents:
diff changeset
1771
kono
parents:
diff changeset
1772 tree v2si_ftype_int
kono
parents:
diff changeset
1773 = build_function_type_list (V2SI_type_node,
kono
parents:
diff changeset
1774 integer_type_node, NULL_TREE);
kono
parents:
diff changeset
1775
kono
parents:
diff changeset
1776 /* Normal vector binops. */
kono
parents:
diff changeset
1777 tree v8qi_ftype_v8qi_v8qi
kono
parents:
diff changeset
1778 = build_function_type_list (V8QI_type_node,
kono
parents:
diff changeset
1779 V8QI_type_node, V8QI_type_node, NULL_TREE);
kono
parents:
diff changeset
1780 tree v4hi_ftype_v4hi_v4hi
kono
parents:
diff changeset
1781 = build_function_type_list (V4HI_type_node,
kono
parents:
diff changeset
1782 V4HI_type_node,V4HI_type_node, NULL_TREE);
kono
parents:
diff changeset
1783 tree v2si_ftype_v2si_v2si
kono
parents:
diff changeset
1784 = build_function_type_list (V2SI_type_node,
kono
parents:
diff changeset
1785 V2SI_type_node, V2SI_type_node, NULL_TREE);
kono
parents:
diff changeset
1786 tree di_ftype_di_di
kono
parents:
diff changeset
1787 = build_function_type_list (long_long_unsigned_type_node,
kono
parents:
diff changeset
1788 long_long_unsigned_type_node,
kono
parents:
diff changeset
1789 long_long_unsigned_type_node,
kono
parents:
diff changeset
1790 NULL_TREE);
kono
parents:
diff changeset
1791
kono
parents:
diff changeset
1792 /* Add all builtins that are more or less simple operations on two
kono
parents:
diff changeset
1793 operands. */
kono
parents:
diff changeset
1794 for (i = 0, d = bdesc_2arg; i < ARRAY_SIZE (bdesc_2arg); i++, d++)
kono
parents:
diff changeset
1795 {
kono
parents:
diff changeset
1796 /* Use one of the operands; the target can have a different mode for
kono
parents:
diff changeset
1797 mask-generating compares. */
kono
parents:
diff changeset
1798 machine_mode mode;
kono
parents:
diff changeset
1799 tree type;
kono
parents:
diff changeset
1800
kono
parents:
diff changeset
1801 if (d->name == 0
kono
parents:
diff changeset
1802 || !(d->feature == isa_bit_iwmmxt
kono
parents:
diff changeset
1803 || d->feature == isa_bit_iwmmxt2))
kono
parents:
diff changeset
1804 continue;
kono
parents:
diff changeset
1805
kono
parents:
diff changeset
1806 mode = insn_data[d->icode].operand[1].mode;
kono
parents:
diff changeset
1807
kono
parents:
diff changeset
1808 switch (mode)
kono
parents:
diff changeset
1809 {
kono
parents:
diff changeset
1810 case E_V8QImode:
kono
parents:
diff changeset
1811 type = v8qi_ftype_v8qi_v8qi;
kono
parents:
diff changeset
1812 break;
kono
parents:
diff changeset
1813 case E_V4HImode:
kono
parents:
diff changeset
1814 type = v4hi_ftype_v4hi_v4hi;
kono
parents:
diff changeset
1815 break;
kono
parents:
diff changeset
1816 case E_V2SImode:
kono
parents:
diff changeset
1817 type = v2si_ftype_v2si_v2si;
kono
parents:
diff changeset
1818 break;
kono
parents:
diff changeset
1819 case E_DImode:
kono
parents:
diff changeset
1820 type = di_ftype_di_di;
kono
parents:
diff changeset
1821 break;
kono
parents:
diff changeset
1822
kono
parents:
diff changeset
1823 default:
kono
parents:
diff changeset
1824 gcc_unreachable ();
kono
parents:
diff changeset
1825 }
kono
parents:
diff changeset
1826
kono
parents:
diff changeset
1827 def_mbuiltin (d->feature, d->name, type, d->code);
kono
parents:
diff changeset
1828 }
kono
parents:
diff changeset
1829
kono
parents:
diff changeset
1830 /* Add the remaining MMX insns with somewhat more complicated types. */
kono
parents:
diff changeset
1831 #define iwmmx_mbuiltin(NAME, TYPE, CODE) \
kono
parents:
diff changeset
1832 def_mbuiltin (isa_bit_iwmmxt, "__builtin_arm_" NAME, \
kono
parents:
diff changeset
1833 (TYPE), ARM_BUILTIN_ ## CODE)
kono
parents:
diff changeset
1834
kono
parents:
diff changeset
1835 #define iwmmx2_mbuiltin(NAME, TYPE, CODE) \
kono
parents:
diff changeset
1836 def_mbuiltin (isa_bit_iwmmxt2, "__builtin_arm_" NAME, \
kono
parents:
diff changeset
1837 (TYPE), ARM_BUILTIN_ ## CODE)
kono
parents:
diff changeset
1838
kono
parents:
diff changeset
1839 iwmmx_mbuiltin ("wzero", di_ftype_void, WZERO);
kono
parents:
diff changeset
1840 iwmmx_mbuiltin ("setwcgr0", void_ftype_int, SETWCGR0);
kono
parents:
diff changeset
1841 iwmmx_mbuiltin ("setwcgr1", void_ftype_int, SETWCGR1);
kono
parents:
diff changeset
1842 iwmmx_mbuiltin ("setwcgr2", void_ftype_int, SETWCGR2);
kono
parents:
diff changeset
1843 iwmmx_mbuiltin ("setwcgr3", void_ftype_int, SETWCGR3);
kono
parents:
diff changeset
1844 iwmmx_mbuiltin ("getwcgr0", int_ftype_void, GETWCGR0);
kono
parents:
diff changeset
1845 iwmmx_mbuiltin ("getwcgr1", int_ftype_void, GETWCGR1);
kono
parents:
diff changeset
1846 iwmmx_mbuiltin ("getwcgr2", int_ftype_void, GETWCGR2);
kono
parents:
diff changeset
1847 iwmmx_mbuiltin ("getwcgr3", int_ftype_void, GETWCGR3);
kono
parents:
diff changeset
1848
kono
parents:
diff changeset
1849 iwmmx_mbuiltin ("wsllh", v4hi_ftype_v4hi_di, WSLLH);
kono
parents:
diff changeset
1850 iwmmx_mbuiltin ("wsllw", v2si_ftype_v2si_di, WSLLW);
kono
parents:
diff changeset
1851 iwmmx_mbuiltin ("wslld", di_ftype_di_di, WSLLD);
kono
parents:
diff changeset
1852 iwmmx_mbuiltin ("wsllhi", v4hi_ftype_v4hi_int, WSLLHI);
kono
parents:
diff changeset
1853 iwmmx_mbuiltin ("wsllwi", v2si_ftype_v2si_int, WSLLWI);
kono
parents:
diff changeset
1854 iwmmx_mbuiltin ("wslldi", di_ftype_di_int, WSLLDI);
kono
parents:
diff changeset
1855
kono
parents:
diff changeset
1856 iwmmx_mbuiltin ("wsrlh", v4hi_ftype_v4hi_di, WSRLH);
kono
parents:
diff changeset
1857 iwmmx_mbuiltin ("wsrlw", v2si_ftype_v2si_di, WSRLW);
kono
parents:
diff changeset
1858 iwmmx_mbuiltin ("wsrld", di_ftype_di_di, WSRLD);
kono
parents:
diff changeset
1859 iwmmx_mbuiltin ("wsrlhi", v4hi_ftype_v4hi_int, WSRLHI);
kono
parents:
diff changeset
1860 iwmmx_mbuiltin ("wsrlwi", v2si_ftype_v2si_int, WSRLWI);
kono
parents:
diff changeset
1861 iwmmx_mbuiltin ("wsrldi", di_ftype_di_int, WSRLDI);
kono
parents:
diff changeset
1862
kono
parents:
diff changeset
1863 iwmmx_mbuiltin ("wsrah", v4hi_ftype_v4hi_di, WSRAH);
kono
parents:
diff changeset
1864 iwmmx_mbuiltin ("wsraw", v2si_ftype_v2si_di, WSRAW);
kono
parents:
diff changeset
1865 iwmmx_mbuiltin ("wsrad", di_ftype_di_di, WSRAD);
kono
parents:
diff changeset
1866 iwmmx_mbuiltin ("wsrahi", v4hi_ftype_v4hi_int, WSRAHI);
kono
parents:
diff changeset
1867 iwmmx_mbuiltin ("wsrawi", v2si_ftype_v2si_int, WSRAWI);
kono
parents:
diff changeset
1868 iwmmx_mbuiltin ("wsradi", di_ftype_di_int, WSRADI);
kono
parents:
diff changeset
1869
kono
parents:
diff changeset
1870 iwmmx_mbuiltin ("wrorh", v4hi_ftype_v4hi_di, WRORH);
kono
parents:
diff changeset
1871 iwmmx_mbuiltin ("wrorw", v2si_ftype_v2si_di, WRORW);
kono
parents:
diff changeset
1872 iwmmx_mbuiltin ("wrord", di_ftype_di_di, WRORD);
kono
parents:
diff changeset
1873 iwmmx_mbuiltin ("wrorhi", v4hi_ftype_v4hi_int, WRORHI);
kono
parents:
diff changeset
1874 iwmmx_mbuiltin ("wrorwi", v2si_ftype_v2si_int, WRORWI);
kono
parents:
diff changeset
1875 iwmmx_mbuiltin ("wrordi", di_ftype_di_int, WRORDI);
kono
parents:
diff changeset
1876
kono
parents:
diff changeset
1877 iwmmx_mbuiltin ("wshufh", v4hi_ftype_v4hi_int, WSHUFH);
kono
parents:
diff changeset
1878
kono
parents:
diff changeset
1879 iwmmx_mbuiltin ("wsadb", v2si_ftype_v2si_v8qi_v8qi, WSADB);
kono
parents:
diff changeset
1880 iwmmx_mbuiltin ("wsadh", v2si_ftype_v2si_v4hi_v4hi, WSADH);
kono
parents:
diff changeset
1881 iwmmx_mbuiltin ("wmadds", v2si_ftype_v4hi_v4hi, WMADDS);
kono
parents:
diff changeset
1882 iwmmx2_mbuiltin ("wmaddsx", v2si_ftype_v4hi_v4hi, WMADDSX);
kono
parents:
diff changeset
1883 iwmmx2_mbuiltin ("wmaddsn", v2si_ftype_v4hi_v4hi, WMADDSN);
kono
parents:
diff changeset
1884 iwmmx_mbuiltin ("wmaddu", v2si_ftype_v4hi_v4hi, WMADDU);
kono
parents:
diff changeset
1885 iwmmx2_mbuiltin ("wmaddux", v2si_ftype_v4hi_v4hi, WMADDUX);
kono
parents:
diff changeset
1886 iwmmx2_mbuiltin ("wmaddun", v2si_ftype_v4hi_v4hi, WMADDUN);
kono
parents:
diff changeset
1887 iwmmx_mbuiltin ("wsadbz", v2si_ftype_v8qi_v8qi, WSADBZ);
kono
parents:
diff changeset
1888 iwmmx_mbuiltin ("wsadhz", v2si_ftype_v4hi_v4hi, WSADHZ);
kono
parents:
diff changeset
1889
kono
parents:
diff changeset
1890 iwmmx_mbuiltin ("textrmsb", int_ftype_v8qi_int, TEXTRMSB);
kono
parents:
diff changeset
1891 iwmmx_mbuiltin ("textrmsh", int_ftype_v4hi_int, TEXTRMSH);
kono
parents:
diff changeset
1892 iwmmx_mbuiltin ("textrmsw", int_ftype_v2si_int, TEXTRMSW);
kono
parents:
diff changeset
1893 iwmmx_mbuiltin ("textrmub", int_ftype_v8qi_int, TEXTRMUB);
kono
parents:
diff changeset
1894 iwmmx_mbuiltin ("textrmuh", int_ftype_v4hi_int, TEXTRMUH);
kono
parents:
diff changeset
1895 iwmmx_mbuiltin ("textrmuw", int_ftype_v2si_int, TEXTRMUW);
kono
parents:
diff changeset
1896 iwmmx_mbuiltin ("tinsrb", v8qi_ftype_v8qi_int_int, TINSRB);
kono
parents:
diff changeset
1897 iwmmx_mbuiltin ("tinsrh", v4hi_ftype_v4hi_int_int, TINSRH);
kono
parents:
diff changeset
1898 iwmmx_mbuiltin ("tinsrw", v2si_ftype_v2si_int_int, TINSRW);
kono
parents:
diff changeset
1899
kono
parents:
diff changeset
1900 iwmmx_mbuiltin ("waccb", di_ftype_v8qi, WACCB);
kono
parents:
diff changeset
1901 iwmmx_mbuiltin ("wacch", di_ftype_v4hi, WACCH);
kono
parents:
diff changeset
1902 iwmmx_mbuiltin ("waccw", di_ftype_v2si, WACCW);
kono
parents:
diff changeset
1903
kono
parents:
diff changeset
1904 iwmmx_mbuiltin ("tmovmskb", int_ftype_v8qi, TMOVMSKB);
kono
parents:
diff changeset
1905 iwmmx_mbuiltin ("tmovmskh", int_ftype_v4hi, TMOVMSKH);
kono
parents:
diff changeset
1906 iwmmx_mbuiltin ("tmovmskw", int_ftype_v2si, TMOVMSKW);
kono
parents:
diff changeset
1907
kono
parents:
diff changeset
1908 iwmmx2_mbuiltin ("waddbhusm", v8qi_ftype_v4hi_v8qi, WADDBHUSM);
kono
parents:
diff changeset
1909 iwmmx2_mbuiltin ("waddbhusl", v8qi_ftype_v4hi_v8qi, WADDBHUSL);
kono
parents:
diff changeset
1910
kono
parents:
diff changeset
1911 iwmmx_mbuiltin ("wpackhss", v8qi_ftype_v4hi_v4hi, WPACKHSS);
kono
parents:
diff changeset
1912 iwmmx_mbuiltin ("wpackhus", v8qi_ftype_v4hi_v4hi, WPACKHUS);
kono
parents:
diff changeset
1913 iwmmx_mbuiltin ("wpackwus", v4hi_ftype_v2si_v2si, WPACKWUS);
kono
parents:
diff changeset
1914 iwmmx_mbuiltin ("wpackwss", v4hi_ftype_v2si_v2si, WPACKWSS);
kono
parents:
diff changeset
1915 iwmmx_mbuiltin ("wpackdus", v2si_ftype_di_di, WPACKDUS);
kono
parents:
diff changeset
1916 iwmmx_mbuiltin ("wpackdss", v2si_ftype_di_di, WPACKDSS);
kono
parents:
diff changeset
1917
kono
parents:
diff changeset
1918 iwmmx_mbuiltin ("wunpckehub", v4hi_ftype_v8qi, WUNPCKEHUB);
kono
parents:
diff changeset
1919 iwmmx_mbuiltin ("wunpckehuh", v2si_ftype_v4hi, WUNPCKEHUH);
kono
parents:
diff changeset
1920 iwmmx_mbuiltin ("wunpckehuw", di_ftype_v2si, WUNPCKEHUW);
kono
parents:
diff changeset
1921 iwmmx_mbuiltin ("wunpckehsb", v4hi_ftype_v8qi, WUNPCKEHSB);
kono
parents:
diff changeset
1922 iwmmx_mbuiltin ("wunpckehsh", v2si_ftype_v4hi, WUNPCKEHSH);
kono
parents:
diff changeset
1923 iwmmx_mbuiltin ("wunpckehsw", di_ftype_v2si, WUNPCKEHSW);
kono
parents:
diff changeset
1924 iwmmx_mbuiltin ("wunpckelub", v4hi_ftype_v8qi, WUNPCKELUB);
kono
parents:
diff changeset
1925 iwmmx_mbuiltin ("wunpckeluh", v2si_ftype_v4hi, WUNPCKELUH);
kono
parents:
diff changeset
1926 iwmmx_mbuiltin ("wunpckeluw", di_ftype_v2si, WUNPCKELUW);
kono
parents:
diff changeset
1927 iwmmx_mbuiltin ("wunpckelsb", v4hi_ftype_v8qi, WUNPCKELSB);
kono
parents:
diff changeset
1928 iwmmx_mbuiltin ("wunpckelsh", v2si_ftype_v4hi, WUNPCKELSH);
kono
parents:
diff changeset
1929 iwmmx_mbuiltin ("wunpckelsw", di_ftype_v2si, WUNPCKELSW);
kono
parents:
diff changeset
1930
kono
parents:
diff changeset
1931 iwmmx_mbuiltin ("wmacs", di_ftype_di_v4hi_v4hi, WMACS);
kono
parents:
diff changeset
1932 iwmmx_mbuiltin ("wmacsz", di_ftype_v4hi_v4hi, WMACSZ);
kono
parents:
diff changeset
1933 iwmmx_mbuiltin ("wmacu", di_ftype_di_v4hi_v4hi, WMACU);
kono
parents:
diff changeset
1934 iwmmx_mbuiltin ("wmacuz", di_ftype_v4hi_v4hi, WMACUZ);
kono
parents:
diff changeset
1935
kono
parents:
diff changeset
1936 iwmmx_mbuiltin ("walign", v8qi_ftype_v8qi_v8qi_int, WALIGNI);
kono
parents:
diff changeset
1937 iwmmx_mbuiltin ("tmia", di_ftype_di_int_int, TMIA);
kono
parents:
diff changeset
1938 iwmmx_mbuiltin ("tmiaph", di_ftype_di_int_int, TMIAPH);
kono
parents:
diff changeset
1939 iwmmx_mbuiltin ("tmiabb", di_ftype_di_int_int, TMIABB);
kono
parents:
diff changeset
1940 iwmmx_mbuiltin ("tmiabt", di_ftype_di_int_int, TMIABT);
kono
parents:
diff changeset
1941 iwmmx_mbuiltin ("tmiatb", di_ftype_di_int_int, TMIATB);
kono
parents:
diff changeset
1942 iwmmx_mbuiltin ("tmiatt", di_ftype_di_int_int, TMIATT);
kono
parents:
diff changeset
1943
kono
parents:
diff changeset
1944 iwmmx2_mbuiltin ("wabsb", v8qi_ftype_v8qi, WABSB);
kono
parents:
diff changeset
1945 iwmmx2_mbuiltin ("wabsh", v4hi_ftype_v4hi, WABSH);
kono
parents:
diff changeset
1946 iwmmx2_mbuiltin ("wabsw", v2si_ftype_v2si, WABSW);
kono
parents:
diff changeset
1947
kono
parents:
diff changeset
1948 iwmmx2_mbuiltin ("wqmiabb", v2si_ftype_v2si_v4hi_v4hi, WQMIABB);
kono
parents:
diff changeset
1949 iwmmx2_mbuiltin ("wqmiabt", v2si_ftype_v2si_v4hi_v4hi, WQMIABT);
kono
parents:
diff changeset
1950 iwmmx2_mbuiltin ("wqmiatb", v2si_ftype_v2si_v4hi_v4hi, WQMIATB);
kono
parents:
diff changeset
1951 iwmmx2_mbuiltin ("wqmiatt", v2si_ftype_v2si_v4hi_v4hi, WQMIATT);
kono
parents:
diff changeset
1952
kono
parents:
diff changeset
1953 iwmmx2_mbuiltin ("wqmiabbn", v2si_ftype_v2si_v4hi_v4hi, WQMIABBN);
kono
parents:
diff changeset
1954 iwmmx2_mbuiltin ("wqmiabtn", v2si_ftype_v2si_v4hi_v4hi, WQMIABTN);
kono
parents:
diff changeset
1955 iwmmx2_mbuiltin ("wqmiatbn", v2si_ftype_v2si_v4hi_v4hi, WQMIATBN);
kono
parents:
diff changeset
1956 iwmmx2_mbuiltin ("wqmiattn", v2si_ftype_v2si_v4hi_v4hi, WQMIATTN);
kono
parents:
diff changeset
1957
kono
parents:
diff changeset
1958 iwmmx2_mbuiltin ("wmiabb", di_ftype_di_v4hi_v4hi, WMIABB);
kono
parents:
diff changeset
1959 iwmmx2_mbuiltin ("wmiabt", di_ftype_di_v4hi_v4hi, WMIABT);
kono
parents:
diff changeset
1960 iwmmx2_mbuiltin ("wmiatb", di_ftype_di_v4hi_v4hi, WMIATB);
kono
parents:
diff changeset
1961 iwmmx2_mbuiltin ("wmiatt", di_ftype_di_v4hi_v4hi, WMIATT);
kono
parents:
diff changeset
1962
kono
parents:
diff changeset
1963 iwmmx2_mbuiltin ("wmiabbn", di_ftype_di_v4hi_v4hi, WMIABBN);
kono
parents:
diff changeset
1964 iwmmx2_mbuiltin ("wmiabtn", di_ftype_di_v4hi_v4hi, WMIABTN);
kono
parents:
diff changeset
1965 iwmmx2_mbuiltin ("wmiatbn", di_ftype_di_v4hi_v4hi, WMIATBN);
kono
parents:
diff changeset
1966 iwmmx2_mbuiltin ("wmiattn", di_ftype_di_v4hi_v4hi, WMIATTN);
kono
parents:
diff changeset
1967
kono
parents:
diff changeset
1968 iwmmx2_mbuiltin ("wmiawbb", di_ftype_di_v2si_v2si, WMIAWBB);
kono
parents:
diff changeset
1969 iwmmx2_mbuiltin ("wmiawbt", di_ftype_di_v2si_v2si, WMIAWBT);
kono
parents:
diff changeset
1970 iwmmx2_mbuiltin ("wmiawtb", di_ftype_di_v2si_v2si, WMIAWTB);
kono
parents:
diff changeset
1971 iwmmx2_mbuiltin ("wmiawtt", di_ftype_di_v2si_v2si, WMIAWTT);
kono
parents:
diff changeset
1972
kono
parents:
diff changeset
1973 iwmmx2_mbuiltin ("wmiawbbn", di_ftype_di_v2si_v2si, WMIAWBBN);
kono
parents:
diff changeset
1974 iwmmx2_mbuiltin ("wmiawbtn", di_ftype_di_v2si_v2si, WMIAWBTN);
kono
parents:
diff changeset
1975 iwmmx2_mbuiltin ("wmiawtbn", di_ftype_di_v2si_v2si, WMIAWTBN);
kono
parents:
diff changeset
1976 iwmmx2_mbuiltin ("wmiawttn", di_ftype_di_v2si_v2si, WMIAWTTN);
kono
parents:
diff changeset
1977
kono
parents:
diff changeset
1978 iwmmx2_mbuiltin ("wmerge", di_ftype_di_di_int, WMERGE);
kono
parents:
diff changeset
1979
kono
parents:
diff changeset
1980 iwmmx_mbuiltin ("tbcstb", v8qi_ftype_char, TBCSTB);
kono
parents:
diff changeset
1981 iwmmx_mbuiltin ("tbcsth", v4hi_ftype_short, TBCSTH);
kono
parents:
diff changeset
1982 iwmmx_mbuiltin ("tbcstw", v2si_ftype_int, TBCSTW);
kono
parents:
diff changeset
1983
kono
parents:
diff changeset
1984 #undef iwmmx_mbuiltin
kono
parents:
diff changeset
1985 #undef iwmmx2_mbuiltin
kono
parents:
diff changeset
1986 }
kono
parents:
diff changeset
1987
kono
parents:
diff changeset
1988 static void
kono
parents:
diff changeset
1989 arm_init_fp16_builtins (void)
kono
parents:
diff changeset
1990 {
kono
parents:
diff changeset
1991 arm_fp16_type_node = make_node (REAL_TYPE);
kono
parents:
diff changeset
1992 TYPE_PRECISION (arm_fp16_type_node) = GET_MODE_PRECISION (HFmode);
kono
parents:
diff changeset
1993 layout_type (arm_fp16_type_node);
kono
parents:
diff changeset
1994 if (arm_fp16_format)
kono
parents:
diff changeset
1995 (*lang_hooks.types.register_builtin_type) (arm_fp16_type_node,
kono
parents:
diff changeset
1996 "__fp16");
kono
parents:
diff changeset
1997 }
kono
parents:
diff changeset
1998
kono
parents:
diff changeset
1999 void
kono
parents:
diff changeset
2000 arm_init_builtins (void)
kono
parents:
diff changeset
2001 {
kono
parents:
diff changeset
2002 if (TARGET_REALLY_IWMMXT)
kono
parents:
diff changeset
2003 arm_init_iwmmxt_builtins ();
kono
parents:
diff changeset
2004
kono
parents:
diff changeset
2005 /* This creates the arm_simd_floatHF_type_node so must come before
kono
parents:
diff changeset
2006 arm_init_neon_builtins which uses it. */
kono
parents:
diff changeset
2007 arm_init_fp16_builtins ();
kono
parents:
diff changeset
2008
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
2009 arm_init_bf16_types ();
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
2010
111
kono
parents:
diff changeset
2011 if (TARGET_MAYBE_HARD_FLOAT)
kono
parents:
diff changeset
2012 {
kono
parents:
diff changeset
2013 arm_init_neon_builtins ();
kono
parents:
diff changeset
2014 arm_init_vfp_builtins ();
kono
parents:
diff changeset
2015 arm_init_crypto_builtins ();
kono
parents:
diff changeset
2016 }
kono
parents:
diff changeset
2017
kono
parents:
diff changeset
2018 arm_init_acle_builtins ();
kono
parents:
diff changeset
2019
kono
parents:
diff changeset
2020 if (TARGET_MAYBE_HARD_FLOAT)
kono
parents:
diff changeset
2021 {
kono
parents:
diff changeset
2022 tree ftype_set_fpscr
kono
parents:
diff changeset
2023 = build_function_type_list (void_type_node, unsigned_type_node, NULL);
kono
parents:
diff changeset
2024 tree ftype_get_fpscr
kono
parents:
diff changeset
2025 = build_function_type_list (unsigned_type_node, NULL);
kono
parents:
diff changeset
2026
kono
parents:
diff changeset
2027 arm_builtin_decls[ARM_BUILTIN_GET_FPSCR]
kono
parents:
diff changeset
2028 = add_builtin_function ("__builtin_arm_get_fpscr", ftype_get_fpscr,
kono
parents:
diff changeset
2029 ARM_BUILTIN_GET_FPSCR, BUILT_IN_MD, NULL, NULL_TREE);
kono
parents:
diff changeset
2030 arm_builtin_decls[ARM_BUILTIN_SET_FPSCR]
kono
parents:
diff changeset
2031 = add_builtin_function ("__builtin_arm_set_fpscr", ftype_set_fpscr,
kono
parents:
diff changeset
2032 ARM_BUILTIN_SET_FPSCR, BUILT_IN_MD, NULL, NULL_TREE);
kono
parents:
diff changeset
2033 }
kono
parents:
diff changeset
2034
kono
parents:
diff changeset
2035 if (use_cmse)
kono
parents:
diff changeset
2036 {
kono
parents:
diff changeset
2037 tree ftype_cmse_nonsecure_caller
kono
parents:
diff changeset
2038 = build_function_type_list (unsigned_type_node, NULL);
kono
parents:
diff changeset
2039 arm_builtin_decls[ARM_BUILTIN_CMSE_NONSECURE_CALLER]
kono
parents:
diff changeset
2040 = add_builtin_function ("__builtin_arm_cmse_nonsecure_caller",
kono
parents:
diff changeset
2041 ftype_cmse_nonsecure_caller,
kono
parents:
diff changeset
2042 ARM_BUILTIN_CMSE_NONSECURE_CALLER, BUILT_IN_MD,
kono
parents:
diff changeset
2043 NULL, NULL_TREE);
kono
parents:
diff changeset
2044 }
kono
parents:
diff changeset
2045 }
kono
parents:
diff changeset
2046
kono
parents:
diff changeset
2047 /* Return the ARM builtin for CODE. */
kono
parents:
diff changeset
2048
kono
parents:
diff changeset
2049 tree
kono
parents:
diff changeset
2050 arm_builtin_decl (unsigned code, bool initialize_p ATTRIBUTE_UNUSED)
kono
parents:
diff changeset
2051 {
kono
parents:
diff changeset
2052 if (code >= ARM_BUILTIN_MAX)
kono
parents:
diff changeset
2053 return error_mark_node;
kono
parents:
diff changeset
2054
kono
parents:
diff changeset
2055 return arm_builtin_decls[code];
kono
parents:
diff changeset
2056 }
kono
parents:
diff changeset
2057
kono
parents:
diff changeset
2058 /* Errors in the source file can cause expand_expr to return const0_rtx
kono
parents:
diff changeset
2059 where we expect a vector. To avoid crashing, use one of the vector
kono
parents:
diff changeset
2060 clear instructions. */
kono
parents:
diff changeset
2061
kono
parents:
diff changeset
2062 static rtx
kono
parents:
diff changeset
2063 safe_vector_operand (rtx x, machine_mode mode)
kono
parents:
diff changeset
2064 {
kono
parents:
diff changeset
2065 if (x != const0_rtx)
kono
parents:
diff changeset
2066 return x;
kono
parents:
diff changeset
2067 x = gen_reg_rtx (mode);
kono
parents:
diff changeset
2068
kono
parents:
diff changeset
2069 emit_insn (gen_iwmmxt_clrdi (mode == DImode ? x
kono
parents:
diff changeset
2070 : gen_rtx_SUBREG (DImode, x, 0)));
kono
parents:
diff changeset
2071 return x;
kono
parents:
diff changeset
2072 }
kono
parents:
diff changeset
2073
kono
parents:
diff changeset
2074 /* Function to expand ternary builtins. */
kono
parents:
diff changeset
2075 static rtx
kono
parents:
diff changeset
2076 arm_expand_ternop_builtin (enum insn_code icode,
kono
parents:
diff changeset
2077 tree exp, rtx target)
kono
parents:
diff changeset
2078 {
kono
parents:
diff changeset
2079 rtx pat;
kono
parents:
diff changeset
2080 tree arg0 = CALL_EXPR_ARG (exp, 0);
kono
parents:
diff changeset
2081 tree arg1 = CALL_EXPR_ARG (exp, 1);
kono
parents:
diff changeset
2082 tree arg2 = CALL_EXPR_ARG (exp, 2);
kono
parents:
diff changeset
2083
kono
parents:
diff changeset
2084 rtx op0 = expand_normal (arg0);
kono
parents:
diff changeset
2085 rtx op1 = expand_normal (arg1);
kono
parents:
diff changeset
2086 rtx op2 = expand_normal (arg2);
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
2087
111
kono
parents:
diff changeset
2088 machine_mode tmode = insn_data[icode].operand[0].mode;
kono
parents:
diff changeset
2089 machine_mode mode0 = insn_data[icode].operand[1].mode;
kono
parents:
diff changeset
2090 machine_mode mode1 = insn_data[icode].operand[2].mode;
kono
parents:
diff changeset
2091 machine_mode mode2 = insn_data[icode].operand[3].mode;
kono
parents:
diff changeset
2092
kono
parents:
diff changeset
2093 if (VECTOR_MODE_P (mode0))
kono
parents:
diff changeset
2094 op0 = safe_vector_operand (op0, mode0);
kono
parents:
diff changeset
2095 if (VECTOR_MODE_P (mode1))
kono
parents:
diff changeset
2096 op1 = safe_vector_operand (op1, mode1);
kono
parents:
diff changeset
2097 if (VECTOR_MODE_P (mode2))
kono
parents:
diff changeset
2098 op2 = safe_vector_operand (op2, mode2);
kono
parents:
diff changeset
2099
kono
parents:
diff changeset
2100 if (! target
kono
parents:
diff changeset
2101 || GET_MODE (target) != tmode
kono
parents:
diff changeset
2102 || ! (*insn_data[icode].operand[0].predicate) (target, tmode))
kono
parents:
diff changeset
2103 target = gen_reg_rtx (tmode);
kono
parents:
diff changeset
2104
kono
parents:
diff changeset
2105 gcc_assert ((GET_MODE (op0) == mode0 || GET_MODE (op0) == VOIDmode)
kono
parents:
diff changeset
2106 && (GET_MODE (op1) == mode1 || GET_MODE (op1) == VOIDmode)
kono
parents:
diff changeset
2107 && (GET_MODE (op2) == mode2 || GET_MODE (op2) == VOIDmode));
kono
parents:
diff changeset
2108
kono
parents:
diff changeset
2109 if (! (*insn_data[icode].operand[1].predicate) (op0, mode0))
kono
parents:
diff changeset
2110 op0 = copy_to_mode_reg (mode0, op0);
kono
parents:
diff changeset
2111 if (! (*insn_data[icode].operand[2].predicate) (op1, mode1))
kono
parents:
diff changeset
2112 op1 = copy_to_mode_reg (mode1, op1);
kono
parents:
diff changeset
2113 if (! (*insn_data[icode].operand[3].predicate) (op2, mode2))
kono
parents:
diff changeset
2114 op2 = copy_to_mode_reg (mode2, op2);
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
2115
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
2116 pat = GEN_FCN (icode) (target, op0, op1, op2);
111
kono
parents:
diff changeset
2117 if (! pat)
kono
parents:
diff changeset
2118 return 0;
kono
parents:
diff changeset
2119 emit_insn (pat);
kono
parents:
diff changeset
2120 return target;
kono
parents:
diff changeset
2121 }
kono
parents:
diff changeset
2122
kono
parents:
diff changeset
2123 /* Subroutine of arm_expand_builtin to take care of binop insns. */
kono
parents:
diff changeset
2124
kono
parents:
diff changeset
2125 static rtx
kono
parents:
diff changeset
2126 arm_expand_binop_builtin (enum insn_code icode,
kono
parents:
diff changeset
2127 tree exp, rtx target)
kono
parents:
diff changeset
2128 {
kono
parents:
diff changeset
2129 rtx pat;
kono
parents:
diff changeset
2130 tree arg0 = CALL_EXPR_ARG (exp, 0);
kono
parents:
diff changeset
2131 tree arg1 = CALL_EXPR_ARG (exp, 1);
kono
parents:
diff changeset
2132 rtx op0 = expand_normal (arg0);
kono
parents:
diff changeset
2133 rtx op1 = expand_normal (arg1);
kono
parents:
diff changeset
2134 machine_mode tmode = insn_data[icode].operand[0].mode;
kono
parents:
diff changeset
2135 machine_mode mode0 = insn_data[icode].operand[1].mode;
kono
parents:
diff changeset
2136 machine_mode mode1 = insn_data[icode].operand[2].mode;
kono
parents:
diff changeset
2137
kono
parents:
diff changeset
2138 if (VECTOR_MODE_P (mode0))
kono
parents:
diff changeset
2139 op0 = safe_vector_operand (op0, mode0);
kono
parents:
diff changeset
2140 if (VECTOR_MODE_P (mode1))
kono
parents:
diff changeset
2141 op1 = safe_vector_operand (op1, mode1);
kono
parents:
diff changeset
2142
kono
parents:
diff changeset
2143 if (! target
kono
parents:
diff changeset
2144 || GET_MODE (target) != tmode
kono
parents:
diff changeset
2145 || ! (*insn_data[icode].operand[0].predicate) (target, tmode))
kono
parents:
diff changeset
2146 target = gen_reg_rtx (tmode);
kono
parents:
diff changeset
2147
kono
parents:
diff changeset
2148 gcc_assert ((GET_MODE (op0) == mode0 || GET_MODE (op0) == VOIDmode)
kono
parents:
diff changeset
2149 && (GET_MODE (op1) == mode1 || GET_MODE (op1) == VOIDmode));
kono
parents:
diff changeset
2150
kono
parents:
diff changeset
2151 if (! (*insn_data[icode].operand[1].predicate) (op0, mode0))
kono
parents:
diff changeset
2152 op0 = copy_to_mode_reg (mode0, op0);
kono
parents:
diff changeset
2153 if (! (*insn_data[icode].operand[2].predicate) (op1, mode1))
kono
parents:
diff changeset
2154 op1 = copy_to_mode_reg (mode1, op1);
kono
parents:
diff changeset
2155
kono
parents:
diff changeset
2156 pat = GEN_FCN (icode) (target, op0, op1);
kono
parents:
diff changeset
2157 if (! pat)
kono
parents:
diff changeset
2158 return 0;
kono
parents:
diff changeset
2159 emit_insn (pat);
kono
parents:
diff changeset
2160 return target;
kono
parents:
diff changeset
2161 }
kono
parents:
diff changeset
2162
kono
parents:
diff changeset
2163 /* Subroutine of arm_expand_builtin to take care of unop insns. */
kono
parents:
diff changeset
2164
kono
parents:
diff changeset
2165 static rtx
kono
parents:
diff changeset
2166 arm_expand_unop_builtin (enum insn_code icode,
kono
parents:
diff changeset
2167 tree exp, rtx target, int do_load)
kono
parents:
diff changeset
2168 {
kono
parents:
diff changeset
2169 rtx pat;
kono
parents:
diff changeset
2170 tree arg0 = CALL_EXPR_ARG (exp, 0);
kono
parents:
diff changeset
2171 rtx op0 = expand_normal (arg0);
kono
parents:
diff changeset
2172 machine_mode tmode = insn_data[icode].operand[0].mode;
kono
parents:
diff changeset
2173 machine_mode mode0 = insn_data[icode].operand[1].mode;
kono
parents:
diff changeset
2174
kono
parents:
diff changeset
2175 if (! target
kono
parents:
diff changeset
2176 || GET_MODE (target) != tmode
kono
parents:
diff changeset
2177 || ! (*insn_data[icode].operand[0].predicate) (target, tmode))
kono
parents:
diff changeset
2178 target = gen_reg_rtx (tmode);
kono
parents:
diff changeset
2179 if (do_load)
kono
parents:
diff changeset
2180 op0 = gen_rtx_MEM (mode0, copy_to_mode_reg (Pmode, op0));
kono
parents:
diff changeset
2181 else
kono
parents:
diff changeset
2182 {
kono
parents:
diff changeset
2183 if (VECTOR_MODE_P (mode0))
kono
parents:
diff changeset
2184 op0 = safe_vector_operand (op0, mode0);
kono
parents:
diff changeset
2185
kono
parents:
diff changeset
2186 if (! (*insn_data[icode].operand[1].predicate) (op0, mode0))
kono
parents:
diff changeset
2187 op0 = copy_to_mode_reg (mode0, op0);
kono
parents:
diff changeset
2188 }
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
2189
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
2190 pat = GEN_FCN (icode) (target, op0);
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
2191
111
kono
parents:
diff changeset
2192 if (! pat)
kono
parents:
diff changeset
2193 return 0;
kono
parents:
diff changeset
2194 emit_insn (pat);
kono
parents:
diff changeset
2195 return target;
kono
parents:
diff changeset
2196 }
kono
parents:
diff changeset
2197
kono
parents:
diff changeset
2198 typedef enum {
kono
parents:
diff changeset
2199 ARG_BUILTIN_COPY_TO_REG,
kono
parents:
diff changeset
2200 ARG_BUILTIN_CONSTANT,
kono
parents:
diff changeset
2201 ARG_BUILTIN_LANE_INDEX,
kono
parents:
diff changeset
2202 ARG_BUILTIN_STRUCT_LOAD_STORE_LANE_INDEX,
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
2203 ARG_BUILTIN_LANE_PAIR_INDEX,
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
2204 ARG_BUILTIN_LANE_QUADTUP_INDEX,
111
kono
parents:
diff changeset
2205 ARG_BUILTIN_NEON_MEMORY,
kono
parents:
diff changeset
2206 ARG_BUILTIN_MEMORY,
kono
parents:
diff changeset
2207 ARG_BUILTIN_STOP
kono
parents:
diff changeset
2208 } builtin_arg;
kono
parents:
diff changeset
2209
kono
parents:
diff changeset
2210
kono
parents:
diff changeset
2211 /* EXP is a pointer argument to a Neon load or store intrinsic. Derive
kono
parents:
diff changeset
2212 and return an expression for the accessed memory.
kono
parents:
diff changeset
2213
kono
parents:
diff changeset
2214 The intrinsic function operates on a block of registers that has
kono
parents:
diff changeset
2215 mode REG_MODE. This block contains vectors of type TYPE_MODE. The
kono
parents:
diff changeset
2216 function references the memory at EXP of type TYPE and in mode
kono
parents:
diff changeset
2217 MEM_MODE; this mode may be BLKmode if no more suitable mode is
kono
parents:
diff changeset
2218 available. */
kono
parents:
diff changeset
2219
kono
parents:
diff changeset
2220 static tree
kono
parents:
diff changeset
2221 neon_dereference_pointer (tree exp, tree type, machine_mode mem_mode,
kono
parents:
diff changeset
2222 machine_mode reg_mode,
kono
parents:
diff changeset
2223 machine_mode vector_mode)
kono
parents:
diff changeset
2224 {
kono
parents:
diff changeset
2225 HOST_WIDE_INT reg_size, vector_size, nvectors, nelems;
kono
parents:
diff changeset
2226 tree elem_type, upper_bound, array_type;
kono
parents:
diff changeset
2227
kono
parents:
diff changeset
2228 /* Work out the size of the register block in bytes. */
kono
parents:
diff changeset
2229 reg_size = GET_MODE_SIZE (reg_mode);
kono
parents:
diff changeset
2230
kono
parents:
diff changeset
2231 /* Work out the size of each vector in bytes. */
kono
parents:
diff changeset
2232 vector_size = GET_MODE_SIZE (vector_mode);
kono
parents:
diff changeset
2233
kono
parents:
diff changeset
2234 /* Work out how many vectors there are. */
kono
parents:
diff changeset
2235 gcc_assert (reg_size % vector_size == 0);
kono
parents:
diff changeset
2236 nvectors = reg_size / vector_size;
kono
parents:
diff changeset
2237
kono
parents:
diff changeset
2238 /* Work out the type of each element. */
kono
parents:
diff changeset
2239 gcc_assert (POINTER_TYPE_P (type));
kono
parents:
diff changeset
2240 elem_type = TREE_TYPE (type);
kono
parents:
diff changeset
2241
kono
parents:
diff changeset
2242 /* Work out how many elements are being loaded or stored.
kono
parents:
diff changeset
2243 MEM_MODE == REG_MODE implies a one-to-one mapping between register
kono
parents:
diff changeset
2244 and memory elements; anything else implies a lane load or store. */
kono
parents:
diff changeset
2245 if (mem_mode == reg_mode)
kono
parents:
diff changeset
2246 nelems = vector_size * nvectors / int_size_in_bytes (elem_type);
kono
parents:
diff changeset
2247 else
kono
parents:
diff changeset
2248 nelems = nvectors;
kono
parents:
diff changeset
2249
kono
parents:
diff changeset
2250 /* Create a type that describes the full access. */
kono
parents:
diff changeset
2251 upper_bound = build_int_cst (size_type_node, nelems - 1);
kono
parents:
diff changeset
2252 array_type = build_array_type (elem_type, build_index_type (upper_bound));
kono
parents:
diff changeset
2253
kono
parents:
diff changeset
2254 /* Dereference EXP using that type. */
kono
parents:
diff changeset
2255 return fold_build2 (MEM_REF, array_type, exp,
kono
parents:
diff changeset
2256 build_int_cst (build_pointer_type (array_type), 0));
kono
parents:
diff changeset
2257 }
kono
parents:
diff changeset
2258
kono
parents:
diff changeset
2259 /* Expand a builtin. */
kono
parents:
diff changeset
2260 static rtx
kono
parents:
diff changeset
2261 arm_expand_builtin_args (rtx target, machine_mode map_mode, int fcode,
kono
parents:
diff changeset
2262 int icode, int have_retval, tree exp,
kono
parents:
diff changeset
2263 builtin_arg *args)
kono
parents:
diff changeset
2264 {
kono
parents:
diff changeset
2265 rtx pat;
kono
parents:
diff changeset
2266 tree arg[SIMD_MAX_BUILTIN_ARGS];
kono
parents:
diff changeset
2267 rtx op[SIMD_MAX_BUILTIN_ARGS];
kono
parents:
diff changeset
2268 machine_mode tmode = insn_data[icode].operand[0].mode;
kono
parents:
diff changeset
2269 machine_mode mode[SIMD_MAX_BUILTIN_ARGS];
kono
parents:
diff changeset
2270 tree formals;
kono
parents:
diff changeset
2271 int argc = 0;
kono
parents:
diff changeset
2272 rtx_insn * insn;
kono
parents:
diff changeset
2273
kono
parents:
diff changeset
2274 if (have_retval
kono
parents:
diff changeset
2275 && (!target
kono
parents:
diff changeset
2276 || GET_MODE (target) != tmode
kono
parents:
diff changeset
2277 || !(*insn_data[icode].operand[0].predicate) (target, tmode)))
kono
parents:
diff changeset
2278 target = gen_reg_rtx (tmode);
kono
parents:
diff changeset
2279
kono
parents:
diff changeset
2280 formals = TYPE_ARG_TYPES (TREE_TYPE (arm_builtin_decls[fcode]));
kono
parents:
diff changeset
2281
kono
parents:
diff changeset
2282 for (;;)
kono
parents:
diff changeset
2283 {
kono
parents:
diff changeset
2284 builtin_arg thisarg = args[argc];
kono
parents:
diff changeset
2285
kono
parents:
diff changeset
2286 if (thisarg == ARG_BUILTIN_STOP)
kono
parents:
diff changeset
2287 break;
kono
parents:
diff changeset
2288 else
kono
parents:
diff changeset
2289 {
kono
parents:
diff changeset
2290 int opno = argc + have_retval;
kono
parents:
diff changeset
2291 arg[argc] = CALL_EXPR_ARG (exp, argc);
kono
parents:
diff changeset
2292 mode[argc] = insn_data[icode].operand[opno].mode;
kono
parents:
diff changeset
2293 if (thisarg == ARG_BUILTIN_NEON_MEMORY)
kono
parents:
diff changeset
2294 {
kono
parents:
diff changeset
2295 machine_mode other_mode
kono
parents:
diff changeset
2296 = insn_data[icode].operand[1 - opno].mode;
kono
parents:
diff changeset
2297 arg[argc] = neon_dereference_pointer (arg[argc],
kono
parents:
diff changeset
2298 TREE_VALUE (formals),
kono
parents:
diff changeset
2299 mode[argc], other_mode,
kono
parents:
diff changeset
2300 map_mode);
kono
parents:
diff changeset
2301 }
kono
parents:
diff changeset
2302
kono
parents:
diff changeset
2303 /* Use EXPAND_MEMORY for ARG_BUILTIN_MEMORY and
kono
parents:
diff changeset
2304 ARG_BUILTIN_NEON_MEMORY to ensure a MEM_P be returned. */
kono
parents:
diff changeset
2305 op[argc] = expand_expr (arg[argc], NULL_RTX, VOIDmode,
kono
parents:
diff changeset
2306 ((thisarg == ARG_BUILTIN_MEMORY
kono
parents:
diff changeset
2307 || thisarg == ARG_BUILTIN_NEON_MEMORY)
kono
parents:
diff changeset
2308 ? EXPAND_MEMORY : EXPAND_NORMAL));
kono
parents:
diff changeset
2309
kono
parents:
diff changeset
2310 switch (thisarg)
kono
parents:
diff changeset
2311 {
kono
parents:
diff changeset
2312 case ARG_BUILTIN_MEMORY:
kono
parents:
diff changeset
2313 case ARG_BUILTIN_COPY_TO_REG:
kono
parents:
diff changeset
2314 if (POINTER_TYPE_P (TREE_TYPE (arg[argc])))
kono
parents:
diff changeset
2315 op[argc] = convert_memory_address (Pmode, op[argc]);
kono
parents:
diff changeset
2316 /*gcc_assert (GET_MODE (op[argc]) == mode[argc]); */
kono
parents:
diff changeset
2317 if (!(*insn_data[icode].operand[opno].predicate)
kono
parents:
diff changeset
2318 (op[argc], mode[argc]))
kono
parents:
diff changeset
2319 op[argc] = copy_to_mode_reg (mode[argc], op[argc]);
kono
parents:
diff changeset
2320 break;
kono
parents:
diff changeset
2321
kono
parents:
diff changeset
2322 case ARG_BUILTIN_STRUCT_LOAD_STORE_LANE_INDEX:
kono
parents:
diff changeset
2323 gcc_assert (argc > 1);
kono
parents:
diff changeset
2324 if (CONST_INT_P (op[argc]))
kono
parents:
diff changeset
2325 {
kono
parents:
diff changeset
2326 neon_lane_bounds (op[argc], 0,
kono
parents:
diff changeset
2327 GET_MODE_NUNITS (map_mode), exp);
kono
parents:
diff changeset
2328 /* Keep to GCC-vector-extension lane indices in the RTL. */
kono
parents:
diff changeset
2329 op[argc] =
kono
parents:
diff changeset
2330 GEN_INT (NEON_ENDIAN_LANE_N (map_mode, INTVAL (op[argc])));
kono
parents:
diff changeset
2331 }
kono
parents:
diff changeset
2332 goto constant_arg;
kono
parents:
diff changeset
2333
kono
parents:
diff changeset
2334 case ARG_BUILTIN_LANE_INDEX:
kono
parents:
diff changeset
2335 /* Previous argument must be a vector, which this indexes. */
kono
parents:
diff changeset
2336 gcc_assert (argc > 0);
kono
parents:
diff changeset
2337 if (CONST_INT_P (op[argc]))
kono
parents:
diff changeset
2338 {
kono
parents:
diff changeset
2339 machine_mode vmode = mode[argc - 1];
kono
parents:
diff changeset
2340 neon_lane_bounds (op[argc], 0, GET_MODE_NUNITS (vmode), exp);
kono
parents:
diff changeset
2341 }
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
2342 /* If the lane index isn't a constant then error out. */
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
2343 goto constant_arg;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
2344
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
2345 case ARG_BUILTIN_LANE_PAIR_INDEX:
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
2346 /* Previous argument must be a vector, which this indexes. The
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
2347 indexing will always select i and i+1 out of the vector, which
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
2348 puts a limit on i. */
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
2349 gcc_assert (argc > 0);
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
2350 if (CONST_INT_P (op[argc]))
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
2351 {
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
2352 machine_mode vmode = mode[argc - 1];
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
2353 neon_lane_bounds (op[argc], 0,
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
2354 GET_MODE_NUNITS (vmode) / 2, exp);
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
2355 }
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
2356 /* If the lane index isn't a constant then error out. */
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
2357 goto constant_arg;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
2358
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
2359 case ARG_BUILTIN_LANE_QUADTUP_INDEX:
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
2360 /* Previous argument must be a vector, which this indexes. */
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
2361 gcc_assert (argc > 0);
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
2362 if (CONST_INT_P (op[argc]))
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
2363 {
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
2364 machine_mode vmode = mode[argc - 1];
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
2365 neon_lane_bounds (op[argc], 0,
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
2366 GET_MODE_NUNITS (vmode) / 4, exp);
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
2367 }
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
2368 /* If the lane index isn't a constant then error out. */
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
2369 goto constant_arg;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
2370
111
kono
parents:
diff changeset
2371 case ARG_BUILTIN_CONSTANT:
kono
parents:
diff changeset
2372 constant_arg:
kono
parents:
diff changeset
2373 if (!(*insn_data[icode].operand[opno].predicate)
kono
parents:
diff changeset
2374 (op[argc], mode[argc]))
kono
parents:
diff changeset
2375 {
kono
parents:
diff changeset
2376 error ("%Kargument %d must be a constant immediate",
kono
parents:
diff changeset
2377 exp, argc + 1);
kono
parents:
diff changeset
2378 /* We have failed to expand the pattern, and are safely
kono
parents:
diff changeset
2379 in to invalid code. But the mid-end will still try to
kono
parents:
diff changeset
2380 build an assignment for this node while it expands,
kono
parents:
diff changeset
2381 before stopping for the error, just pass it back
kono
parents:
diff changeset
2382 TARGET to ensure a valid assignment. */
kono
parents:
diff changeset
2383 return target;
kono
parents:
diff changeset
2384 }
kono
parents:
diff changeset
2385 break;
kono
parents:
diff changeset
2386
kono
parents:
diff changeset
2387 case ARG_BUILTIN_NEON_MEMORY:
kono
parents:
diff changeset
2388 /* Check if expand failed. */
kono
parents:
diff changeset
2389 if (op[argc] == const0_rtx)
kono
parents:
diff changeset
2390 return 0;
kono
parents:
diff changeset
2391 gcc_assert (MEM_P (op[argc]));
kono
parents:
diff changeset
2392 PUT_MODE (op[argc], mode[argc]);
kono
parents:
diff changeset
2393 /* ??? arm_neon.h uses the same built-in functions for signed
kono
parents:
diff changeset
2394 and unsigned accesses, casting where necessary. This isn't
kono
parents:
diff changeset
2395 alias safe. */
kono
parents:
diff changeset
2396 set_mem_alias_set (op[argc], 0);
kono
parents:
diff changeset
2397 if (!(*insn_data[icode].operand[opno].predicate)
kono
parents:
diff changeset
2398 (op[argc], mode[argc]))
kono
parents:
diff changeset
2399 op[argc] = (replace_equiv_address
kono
parents:
diff changeset
2400 (op[argc],
kono
parents:
diff changeset
2401 copy_to_mode_reg (Pmode, XEXP (op[argc], 0))));
kono
parents:
diff changeset
2402 break;
kono
parents:
diff changeset
2403
kono
parents:
diff changeset
2404 case ARG_BUILTIN_STOP:
kono
parents:
diff changeset
2405 gcc_unreachable ();
kono
parents:
diff changeset
2406 }
kono
parents:
diff changeset
2407
kono
parents:
diff changeset
2408 argc++;
kono
parents:
diff changeset
2409 }
kono
parents:
diff changeset
2410 }
kono
parents:
diff changeset
2411
kono
parents:
diff changeset
2412 if (have_retval)
kono
parents:
diff changeset
2413 switch (argc)
kono
parents:
diff changeset
2414 {
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
2415 case 0:
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
2416 pat = GEN_FCN (icode) (target);
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
2417 break;
111
kono
parents:
diff changeset
2418 case 1:
kono
parents:
diff changeset
2419 pat = GEN_FCN (icode) (target, op[0]);
kono
parents:
diff changeset
2420 break;
kono
parents:
diff changeset
2421
kono
parents:
diff changeset
2422 case 2:
kono
parents:
diff changeset
2423 pat = GEN_FCN (icode) (target, op[0], op[1]);
kono
parents:
diff changeset
2424 break;
kono
parents:
diff changeset
2425
kono
parents:
diff changeset
2426 case 3:
kono
parents:
diff changeset
2427 pat = GEN_FCN (icode) (target, op[0], op[1], op[2]);
kono
parents:
diff changeset
2428 break;
kono
parents:
diff changeset
2429
kono
parents:
diff changeset
2430 case 4:
kono
parents:
diff changeset
2431 pat = GEN_FCN (icode) (target, op[0], op[1], op[2], op[3]);
kono
parents:
diff changeset
2432 break;
kono
parents:
diff changeset
2433
kono
parents:
diff changeset
2434 case 5:
kono
parents:
diff changeset
2435 pat = GEN_FCN (icode) (target, op[0], op[1], op[2], op[3], op[4]);
kono
parents:
diff changeset
2436 break;
kono
parents:
diff changeset
2437
kono
parents:
diff changeset
2438 case 6:
kono
parents:
diff changeset
2439 pat = GEN_FCN (icode) (target, op[0], op[1], op[2], op[3], op[4], op[5]);
kono
parents:
diff changeset
2440 break;
kono
parents:
diff changeset
2441
kono
parents:
diff changeset
2442 default:
kono
parents:
diff changeset
2443 gcc_unreachable ();
kono
parents:
diff changeset
2444 }
kono
parents:
diff changeset
2445 else
kono
parents:
diff changeset
2446 switch (argc)
kono
parents:
diff changeset
2447 {
kono
parents:
diff changeset
2448 case 1:
kono
parents:
diff changeset
2449 pat = GEN_FCN (icode) (op[0]);
kono
parents:
diff changeset
2450 break;
kono
parents:
diff changeset
2451
kono
parents:
diff changeset
2452 case 2:
kono
parents:
diff changeset
2453 pat = GEN_FCN (icode) (op[0], op[1]);
kono
parents:
diff changeset
2454 break;
kono
parents:
diff changeset
2455
kono
parents:
diff changeset
2456 case 3:
kono
parents:
diff changeset
2457 pat = GEN_FCN (icode) (op[0], op[1], op[2]);
kono
parents:
diff changeset
2458 break;
kono
parents:
diff changeset
2459
kono
parents:
diff changeset
2460 case 4:
kono
parents:
diff changeset
2461 pat = GEN_FCN (icode) (op[0], op[1], op[2], op[3]);
kono
parents:
diff changeset
2462 break;
kono
parents:
diff changeset
2463
kono
parents:
diff changeset
2464 case 5:
kono
parents:
diff changeset
2465 pat = GEN_FCN (icode) (op[0], op[1], op[2], op[3], op[4]);
kono
parents:
diff changeset
2466 break;
kono
parents:
diff changeset
2467
kono
parents:
diff changeset
2468 case 6:
kono
parents:
diff changeset
2469 pat = GEN_FCN (icode) (op[0], op[1], op[2], op[3], op[4], op[5]);
kono
parents:
diff changeset
2470 break;
kono
parents:
diff changeset
2471
kono
parents:
diff changeset
2472 default:
kono
parents:
diff changeset
2473 gcc_unreachable ();
kono
parents:
diff changeset
2474 }
kono
parents:
diff changeset
2475
kono
parents:
diff changeset
2476 if (!pat)
kono
parents:
diff changeset
2477 return 0;
kono
parents:
diff changeset
2478
kono
parents:
diff changeset
2479 /* Check whether our current target implements the pattern chosen for this
kono
parents:
diff changeset
2480 builtin and error out if not. */
kono
parents:
diff changeset
2481 start_sequence ();
kono
parents:
diff changeset
2482 emit_insn (pat);
kono
parents:
diff changeset
2483 insn = get_insns ();
kono
parents:
diff changeset
2484 end_sequence ();
kono
parents:
diff changeset
2485
kono
parents:
diff changeset
2486 if (recog_memoized (insn) < 0)
kono
parents:
diff changeset
2487 error ("this builtin is not supported for this target");
kono
parents:
diff changeset
2488 else
kono
parents:
diff changeset
2489 emit_insn (insn);
kono
parents:
diff changeset
2490
kono
parents:
diff changeset
2491 return target;
kono
parents:
diff changeset
2492 }
kono
parents:
diff changeset
2493
kono
parents:
diff changeset
2494 /* Expand a builtin. These builtins are "special" because they don't have
kono
parents:
diff changeset
2495 symbolic constants defined per-instruction or per instruction-variant.
kono
parents:
diff changeset
2496 Instead, the required info is looked up in the ARM_BUILTIN_DATA record that
kono
parents:
diff changeset
2497 is passed into the function. */
kono
parents:
diff changeset
2498
kono
parents:
diff changeset
2499 static rtx
kono
parents:
diff changeset
2500 arm_expand_builtin_1 (int fcode, tree exp, rtx target,
kono
parents:
diff changeset
2501 arm_builtin_datum *d)
kono
parents:
diff changeset
2502 {
kono
parents:
diff changeset
2503 enum insn_code icode = d->code;
kono
parents:
diff changeset
2504 builtin_arg args[SIMD_MAX_BUILTIN_ARGS + 1];
kono
parents:
diff changeset
2505 int num_args = insn_data[d->code].n_operands;
kono
parents:
diff changeset
2506 int is_void = 0;
kono
parents:
diff changeset
2507 int k;
kono
parents:
diff changeset
2508 bool neon = false;
kono
parents:
diff changeset
2509
kono
parents:
diff changeset
2510 if (IN_RANGE (fcode, ARM_BUILTIN_VFP_BASE, ARM_BUILTIN_ACLE_BASE - 1))
kono
parents:
diff changeset
2511 neon = true;
kono
parents:
diff changeset
2512
kono
parents:
diff changeset
2513 is_void = !!(d->qualifiers[0] & qualifier_void);
kono
parents:
diff changeset
2514
kono
parents:
diff changeset
2515 num_args += is_void;
kono
parents:
diff changeset
2516
kono
parents:
diff changeset
2517 for (k = 1; k < num_args; k++)
kono
parents:
diff changeset
2518 {
kono
parents:
diff changeset
2519 /* We have four arrays of data, each indexed in a different fashion.
kono
parents:
diff changeset
2520 qualifiers - element 0 always describes the function return type.
kono
parents:
diff changeset
2521 operands - element 0 is either the operand for return value (if
kono
parents:
diff changeset
2522 the function has a non-void return type) or the operand for the
kono
parents:
diff changeset
2523 first argument.
kono
parents:
diff changeset
2524 expr_args - element 0 always holds the first argument.
kono
parents:
diff changeset
2525 args - element 0 is always used for the return type. */
kono
parents:
diff changeset
2526 int qualifiers_k = k;
kono
parents:
diff changeset
2527 int operands_k = k - is_void;
kono
parents:
diff changeset
2528 int expr_args_k = k - 1;
kono
parents:
diff changeset
2529
kono
parents:
diff changeset
2530 if (d->qualifiers[qualifiers_k] & qualifier_lane_index)
kono
parents:
diff changeset
2531 args[k] = ARG_BUILTIN_LANE_INDEX;
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
2532 else if (d->qualifiers[qualifiers_k] & qualifier_lane_pair_index)
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
2533 args[k] = ARG_BUILTIN_LANE_PAIR_INDEX;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
2534 else if (d->qualifiers[qualifiers_k] & qualifier_lane_quadtup_index)
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
2535 args[k] = ARG_BUILTIN_LANE_QUADTUP_INDEX;
111
kono
parents:
diff changeset
2536 else if (d->qualifiers[qualifiers_k] & qualifier_struct_load_store_lane_index)
kono
parents:
diff changeset
2537 args[k] = ARG_BUILTIN_STRUCT_LOAD_STORE_LANE_INDEX;
kono
parents:
diff changeset
2538 else if (d->qualifiers[qualifiers_k] & qualifier_immediate)
kono
parents:
diff changeset
2539 args[k] = ARG_BUILTIN_CONSTANT;
kono
parents:
diff changeset
2540 else if (d->qualifiers[qualifiers_k] & qualifier_maybe_immediate)
kono
parents:
diff changeset
2541 {
kono
parents:
diff changeset
2542 rtx arg
kono
parents:
diff changeset
2543 = expand_normal (CALL_EXPR_ARG (exp,
kono
parents:
diff changeset
2544 (expr_args_k)));
kono
parents:
diff changeset
2545 /* Handle constants only if the predicate allows it. */
kono
parents:
diff changeset
2546 bool op_const_int_p =
kono
parents:
diff changeset
2547 (CONST_INT_P (arg)
kono
parents:
diff changeset
2548 && (*insn_data[icode].operand[operands_k].predicate)
kono
parents:
diff changeset
2549 (arg, insn_data[icode].operand[operands_k].mode));
kono
parents:
diff changeset
2550 args[k] = op_const_int_p ? ARG_BUILTIN_CONSTANT : ARG_BUILTIN_COPY_TO_REG;
kono
parents:
diff changeset
2551 }
kono
parents:
diff changeset
2552 else if (d->qualifiers[qualifiers_k] & qualifier_pointer)
kono
parents:
diff changeset
2553 {
kono
parents:
diff changeset
2554 if (neon)
kono
parents:
diff changeset
2555 args[k] = ARG_BUILTIN_NEON_MEMORY;
kono
parents:
diff changeset
2556 else
kono
parents:
diff changeset
2557 args[k] = ARG_BUILTIN_MEMORY;
kono
parents:
diff changeset
2558 }
kono
parents:
diff changeset
2559 else
kono
parents:
diff changeset
2560 args[k] = ARG_BUILTIN_COPY_TO_REG;
kono
parents:
diff changeset
2561 }
kono
parents:
diff changeset
2562 args[k] = ARG_BUILTIN_STOP;
kono
parents:
diff changeset
2563
kono
parents:
diff changeset
2564 /* The interface to arm_expand_builtin_args expects a 0 if
kono
parents:
diff changeset
2565 the function is void, and a 1 if it is not. */
kono
parents:
diff changeset
2566 return arm_expand_builtin_args
kono
parents:
diff changeset
2567 (target, d->mode, fcode, icode, !is_void, exp,
kono
parents:
diff changeset
2568 &args[1]);
kono
parents:
diff changeset
2569 }
kono
parents:
diff changeset
2570
kono
parents:
diff changeset
2571 /* Expand an ACLE builtin, i.e. those registered only if their respective
kono
parents:
diff changeset
2572 target constraints are met. This check happens within
kono
parents:
diff changeset
2573 arm_expand_builtin_args. */
kono
parents:
diff changeset
2574
kono
parents:
diff changeset
2575 static rtx
kono
parents:
diff changeset
2576 arm_expand_acle_builtin (int fcode, tree exp, rtx target)
kono
parents:
diff changeset
2577 {
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
2578 if (fcode == ARM_BUILTIN_SAT_IMM_CHECK)
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
2579 {
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
2580 /* Check the saturation immediate bounds. */
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
2581
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
2582 rtx min_sat = expand_normal (CALL_EXPR_ARG (exp, 1));
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
2583 rtx max_sat = expand_normal (CALL_EXPR_ARG (exp, 2));
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
2584 gcc_assert (CONST_INT_P (min_sat));
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
2585 gcc_assert (CONST_INT_P (max_sat));
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
2586 rtx sat_imm = expand_normal (CALL_EXPR_ARG (exp, 0));
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
2587 if (CONST_INT_P (sat_imm))
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
2588 {
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
2589 if (!IN_RANGE (sat_imm, min_sat, max_sat))
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
2590 error ("%Ksaturation bit range must be in the range [%wd, %wd]",
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
2591 exp, UINTVAL (min_sat), UINTVAL (max_sat));
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
2592 }
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
2593 else
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
2594 error ("%Ksaturation bit range must be a constant immediate", exp);
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
2595 /* Don't generate any RTL. */
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
2596 return const0_rtx;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
2597 }
111
kono
parents:
diff changeset
2598 arm_builtin_datum *d
kono
parents:
diff changeset
2599 = &acle_builtin_data[fcode - ARM_BUILTIN_ACLE_PATTERN_START];
kono
parents:
diff changeset
2600
kono
parents:
diff changeset
2601 return arm_expand_builtin_1 (fcode, exp, target, d);
kono
parents:
diff changeset
2602 }
kono
parents:
diff changeset
2603
kono
parents:
diff changeset
2604 /* Expand a Neon builtin, i.e. those registered only if TARGET_NEON holds.
kono
parents:
diff changeset
2605 Most of these are "special" because they don't have symbolic
kono
parents:
diff changeset
2606 constants defined per-instruction or per instruction-variant. Instead, the
kono
parents:
diff changeset
2607 required info is looked up in the table neon_builtin_data. */
kono
parents:
diff changeset
2608
kono
parents:
diff changeset
2609 static rtx
kono
parents:
diff changeset
2610 arm_expand_neon_builtin (int fcode, tree exp, rtx target)
kono
parents:
diff changeset
2611 {
kono
parents:
diff changeset
2612 if (fcode >= ARM_BUILTIN_NEON_BASE && ! TARGET_NEON)
kono
parents:
diff changeset
2613 {
kono
parents:
diff changeset
2614 fatal_error (input_location,
kono
parents:
diff changeset
2615 "You must enable NEON instructions"
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
2616 " (e.g. %<-mfloat-abi=softfp%> %<-mfpu=neon%>)"
111
kono
parents:
diff changeset
2617 " to use these intrinsics.");
kono
parents:
diff changeset
2618 return const0_rtx;
kono
parents:
diff changeset
2619 }
kono
parents:
diff changeset
2620
kono
parents:
diff changeset
2621 if (fcode == ARM_BUILTIN_NEON_LANE_CHECK)
kono
parents:
diff changeset
2622 {
kono
parents:
diff changeset
2623 /* Builtin is only to check bounds of the lane passed to some intrinsics
kono
parents:
diff changeset
2624 that are implemented with gcc vector extensions in arm_neon.h. */
kono
parents:
diff changeset
2625
kono
parents:
diff changeset
2626 tree nlanes = CALL_EXPR_ARG (exp, 0);
kono
parents:
diff changeset
2627 gcc_assert (TREE_CODE (nlanes) == INTEGER_CST);
kono
parents:
diff changeset
2628 rtx lane_idx = expand_normal (CALL_EXPR_ARG (exp, 1));
kono
parents:
diff changeset
2629 if (CONST_INT_P (lane_idx))
kono
parents:
diff changeset
2630 neon_lane_bounds (lane_idx, 0, TREE_INT_CST_LOW (nlanes), exp);
kono
parents:
diff changeset
2631 else
kono
parents:
diff changeset
2632 error ("%Klane index must be a constant immediate", exp);
kono
parents:
diff changeset
2633 /* Don't generate any RTL. */
kono
parents:
diff changeset
2634 return const0_rtx;
kono
parents:
diff changeset
2635 }
kono
parents:
diff changeset
2636
kono
parents:
diff changeset
2637 arm_builtin_datum *d
kono
parents:
diff changeset
2638 = &neon_builtin_data[fcode - ARM_BUILTIN_NEON_PATTERN_START];
kono
parents:
diff changeset
2639
kono
parents:
diff changeset
2640 return arm_expand_builtin_1 (fcode, exp, target, d);
kono
parents:
diff changeset
2641 }
kono
parents:
diff changeset
2642
kono
parents:
diff changeset
2643 /* Expand a VFP builtin. These builtins are treated like
kono
parents:
diff changeset
2644 neon builtins except that the data is looked up in table
kono
parents:
diff changeset
2645 VFP_BUILTIN_DATA. */
kono
parents:
diff changeset
2646
kono
parents:
diff changeset
2647 static rtx
kono
parents:
diff changeset
2648 arm_expand_vfp_builtin (int fcode, tree exp, rtx target)
kono
parents:
diff changeset
2649 {
kono
parents:
diff changeset
2650 if (fcode >= ARM_BUILTIN_VFP_BASE && ! TARGET_HARD_FLOAT)
kono
parents:
diff changeset
2651 {
kono
parents:
diff changeset
2652 fatal_error (input_location,
kono
parents:
diff changeset
2653 "You must enable VFP instructions"
kono
parents:
diff changeset
2654 " to use these intrinsics.");
kono
parents:
diff changeset
2655 return const0_rtx;
kono
parents:
diff changeset
2656 }
kono
parents:
diff changeset
2657
kono
parents:
diff changeset
2658 arm_builtin_datum *d
kono
parents:
diff changeset
2659 = &vfp_builtin_data[fcode - ARM_BUILTIN_VFP_PATTERN_START];
kono
parents:
diff changeset
2660
kono
parents:
diff changeset
2661 return arm_expand_builtin_1 (fcode, exp, target, d);
kono
parents:
diff changeset
2662 }
kono
parents:
diff changeset
2663
kono
parents:
diff changeset
2664 /* Expand an expression EXP that calls a built-in function,
kono
parents:
diff changeset
2665 with result going to TARGET if that's convenient
kono
parents:
diff changeset
2666 (and in mode MODE if that's convenient).
kono
parents:
diff changeset
2667 SUBTARGET may be used as the target for computing one of EXP's operands.
kono
parents:
diff changeset
2668 IGNORE is nonzero if the value is to be ignored. */
kono
parents:
diff changeset
2669
kono
parents:
diff changeset
2670 rtx
kono
parents:
diff changeset
2671 arm_expand_builtin (tree exp,
kono
parents:
diff changeset
2672 rtx target,
kono
parents:
diff changeset
2673 rtx subtarget ATTRIBUTE_UNUSED,
kono
parents:
diff changeset
2674 machine_mode mode ATTRIBUTE_UNUSED,
kono
parents:
diff changeset
2675 int ignore ATTRIBUTE_UNUSED)
kono
parents:
diff changeset
2676 {
kono
parents:
diff changeset
2677 const struct builtin_description * d;
kono
parents:
diff changeset
2678 enum insn_code icode;
kono
parents:
diff changeset
2679 tree fndecl = TREE_OPERAND (CALL_EXPR_FN (exp), 0);
kono
parents:
diff changeset
2680 tree arg0;
kono
parents:
diff changeset
2681 tree arg1;
kono
parents:
diff changeset
2682 tree arg2;
kono
parents:
diff changeset
2683 rtx op0;
kono
parents:
diff changeset
2684 rtx op1;
kono
parents:
diff changeset
2685 rtx op2;
kono
parents:
diff changeset
2686 rtx pat;
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
2687 unsigned int fcode = DECL_MD_FUNCTION_CODE (fndecl);
111
kono
parents:
diff changeset
2688 size_t i;
kono
parents:
diff changeset
2689 machine_mode tmode;
kono
parents:
diff changeset
2690 machine_mode mode0;
kono
parents:
diff changeset
2691 machine_mode mode1;
kono
parents:
diff changeset
2692 machine_mode mode2;
kono
parents:
diff changeset
2693 int opint;
kono
parents:
diff changeset
2694 int selector;
kono
parents:
diff changeset
2695 int mask;
kono
parents:
diff changeset
2696 int imm;
kono
parents:
diff changeset
2697
kono
parents:
diff changeset
2698 if (fcode >= ARM_BUILTIN_ACLE_BASE)
kono
parents:
diff changeset
2699 return arm_expand_acle_builtin (fcode, exp, target);
kono
parents:
diff changeset
2700
kono
parents:
diff changeset
2701 if (fcode >= ARM_BUILTIN_NEON_BASE)
kono
parents:
diff changeset
2702 return arm_expand_neon_builtin (fcode, exp, target);
kono
parents:
diff changeset
2703
kono
parents:
diff changeset
2704 if (fcode >= ARM_BUILTIN_VFP_BASE)
kono
parents:
diff changeset
2705 return arm_expand_vfp_builtin (fcode, exp, target);
kono
parents:
diff changeset
2706
kono
parents:
diff changeset
2707 /* Check in the context of the function making the call whether the
kono
parents:
diff changeset
2708 builtin is supported. */
kono
parents:
diff changeset
2709 if (fcode >= ARM_BUILTIN_CRYPTO_BASE
kono
parents:
diff changeset
2710 && (!TARGET_CRYPTO || !TARGET_HARD_FLOAT))
kono
parents:
diff changeset
2711 {
kono
parents:
diff changeset
2712 fatal_error (input_location,
kono
parents:
diff changeset
2713 "You must enable crypto instructions"
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
2714 " (e.g. include %<-mfloat-abi=softfp%> "
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
2715 "%<-mfpu=crypto-neon%>)"
111
kono
parents:
diff changeset
2716 " to use these intrinsics.");
kono
parents:
diff changeset
2717 return const0_rtx;
kono
parents:
diff changeset
2718 }
kono
parents:
diff changeset
2719
kono
parents:
diff changeset
2720 switch (fcode)
kono
parents:
diff changeset
2721 {
kono
parents:
diff changeset
2722 case ARM_BUILTIN_GET_FPSCR:
kono
parents:
diff changeset
2723 case ARM_BUILTIN_SET_FPSCR:
kono
parents:
diff changeset
2724 if (fcode == ARM_BUILTIN_GET_FPSCR)
kono
parents:
diff changeset
2725 {
kono
parents:
diff changeset
2726 icode = CODE_FOR_get_fpscr;
kono
parents:
diff changeset
2727 target = gen_reg_rtx (SImode);
kono
parents:
diff changeset
2728 pat = GEN_FCN (icode) (target);
kono
parents:
diff changeset
2729 }
kono
parents:
diff changeset
2730 else
kono
parents:
diff changeset
2731 {
kono
parents:
diff changeset
2732 target = NULL_RTX;
kono
parents:
diff changeset
2733 icode = CODE_FOR_set_fpscr;
kono
parents:
diff changeset
2734 arg0 = CALL_EXPR_ARG (exp, 0);
kono
parents:
diff changeset
2735 op0 = expand_normal (arg0);
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
2736 pat = GEN_FCN (icode) (force_reg (SImode, op0));
111
kono
parents:
diff changeset
2737 }
kono
parents:
diff changeset
2738 emit_insn (pat);
kono
parents:
diff changeset
2739 return target;
kono
parents:
diff changeset
2740
kono
parents:
diff changeset
2741 case ARM_BUILTIN_CMSE_NONSECURE_CALLER:
kono
parents:
diff changeset
2742 target = gen_reg_rtx (SImode);
kono
parents:
diff changeset
2743 op0 = arm_return_addr (0, NULL_RTX);
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
2744 emit_insn (gen_andsi3 (target, op0, const1_rtx));
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
2745 op1 = gen_rtx_EQ (SImode, target, const0_rtx);
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
2746 emit_insn (gen_cstoresi4 (target, op1, target, const0_rtx));
111
kono
parents:
diff changeset
2747 return target;
kono
parents:
diff changeset
2748
kono
parents:
diff changeset
2749 case ARM_BUILTIN_TEXTRMSB:
kono
parents:
diff changeset
2750 case ARM_BUILTIN_TEXTRMUB:
kono
parents:
diff changeset
2751 case ARM_BUILTIN_TEXTRMSH:
kono
parents:
diff changeset
2752 case ARM_BUILTIN_TEXTRMUH:
kono
parents:
diff changeset
2753 case ARM_BUILTIN_TEXTRMSW:
kono
parents:
diff changeset
2754 case ARM_BUILTIN_TEXTRMUW:
kono
parents:
diff changeset
2755 icode = (fcode == ARM_BUILTIN_TEXTRMSB ? CODE_FOR_iwmmxt_textrmsb
kono
parents:
diff changeset
2756 : fcode == ARM_BUILTIN_TEXTRMUB ? CODE_FOR_iwmmxt_textrmub
kono
parents:
diff changeset
2757 : fcode == ARM_BUILTIN_TEXTRMSH ? CODE_FOR_iwmmxt_textrmsh
kono
parents:
diff changeset
2758 : fcode == ARM_BUILTIN_TEXTRMUH ? CODE_FOR_iwmmxt_textrmuh
kono
parents:
diff changeset
2759 : CODE_FOR_iwmmxt_textrmw);
kono
parents:
diff changeset
2760
kono
parents:
diff changeset
2761 arg0 = CALL_EXPR_ARG (exp, 0);
kono
parents:
diff changeset
2762 arg1 = CALL_EXPR_ARG (exp, 1);
kono
parents:
diff changeset
2763 op0 = expand_normal (arg0);
kono
parents:
diff changeset
2764 op1 = expand_normal (arg1);
kono
parents:
diff changeset
2765 tmode = insn_data[icode].operand[0].mode;
kono
parents:
diff changeset
2766 mode0 = insn_data[icode].operand[1].mode;
kono
parents:
diff changeset
2767 mode1 = insn_data[icode].operand[2].mode;
kono
parents:
diff changeset
2768
kono
parents:
diff changeset
2769 if (! (*insn_data[icode].operand[1].predicate) (op0, mode0))
kono
parents:
diff changeset
2770 op0 = copy_to_mode_reg (mode0, op0);
kono
parents:
diff changeset
2771 if (! (*insn_data[icode].operand[2].predicate) (op1, mode1))
kono
parents:
diff changeset
2772 {
kono
parents:
diff changeset
2773 /* @@@ better error message */
kono
parents:
diff changeset
2774 error ("selector must be an immediate");
kono
parents:
diff changeset
2775 return gen_reg_rtx (tmode);
kono
parents:
diff changeset
2776 }
kono
parents:
diff changeset
2777
kono
parents:
diff changeset
2778 opint = INTVAL (op1);
kono
parents:
diff changeset
2779 if (fcode == ARM_BUILTIN_TEXTRMSB || fcode == ARM_BUILTIN_TEXTRMUB)
kono
parents:
diff changeset
2780 {
kono
parents:
diff changeset
2781 if (opint > 7 || opint < 0)
kono
parents:
diff changeset
2782 error ("the range of selector should be in 0 to 7");
kono
parents:
diff changeset
2783 }
kono
parents:
diff changeset
2784 else if (fcode == ARM_BUILTIN_TEXTRMSH || fcode == ARM_BUILTIN_TEXTRMUH)
kono
parents:
diff changeset
2785 {
kono
parents:
diff changeset
2786 if (opint > 3 || opint < 0)
kono
parents:
diff changeset
2787 error ("the range of selector should be in 0 to 3");
kono
parents:
diff changeset
2788 }
kono
parents:
diff changeset
2789 else /* ARM_BUILTIN_TEXTRMSW || ARM_BUILTIN_TEXTRMUW. */
kono
parents:
diff changeset
2790 {
kono
parents:
diff changeset
2791 if (opint > 1 || opint < 0)
kono
parents:
diff changeset
2792 error ("the range of selector should be in 0 to 1");
kono
parents:
diff changeset
2793 }
kono
parents:
diff changeset
2794
kono
parents:
diff changeset
2795 if (target == 0
kono
parents:
diff changeset
2796 || GET_MODE (target) != tmode
kono
parents:
diff changeset
2797 || ! (*insn_data[icode].operand[0].predicate) (target, tmode))
kono
parents:
diff changeset
2798 target = gen_reg_rtx (tmode);
kono
parents:
diff changeset
2799 pat = GEN_FCN (icode) (target, op0, op1);
kono
parents:
diff changeset
2800 if (! pat)
kono
parents:
diff changeset
2801 return 0;
kono
parents:
diff changeset
2802 emit_insn (pat);
kono
parents:
diff changeset
2803 return target;
kono
parents:
diff changeset
2804
kono
parents:
diff changeset
2805 case ARM_BUILTIN_WALIGNI:
kono
parents:
diff changeset
2806 /* If op2 is immediate, call walighi, else call walighr. */
kono
parents:
diff changeset
2807 arg0 = CALL_EXPR_ARG (exp, 0);
kono
parents:
diff changeset
2808 arg1 = CALL_EXPR_ARG (exp, 1);
kono
parents:
diff changeset
2809 arg2 = CALL_EXPR_ARG (exp, 2);
kono
parents:
diff changeset
2810 op0 = expand_normal (arg0);
kono
parents:
diff changeset
2811 op1 = expand_normal (arg1);
kono
parents:
diff changeset
2812 op2 = expand_normal (arg2);
kono
parents:
diff changeset
2813 if (CONST_INT_P (op2))
kono
parents:
diff changeset
2814 {
kono
parents:
diff changeset
2815 icode = CODE_FOR_iwmmxt_waligni;
kono
parents:
diff changeset
2816 tmode = insn_data[icode].operand[0].mode;
kono
parents:
diff changeset
2817 mode0 = insn_data[icode].operand[1].mode;
kono
parents:
diff changeset
2818 mode1 = insn_data[icode].operand[2].mode;
kono
parents:
diff changeset
2819 mode2 = insn_data[icode].operand[3].mode;
kono
parents:
diff changeset
2820 if (!(*insn_data[icode].operand[1].predicate) (op0, mode0))
kono
parents:
diff changeset
2821 op0 = copy_to_mode_reg (mode0, op0);
kono
parents:
diff changeset
2822 if (!(*insn_data[icode].operand[2].predicate) (op1, mode1))
kono
parents:
diff changeset
2823 op1 = copy_to_mode_reg (mode1, op1);
kono
parents:
diff changeset
2824 gcc_assert ((*insn_data[icode].operand[3].predicate) (op2, mode2));
kono
parents:
diff changeset
2825 selector = INTVAL (op2);
kono
parents:
diff changeset
2826 if (selector > 7 || selector < 0)
kono
parents:
diff changeset
2827 error ("the range of selector should be in 0 to 7");
kono
parents:
diff changeset
2828 }
kono
parents:
diff changeset
2829 else
kono
parents:
diff changeset
2830 {
kono
parents:
diff changeset
2831 icode = CODE_FOR_iwmmxt_walignr;
kono
parents:
diff changeset
2832 tmode = insn_data[icode].operand[0].mode;
kono
parents:
diff changeset
2833 mode0 = insn_data[icode].operand[1].mode;
kono
parents:
diff changeset
2834 mode1 = insn_data[icode].operand[2].mode;
kono
parents:
diff changeset
2835 mode2 = insn_data[icode].operand[3].mode;
kono
parents:
diff changeset
2836 if (!(*insn_data[icode].operand[1].predicate) (op0, mode0))
kono
parents:
diff changeset
2837 op0 = copy_to_mode_reg (mode0, op0);
kono
parents:
diff changeset
2838 if (!(*insn_data[icode].operand[2].predicate) (op1, mode1))
kono
parents:
diff changeset
2839 op1 = copy_to_mode_reg (mode1, op1);
kono
parents:
diff changeset
2840 if (!(*insn_data[icode].operand[3].predicate) (op2, mode2))
kono
parents:
diff changeset
2841 op2 = copy_to_mode_reg (mode2, op2);
kono
parents:
diff changeset
2842 }
kono
parents:
diff changeset
2843 if (target == 0
kono
parents:
diff changeset
2844 || GET_MODE (target) != tmode
kono
parents:
diff changeset
2845 || !(*insn_data[icode].operand[0].predicate) (target, tmode))
kono
parents:
diff changeset
2846 target = gen_reg_rtx (tmode);
kono
parents:
diff changeset
2847 pat = GEN_FCN (icode) (target, op0, op1, op2);
kono
parents:
diff changeset
2848 if (!pat)
kono
parents:
diff changeset
2849 return 0;
kono
parents:
diff changeset
2850 emit_insn (pat);
kono
parents:
diff changeset
2851 return target;
kono
parents:
diff changeset
2852
kono
parents:
diff changeset
2853 case ARM_BUILTIN_TINSRB:
kono
parents:
diff changeset
2854 case ARM_BUILTIN_TINSRH:
kono
parents:
diff changeset
2855 case ARM_BUILTIN_TINSRW:
kono
parents:
diff changeset
2856 case ARM_BUILTIN_WMERGE:
kono
parents:
diff changeset
2857 icode = (fcode == ARM_BUILTIN_TINSRB ? CODE_FOR_iwmmxt_tinsrb
kono
parents:
diff changeset
2858 : fcode == ARM_BUILTIN_TINSRH ? CODE_FOR_iwmmxt_tinsrh
kono
parents:
diff changeset
2859 : fcode == ARM_BUILTIN_WMERGE ? CODE_FOR_iwmmxt_wmerge
kono
parents:
diff changeset
2860 : CODE_FOR_iwmmxt_tinsrw);
kono
parents:
diff changeset
2861 arg0 = CALL_EXPR_ARG (exp, 0);
kono
parents:
diff changeset
2862 arg1 = CALL_EXPR_ARG (exp, 1);
kono
parents:
diff changeset
2863 arg2 = CALL_EXPR_ARG (exp, 2);
kono
parents:
diff changeset
2864 op0 = expand_normal (arg0);
kono
parents:
diff changeset
2865 op1 = expand_normal (arg1);
kono
parents:
diff changeset
2866 op2 = expand_normal (arg2);
kono
parents:
diff changeset
2867 tmode = insn_data[icode].operand[0].mode;
kono
parents:
diff changeset
2868 mode0 = insn_data[icode].operand[1].mode;
kono
parents:
diff changeset
2869 mode1 = insn_data[icode].operand[2].mode;
kono
parents:
diff changeset
2870 mode2 = insn_data[icode].operand[3].mode;
kono
parents:
diff changeset
2871
kono
parents:
diff changeset
2872 if (! (*insn_data[icode].operand[1].predicate) (op0, mode0))
kono
parents:
diff changeset
2873 op0 = copy_to_mode_reg (mode0, op0);
kono
parents:
diff changeset
2874 if (! (*insn_data[icode].operand[2].predicate) (op1, mode1))
kono
parents:
diff changeset
2875 op1 = copy_to_mode_reg (mode1, op1);
kono
parents:
diff changeset
2876 if (! (*insn_data[icode].operand[3].predicate) (op2, mode2))
kono
parents:
diff changeset
2877 {
kono
parents:
diff changeset
2878 error ("selector must be an immediate");
kono
parents:
diff changeset
2879 return const0_rtx;
kono
parents:
diff changeset
2880 }
kono
parents:
diff changeset
2881 if (icode == CODE_FOR_iwmmxt_wmerge)
kono
parents:
diff changeset
2882 {
kono
parents:
diff changeset
2883 selector = INTVAL (op2);
kono
parents:
diff changeset
2884 if (selector > 7 || selector < 0)
kono
parents:
diff changeset
2885 error ("the range of selector should be in 0 to 7");
kono
parents:
diff changeset
2886 }
kono
parents:
diff changeset
2887 if ((icode == CODE_FOR_iwmmxt_tinsrb)
kono
parents:
diff changeset
2888 || (icode == CODE_FOR_iwmmxt_tinsrh)
kono
parents:
diff changeset
2889 || (icode == CODE_FOR_iwmmxt_tinsrw))
kono
parents:
diff changeset
2890 {
kono
parents:
diff changeset
2891 mask = 0x01;
kono
parents:
diff changeset
2892 selector= INTVAL (op2);
kono
parents:
diff changeset
2893 if (icode == CODE_FOR_iwmmxt_tinsrb && (selector < 0 || selector > 7))
kono
parents:
diff changeset
2894 error ("the range of selector should be in 0 to 7");
kono
parents:
diff changeset
2895 else if (icode == CODE_FOR_iwmmxt_tinsrh && (selector < 0 ||selector > 3))
kono
parents:
diff changeset
2896 error ("the range of selector should be in 0 to 3");
kono
parents:
diff changeset
2897 else if (icode == CODE_FOR_iwmmxt_tinsrw && (selector < 0 ||selector > 1))
kono
parents:
diff changeset
2898 error ("the range of selector should be in 0 to 1");
kono
parents:
diff changeset
2899 mask <<= selector;
kono
parents:
diff changeset
2900 op2 = GEN_INT (mask);
kono
parents:
diff changeset
2901 }
kono
parents:
diff changeset
2902 if (target == 0
kono
parents:
diff changeset
2903 || GET_MODE (target) != tmode
kono
parents:
diff changeset
2904 || ! (*insn_data[icode].operand[0].predicate) (target, tmode))
kono
parents:
diff changeset
2905 target = gen_reg_rtx (tmode);
kono
parents:
diff changeset
2906 pat = GEN_FCN (icode) (target, op0, op1, op2);
kono
parents:
diff changeset
2907 if (! pat)
kono
parents:
diff changeset
2908 return 0;
kono
parents:
diff changeset
2909 emit_insn (pat);
kono
parents:
diff changeset
2910 return target;
kono
parents:
diff changeset
2911
kono
parents:
diff changeset
2912 case ARM_BUILTIN_SETWCGR0:
kono
parents:
diff changeset
2913 case ARM_BUILTIN_SETWCGR1:
kono
parents:
diff changeset
2914 case ARM_BUILTIN_SETWCGR2:
kono
parents:
diff changeset
2915 case ARM_BUILTIN_SETWCGR3:
kono
parents:
diff changeset
2916 icode = (fcode == ARM_BUILTIN_SETWCGR0 ? CODE_FOR_iwmmxt_setwcgr0
kono
parents:
diff changeset
2917 : fcode == ARM_BUILTIN_SETWCGR1 ? CODE_FOR_iwmmxt_setwcgr1
kono
parents:
diff changeset
2918 : fcode == ARM_BUILTIN_SETWCGR2 ? CODE_FOR_iwmmxt_setwcgr2
kono
parents:
diff changeset
2919 : CODE_FOR_iwmmxt_setwcgr3);
kono
parents:
diff changeset
2920 arg0 = CALL_EXPR_ARG (exp, 0);
kono
parents:
diff changeset
2921 op0 = expand_normal (arg0);
kono
parents:
diff changeset
2922 mode0 = insn_data[icode].operand[0].mode;
kono
parents:
diff changeset
2923 if (!(*insn_data[icode].operand[0].predicate) (op0, mode0))
kono
parents:
diff changeset
2924 op0 = copy_to_mode_reg (mode0, op0);
kono
parents:
diff changeset
2925 pat = GEN_FCN (icode) (op0);
kono
parents:
diff changeset
2926 if (!pat)
kono
parents:
diff changeset
2927 return 0;
kono
parents:
diff changeset
2928 emit_insn (pat);
kono
parents:
diff changeset
2929 return 0;
kono
parents:
diff changeset
2930
kono
parents:
diff changeset
2931 case ARM_BUILTIN_GETWCGR0:
kono
parents:
diff changeset
2932 case ARM_BUILTIN_GETWCGR1:
kono
parents:
diff changeset
2933 case ARM_BUILTIN_GETWCGR2:
kono
parents:
diff changeset
2934 case ARM_BUILTIN_GETWCGR3:
kono
parents:
diff changeset
2935 icode = (fcode == ARM_BUILTIN_GETWCGR0 ? CODE_FOR_iwmmxt_getwcgr0
kono
parents:
diff changeset
2936 : fcode == ARM_BUILTIN_GETWCGR1 ? CODE_FOR_iwmmxt_getwcgr1
kono
parents:
diff changeset
2937 : fcode == ARM_BUILTIN_GETWCGR2 ? CODE_FOR_iwmmxt_getwcgr2
kono
parents:
diff changeset
2938 : CODE_FOR_iwmmxt_getwcgr3);
kono
parents:
diff changeset
2939 tmode = insn_data[icode].operand[0].mode;
kono
parents:
diff changeset
2940 if (target == 0
kono
parents:
diff changeset
2941 || GET_MODE (target) != tmode
kono
parents:
diff changeset
2942 || !(*insn_data[icode].operand[0].predicate) (target, tmode))
kono
parents:
diff changeset
2943 target = gen_reg_rtx (tmode);
kono
parents:
diff changeset
2944 pat = GEN_FCN (icode) (target);
kono
parents:
diff changeset
2945 if (!pat)
kono
parents:
diff changeset
2946 return 0;
kono
parents:
diff changeset
2947 emit_insn (pat);
kono
parents:
diff changeset
2948 return target;
kono
parents:
diff changeset
2949
kono
parents:
diff changeset
2950 case ARM_BUILTIN_WSHUFH:
kono
parents:
diff changeset
2951 icode = CODE_FOR_iwmmxt_wshufh;
kono
parents:
diff changeset
2952 arg0 = CALL_EXPR_ARG (exp, 0);
kono
parents:
diff changeset
2953 arg1 = CALL_EXPR_ARG (exp, 1);
kono
parents:
diff changeset
2954 op0 = expand_normal (arg0);
kono
parents:
diff changeset
2955 op1 = expand_normal (arg1);
kono
parents:
diff changeset
2956 tmode = insn_data[icode].operand[0].mode;
kono
parents:
diff changeset
2957 mode1 = insn_data[icode].operand[1].mode;
kono
parents:
diff changeset
2958 mode2 = insn_data[icode].operand[2].mode;
kono
parents:
diff changeset
2959
kono
parents:
diff changeset
2960 if (! (*insn_data[icode].operand[1].predicate) (op0, mode1))
kono
parents:
diff changeset
2961 op0 = copy_to_mode_reg (mode1, op0);
kono
parents:
diff changeset
2962 if (! (*insn_data[icode].operand[2].predicate) (op1, mode2))
kono
parents:
diff changeset
2963 {
kono
parents:
diff changeset
2964 error ("mask must be an immediate");
kono
parents:
diff changeset
2965 return const0_rtx;
kono
parents:
diff changeset
2966 }
kono
parents:
diff changeset
2967 selector = INTVAL (op1);
kono
parents:
diff changeset
2968 if (selector < 0 || selector > 255)
kono
parents:
diff changeset
2969 error ("the range of mask should be in 0 to 255");
kono
parents:
diff changeset
2970 if (target == 0
kono
parents:
diff changeset
2971 || GET_MODE (target) != tmode
kono
parents:
diff changeset
2972 || ! (*insn_data[icode].operand[0].predicate) (target, tmode))
kono
parents:
diff changeset
2973 target = gen_reg_rtx (tmode);
kono
parents:
diff changeset
2974 pat = GEN_FCN (icode) (target, op0, op1);
kono
parents:
diff changeset
2975 if (! pat)
kono
parents:
diff changeset
2976 return 0;
kono
parents:
diff changeset
2977 emit_insn (pat);
kono
parents:
diff changeset
2978 return target;
kono
parents:
diff changeset
2979
kono
parents:
diff changeset
2980 case ARM_BUILTIN_WMADDS:
kono
parents:
diff changeset
2981 return arm_expand_binop_builtin (CODE_FOR_iwmmxt_wmadds, exp, target);
kono
parents:
diff changeset
2982 case ARM_BUILTIN_WMADDSX:
kono
parents:
diff changeset
2983 return arm_expand_binop_builtin (CODE_FOR_iwmmxt_wmaddsx, exp, target);
kono
parents:
diff changeset
2984 case ARM_BUILTIN_WMADDSN:
kono
parents:
diff changeset
2985 return arm_expand_binop_builtin (CODE_FOR_iwmmxt_wmaddsn, exp, target);
kono
parents:
diff changeset
2986 case ARM_BUILTIN_WMADDU:
kono
parents:
diff changeset
2987 return arm_expand_binop_builtin (CODE_FOR_iwmmxt_wmaddu, exp, target);
kono
parents:
diff changeset
2988 case ARM_BUILTIN_WMADDUX:
kono
parents:
diff changeset
2989 return arm_expand_binop_builtin (CODE_FOR_iwmmxt_wmaddux, exp, target);
kono
parents:
diff changeset
2990 case ARM_BUILTIN_WMADDUN:
kono
parents:
diff changeset
2991 return arm_expand_binop_builtin (CODE_FOR_iwmmxt_wmaddun, exp, target);
kono
parents:
diff changeset
2992 case ARM_BUILTIN_WSADBZ:
kono
parents:
diff changeset
2993 return arm_expand_binop_builtin (CODE_FOR_iwmmxt_wsadbz, exp, target);
kono
parents:
diff changeset
2994 case ARM_BUILTIN_WSADHZ:
kono
parents:
diff changeset
2995 return arm_expand_binop_builtin (CODE_FOR_iwmmxt_wsadhz, exp, target);
kono
parents:
diff changeset
2996
kono
parents:
diff changeset
2997 /* Several three-argument builtins. */
kono
parents:
diff changeset
2998 case ARM_BUILTIN_WMACS:
kono
parents:
diff changeset
2999 case ARM_BUILTIN_WMACU:
kono
parents:
diff changeset
3000 case ARM_BUILTIN_TMIA:
kono
parents:
diff changeset
3001 case ARM_BUILTIN_TMIAPH:
kono
parents:
diff changeset
3002 case ARM_BUILTIN_TMIATT:
kono
parents:
diff changeset
3003 case ARM_BUILTIN_TMIATB:
kono
parents:
diff changeset
3004 case ARM_BUILTIN_TMIABT:
kono
parents:
diff changeset
3005 case ARM_BUILTIN_TMIABB:
kono
parents:
diff changeset
3006 case ARM_BUILTIN_WQMIABB:
kono
parents:
diff changeset
3007 case ARM_BUILTIN_WQMIABT:
kono
parents:
diff changeset
3008 case ARM_BUILTIN_WQMIATB:
kono
parents:
diff changeset
3009 case ARM_BUILTIN_WQMIATT:
kono
parents:
diff changeset
3010 case ARM_BUILTIN_WQMIABBN:
kono
parents:
diff changeset
3011 case ARM_BUILTIN_WQMIABTN:
kono
parents:
diff changeset
3012 case ARM_BUILTIN_WQMIATBN:
kono
parents:
diff changeset
3013 case ARM_BUILTIN_WQMIATTN:
kono
parents:
diff changeset
3014 case ARM_BUILTIN_WMIABB:
kono
parents:
diff changeset
3015 case ARM_BUILTIN_WMIABT:
kono
parents:
diff changeset
3016 case ARM_BUILTIN_WMIATB:
kono
parents:
diff changeset
3017 case ARM_BUILTIN_WMIATT:
kono
parents:
diff changeset
3018 case ARM_BUILTIN_WMIABBN:
kono
parents:
diff changeset
3019 case ARM_BUILTIN_WMIABTN:
kono
parents:
diff changeset
3020 case ARM_BUILTIN_WMIATBN:
kono
parents:
diff changeset
3021 case ARM_BUILTIN_WMIATTN:
kono
parents:
diff changeset
3022 case ARM_BUILTIN_WMIAWBB:
kono
parents:
diff changeset
3023 case ARM_BUILTIN_WMIAWBT:
kono
parents:
diff changeset
3024 case ARM_BUILTIN_WMIAWTB:
kono
parents:
diff changeset
3025 case ARM_BUILTIN_WMIAWTT:
kono
parents:
diff changeset
3026 case ARM_BUILTIN_WMIAWBBN:
kono
parents:
diff changeset
3027 case ARM_BUILTIN_WMIAWBTN:
kono
parents:
diff changeset
3028 case ARM_BUILTIN_WMIAWTBN:
kono
parents:
diff changeset
3029 case ARM_BUILTIN_WMIAWTTN:
kono
parents:
diff changeset
3030 case ARM_BUILTIN_WSADB:
kono
parents:
diff changeset
3031 case ARM_BUILTIN_WSADH:
kono
parents:
diff changeset
3032 icode = (fcode == ARM_BUILTIN_WMACS ? CODE_FOR_iwmmxt_wmacs
kono
parents:
diff changeset
3033 : fcode == ARM_BUILTIN_WMACU ? CODE_FOR_iwmmxt_wmacu
kono
parents:
diff changeset
3034 : fcode == ARM_BUILTIN_TMIA ? CODE_FOR_iwmmxt_tmia
kono
parents:
diff changeset
3035 : fcode == ARM_BUILTIN_TMIAPH ? CODE_FOR_iwmmxt_tmiaph
kono
parents:
diff changeset
3036 : fcode == ARM_BUILTIN_TMIABB ? CODE_FOR_iwmmxt_tmiabb
kono
parents:
diff changeset
3037 : fcode == ARM_BUILTIN_TMIABT ? CODE_FOR_iwmmxt_tmiabt
kono
parents:
diff changeset
3038 : fcode == ARM_BUILTIN_TMIATB ? CODE_FOR_iwmmxt_tmiatb
kono
parents:
diff changeset
3039 : fcode == ARM_BUILTIN_TMIATT ? CODE_FOR_iwmmxt_tmiatt
kono
parents:
diff changeset
3040 : fcode == ARM_BUILTIN_WQMIABB ? CODE_FOR_iwmmxt_wqmiabb
kono
parents:
diff changeset
3041 : fcode == ARM_BUILTIN_WQMIABT ? CODE_FOR_iwmmxt_wqmiabt
kono
parents:
diff changeset
3042 : fcode == ARM_BUILTIN_WQMIATB ? CODE_FOR_iwmmxt_wqmiatb
kono
parents:
diff changeset
3043 : fcode == ARM_BUILTIN_WQMIATT ? CODE_FOR_iwmmxt_wqmiatt
kono
parents:
diff changeset
3044 : fcode == ARM_BUILTIN_WQMIABBN ? CODE_FOR_iwmmxt_wqmiabbn
kono
parents:
diff changeset
3045 : fcode == ARM_BUILTIN_WQMIABTN ? CODE_FOR_iwmmxt_wqmiabtn
kono
parents:
diff changeset
3046 : fcode == ARM_BUILTIN_WQMIATBN ? CODE_FOR_iwmmxt_wqmiatbn
kono
parents:
diff changeset
3047 : fcode == ARM_BUILTIN_WQMIATTN ? CODE_FOR_iwmmxt_wqmiattn
kono
parents:
diff changeset
3048 : fcode == ARM_BUILTIN_WMIABB ? CODE_FOR_iwmmxt_wmiabb
kono
parents:
diff changeset
3049 : fcode == ARM_BUILTIN_WMIABT ? CODE_FOR_iwmmxt_wmiabt
kono
parents:
diff changeset
3050 : fcode == ARM_BUILTIN_WMIATB ? CODE_FOR_iwmmxt_wmiatb
kono
parents:
diff changeset
3051 : fcode == ARM_BUILTIN_WMIATT ? CODE_FOR_iwmmxt_wmiatt
kono
parents:
diff changeset
3052 : fcode == ARM_BUILTIN_WMIABBN ? CODE_FOR_iwmmxt_wmiabbn
kono
parents:
diff changeset
3053 : fcode == ARM_BUILTIN_WMIABTN ? CODE_FOR_iwmmxt_wmiabtn
kono
parents:
diff changeset
3054 : fcode == ARM_BUILTIN_WMIATBN ? CODE_FOR_iwmmxt_wmiatbn
kono
parents:
diff changeset
3055 : fcode == ARM_BUILTIN_WMIATTN ? CODE_FOR_iwmmxt_wmiattn
kono
parents:
diff changeset
3056 : fcode == ARM_BUILTIN_WMIAWBB ? CODE_FOR_iwmmxt_wmiawbb
kono
parents:
diff changeset
3057 : fcode == ARM_BUILTIN_WMIAWBT ? CODE_FOR_iwmmxt_wmiawbt
kono
parents:
diff changeset
3058 : fcode == ARM_BUILTIN_WMIAWTB ? CODE_FOR_iwmmxt_wmiawtb
kono
parents:
diff changeset
3059 : fcode == ARM_BUILTIN_WMIAWTT ? CODE_FOR_iwmmxt_wmiawtt
kono
parents:
diff changeset
3060 : fcode == ARM_BUILTIN_WMIAWBBN ? CODE_FOR_iwmmxt_wmiawbbn
kono
parents:
diff changeset
3061 : fcode == ARM_BUILTIN_WMIAWBTN ? CODE_FOR_iwmmxt_wmiawbtn
kono
parents:
diff changeset
3062 : fcode == ARM_BUILTIN_WMIAWTBN ? CODE_FOR_iwmmxt_wmiawtbn
kono
parents:
diff changeset
3063 : fcode == ARM_BUILTIN_WMIAWTTN ? CODE_FOR_iwmmxt_wmiawttn
kono
parents:
diff changeset
3064 : fcode == ARM_BUILTIN_WSADB ? CODE_FOR_iwmmxt_wsadb
kono
parents:
diff changeset
3065 : CODE_FOR_iwmmxt_wsadh);
kono
parents:
diff changeset
3066 arg0 = CALL_EXPR_ARG (exp, 0);
kono
parents:
diff changeset
3067 arg1 = CALL_EXPR_ARG (exp, 1);
kono
parents:
diff changeset
3068 arg2 = CALL_EXPR_ARG (exp, 2);
kono
parents:
diff changeset
3069 op0 = expand_normal (arg0);
kono
parents:
diff changeset
3070 op1 = expand_normal (arg1);
kono
parents:
diff changeset
3071 op2 = expand_normal (arg2);
kono
parents:
diff changeset
3072 tmode = insn_data[icode].operand[0].mode;
kono
parents:
diff changeset
3073 mode0 = insn_data[icode].operand[1].mode;
kono
parents:
diff changeset
3074 mode1 = insn_data[icode].operand[2].mode;
kono
parents:
diff changeset
3075 mode2 = insn_data[icode].operand[3].mode;
kono
parents:
diff changeset
3076
kono
parents:
diff changeset
3077 if (! (*insn_data[icode].operand[1].predicate) (op0, mode0))
kono
parents:
diff changeset
3078 op0 = copy_to_mode_reg (mode0, op0);
kono
parents:
diff changeset
3079 if (! (*insn_data[icode].operand[2].predicate) (op1, mode1))
kono
parents:
diff changeset
3080 op1 = copy_to_mode_reg (mode1, op1);
kono
parents:
diff changeset
3081 if (! (*insn_data[icode].operand[3].predicate) (op2, mode2))
kono
parents:
diff changeset
3082 op2 = copy_to_mode_reg (mode2, op2);
kono
parents:
diff changeset
3083 if (target == 0
kono
parents:
diff changeset
3084 || GET_MODE (target) != tmode
kono
parents:
diff changeset
3085 || ! (*insn_data[icode].operand[0].predicate) (target, tmode))
kono
parents:
diff changeset
3086 target = gen_reg_rtx (tmode);
kono
parents:
diff changeset
3087 pat = GEN_FCN (icode) (target, op0, op1, op2);
kono
parents:
diff changeset
3088 if (! pat)
kono
parents:
diff changeset
3089 return 0;
kono
parents:
diff changeset
3090 emit_insn (pat);
kono
parents:
diff changeset
3091 return target;
kono
parents:
diff changeset
3092
kono
parents:
diff changeset
3093 case ARM_BUILTIN_WZERO:
kono
parents:
diff changeset
3094 target = gen_reg_rtx (DImode);
kono
parents:
diff changeset
3095 emit_insn (gen_iwmmxt_clrdi (target));
kono
parents:
diff changeset
3096 return target;
kono
parents:
diff changeset
3097
kono
parents:
diff changeset
3098 case ARM_BUILTIN_WSRLHI:
kono
parents:
diff changeset
3099 case ARM_BUILTIN_WSRLWI:
kono
parents:
diff changeset
3100 case ARM_BUILTIN_WSRLDI:
kono
parents:
diff changeset
3101 case ARM_BUILTIN_WSLLHI:
kono
parents:
diff changeset
3102 case ARM_BUILTIN_WSLLWI:
kono
parents:
diff changeset
3103 case ARM_BUILTIN_WSLLDI:
kono
parents:
diff changeset
3104 case ARM_BUILTIN_WSRAHI:
kono
parents:
diff changeset
3105 case ARM_BUILTIN_WSRAWI:
kono
parents:
diff changeset
3106 case ARM_BUILTIN_WSRADI:
kono
parents:
diff changeset
3107 case ARM_BUILTIN_WRORHI:
kono
parents:
diff changeset
3108 case ARM_BUILTIN_WRORWI:
kono
parents:
diff changeset
3109 case ARM_BUILTIN_WRORDI:
kono
parents:
diff changeset
3110 case ARM_BUILTIN_WSRLH:
kono
parents:
diff changeset
3111 case ARM_BUILTIN_WSRLW:
kono
parents:
diff changeset
3112 case ARM_BUILTIN_WSRLD:
kono
parents:
diff changeset
3113 case ARM_BUILTIN_WSLLH:
kono
parents:
diff changeset
3114 case ARM_BUILTIN_WSLLW:
kono
parents:
diff changeset
3115 case ARM_BUILTIN_WSLLD:
kono
parents:
diff changeset
3116 case ARM_BUILTIN_WSRAH:
kono
parents:
diff changeset
3117 case ARM_BUILTIN_WSRAW:
kono
parents:
diff changeset
3118 case ARM_BUILTIN_WSRAD:
kono
parents:
diff changeset
3119 case ARM_BUILTIN_WRORH:
kono
parents:
diff changeset
3120 case ARM_BUILTIN_WRORW:
kono
parents:
diff changeset
3121 case ARM_BUILTIN_WRORD:
kono
parents:
diff changeset
3122 icode = (fcode == ARM_BUILTIN_WSRLHI ? CODE_FOR_lshrv4hi3_iwmmxt
kono
parents:
diff changeset
3123 : fcode == ARM_BUILTIN_WSRLWI ? CODE_FOR_lshrv2si3_iwmmxt
kono
parents:
diff changeset
3124 : fcode == ARM_BUILTIN_WSRLDI ? CODE_FOR_lshrdi3_iwmmxt
kono
parents:
diff changeset
3125 : fcode == ARM_BUILTIN_WSLLHI ? CODE_FOR_ashlv4hi3_iwmmxt
kono
parents:
diff changeset
3126 : fcode == ARM_BUILTIN_WSLLWI ? CODE_FOR_ashlv2si3_iwmmxt
kono
parents:
diff changeset
3127 : fcode == ARM_BUILTIN_WSLLDI ? CODE_FOR_ashldi3_iwmmxt
kono
parents:
diff changeset
3128 : fcode == ARM_BUILTIN_WSRAHI ? CODE_FOR_ashrv4hi3_iwmmxt
kono
parents:
diff changeset
3129 : fcode == ARM_BUILTIN_WSRAWI ? CODE_FOR_ashrv2si3_iwmmxt
kono
parents:
diff changeset
3130 : fcode == ARM_BUILTIN_WSRADI ? CODE_FOR_ashrdi3_iwmmxt
kono
parents:
diff changeset
3131 : fcode == ARM_BUILTIN_WRORHI ? CODE_FOR_rorv4hi3
kono
parents:
diff changeset
3132 : fcode == ARM_BUILTIN_WRORWI ? CODE_FOR_rorv2si3
kono
parents:
diff changeset
3133 : fcode == ARM_BUILTIN_WRORDI ? CODE_FOR_rordi3
kono
parents:
diff changeset
3134 : fcode == ARM_BUILTIN_WSRLH ? CODE_FOR_lshrv4hi3_di
kono
parents:
diff changeset
3135 : fcode == ARM_BUILTIN_WSRLW ? CODE_FOR_lshrv2si3_di
kono
parents:
diff changeset
3136 : fcode == ARM_BUILTIN_WSRLD ? CODE_FOR_lshrdi3_di
kono
parents:
diff changeset
3137 : fcode == ARM_BUILTIN_WSLLH ? CODE_FOR_ashlv4hi3_di
kono
parents:
diff changeset
3138 : fcode == ARM_BUILTIN_WSLLW ? CODE_FOR_ashlv2si3_di
kono
parents:
diff changeset
3139 : fcode == ARM_BUILTIN_WSLLD ? CODE_FOR_ashldi3_di
kono
parents:
diff changeset
3140 : fcode == ARM_BUILTIN_WSRAH ? CODE_FOR_ashrv4hi3_di
kono
parents:
diff changeset
3141 : fcode == ARM_BUILTIN_WSRAW ? CODE_FOR_ashrv2si3_di
kono
parents:
diff changeset
3142 : fcode == ARM_BUILTIN_WSRAD ? CODE_FOR_ashrdi3_di
kono
parents:
diff changeset
3143 : fcode == ARM_BUILTIN_WRORH ? CODE_FOR_rorv4hi3_di
kono
parents:
diff changeset
3144 : fcode == ARM_BUILTIN_WRORW ? CODE_FOR_rorv2si3_di
kono
parents:
diff changeset
3145 : fcode == ARM_BUILTIN_WRORD ? CODE_FOR_rordi3_di
kono
parents:
diff changeset
3146 : CODE_FOR_nothing);
kono
parents:
diff changeset
3147 arg1 = CALL_EXPR_ARG (exp, 1);
kono
parents:
diff changeset
3148 op1 = expand_normal (arg1);
kono
parents:
diff changeset
3149 if (GET_MODE (op1) == VOIDmode)
kono
parents:
diff changeset
3150 {
kono
parents:
diff changeset
3151 imm = INTVAL (op1);
kono
parents:
diff changeset
3152 if ((fcode == ARM_BUILTIN_WRORHI || fcode == ARM_BUILTIN_WRORWI
kono
parents:
diff changeset
3153 || fcode == ARM_BUILTIN_WRORH || fcode == ARM_BUILTIN_WRORW)
kono
parents:
diff changeset
3154 && (imm < 0 || imm > 32))
kono
parents:
diff changeset
3155 {
kono
parents:
diff changeset
3156 if (fcode == ARM_BUILTIN_WRORHI)
kono
parents:
diff changeset
3157 error ("the range of count should be in 0 to 32. please check the intrinsic _mm_rori_pi16 in code.");
kono
parents:
diff changeset
3158 else if (fcode == ARM_BUILTIN_WRORWI)
kono
parents:
diff changeset
3159 error ("the range of count should be in 0 to 32. please check the intrinsic _mm_rori_pi32 in code.");
kono
parents:
diff changeset
3160 else if (fcode == ARM_BUILTIN_WRORH)
kono
parents:
diff changeset
3161 error ("the range of count should be in 0 to 32. please check the intrinsic _mm_ror_pi16 in code.");
kono
parents:
diff changeset
3162 else
kono
parents:
diff changeset
3163 error ("the range of count should be in 0 to 32. please check the intrinsic _mm_ror_pi32 in code.");
kono
parents:
diff changeset
3164 }
kono
parents:
diff changeset
3165 else if ((fcode == ARM_BUILTIN_WRORDI || fcode == ARM_BUILTIN_WRORD)
kono
parents:
diff changeset
3166 && (imm < 0 || imm > 64))
kono
parents:
diff changeset
3167 {
kono
parents:
diff changeset
3168 if (fcode == ARM_BUILTIN_WRORDI)
kono
parents:
diff changeset
3169 error ("the range of count should be in 0 to 64. please check the intrinsic _mm_rori_si64 in code.");
kono
parents:
diff changeset
3170 else
kono
parents:
diff changeset
3171 error ("the range of count should be in 0 to 64. please check the intrinsic _mm_ror_si64 in code.");
kono
parents:
diff changeset
3172 }
kono
parents:
diff changeset
3173 else if (imm < 0)
kono
parents:
diff changeset
3174 {
kono
parents:
diff changeset
3175 if (fcode == ARM_BUILTIN_WSRLHI)
kono
parents:
diff changeset
3176 error ("the count should be no less than 0. please check the intrinsic _mm_srli_pi16 in code.");
kono
parents:
diff changeset
3177 else if (fcode == ARM_BUILTIN_WSRLWI)
kono
parents:
diff changeset
3178 error ("the count should be no less than 0. please check the intrinsic _mm_srli_pi32 in code.");
kono
parents:
diff changeset
3179 else if (fcode == ARM_BUILTIN_WSRLDI)
kono
parents:
diff changeset
3180 error ("the count should be no less than 0. please check the intrinsic _mm_srli_si64 in code.");
kono
parents:
diff changeset
3181 else if (fcode == ARM_BUILTIN_WSLLHI)
kono
parents:
diff changeset
3182 error ("the count should be no less than 0. please check the intrinsic _mm_slli_pi16 in code.");
kono
parents:
diff changeset
3183 else if (fcode == ARM_BUILTIN_WSLLWI)
kono
parents:
diff changeset
3184 error ("the count should be no less than 0. please check the intrinsic _mm_slli_pi32 in code.");
kono
parents:
diff changeset
3185 else if (fcode == ARM_BUILTIN_WSLLDI)
kono
parents:
diff changeset
3186 error ("the count should be no less than 0. please check the intrinsic _mm_slli_si64 in code.");
kono
parents:
diff changeset
3187 else if (fcode == ARM_BUILTIN_WSRAHI)
kono
parents:
diff changeset
3188 error ("the count should be no less than 0. please check the intrinsic _mm_srai_pi16 in code.");
kono
parents:
diff changeset
3189 else if (fcode == ARM_BUILTIN_WSRAWI)
kono
parents:
diff changeset
3190 error ("the count should be no less than 0. please check the intrinsic _mm_srai_pi32 in code.");
kono
parents:
diff changeset
3191 else if (fcode == ARM_BUILTIN_WSRADI)
kono
parents:
diff changeset
3192 error ("the count should be no less than 0. please check the intrinsic _mm_srai_si64 in code.");
kono
parents:
diff changeset
3193 else if (fcode == ARM_BUILTIN_WSRLH)
kono
parents:
diff changeset
3194 error ("the count should be no less than 0. please check the intrinsic _mm_srl_pi16 in code.");
kono
parents:
diff changeset
3195 else if (fcode == ARM_BUILTIN_WSRLW)
kono
parents:
diff changeset
3196 error ("the count should be no less than 0. please check the intrinsic _mm_srl_pi32 in code.");
kono
parents:
diff changeset
3197 else if (fcode == ARM_BUILTIN_WSRLD)
kono
parents:
diff changeset
3198 error ("the count should be no less than 0. please check the intrinsic _mm_srl_si64 in code.");
kono
parents:
diff changeset
3199 else if (fcode == ARM_BUILTIN_WSLLH)
kono
parents:
diff changeset
3200 error ("the count should be no less than 0. please check the intrinsic _mm_sll_pi16 in code.");
kono
parents:
diff changeset
3201 else if (fcode == ARM_BUILTIN_WSLLW)
kono
parents:
diff changeset
3202 error ("the count should be no less than 0. please check the intrinsic _mm_sll_pi32 in code.");
kono
parents:
diff changeset
3203 else if (fcode == ARM_BUILTIN_WSLLD)
kono
parents:
diff changeset
3204 error ("the count should be no less than 0. please check the intrinsic _mm_sll_si64 in code.");
kono
parents:
diff changeset
3205 else if (fcode == ARM_BUILTIN_WSRAH)
kono
parents:
diff changeset
3206 error ("the count should be no less than 0. please check the intrinsic _mm_sra_pi16 in code.");
kono
parents:
diff changeset
3207 else if (fcode == ARM_BUILTIN_WSRAW)
kono
parents:
diff changeset
3208 error ("the count should be no less than 0. please check the intrinsic _mm_sra_pi32 in code.");
kono
parents:
diff changeset
3209 else
kono
parents:
diff changeset
3210 error ("the count should be no less than 0. please check the intrinsic _mm_sra_si64 in code.");
kono
parents:
diff changeset
3211 }
kono
parents:
diff changeset
3212 }
kono
parents:
diff changeset
3213 return arm_expand_binop_builtin (icode, exp, target);
kono
parents:
diff changeset
3214
kono
parents:
diff changeset
3215 default:
kono
parents:
diff changeset
3216 break;
kono
parents:
diff changeset
3217 }
kono
parents:
diff changeset
3218
kono
parents:
diff changeset
3219 for (i = 0, d = bdesc_2arg; i < ARRAY_SIZE (bdesc_2arg); i++, d++)
kono
parents:
diff changeset
3220 if (d->code == (enum arm_builtins) fcode)
kono
parents:
diff changeset
3221 return arm_expand_binop_builtin (d->icode, exp, target);
kono
parents:
diff changeset
3222
kono
parents:
diff changeset
3223 for (i = 0, d = bdesc_1arg; i < ARRAY_SIZE (bdesc_1arg); i++, d++)
kono
parents:
diff changeset
3224 if (d->code == (enum arm_builtins) fcode)
kono
parents:
diff changeset
3225 return arm_expand_unop_builtin (d->icode, exp, target, 0);
kono
parents:
diff changeset
3226
kono
parents:
diff changeset
3227 for (i = 0, d = bdesc_3arg; i < ARRAY_SIZE (bdesc_3arg); i++, d++)
kono
parents:
diff changeset
3228 if (d->code == (enum arm_builtins) fcode)
kono
parents:
diff changeset
3229 return arm_expand_ternop_builtin (d->icode, exp, target);
kono
parents:
diff changeset
3230
kono
parents:
diff changeset
3231 /* @@@ Should really do something sensible here. */
kono
parents:
diff changeset
3232 return NULL_RTX;
kono
parents:
diff changeset
3233 }
kono
parents:
diff changeset
3234
kono
parents:
diff changeset
3235 tree
kono
parents:
diff changeset
3236 arm_builtin_vectorized_function (unsigned int fn, tree type_out, tree type_in)
kono
parents:
diff changeset
3237 {
kono
parents:
diff changeset
3238 machine_mode in_mode, out_mode;
kono
parents:
diff changeset
3239 int in_n, out_n;
kono
parents:
diff changeset
3240 bool out_unsigned_p = TYPE_UNSIGNED (type_out);
kono
parents:
diff changeset
3241
kono
parents:
diff changeset
3242 /* Can't provide any vectorized builtins when we can't use NEON. */
kono
parents:
diff changeset
3243 if (!TARGET_NEON)
kono
parents:
diff changeset
3244 return NULL_TREE;
kono
parents:
diff changeset
3245
kono
parents:
diff changeset
3246 if (TREE_CODE (type_out) != VECTOR_TYPE
kono
parents:
diff changeset
3247 || TREE_CODE (type_in) != VECTOR_TYPE)
kono
parents:
diff changeset
3248 return NULL_TREE;
kono
parents:
diff changeset
3249
kono
parents:
diff changeset
3250 out_mode = TYPE_MODE (TREE_TYPE (type_out));
kono
parents:
diff changeset
3251 out_n = TYPE_VECTOR_SUBPARTS (type_out);
kono
parents:
diff changeset
3252 in_mode = TYPE_MODE (TREE_TYPE (type_in));
kono
parents:
diff changeset
3253 in_n = TYPE_VECTOR_SUBPARTS (type_in);
kono
parents:
diff changeset
3254
kono
parents:
diff changeset
3255 /* ARM_CHECK_BUILTIN_MODE and ARM_FIND_VRINT_VARIANT are used to find the
kono
parents:
diff changeset
3256 decl of the vectorized builtin for the appropriate vector mode.
kono
parents:
diff changeset
3257 NULL_TREE is returned if no such builtin is available. */
kono
parents:
diff changeset
3258 #undef ARM_CHECK_BUILTIN_MODE
kono
parents:
diff changeset
3259 #define ARM_CHECK_BUILTIN_MODE(C) \
kono
parents:
diff changeset
3260 (TARGET_VFP5 \
kono
parents:
diff changeset
3261 && flag_unsafe_math_optimizations \
kono
parents:
diff changeset
3262 && ARM_CHECK_BUILTIN_MODE_1 (C))
kono
parents:
diff changeset
3263
kono
parents:
diff changeset
3264 #undef ARM_CHECK_BUILTIN_MODE_1
kono
parents:
diff changeset
3265 #define ARM_CHECK_BUILTIN_MODE_1(C) \
kono
parents:
diff changeset
3266 (out_mode == SFmode && out_n == C \
kono
parents:
diff changeset
3267 && in_mode == SFmode && in_n == C)
kono
parents:
diff changeset
3268
kono
parents:
diff changeset
3269 #undef ARM_FIND_VRINT_VARIANT
kono
parents:
diff changeset
3270 #define ARM_FIND_VRINT_VARIANT(N) \
kono
parents:
diff changeset
3271 (ARM_CHECK_BUILTIN_MODE (2) \
kono
parents:
diff changeset
3272 ? arm_builtin_decl(ARM_BUILTIN_NEON_##N##v2sf, false) \
kono
parents:
diff changeset
3273 : (ARM_CHECK_BUILTIN_MODE (4) \
kono
parents:
diff changeset
3274 ? arm_builtin_decl(ARM_BUILTIN_NEON_##N##v4sf, false) \
kono
parents:
diff changeset
3275 : NULL_TREE))
kono
parents:
diff changeset
3276
kono
parents:
diff changeset
3277 switch (fn)
kono
parents:
diff changeset
3278 {
kono
parents:
diff changeset
3279 CASE_CFN_FLOOR:
kono
parents:
diff changeset
3280 return ARM_FIND_VRINT_VARIANT (vrintm);
kono
parents:
diff changeset
3281 CASE_CFN_CEIL:
kono
parents:
diff changeset
3282 return ARM_FIND_VRINT_VARIANT (vrintp);
kono
parents:
diff changeset
3283 CASE_CFN_TRUNC:
kono
parents:
diff changeset
3284 return ARM_FIND_VRINT_VARIANT (vrintz);
kono
parents:
diff changeset
3285 CASE_CFN_ROUND:
kono
parents:
diff changeset
3286 return ARM_FIND_VRINT_VARIANT (vrinta);
kono
parents:
diff changeset
3287 #undef ARM_CHECK_BUILTIN_MODE_1
kono
parents:
diff changeset
3288 #define ARM_CHECK_BUILTIN_MODE_1(C) \
kono
parents:
diff changeset
3289 (out_mode == SImode && out_n == C \
kono
parents:
diff changeset
3290 && in_mode == SFmode && in_n == C)
kono
parents:
diff changeset
3291
kono
parents:
diff changeset
3292 #define ARM_FIND_VCVT_VARIANT(N) \
kono
parents:
diff changeset
3293 (ARM_CHECK_BUILTIN_MODE (2) \
kono
parents:
diff changeset
3294 ? arm_builtin_decl(ARM_BUILTIN_NEON_##N##v2sfv2si, false) \
kono
parents:
diff changeset
3295 : (ARM_CHECK_BUILTIN_MODE (4) \
kono
parents:
diff changeset
3296 ? arm_builtin_decl(ARM_BUILTIN_NEON_##N##v4sfv4si, false) \
kono
parents:
diff changeset
3297 : NULL_TREE))
kono
parents:
diff changeset
3298
kono
parents:
diff changeset
3299 #define ARM_FIND_VCVTU_VARIANT(N) \
kono
parents:
diff changeset
3300 (ARM_CHECK_BUILTIN_MODE (2) \
kono
parents:
diff changeset
3301 ? arm_builtin_decl(ARM_BUILTIN_NEON_##N##uv2sfv2si, false) \
kono
parents:
diff changeset
3302 : (ARM_CHECK_BUILTIN_MODE (4) \
kono
parents:
diff changeset
3303 ? arm_builtin_decl(ARM_BUILTIN_NEON_##N##uv4sfv4si, false) \
kono
parents:
diff changeset
3304 : NULL_TREE))
kono
parents:
diff changeset
3305 CASE_CFN_LROUND:
kono
parents:
diff changeset
3306 return (out_unsigned_p
kono
parents:
diff changeset
3307 ? ARM_FIND_VCVTU_VARIANT (vcvta)
kono
parents:
diff changeset
3308 : ARM_FIND_VCVT_VARIANT (vcvta));
kono
parents:
diff changeset
3309 CASE_CFN_LCEIL:
kono
parents:
diff changeset
3310 return (out_unsigned_p
kono
parents:
diff changeset
3311 ? ARM_FIND_VCVTU_VARIANT (vcvtp)
kono
parents:
diff changeset
3312 : ARM_FIND_VCVT_VARIANT (vcvtp));
kono
parents:
diff changeset
3313 CASE_CFN_LFLOOR:
kono
parents:
diff changeset
3314 return (out_unsigned_p
kono
parents:
diff changeset
3315 ? ARM_FIND_VCVTU_VARIANT (vcvtm)
kono
parents:
diff changeset
3316 : ARM_FIND_VCVT_VARIANT (vcvtm));
kono
parents:
diff changeset
3317 #undef ARM_CHECK_BUILTIN_MODE
kono
parents:
diff changeset
3318 #define ARM_CHECK_BUILTIN_MODE(C, N) \
kono
parents:
diff changeset
3319 (out_mode == N##mode && out_n == C \
kono
parents:
diff changeset
3320 && in_mode == N##mode && in_n == C)
kono
parents:
diff changeset
3321 case CFN_BUILT_IN_BSWAP16:
kono
parents:
diff changeset
3322 if (ARM_CHECK_BUILTIN_MODE (4, HI))
kono
parents:
diff changeset
3323 return arm_builtin_decl (ARM_BUILTIN_NEON_bswapv4hi, false);
kono
parents:
diff changeset
3324 else if (ARM_CHECK_BUILTIN_MODE (8, HI))
kono
parents:
diff changeset
3325 return arm_builtin_decl (ARM_BUILTIN_NEON_bswapv8hi, false);
kono
parents:
diff changeset
3326 else
kono
parents:
diff changeset
3327 return NULL_TREE;
kono
parents:
diff changeset
3328 case CFN_BUILT_IN_BSWAP32:
kono
parents:
diff changeset
3329 if (ARM_CHECK_BUILTIN_MODE (2, SI))
kono
parents:
diff changeset
3330 return arm_builtin_decl (ARM_BUILTIN_NEON_bswapv2si, false);
kono
parents:
diff changeset
3331 else if (ARM_CHECK_BUILTIN_MODE (4, SI))
kono
parents:
diff changeset
3332 return arm_builtin_decl (ARM_BUILTIN_NEON_bswapv4si, false);
kono
parents:
diff changeset
3333 else
kono
parents:
diff changeset
3334 return NULL_TREE;
kono
parents:
diff changeset
3335 case CFN_BUILT_IN_BSWAP64:
kono
parents:
diff changeset
3336 if (ARM_CHECK_BUILTIN_MODE (2, DI))
kono
parents:
diff changeset
3337 return arm_builtin_decl (ARM_BUILTIN_NEON_bswapv2di, false);
kono
parents:
diff changeset
3338 else
kono
parents:
diff changeset
3339 return NULL_TREE;
kono
parents:
diff changeset
3340 CASE_CFN_COPYSIGN:
kono
parents:
diff changeset
3341 if (ARM_CHECK_BUILTIN_MODE (2, SF))
kono
parents:
diff changeset
3342 return arm_builtin_decl (ARM_BUILTIN_NEON_copysignfv2sf, false);
kono
parents:
diff changeset
3343 else if (ARM_CHECK_BUILTIN_MODE (4, SF))
kono
parents:
diff changeset
3344 return arm_builtin_decl (ARM_BUILTIN_NEON_copysignfv4sf, false);
kono
parents:
diff changeset
3345 else
kono
parents:
diff changeset
3346 return NULL_TREE;
kono
parents:
diff changeset
3347
kono
parents:
diff changeset
3348 default:
kono
parents:
diff changeset
3349 return NULL_TREE;
kono
parents:
diff changeset
3350 }
kono
parents:
diff changeset
3351 return NULL_TREE;
kono
parents:
diff changeset
3352 }
kono
parents:
diff changeset
3353 #undef ARM_FIND_VCVT_VARIANT
kono
parents:
diff changeset
3354 #undef ARM_FIND_VCVTU_VARIANT
kono
parents:
diff changeset
3355 #undef ARM_CHECK_BUILTIN_MODE
kono
parents:
diff changeset
3356 #undef ARM_FIND_VRINT_VARIANT
kono
parents:
diff changeset
3357
kono
parents:
diff changeset
3358 void
kono
parents:
diff changeset
3359 arm_atomic_assign_expand_fenv (tree *hold, tree *clear, tree *update)
kono
parents:
diff changeset
3360 {
kono
parents:
diff changeset
3361 const unsigned ARM_FE_INVALID = 1;
kono
parents:
diff changeset
3362 const unsigned ARM_FE_DIVBYZERO = 2;
kono
parents:
diff changeset
3363 const unsigned ARM_FE_OVERFLOW = 4;
kono
parents:
diff changeset
3364 const unsigned ARM_FE_UNDERFLOW = 8;
kono
parents:
diff changeset
3365 const unsigned ARM_FE_INEXACT = 16;
kono
parents:
diff changeset
3366 const unsigned HOST_WIDE_INT ARM_FE_ALL_EXCEPT = (ARM_FE_INVALID
kono
parents:
diff changeset
3367 | ARM_FE_DIVBYZERO
kono
parents:
diff changeset
3368 | ARM_FE_OVERFLOW
kono
parents:
diff changeset
3369 | ARM_FE_UNDERFLOW
kono
parents:
diff changeset
3370 | ARM_FE_INEXACT);
kono
parents:
diff changeset
3371 const unsigned HOST_WIDE_INT ARM_FE_EXCEPT_SHIFT = 8;
kono
parents:
diff changeset
3372 tree fenv_var, get_fpscr, set_fpscr, mask, ld_fenv, masked_fenv;
kono
parents:
diff changeset
3373 tree new_fenv_var, reload_fenv, restore_fnenv;
kono
parents:
diff changeset
3374 tree update_call, atomic_feraiseexcept, hold_fnclex;
kono
parents:
diff changeset
3375
kono
parents:
diff changeset
3376 if (!TARGET_HARD_FLOAT)
kono
parents:
diff changeset
3377 return;
kono
parents:
diff changeset
3378
kono
parents:
diff changeset
3379 /* Generate the equivalent of :
kono
parents:
diff changeset
3380 unsigned int fenv_var;
kono
parents:
diff changeset
3381 fenv_var = __builtin_arm_get_fpscr ();
kono
parents:
diff changeset
3382
kono
parents:
diff changeset
3383 unsigned int masked_fenv;
kono
parents:
diff changeset
3384 masked_fenv = fenv_var & mask;
kono
parents:
diff changeset
3385
kono
parents:
diff changeset
3386 __builtin_arm_set_fpscr (masked_fenv); */
kono
parents:
diff changeset
3387
kono
parents:
diff changeset
3388 fenv_var = create_tmp_var_raw (unsigned_type_node);
kono
parents:
diff changeset
3389 get_fpscr = arm_builtin_decls[ARM_BUILTIN_GET_FPSCR];
kono
parents:
diff changeset
3390 set_fpscr = arm_builtin_decls[ARM_BUILTIN_SET_FPSCR];
kono
parents:
diff changeset
3391 mask = build_int_cst (unsigned_type_node,
kono
parents:
diff changeset
3392 ~((ARM_FE_ALL_EXCEPT << ARM_FE_EXCEPT_SHIFT)
kono
parents:
diff changeset
3393 | ARM_FE_ALL_EXCEPT));
kono
parents:
diff changeset
3394 ld_fenv = build2 (MODIFY_EXPR, unsigned_type_node,
kono
parents:
diff changeset
3395 fenv_var, build_call_expr (get_fpscr, 0));
kono
parents:
diff changeset
3396 masked_fenv = build2 (BIT_AND_EXPR, unsigned_type_node, fenv_var, mask);
kono
parents:
diff changeset
3397 hold_fnclex = build_call_expr (set_fpscr, 1, masked_fenv);
kono
parents:
diff changeset
3398 *hold = build2 (COMPOUND_EXPR, void_type_node,
kono
parents:
diff changeset
3399 build2 (COMPOUND_EXPR, void_type_node, masked_fenv, ld_fenv),
kono
parents:
diff changeset
3400 hold_fnclex);
kono
parents:
diff changeset
3401
kono
parents:
diff changeset
3402 /* Store the value of masked_fenv to clear the exceptions:
kono
parents:
diff changeset
3403 __builtin_arm_set_fpscr (masked_fenv); */
kono
parents:
diff changeset
3404
kono
parents:
diff changeset
3405 *clear = build_call_expr (set_fpscr, 1, masked_fenv);
kono
parents:
diff changeset
3406
kono
parents:
diff changeset
3407 /* Generate the equivalent of :
kono
parents:
diff changeset
3408 unsigned int new_fenv_var;
kono
parents:
diff changeset
3409 new_fenv_var = __builtin_arm_get_fpscr ();
kono
parents:
diff changeset
3410
kono
parents:
diff changeset
3411 __builtin_arm_set_fpscr (fenv_var);
kono
parents:
diff changeset
3412
kono
parents:
diff changeset
3413 __atomic_feraiseexcept (new_fenv_var); */
kono
parents:
diff changeset
3414
kono
parents:
diff changeset
3415 new_fenv_var = create_tmp_var_raw (unsigned_type_node);
kono
parents:
diff changeset
3416 reload_fenv = build2 (MODIFY_EXPR, unsigned_type_node, new_fenv_var,
kono
parents:
diff changeset
3417 build_call_expr (get_fpscr, 0));
kono
parents:
diff changeset
3418 restore_fnenv = build_call_expr (set_fpscr, 1, fenv_var);
kono
parents:
diff changeset
3419 atomic_feraiseexcept = builtin_decl_implicit (BUILT_IN_ATOMIC_FERAISEEXCEPT);
kono
parents:
diff changeset
3420 update_call = build_call_expr (atomic_feraiseexcept, 1,
kono
parents:
diff changeset
3421 fold_convert (integer_type_node, new_fenv_var));
kono
parents:
diff changeset
3422 *update = build2 (COMPOUND_EXPR, void_type_node,
kono
parents:
diff changeset
3423 build2 (COMPOUND_EXPR, void_type_node,
kono
parents:
diff changeset
3424 reload_fenv, restore_fnenv), update_call);
kono
parents:
diff changeset
3425 }
kono
parents:
diff changeset
3426
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
3427 /* Implement TARGET_CHECK_BUILTIN_CALL. Record a read of the Q bit through
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
3428 intrinsics in the machine function. */
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
3429 bool
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
3430 arm_check_builtin_call (location_t , vec<location_t> , tree fndecl,
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
3431 tree, unsigned int, tree *)
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
3432 {
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
3433 int fcode = DECL_MD_FUNCTION_CODE (fndecl);
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
3434 if (fcode == ARM_BUILTIN_saturation_occurred
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
3435 || fcode == ARM_BUILTIN_set_saturation)
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
3436 {
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
3437 if (cfun && cfun->decl)
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
3438 DECL_ATTRIBUTES (cfun->decl)
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
3439 = tree_cons (get_identifier ("acle qbit"), NULL_TREE,
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
3440 DECL_ATTRIBUTES (cfun->decl));
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
3441 }
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
3442 if (fcode == ARM_BUILTIN_sel)
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
3443 {
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
3444 if (cfun && cfun->decl)
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
3445 DECL_ATTRIBUTES (cfun->decl)
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
3446 = tree_cons (get_identifier ("acle gebits"), NULL_TREE,
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
3447 DECL_ATTRIBUTES (cfun->decl));
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
3448 }
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
3449 return true;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
3450 }
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
3451
111
kono
parents:
diff changeset
3452 #include "gt-arm-builtins.h"