aarch64-sve.md revision 1.1.1.3 1 1.1 mrg ;; Machine description for AArch64 SVE.
2 1.1.1.3 mrg ;; Copyright (C) 2009-2020 Free Software Foundation, Inc.
3 1.1 mrg ;; Contributed by ARM Ltd.
4 1.1 mrg ;;
5 1.1 mrg ;; This file is part of GCC.
6 1.1 mrg ;;
7 1.1 mrg ;; GCC is free software; you can redistribute it and/or modify it
8 1.1 mrg ;; under the terms of the GNU General Public License as published by
9 1.1 mrg ;; the Free Software Foundation; either version 3, or (at your option)
10 1.1 mrg ;; any later version.
11 1.1 mrg ;;
12 1.1 mrg ;; GCC is distributed in the hope that it will be useful, but
13 1.1 mrg ;; WITHOUT ANY WARRANTY; without even the implied warranty of
14 1.1 mrg ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 1.1 mrg ;; General Public License for more details.
16 1.1 mrg ;;
17 1.1 mrg ;; You should have received a copy of the GNU General Public License
18 1.1 mrg ;; along with GCC; see the file COPYING3. If not see
19 1.1 mrg ;; <http://www.gnu.org/licenses/>.
20 1.1 mrg
21 1.1.1.3 mrg ;; The file is organised into the following sections (search for the full
22 1.1.1.3 mrg ;; line):
23 1.1.1.3 mrg ;;
24 1.1.1.3 mrg ;; == General notes
25 1.1.1.3 mrg ;; ---- Note on the handling of big-endian SVE
26 1.1.1.3 mrg ;; ---- Description of UNSPEC_PTEST
27 1.1.1.3 mrg ;; ---- Description of UNSPEC_PRED_Z
28 1.1.1.3 mrg ;; ---- Note on predicated integer arithemtic and UNSPEC_PRED_X
29 1.1.1.3 mrg ;; ---- Note on predicated FP arithmetic patterns and GP "strictness"
30 1.1.1.3 mrg ;; ---- Note on FFR handling
31 1.1.1.3 mrg ;;
32 1.1.1.3 mrg ;; == Moves
33 1.1.1.3 mrg ;; ---- Moves of single vectors
34 1.1.1.3 mrg ;; ---- Moves of multiple vectors
35 1.1.1.3 mrg ;; ---- Moves of predicates
36 1.1.1.3 mrg ;; ---- Moves relating to the FFR
37 1.1.1.3 mrg ;;
38 1.1.1.3 mrg ;; == Loads
39 1.1.1.3 mrg ;; ---- Normal contiguous loads
40 1.1.1.3 mrg ;; ---- Extending contiguous loads
41 1.1.1.3 mrg ;; ---- First-faulting contiguous loads
42 1.1.1.3 mrg ;; ---- First-faulting extending contiguous loads
43 1.1.1.3 mrg ;; ---- Non-temporal contiguous loads
44 1.1.1.3 mrg ;; ---- Normal gather loads
45 1.1.1.3 mrg ;; ---- Extending gather loads
46 1.1.1.3 mrg ;; ---- First-faulting gather loads
47 1.1.1.3 mrg ;; ---- First-faulting extending gather loads
48 1.1.1.3 mrg ;;
49 1.1.1.3 mrg ;; == Prefetches
50 1.1.1.3 mrg ;; ---- Contiguous prefetches
51 1.1.1.3 mrg ;; ---- Gather prefetches
52 1.1.1.3 mrg ;;
53 1.1.1.3 mrg ;; == Stores
54 1.1.1.3 mrg ;; ---- Normal contiguous stores
55 1.1.1.3 mrg ;; ---- Truncating contiguous stores
56 1.1.1.3 mrg ;; ---- Non-temporal contiguous stores
57 1.1.1.3 mrg ;; ---- Normal scatter stores
58 1.1.1.3 mrg ;; ---- Truncating scatter stores
59 1.1.1.3 mrg ;;
60 1.1.1.3 mrg ;; == Vector creation
61 1.1.1.3 mrg ;; ---- [INT,FP] Duplicate element
62 1.1.1.3 mrg ;; ---- [INT,FP] Initialize from individual elements
63 1.1.1.3 mrg ;; ---- [INT] Linear series
64 1.1.1.3 mrg ;; ---- [PRED] Duplicate element
65 1.1.1.3 mrg ;;
66 1.1.1.3 mrg ;; == Vector decomposition
67 1.1.1.3 mrg ;; ---- [INT,FP] Extract index
68 1.1.1.3 mrg ;; ---- [INT,FP] Extract active element
69 1.1.1.3 mrg ;; ---- [PRED] Extract index
70 1.1.1.3 mrg ;;
71 1.1.1.3 mrg ;; == Unary arithmetic
72 1.1.1.3 mrg ;; ---- [INT] General unary arithmetic corresponding to rtx codes
73 1.1.1.3 mrg ;; ---- [INT] General unary arithmetic corresponding to unspecs
74 1.1.1.3 mrg ;; ---- [INT] Sign and zero extension
75 1.1.1.3 mrg ;; ---- [INT] Truncation
76 1.1.1.3 mrg ;; ---- [INT] Logical inverse
77 1.1.1.3 mrg ;; ---- [FP<-INT] General unary arithmetic that maps to unspecs
78 1.1.1.3 mrg ;; ---- [FP] General unary arithmetic corresponding to unspecs
79 1.1.1.3 mrg ;; ---- [FP] Square root
80 1.1.1.3 mrg ;; ---- [FP] Reciprocal square root
81 1.1.1.3 mrg ;; ---- [PRED] Inverse
82 1.1.1.3 mrg
83 1.1.1.3 mrg ;; == Binary arithmetic
84 1.1.1.3 mrg ;; ---- [INT] General binary arithmetic corresponding to rtx codes
85 1.1.1.3 mrg ;; ---- [INT] Addition
86 1.1.1.3 mrg ;; ---- [INT] Subtraction
87 1.1.1.3 mrg ;; ---- [INT] Take address
88 1.1.1.3 mrg ;; ---- [INT] Absolute difference
89 1.1.1.3 mrg ;; ---- [INT] Saturating addition and subtraction
90 1.1.1.3 mrg ;; ---- [INT] Highpart multiplication
91 1.1.1.3 mrg ;; ---- [INT] Division
92 1.1.1.3 mrg ;; ---- [INT] Binary logical operations
93 1.1.1.3 mrg ;; ---- [INT] Binary logical operations (inverted second input)
94 1.1.1.3 mrg ;; ---- [INT] Shifts (rounding towards -Inf)
95 1.1.1.3 mrg ;; ---- [INT] Shifts (rounding towards 0)
96 1.1.1.3 mrg ;; ---- [FP<-INT] General binary arithmetic corresponding to unspecs
97 1.1.1.3 mrg ;; ---- [FP] General binary arithmetic corresponding to rtx codes
98 1.1.1.3 mrg ;; ---- [FP] General binary arithmetic corresponding to unspecs
99 1.1.1.3 mrg ;; ---- [FP] Addition
100 1.1.1.3 mrg ;; ---- [FP] Complex addition
101 1.1.1.3 mrg ;; ---- [FP] Subtraction
102 1.1.1.3 mrg ;; ---- [FP] Absolute difference
103 1.1.1.3 mrg ;; ---- [FP] Multiplication
104 1.1.1.3 mrg ;; ---- [FP] Division
105 1.1.1.3 mrg ;; ---- [FP] Binary logical operations
106 1.1.1.3 mrg ;; ---- [FP] Sign copying
107 1.1.1.3 mrg ;; ---- [FP] Maximum and minimum
108 1.1.1.3 mrg ;; ---- [PRED] Binary logical operations
109 1.1.1.3 mrg ;; ---- [PRED] Binary logical operations (inverted second input)
110 1.1.1.3 mrg ;; ---- [PRED] Binary logical operations (inverted result)
111 1.1.1.3 mrg ;;
112 1.1.1.3 mrg ;; == Ternary arithmetic
113 1.1.1.3 mrg ;; ---- [INT] MLA and MAD
114 1.1.1.3 mrg ;; ---- [INT] MLS and MSB
115 1.1.1.3 mrg ;; ---- [INT] Dot product
116 1.1.1.3 mrg ;; ---- [INT] Sum of absolute differences
117 1.1.1.3 mrg ;; ---- [INT] Matrix multiply-accumulate
118 1.1.1.3 mrg ;; ---- [FP] General ternary arithmetic corresponding to unspecs
119 1.1.1.3 mrg ;; ---- [FP] Complex multiply-add
120 1.1.1.3 mrg ;; ---- [FP] Trigonometric multiply-add
121 1.1.1.3 mrg ;; ---- [FP] Bfloat16 long ternary arithmetic (SF,BF,BF)
122 1.1.1.3 mrg ;; ---- [FP] Matrix multiply-accumulate
123 1.1.1.3 mrg ;;
124 1.1.1.3 mrg ;; == Comparisons and selects
125 1.1.1.3 mrg ;; ---- [INT,FP] Select based on predicates
126 1.1.1.3 mrg ;; ---- [INT,FP] Compare and select
127 1.1.1.3 mrg ;; ---- [INT] Comparisons
128 1.1.1.3 mrg ;; ---- [INT] While tests
129 1.1.1.3 mrg ;; ---- [FP] Direct comparisons
130 1.1.1.3 mrg ;; ---- [FP] Absolute comparisons
131 1.1.1.3 mrg ;; ---- [PRED] Select
132 1.1.1.3 mrg ;; ---- [PRED] Test bits
133 1.1.1.3 mrg ;;
134 1.1.1.3 mrg ;; == Reductions
135 1.1.1.3 mrg ;; ---- [INT,FP] Conditional reductions
136 1.1.1.3 mrg ;; ---- [INT] Tree reductions
137 1.1.1.3 mrg ;; ---- [FP] Tree reductions
138 1.1.1.3 mrg ;; ---- [FP] Left-to-right reductions
139 1.1.1.3 mrg ;;
140 1.1.1.3 mrg ;; == Permutes
141 1.1.1.3 mrg ;; ---- [INT,FP] General permutes
142 1.1.1.3 mrg ;; ---- [INT,FP] Special-purpose unary permutes
143 1.1.1.3 mrg ;; ---- [INT,FP] Special-purpose binary permutes
144 1.1.1.3 mrg ;; ---- [PRED] Special-purpose unary permutes
145 1.1.1.3 mrg ;; ---- [PRED] Special-purpose binary permutes
146 1.1.1.3 mrg ;;
147 1.1.1.3 mrg ;; == Conversions
148 1.1.1.3 mrg ;; ---- [INT<-INT] Packs
149 1.1.1.3 mrg ;; ---- [INT<-INT] Unpacks
150 1.1.1.3 mrg ;; ---- [INT<-FP] Conversions
151 1.1.1.3 mrg ;; ---- [INT<-FP] Packs
152 1.1.1.3 mrg ;; ---- [INT<-FP] Unpacks
153 1.1.1.3 mrg ;; ---- [FP<-INT] Conversions
154 1.1.1.3 mrg ;; ---- [FP<-INT] Packs
155 1.1.1.3 mrg ;; ---- [FP<-INT] Unpacks
156 1.1.1.3 mrg ;; ---- [FP<-FP] Packs
157 1.1.1.3 mrg ;; ---- [FP<-FP] Packs (bfloat16)
158 1.1.1.3 mrg ;; ---- [FP<-FP] Unpacks
159 1.1.1.3 mrg ;; ---- [PRED<-PRED] Packs
160 1.1.1.3 mrg ;; ---- [PRED<-PRED] Unpacks
161 1.1.1.3 mrg ;;
162 1.1.1.3 mrg ;; == Vector partitioning
163 1.1.1.3 mrg ;; ---- [PRED] Unary partitioning
164 1.1.1.3 mrg ;; ---- [PRED] Binary partitioning
165 1.1.1.3 mrg ;; ---- [PRED] Scalarization
166 1.1.1.3 mrg ;;
167 1.1.1.3 mrg ;; == Counting elements
168 1.1.1.3 mrg ;; ---- [INT] Count elements in a pattern (scalar)
169 1.1.1.3 mrg ;; ---- [INT] Increment by the number of elements in a pattern (scalar)
170 1.1.1.3 mrg ;; ---- [INT] Increment by the number of elements in a pattern (vector)
171 1.1.1.3 mrg ;; ---- [INT] Decrement by the number of elements in a pattern (scalar)
172 1.1.1.3 mrg ;; ---- [INT] Decrement by the number of elements in a pattern (vector)
173 1.1.1.3 mrg ;; ---- [INT] Count elements in a predicate (scalar)
174 1.1.1.3 mrg ;; ---- [INT] Increment by the number of elements in a predicate (scalar)
175 1.1.1.3 mrg ;; ---- [INT] Increment by the number of elements in a predicate (vector)
176 1.1.1.3 mrg ;; ---- [INT] Decrement by the number of elements in a predicate (scalar)
177 1.1.1.3 mrg ;; ---- [INT] Decrement by the number of elements in a predicate (vector)
178 1.1.1.3 mrg
179 1.1.1.3 mrg ;; =========================================================================
180 1.1.1.3 mrg ;; == General notes
181 1.1.1.3 mrg ;; =========================================================================
182 1.1.1.3 mrg ;;
183 1.1.1.3 mrg ;; -------------------------------------------------------------------------
184 1.1.1.3 mrg ;; ---- Note on the handling of big-endian SVE
185 1.1.1.3 mrg ;; -------------------------------------------------------------------------
186 1.1 mrg ;;
187 1.1 mrg ;; On big-endian systems, Advanced SIMD mov<mode> patterns act in the
188 1.1 mrg ;; same way as movdi or movti would: the first byte of memory goes
189 1.1 mrg ;; into the most significant byte of the register and the last byte
190 1.1 mrg ;; of memory goes into the least significant byte of the register.
191 1.1 mrg ;; This is the most natural ordering for Advanced SIMD and matches
192 1.1 mrg ;; the ABI layout for 64-bit and 128-bit vector types.
193 1.1 mrg ;;
194 1.1 mrg ;; As a result, the order of bytes within the register is what GCC
195 1.1 mrg ;; expects for a big-endian target, and subreg offsets therefore work
196 1.1 mrg ;; as expected, with the first element in memory having subreg offset 0
197 1.1 mrg ;; and the last element in memory having the subreg offset associated
198 1.1 mrg ;; with a big-endian lowpart. However, this ordering also means that
199 1.1 mrg ;; GCC's lane numbering does not match the architecture's numbering:
200 1.1 mrg ;; GCC always treats the element at the lowest address in memory
201 1.1 mrg ;; (subreg offset 0) as element 0, while the architecture treats
202 1.1 mrg ;; the least significant end of the register as element 0.
203 1.1 mrg ;;
204 1.1 mrg ;; The situation for SVE is different. We want the layout of the
205 1.1 mrg ;; SVE register to be same for mov<mode> as it is for maskload<mode>:
206 1.1 mrg ;; logically, a mov<mode> load must be indistinguishable from a
207 1.1 mrg ;; maskload<mode> whose mask is all true. We therefore need the
208 1.1 mrg ;; register layout to match LD1 rather than LDR. The ABI layout of
209 1.1 mrg ;; SVE types also matches LD1 byte ordering rather than LDR byte ordering.
210 1.1 mrg ;;
211 1.1 mrg ;; As a result, the architecture lane numbering matches GCC's lane
212 1.1 mrg ;; numbering, with element 0 always being the first in memory.
213 1.1 mrg ;; However:
214 1.1 mrg ;;
215 1.1 mrg ;; - Applying a subreg offset to a register does not give the element
216 1.1 mrg ;; that GCC expects: the first element in memory has the subreg offset
217 1.1 mrg ;; associated with a big-endian lowpart while the last element in memory
218 1.1 mrg ;; has subreg offset 0. We handle this via TARGET_CAN_CHANGE_MODE_CLASS.
219 1.1 mrg ;;
220 1.1 mrg ;; - We cannot use LDR and STR for spill slots that might be accessed
221 1.1 mrg ;; via subregs, since although the elements have the order GCC expects,
222 1.1 mrg ;; the order of the bytes within the elements is different. We instead
223 1.1 mrg ;; access spill slots via LD1 and ST1, using secondary reloads to
224 1.1 mrg ;; reserve a predicate register.
225 1.1.1.3 mrg ;;
226 1.1.1.3 mrg ;; -------------------------------------------------------------------------
227 1.1.1.3 mrg ;; ---- Description of UNSPEC_PTEST
228 1.1.1.3 mrg ;; -------------------------------------------------------------------------
229 1.1.1.3 mrg ;;
230 1.1.1.3 mrg ;; SVE provides a PTEST instruction for testing the active lanes of a
231 1.1.1.3 mrg ;; predicate and setting the flags based on the result. The associated
232 1.1.1.3 mrg ;; condition code tests are:
233 1.1.1.3 mrg ;;
234 1.1.1.3 mrg ;; - any (= ne): at least one active bit is set
235 1.1.1.3 mrg ;; - none (= eq): all active bits are clear (*)
236 1.1.1.3 mrg ;; - first (= mi): the first active bit is set
237 1.1.1.3 mrg ;; - nfrst (= pl): the first active bit is clear (*)
238 1.1.1.3 mrg ;; - last (= cc): the last active bit is set
239 1.1.1.3 mrg ;; - nlast (= cs): the last active bit is clear (*)
240 1.1.1.3 mrg ;;
241 1.1.1.3 mrg ;; where the conditions marked (*) are also true when there are no active
242 1.1.1.3 mrg ;; lanes (i.e. when the governing predicate is a PFALSE). The flags results
243 1.1.1.3 mrg ;; of a PTEST use the condition code mode CC_NZC.
244 1.1.1.3 mrg ;;
245 1.1.1.3 mrg ;; PTEST is always a .B operation (i.e. it always operates on VNx16BI).
246 1.1.1.3 mrg ;; This means that for other predicate modes, we need a governing predicate
247 1.1.1.3 mrg ;; in which all bits are defined.
248 1.1.1.3 mrg ;;
249 1.1.1.3 mrg ;; For example, most predicated .H operations ignore the odd bits of the
250 1.1.1.3 mrg ;; governing predicate, so that an active lane is represented by the
251 1.1.1.3 mrg ;; bits "1x" and an inactive lane by the bits "0x", where "x" can be
252 1.1.1.3 mrg ;; any value. To test a .H predicate, we instead need "10" and "00"
253 1.1.1.3 mrg ;; respectively, so that the condition only tests the even bits of the
254 1.1.1.3 mrg ;; predicate.
255 1.1.1.3 mrg ;;
256 1.1.1.3 mrg ;; Several instructions set the flags as a side-effect, in the same way
257 1.1.1.3 mrg ;; that a separate PTEST would. It's important for code quality that we
258 1.1.1.3 mrg ;; use these flags results as often as possible, particularly in the case
259 1.1.1.3 mrg ;; of WHILE* and RDFFR.
260 1.1.1.3 mrg ;;
261 1.1.1.3 mrg ;; Also, some of the instructions that set the flags are unpredicated
262 1.1.1.3 mrg ;; and instead implicitly test all .B, .H, .S or .D elements, as though
263 1.1.1.3 mrg ;; they were predicated on a PTRUE of that size. For example, a .S
264 1.1.1.3 mrg ;; WHILELO sets the flags in the same way as a PTEST with a .S PTRUE
265 1.1.1.3 mrg ;; would.
266 1.1.1.3 mrg ;;
267 1.1.1.3 mrg ;; We therefore need to represent PTEST operations in a way that
268 1.1.1.3 mrg ;; makes it easy to combine them with both predicated and unpredicated
269 1.1.1.3 mrg ;; operations, while using a VNx16BI governing predicate for all
270 1.1.1.3 mrg ;; predicate modes. We do this using:
271 1.1.1.3 mrg ;;
272 1.1.1.3 mrg ;; (unspec:CC_NZC [gp cast_gp ptrue_flag op] UNSPEC_PTEST)
273 1.1.1.3 mrg ;;
274 1.1.1.3 mrg ;; where:
275 1.1.1.3 mrg ;;
276 1.1.1.3 mrg ;; - GP is the real VNx16BI governing predicate
277 1.1.1.3 mrg ;;
278 1.1.1.3 mrg ;; - CAST_GP is GP cast to the mode of OP. All bits dropped by casting
279 1.1.1.3 mrg ;; GP to CAST_GP are guaranteed to be clear in GP.
280 1.1.1.3 mrg ;;
281 1.1.1.3 mrg ;; - PTRUE_FLAG is a CONST_INT (conceptually of mode SI) that has the value
282 1.1.1.3 mrg ;; SVE_KNOWN_PTRUE if we know that CAST_GP (rather than GP) is all-true and
283 1.1.1.3 mrg ;; SVE_MAYBE_NOT_PTRUE otherwise.
284 1.1.1.3 mrg ;;
285 1.1.1.3 mrg ;; - OP is the predicate we want to test, of the same mode as CAST_GP.
286 1.1.1.3 mrg ;;
287 1.1.1.3 mrg ;; -------------------------------------------------------------------------
288 1.1.1.3 mrg ;; ---- Description of UNSPEC_PRED_Z
289 1.1.1.3 mrg ;; -------------------------------------------------------------------------
290 1.1.1.3 mrg ;;
291 1.1.1.3 mrg ;; SVE integer comparisons are predicated and return zero for inactive
292 1.1.1.3 mrg ;; lanes. Sometimes we use them with predicates that are all-true and
293 1.1.1.3 mrg ;; sometimes we use them with general predicates.
294 1.1.1.3 mrg ;;
295 1.1.1.3 mrg ;; The integer comparisons also set the flags and so build-in the effect
296 1.1.1.3 mrg ;; of a PTEST. We therefore want to be able to combine integer comparison
297 1.1.1.3 mrg ;; patterns with PTESTs of the result. One difficulty with doing this is
298 1.1.1.3 mrg ;; that (as noted above) the PTEST is always a .B operation and so can place
299 1.1.1.3 mrg ;; stronger requirements on the governing predicate than the comparison does.
300 1.1.1.3 mrg ;;
301 1.1.1.3 mrg ;; For example, when applying a separate PTEST to the result of a full-vector
302 1.1.1.3 mrg ;; .H comparison, the PTEST must be predicated on a .H PTRUE instead of a
303 1.1.1.3 mrg ;; .B PTRUE. In constrast, the comparison might be predicated on either
304 1.1.1.3 mrg ;; a .H PTRUE or a .B PTRUE, since the values of odd-indexed predicate
305 1.1.1.3 mrg ;; bits don't matter for .H operations.
306 1.1.1.3 mrg ;;
307 1.1.1.3 mrg ;; We therefore can't rely on a full-vector comparison using the same
308 1.1.1.3 mrg ;; predicate register as a following PTEST. We instead need to remember
309 1.1.1.3 mrg ;; whether a comparison is known to be a full-vector comparison and use
310 1.1.1.3 mrg ;; this information in addition to a check for equal predicate registers.
311 1.1.1.3 mrg ;; At the same time, it's useful to have a common representation for all
312 1.1.1.3 mrg ;; integer comparisons, so that they can be handled by a single set of
313 1.1.1.3 mrg ;; patterns.
314 1.1.1.3 mrg ;;
315 1.1.1.3 mrg ;; We therefore take a similar approach to UNSPEC_PTEST above and use:
316 1.1.1.3 mrg ;;
317 1.1.1.3 mrg ;; (unspec:<M:VPRED> [gp ptrue_flag (code:M op0 op1)] UNSPEC_PRED_Z)
318 1.1.1.3 mrg ;;
319 1.1.1.3 mrg ;; where:
320 1.1.1.3 mrg ;;
321 1.1.1.3 mrg ;; - GP is the governing predicate, of mode <M:VPRED>
322 1.1.1.3 mrg ;;
323 1.1.1.3 mrg ;; - PTRUE_FLAG is a CONST_INT (conceptually of mode SI) that has the value
324 1.1.1.3 mrg ;; SVE_KNOWN_PTRUE if we know that GP is all-true and SVE_MAYBE_NOT_PTRUE
325 1.1.1.3 mrg ;; otherwise
326 1.1.1.3 mrg ;;
327 1.1.1.3 mrg ;; - CODE is the comparison code
328 1.1.1.3 mrg ;;
329 1.1.1.3 mrg ;; - OP0 and OP1 are the values being compared, of mode M
330 1.1.1.3 mrg ;;
331 1.1.1.3 mrg ;; The "Z" in UNSPEC_PRED_Z indicates that inactive lanes are zero.
332 1.1.1.3 mrg ;;
333 1.1.1.3 mrg ;; -------------------------------------------------------------------------
334 1.1.1.3 mrg ;; ---- Note on predicated integer arithemtic and UNSPEC_PRED_X
335 1.1.1.3 mrg ;; -------------------------------------------------------------------------
336 1.1.1.3 mrg ;;
337 1.1.1.3 mrg ;; Many SVE integer operations are predicated. We can generate them
338 1.1.1.3 mrg ;; from four sources:
339 1.1.1.3 mrg ;;
340 1.1.1.3 mrg ;; (1) Using normal unpredicated optabs. In this case we need to create
341 1.1.1.3 mrg ;; an all-true predicate register to act as the governing predicate
342 1.1.1.3 mrg ;; for the SVE instruction. There are no inactive lanes, and thus
343 1.1.1.3 mrg ;; the values of inactive lanes don't matter.
344 1.1.1.3 mrg ;;
345 1.1.1.3 mrg ;; (2) Using _x ACLE functions. In this case the function provides a
346 1.1.1.3 mrg ;; specific predicate and some lanes might be inactive. However,
347 1.1.1.3 mrg ;; as for (1), the values of the inactive lanes don't matter.
348 1.1.1.3 mrg ;; We can make extra lanes active without changing the behavior
349 1.1.1.3 mrg ;; (although for code-quality reasons we should avoid doing so
350 1.1.1.3 mrg ;; needlessly).
351 1.1.1.3 mrg ;;
352 1.1.1.3 mrg ;; (3) Using cond_* optabs that correspond to IFN_COND_* internal functions.
353 1.1.1.3 mrg ;; These optabs have a predicate operand that specifies which lanes are
354 1.1.1.3 mrg ;; active and another operand that provides the values of inactive lanes.
355 1.1.1.3 mrg ;;
356 1.1.1.3 mrg ;; (4) Using _m and _z ACLE functions. These functions map to the same
357 1.1.1.3 mrg ;; patterns as (3), with the _z functions setting inactive lanes to zero
358 1.1.1.3 mrg ;; and the _m functions setting the inactive lanes to one of the function
359 1.1.1.3 mrg ;; arguments.
360 1.1.1.3 mrg ;;
361 1.1.1.3 mrg ;; For (1) and (2) we need a way of attaching the predicate to a normal
362 1.1.1.3 mrg ;; unpredicated integer operation. We do this using:
363 1.1.1.3 mrg ;;
364 1.1.1.3 mrg ;; (unspec:M [pred (code:M (op0 op1 ...))] UNSPEC_PRED_X)
365 1.1.1.3 mrg ;;
366 1.1.1.3 mrg ;; where (code:M (op0 op1 ...)) is the normal integer operation and PRED
367 1.1.1.3 mrg ;; is a predicate of mode <M:VPRED>. PRED might or might not be a PTRUE;
368 1.1.1.3 mrg ;; it always is for (1), but might not be for (2).
369 1.1.1.3 mrg ;;
370 1.1.1.3 mrg ;; The unspec as a whole has the same value as (code:M ...) when PRED is
371 1.1.1.3 mrg ;; all-true. It is always semantically valid to replace PRED with a PTRUE,
372 1.1.1.3 mrg ;; but as noted above, we should only do so if there's a specific benefit.
373 1.1.1.3 mrg ;;
374 1.1.1.3 mrg ;; (The "_X" in the unspec is named after the ACLE functions in (2).)
375 1.1.1.3 mrg ;;
376 1.1.1.3 mrg ;; For (3) and (4) we can simply use the SVE port's normal representation
377 1.1.1.3 mrg ;; of a predicate-based select:
378 1.1.1.3 mrg ;;
379 1.1.1.3 mrg ;; (unspec:M [pred (code:M (op0 op1 ...)) inactive] UNSPEC_SEL)
380 1.1.1.3 mrg ;;
381 1.1.1.3 mrg ;; where INACTIVE specifies the values of inactive lanes.
382 1.1.1.3 mrg ;;
383 1.1.1.3 mrg ;; We can also use the UNSPEC_PRED_X wrapper in the UNSPEC_SEL rather
384 1.1.1.3 mrg ;; than inserting the integer operation directly. This is mostly useful
385 1.1.1.3 mrg ;; if we want the combine pass to merge an integer operation with an explicit
386 1.1.1.3 mrg ;; vcond_mask (in other words, with a following SEL instruction). However,
387 1.1.1.3 mrg ;; it's generally better to merge such operations at the gimple level
388 1.1.1.3 mrg ;; using (3).
389 1.1.1.3 mrg ;;
390 1.1.1.3 mrg ;; -------------------------------------------------------------------------
391 1.1.1.3 mrg ;; ---- Note on predicated FP arithmetic patterns and GP "strictness"
392 1.1.1.3 mrg ;; -------------------------------------------------------------------------
393 1.1.1.3 mrg ;;
394 1.1.1.3 mrg ;; Most SVE floating-point operations are predicated. We can generate
395 1.1.1.3 mrg ;; them from four sources:
396 1.1.1.3 mrg ;;
397 1.1.1.3 mrg ;; (1) Using normal unpredicated optabs. In this case we need to create
398 1.1.1.3 mrg ;; an all-true predicate register to act as the governing predicate
399 1.1.1.3 mrg ;; for the SVE instruction. There are no inactive lanes, and thus
400 1.1.1.3 mrg ;; the values of inactive lanes don't matter.
401 1.1.1.3 mrg ;;
402 1.1.1.3 mrg ;; (2) Using _x ACLE functions. In this case the function provides a
403 1.1.1.3 mrg ;; specific predicate and some lanes might be inactive. However,
404 1.1.1.3 mrg ;; as for (1), the values of the inactive lanes don't matter.
405 1.1.1.3 mrg ;;
406 1.1.1.3 mrg ;; The instruction must have the same exception behavior as the
407 1.1.1.3 mrg ;; function call unless things like command-line flags specifically
408 1.1.1.3 mrg ;; allow otherwise. For example, with -ffast-math, it is OK to
409 1.1.1.3 mrg ;; raise exceptions for inactive lanes, but normally it isn't.
410 1.1.1.3 mrg ;;
411 1.1.1.3 mrg ;; (3) Using cond_* optabs that correspond to IFN_COND_* internal functions.
412 1.1.1.3 mrg ;; These optabs have a predicate operand that specifies which lanes are
413 1.1.1.3 mrg ;; active and another operand that provides the values of inactive lanes.
414 1.1.1.3 mrg ;;
415 1.1.1.3 mrg ;; (4) Using _m and _z ACLE functions. These functions map to the same
416 1.1.1.3 mrg ;; patterns as (3), with the _z functions setting inactive lanes to zero
417 1.1.1.3 mrg ;; and the _m functions setting the inactive lanes to one of the function
418 1.1.1.3 mrg ;; arguments.
419 1.1.1.3 mrg ;;
420 1.1.1.3 mrg ;; So:
421 1.1.1.3 mrg ;;
422 1.1.1.3 mrg ;; - In (1), the predicate is known to be all true and the pattern can use
423 1.1.1.3 mrg ;; unpredicated operations where available.
424 1.1.1.3 mrg ;;
425 1.1.1.3 mrg ;; - In (2), the predicate might or might not be all true. The pattern can
426 1.1.1.3 mrg ;; use unpredicated instructions if the predicate is all-true or if things
427 1.1.1.3 mrg ;; like command-line flags allow exceptions for inactive lanes.
428 1.1.1.3 mrg ;;
429 1.1.1.3 mrg ;; - (3) and (4) represent a native SVE predicated operation. Some lanes
430 1.1.1.3 mrg ;; might be inactive and inactive lanes of the result must have specific
431 1.1.1.3 mrg ;; values. There is no scope for using unpredicated instructions (and no
432 1.1.1.3 mrg ;; reason to want to), so the question about command-line flags doesn't
433 1.1.1.3 mrg ;; arise.
434 1.1.1.3 mrg ;;
435 1.1.1.3 mrg ;; It would be inaccurate to model (2) as an rtx code like (sqrt ...)
436 1.1.1.3 mrg ;; in combination with a separate predicate operand, e.g.
437 1.1.1.3 mrg ;;
438 1.1.1.3 mrg ;; (unspec [(match_operand:<VPRED> 1 "register_operand" "Upl")
439 1.1.1.3 mrg ;; (sqrt:SVE_FULL_F 2 "register_operand" "w")]
440 1.1.1.3 mrg ;; ....)
441 1.1.1.3 mrg ;;
442 1.1.1.3 mrg ;; because (sqrt ...) can raise an exception for any lane, including
443 1.1.1.3 mrg ;; inactive ones. We therefore need to use an unspec instead.
444 1.1.1.3 mrg ;;
445 1.1.1.3 mrg ;; Also, (2) requires some way of distinguishing the case in which the
446 1.1.1.3 mrg ;; predicate might have inactive lanes and cannot be changed from the
447 1.1.1.3 mrg ;; case in which the predicate has no inactive lanes or can be changed.
448 1.1.1.3 mrg ;; This information is also useful when matching combined FP patterns
449 1.1.1.3 mrg ;; in which the predicates might not be equal.
450 1.1.1.3 mrg ;;
451 1.1.1.3 mrg ;; We therefore model FP operations as an unspec of the form:
452 1.1.1.3 mrg ;;
453 1.1.1.3 mrg ;; (unspec [pred strictness op0 op1 ...] UNSPEC_COND_<MNEMONIC>)
454 1.1.1.3 mrg ;;
455 1.1.1.3 mrg ;; where:
456 1.1.1.3 mrg ;;
457 1.1.1.3 mrg ;; - PRED is the governing predicate.
458 1.1.1.3 mrg ;;
459 1.1.1.3 mrg ;; - STRICTNESS is a CONST_INT that conceptually has mode SI. It has the
460 1.1.1.3 mrg ;; value SVE_STRICT_GP if PRED might have inactive lanes and if those
461 1.1.1.3 mrg ;; lanes must remain inactive. It has the value SVE_RELAXED_GP otherwise.
462 1.1.1.3 mrg ;;
463 1.1.1.3 mrg ;; - OP0 OP1 ... are the normal input operands to the operation.
464 1.1.1.3 mrg ;;
465 1.1.1.3 mrg ;; - MNEMONIC is the mnemonic of the associated SVE instruction.
466 1.1.1.3 mrg ;;
467 1.1.1.3 mrg ;; For (3) and (4), we combine these operations with an UNSPEC_SEL
468 1.1.1.3 mrg ;; that selects between the result of the FP operation and the "else"
469 1.1.1.3 mrg ;; value. (This else value is a merge input for _m ACLE functions
470 1.1.1.3 mrg ;; and zero for _z ACLE functions.) The outer pattern then has the form:
471 1.1.1.3 mrg ;;
472 1.1.1.3 mrg ;; (unspec [pred fp_operation else_value] UNSPEC_SEL)
473 1.1.1.3 mrg ;;
474 1.1.1.3 mrg ;; This means that the patterns for (3) and (4) have two predicates:
475 1.1.1.3 mrg ;; one for the FP operation itself and one for the UNSPEC_SEL.
476 1.1.1.3 mrg ;; This pattern is equivalent to the result of combining an instance
477 1.1.1.3 mrg ;; of (1) or (2) with a separate vcond instruction, so these patterns
478 1.1.1.3 mrg ;; are useful as combine targets too.
479 1.1.1.3 mrg ;;
480 1.1.1.3 mrg ;; However, in the combine case, the instructions that we want to
481 1.1.1.3 mrg ;; combine might use different predicates. Then:
482 1.1.1.3 mrg ;;
483 1.1.1.3 mrg ;; - Some of the active lanes of the FP operation might be discarded
484 1.1.1.3 mrg ;; by the UNSPEC_SEL. It's OK to drop the FP operation on those lanes,
485 1.1.1.3 mrg ;; even for SVE_STRICT_GP, since the operations on those lanes are
486 1.1.1.3 mrg ;; effectively dead code.
487 1.1.1.3 mrg ;;
488 1.1.1.3 mrg ;; - Some of the inactive lanes of the FP operation might be selected
489 1.1.1.3 mrg ;; by the UNSPEC_SEL, giving unspecified values for those lanes.
490 1.1.1.3 mrg ;; SVE_RELAXED_GP lets us extend the FP operation to cover these
491 1.1.1.3 mrg ;; extra lanes, but SVE_STRICT_GP does not.
492 1.1.1.3 mrg ;;
493 1.1.1.3 mrg ;; Thus SVE_RELAXED_GP allows us to ignore the predicate on the FP operation
494 1.1.1.3 mrg ;; and operate on exactly the lanes selected by the UNSPEC_SEL predicate.
495 1.1.1.3 mrg ;; This typically leads to patterns like:
496 1.1.1.3 mrg ;;
497 1.1.1.3 mrg ;; (unspec [(match_operand 1 "register_operand" "Upl")
498 1.1.1.3 mrg ;; (unspec [(match_operand N)
499 1.1.1.3 mrg ;; (const_int SVE_RELAXED_GP)
500 1.1.1.3 mrg ;; ...]
501 1.1.1.3 mrg ;; UNSPEC_COND_<MNEMONIC>)
502 1.1.1.3 mrg ;; ...])
503 1.1.1.3 mrg ;;
504 1.1.1.3 mrg ;; where operand N is allowed to be anything. These instructions then
505 1.1.1.3 mrg ;; have rewrite rules to replace operand N with operand 1, which gives the
506 1.1.1.3 mrg ;; instructions a canonical form and means that the original operand N is
507 1.1.1.3 mrg ;; not kept live unnecessarily.
508 1.1.1.3 mrg ;;
509 1.1.1.3 mrg ;; In contrast, SVE_STRICT_GP only allows the UNSPEC_SEL predicate to be
510 1.1.1.3 mrg ;; a subset of the FP operation predicate. This case isn't interesting
511 1.1.1.3 mrg ;; for FP operations that have an all-true predicate, since such operations
512 1.1.1.3 mrg ;; use SVE_RELAXED_GP instead. And it is not possible for instruction
513 1.1.1.3 mrg ;; conditions to track the subset relationship for arbitrary registers.
514 1.1.1.3 mrg ;; So in practice, the only useful case for SVE_STRICT_GP is the one
515 1.1.1.3 mrg ;; in which the predicates match:
516 1.1.1.3 mrg ;;
517 1.1.1.3 mrg ;; (unspec [(match_operand 1 "register_operand" "Upl")
518 1.1.1.3 mrg ;; (unspec [(match_dup 1)
519 1.1.1.3 mrg ;; (const_int SVE_STRICT_GP)
520 1.1.1.3 mrg ;; ...]
521 1.1.1.3 mrg ;; UNSPEC_COND_<MNEMONIC>)
522 1.1.1.3 mrg ;; ...])
523 1.1.1.3 mrg ;;
524 1.1.1.3 mrg ;; This pattern would also be correct for SVE_RELAXED_GP, but it would
525 1.1.1.3 mrg ;; be redundant with the one above. However, if the combine pattern
526 1.1.1.3 mrg ;; has multiple FP operations, using a match_operand allows combinations
527 1.1.1.3 mrg ;; of SVE_STRICT_GP and SVE_RELAXED_GP in the same operation, provided
528 1.1.1.3 mrg ;; that the predicates are the same:
529 1.1.1.3 mrg ;;
530 1.1.1.3 mrg ;; (unspec [(match_operand 1 "register_operand" "Upl")
531 1.1.1.3 mrg ;; (...
532 1.1.1.3 mrg ;; (unspec [(match_dup 1)
533 1.1.1.3 mrg ;; (match_operand:SI N "aarch64_sve_gp_strictness")
534 1.1.1.3 mrg ;; ...]
535 1.1.1.3 mrg ;; UNSPEC_COND_<MNEMONIC1>)
536 1.1.1.3 mrg ;; (unspec [(match_dup 1)
537 1.1.1.3 mrg ;; (match_operand:SI M "aarch64_sve_gp_strictness")
538 1.1.1.3 mrg ;; ...]
539 1.1.1.3 mrg ;; UNSPEC_COND_<MNEMONIC2>) ...)
540 1.1.1.3 mrg ;; ...])
541 1.1.1.3 mrg ;;
542 1.1.1.3 mrg ;; The fully-relaxed version of this pattern is:
543 1.1.1.3 mrg ;;
544 1.1.1.3 mrg ;; (unspec [(match_operand 1 "register_operand" "Upl")
545 1.1.1.3 mrg ;; (...
546 1.1.1.3 mrg ;; (unspec [(match_operand:SI N)
547 1.1.1.3 mrg ;; (const_int SVE_RELAXED_GP)
548 1.1.1.3 mrg ;; ...]
549 1.1.1.3 mrg ;; UNSPEC_COND_<MNEMONIC1>)
550 1.1.1.3 mrg ;; (unspec [(match_operand:SI M)
551 1.1.1.3 mrg ;; (const_int SVE_RELAXED_GP)
552 1.1.1.3 mrg ;; ...]
553 1.1.1.3 mrg ;; UNSPEC_COND_<MNEMONIC2>) ...)
554 1.1.1.3 mrg ;; ...])
555 1.1.1.3 mrg ;;
556 1.1.1.3 mrg ;; -------------------------------------------------------------------------
557 1.1.1.3 mrg ;; ---- Note on FFR handling
558 1.1.1.3 mrg ;; -------------------------------------------------------------------------
559 1.1.1.3 mrg ;;
560 1.1.1.3 mrg ;; Logically we want to divide FFR-related instructions into regions
561 1.1.1.3 mrg ;; that contain exactly one of:
562 1.1.1.3 mrg ;;
563 1.1.1.3 mrg ;; - a single write to the FFR
564 1.1.1.3 mrg ;; - any number of reads from the FFR (but only one read is likely)
565 1.1.1.3 mrg ;; - any number of LDFF1 and LDNF1 instructions
566 1.1.1.3 mrg ;;
567 1.1.1.3 mrg ;; However, LDFF1 and LDNF1 instructions should otherwise behave like
568 1.1.1.3 mrg ;; normal loads as far as possible. This means that they should be
569 1.1.1.3 mrg ;; schedulable within a region in the same way that LD1 would be,
570 1.1.1.3 mrg ;; and they should be deleted as dead if the result is unused. The loads
571 1.1.1.3 mrg ;; should therefore not write to the FFR, since that would both serialize
572 1.1.1.3 mrg ;; the loads with respect to each other and keep the loads live for any
573 1.1.1.3 mrg ;; later RDFFR.
574 1.1.1.3 mrg ;;
575 1.1.1.3 mrg ;; We get around this by using a fake "FFR token" (FFRT) to help describe
576 1.1.1.3 mrg ;; the dependencies. Writing to the FFRT starts a new "FFRT region",
577 1.1.1.3 mrg ;; while using the FFRT keeps the instruction within its region.
578 1.1.1.3 mrg ;; Specifically:
579 1.1.1.3 mrg ;;
580 1.1.1.3 mrg ;; - Writes start a new FFRT region as well as setting the FFR:
581 1.1.1.3 mrg ;;
582 1.1.1.3 mrg ;; W1: parallel (FFRT = <new value>, FFR = <actual FFR value>)
583 1.1.1.3 mrg ;;
584 1.1.1.3 mrg ;; - Loads use an LD1-like instruction that also uses the FFRT, so that the
585 1.1.1.3 mrg ;; loads stay within the same FFRT region:
586 1.1.1.3 mrg ;;
587 1.1.1.3 mrg ;; L1: load data while using the FFRT
588 1.1.1.3 mrg ;;
589 1.1.1.3 mrg ;; In addition, any FFRT region that includes a load also has at least one
590 1.1.1.3 mrg ;; instance of:
591 1.1.1.3 mrg ;;
592 1.1.1.3 mrg ;; L2: FFR = update(FFR, FFRT) [type == no_insn]
593 1.1.1.3 mrg ;;
594 1.1.1.3 mrg ;; to make it clear that the region both reads from and writes to the FFR.
595 1.1.1.3 mrg ;;
596 1.1.1.3 mrg ;; - Reads do the following:
597 1.1.1.3 mrg ;;
598 1.1.1.3 mrg ;; R1: FFRT = FFR [type == no_insn]
599 1.1.1.3 mrg ;; R2: read from the FFRT
600 1.1.1.3 mrg ;; R3: FFRT = update(FFRT) [type == no_insn]
601 1.1.1.3 mrg ;;
602 1.1.1.3 mrg ;; R1 and R3 both create new FFRT regions, so that previous LDFF1s and
603 1.1.1.3 mrg ;; LDNF1s cannot move forwards across R1 and later LDFF1s and LDNF1s
604 1.1.1.3 mrg ;; cannot move backwards across R3.
605 1.1.1.3 mrg ;;
606 1.1.1.3 mrg ;; This way, writes are only kept alive by later loads or reads,
607 1.1.1.3 mrg ;; and write/read pairs fold normally. For two consecutive reads,
608 1.1.1.3 mrg ;; the first R3 is made dead by the second R1, which in turn becomes
609 1.1.1.3 mrg ;; redundant with the first R1. We then have:
610 1.1.1.3 mrg ;;
611 1.1.1.3 mrg ;; first R1: FFRT = FFR
612 1.1.1.3 mrg ;; first read from the FFRT
613 1.1.1.3 mrg ;; second read from the FFRT
614 1.1.1.3 mrg ;; second R3: FFRT = update(FFRT)
615 1.1.1.3 mrg ;;
616 1.1.1.3 mrg ;; i.e. the two FFRT regions collapse into a single one with two
617 1.1.1.3 mrg ;; independent reads.
618 1.1.1.3 mrg ;;
619 1.1.1.3 mrg ;; The model still prevents some valid optimizations though. For example,
620 1.1.1.3 mrg ;; if all loads in an FFRT region are deleted as dead, nothing would remove
621 1.1.1.3 mrg ;; the L2 instructions.
622 1.1.1.3 mrg
623 1.1.1.3 mrg ;; =========================================================================
624 1.1.1.3 mrg ;; == Moves
625 1.1.1.3 mrg ;; =========================================================================
626 1.1.1.3 mrg
627 1.1.1.3 mrg ;; -------------------------------------------------------------------------
628 1.1.1.3 mrg ;; ---- Moves of single vectors
629 1.1.1.3 mrg ;; -------------------------------------------------------------------------
630 1.1.1.3 mrg ;; Includes:
631 1.1.1.3 mrg ;; - MOV (including aliases)
632 1.1.1.3 mrg ;; - LD1B (contiguous form)
633 1.1.1.3 mrg ;; - LD1D ( " " )
634 1.1.1.3 mrg ;; - LD1H ( " " )
635 1.1.1.3 mrg ;; - LD1W ( " " )
636 1.1.1.3 mrg ;; - LDR
637 1.1.1.3 mrg ;; - ST1B (contiguous form)
638 1.1.1.3 mrg ;; - ST1D ( " " )
639 1.1.1.3 mrg ;; - ST1H ( " " )
640 1.1.1.3 mrg ;; - ST1W ( " " )
641 1.1.1.3 mrg ;; - STR
642 1.1.1.3 mrg ;; -------------------------------------------------------------------------
643 1.1 mrg
644 1.1 mrg (define_expand "mov<mode>"
645 1.1 mrg [(set (match_operand:SVE_ALL 0 "nonimmediate_operand")
646 1.1 mrg (match_operand:SVE_ALL 1 "general_operand"))]
647 1.1 mrg "TARGET_SVE"
648 1.1 mrg {
649 1.1 mrg /* Use the predicated load and store patterns where possible.
650 1.1 mrg This is required for big-endian targets (see the comment at the
651 1.1 mrg head of the file) and increases the addressing choices for
652 1.1 mrg little-endian. */
653 1.1 mrg if ((MEM_P (operands[0]) || MEM_P (operands[1]))
654 1.1.1.3 mrg && can_create_pseudo_p ())
655 1.1 mrg {
656 1.1 mrg aarch64_expand_sve_mem_move (operands[0], operands[1], <VPRED>mode);
657 1.1 mrg DONE;
658 1.1 mrg }
659 1.1 mrg
660 1.1 mrg if (CONSTANT_P (operands[1]))
661 1.1 mrg {
662 1.1.1.3 mrg aarch64_expand_mov_immediate (operands[0], operands[1]);
663 1.1 mrg DONE;
664 1.1 mrg }
665 1.1 mrg
666 1.1 mrg /* Optimize subregs on big-endian targets: we can use REV[BHW]
667 1.1 mrg instead of going through memory. */
668 1.1 mrg if (BYTES_BIG_ENDIAN
669 1.1.1.3 mrg && aarch64_maybe_expand_sve_subreg_move (operands[0], operands[1]))
670 1.1 mrg DONE;
671 1.1 mrg }
672 1.1 mrg )
673 1.1 mrg
674 1.1.1.3 mrg (define_expand "movmisalign<mode>"
675 1.1.1.3 mrg [(set (match_operand:SVE_ALL 0 "nonimmediate_operand")
676 1.1.1.3 mrg (match_operand:SVE_ALL 1 "general_operand"))]
677 1.1.1.3 mrg "TARGET_SVE"
678 1.1 mrg {
679 1.1.1.3 mrg /* Equivalent to a normal move for our purpooses. */
680 1.1.1.3 mrg emit_move_insn (operands[0], operands[1]);
681 1.1 mrg DONE;
682 1.1 mrg }
683 1.1 mrg )
684 1.1 mrg
685 1.1.1.3 mrg ;; Unpredicated moves that can use LDR and STR, i.e. full vectors for which
686 1.1.1.3 mrg ;; little-endian ordering is acceptable. Only allow memory operations during
687 1.1.1.3 mrg ;; and after RA; before RA we want the predicated load and store patterns to
688 1.1.1.3 mrg ;; be used instead.
689 1.1.1.3 mrg (define_insn "*aarch64_sve_mov<mode>_ldr_str"
690 1.1.1.3 mrg [(set (match_operand:SVE_FULL 0 "aarch64_sve_nonimmediate_operand" "=w, Utr, w, w")
691 1.1.1.3 mrg (match_operand:SVE_FULL 1 "aarch64_sve_general_operand" "Utr, w, w, Dn"))]
692 1.1 mrg "TARGET_SVE
693 1.1.1.3 mrg && (<MODE>mode == VNx16QImode || !BYTES_BIG_ENDIAN)
694 1.1 mrg && ((lra_in_progress || reload_completed)
695 1.1 mrg || (register_operand (operands[0], <MODE>mode)
696 1.1 mrg && nonmemory_operand (operands[1], <MODE>mode)))"
697 1.1 mrg "@
698 1.1 mrg ldr\t%0, %1
699 1.1 mrg str\t%1, %0
700 1.1 mrg mov\t%0.d, %1.d
701 1.1 mrg * return aarch64_output_sve_mov_immediate (operands[1]);"
702 1.1 mrg )
703 1.1 mrg
704 1.1.1.3 mrg ;; Unpredicated moves that cannot use LDR and STR, i.e. partial vectors
705 1.1.1.3 mrg ;; or vectors for which little-endian ordering isn't acceptable. Memory
706 1.1.1.3 mrg ;; accesses require secondary reloads.
707 1.1.1.3 mrg (define_insn "*aarch64_sve_mov<mode>_no_ldr_str"
708 1.1 mrg [(set (match_operand:SVE_ALL 0 "register_operand" "=w, w")
709 1.1 mrg (match_operand:SVE_ALL 1 "aarch64_nonmemory_operand" "w, Dn"))]
710 1.1.1.3 mrg "TARGET_SVE
711 1.1.1.3 mrg && <MODE>mode != VNx16QImode
712 1.1.1.3 mrg && (BYTES_BIG_ENDIAN
713 1.1.1.3 mrg || maybe_ne (BYTES_PER_SVE_VECTOR, GET_MODE_SIZE (<MODE>mode)))"
714 1.1 mrg "@
715 1.1 mrg mov\t%0.d, %1.d
716 1.1 mrg * return aarch64_output_sve_mov_immediate (operands[1]);"
717 1.1 mrg )
718 1.1 mrg
719 1.1.1.3 mrg ;; Handle memory reloads for modes that can't use LDR and STR. We use
720 1.1.1.3 mrg ;; byte PTRUE for all modes to try to encourage reuse. This pattern
721 1.1.1.3 mrg ;; needs constraints because it is returned by TARGET_SECONDARY_RELOAD.
722 1.1.1.3 mrg (define_expand "aarch64_sve_reload_mem"
723 1.1 mrg [(parallel
724 1.1 mrg [(set (match_operand 0)
725 1.1.1.3 mrg (match_operand 1))
726 1.1 mrg (clobber (match_operand:VNx16BI 2 "register_operand" "=Upl"))])]
727 1.1.1.3 mrg "TARGET_SVE"
728 1.1 mrg {
729 1.1 mrg /* Create a PTRUE. */
730 1.1 mrg emit_move_insn (operands[2], CONSTM1_RTX (VNx16BImode));
731 1.1 mrg
732 1.1 mrg /* Refer to the PTRUE in the appropriate mode for this move. */
733 1.1 mrg machine_mode mode = GET_MODE (operands[0]);
734 1.1.1.3 mrg rtx pred = gen_lowpart (aarch64_sve_pred_mode (mode), operands[2]);
735 1.1 mrg
736 1.1 mrg /* Emit a predicated load or store. */
737 1.1 mrg aarch64_emit_sve_pred_move (operands[0], pred, operands[1]);
738 1.1 mrg DONE;
739 1.1 mrg }
740 1.1 mrg )
741 1.1 mrg
742 1.1.1.3 mrg ;; A predicated move in which the predicate is known to be all-true.
743 1.1.1.3 mrg ;; Note that this pattern is generated directly by aarch64_emit_sve_pred_move,
744 1.1.1.3 mrg ;; so changes to this pattern will need changes there as well.
745 1.1.1.2 mrg (define_insn_and_split "@aarch64_pred_mov<mode>"
746 1.1.1.2 mrg [(set (match_operand:SVE_ALL 0 "nonimmediate_operand" "=w, w, m")
747 1.1 mrg (unspec:SVE_ALL
748 1.1.1.2 mrg [(match_operand:<VPRED> 1 "register_operand" "Upl, Upl, Upl")
749 1.1.1.2 mrg (match_operand:SVE_ALL 2 "nonimmediate_operand" "w, m, w")]
750 1.1.1.3 mrg UNSPEC_PRED_X))]
751 1.1 mrg "TARGET_SVE
752 1.1 mrg && (register_operand (operands[0], <MODE>mode)
753 1.1 mrg || register_operand (operands[2], <MODE>mode))"
754 1.1 mrg "@
755 1.1.1.2 mrg #
756 1.1.1.3 mrg ld1<Vesize>\t%0.<Vctype>, %1/z, %2
757 1.1.1.3 mrg st1<Vesize>\t%2.<Vctype>, %1, %0"
758 1.1.1.2 mrg "&& register_operand (operands[0], <MODE>mode)
759 1.1.1.2 mrg && register_operand (operands[2], <MODE>mode)"
760 1.1.1.2 mrg [(set (match_dup 0) (match_dup 2))]
761 1.1 mrg )
762 1.1 mrg
763 1.1.1.3 mrg ;; A pattern for optimizing SUBREGs that have a reinterpreting effect
764 1.1.1.3 mrg ;; on big-endian targets; see aarch64_maybe_expand_sve_subreg_move
765 1.1.1.3 mrg ;; for details. We use a special predicate for operand 2 to reduce
766 1.1.1.3 mrg ;; the number of patterns.
767 1.1.1.3 mrg (define_insn_and_split "*aarch64_sve_mov<mode>_subreg_be"
768 1.1.1.3 mrg [(set (match_operand:SVE_ALL 0 "aarch64_sve_nonimmediate_operand" "=w")
769 1.1.1.3 mrg (unspec:SVE_ALL
770 1.1.1.3 mrg [(match_operand:VNx16BI 1 "register_operand" "Upl")
771 1.1.1.3 mrg (match_operand 2 "aarch64_any_register_operand" "w")]
772 1.1.1.3 mrg UNSPEC_REV_SUBREG))]
773 1.1.1.3 mrg "TARGET_SVE && BYTES_BIG_ENDIAN"
774 1.1.1.3 mrg "#"
775 1.1.1.3 mrg "&& reload_completed"
776 1.1.1.3 mrg [(const_int 0)]
777 1.1 mrg {
778 1.1.1.3 mrg aarch64_split_sve_subreg_move (operands[0], operands[1], operands[2]);
779 1.1 mrg DONE;
780 1.1 mrg }
781 1.1 mrg )
782 1.1 mrg
783 1.1.1.3 mrg ;; Reinterpret operand 1 in operand 0's mode, without changing its contents.
784 1.1.1.3 mrg ;; This is equivalent to a subreg on little-endian targets but not for
785 1.1.1.3 mrg ;; big-endian; see the comment at the head of the file for details.
786 1.1.1.3 mrg (define_expand "@aarch64_sve_reinterpret<mode>"
787 1.1.1.3 mrg [(set (match_operand:SVE_ALL 0 "register_operand")
788 1.1 mrg (unspec:SVE_ALL
789 1.1.1.3 mrg [(match_operand 1 "aarch64_any_register_operand")]
790 1.1.1.3 mrg UNSPEC_REINTERPRET))]
791 1.1 mrg "TARGET_SVE"
792 1.1 mrg {
793 1.1.1.3 mrg machine_mode src_mode = GET_MODE (operands[1]);
794 1.1.1.3 mrg if (targetm.can_change_mode_class (<MODE>mode, src_mode, FP_REGS))
795 1.1.1.3 mrg {
796 1.1.1.3 mrg emit_move_insn (operands[0], gen_lowpart (<MODE>mode, operands[1]));
797 1.1.1.3 mrg DONE;
798 1.1.1.3 mrg }
799 1.1 mrg }
800 1.1 mrg )
801 1.1 mrg
802 1.1.1.3 mrg ;; A pattern for handling type punning on big-endian targets. We use a
803 1.1.1.3 mrg ;; special predicate for operand 1 to reduce the number of patterns.
804 1.1.1.3 mrg (define_insn_and_split "*aarch64_sve_reinterpret<mode>"
805 1.1.1.3 mrg [(set (match_operand:SVE_ALL 0 "register_operand" "=w")
806 1.1.1.3 mrg (unspec:SVE_ALL
807 1.1.1.3 mrg [(match_operand 1 "aarch64_any_register_operand" "w")]
808 1.1.1.3 mrg UNSPEC_REINTERPRET))]
809 1.1 mrg "TARGET_SVE"
810 1.1.1.3 mrg "#"
811 1.1.1.3 mrg "&& reload_completed"
812 1.1.1.3 mrg [(set (match_dup 0) (match_dup 1))]
813 1.1 mrg {
814 1.1.1.3 mrg operands[1] = aarch64_replace_reg_mode (operands[1], <MODE>mode);
815 1.1 mrg }
816 1.1 mrg )
817 1.1 mrg
818 1.1.1.3 mrg ;; -------------------------------------------------------------------------
819 1.1.1.3 mrg ;; ---- Moves of multiple vectors
820 1.1.1.3 mrg ;; -------------------------------------------------------------------------
821 1.1.1.3 mrg ;; All patterns in this section are synthetic and split to real
822 1.1.1.3 mrg ;; instructions after reload.
823 1.1.1.3 mrg ;; -------------------------------------------------------------------------
824 1.1 mrg
825 1.1 mrg (define_expand "mov<mode>"
826 1.1 mrg [(set (match_operand:SVE_STRUCT 0 "nonimmediate_operand")
827 1.1 mrg (match_operand:SVE_STRUCT 1 "general_operand"))]
828 1.1 mrg "TARGET_SVE"
829 1.1 mrg {
830 1.1 mrg /* Big-endian loads and stores need to be done via LD1 and ST1;
831 1.1 mrg see the comment at the head of the file for details. */
832 1.1 mrg if ((MEM_P (operands[0]) || MEM_P (operands[1]))
833 1.1 mrg && BYTES_BIG_ENDIAN)
834 1.1 mrg {
835 1.1 mrg gcc_assert (can_create_pseudo_p ());
836 1.1 mrg aarch64_expand_sve_mem_move (operands[0], operands[1], <VPRED>mode);
837 1.1 mrg DONE;
838 1.1 mrg }
839 1.1 mrg
840 1.1 mrg if (CONSTANT_P (operands[1]))
841 1.1 mrg {
842 1.1 mrg aarch64_expand_mov_immediate (operands[0], operands[1]);
843 1.1 mrg DONE;
844 1.1 mrg }
845 1.1 mrg }
846 1.1 mrg )
847 1.1 mrg
848 1.1 mrg ;; Unpredicated structure moves (little-endian).
849 1.1 mrg (define_insn "*aarch64_sve_mov<mode>_le"
850 1.1 mrg [(set (match_operand:SVE_STRUCT 0 "aarch64_sve_nonimmediate_operand" "=w, Utr, w, w")
851 1.1 mrg (match_operand:SVE_STRUCT 1 "aarch64_sve_general_operand" "Utr, w, w, Dn"))]
852 1.1 mrg "TARGET_SVE && !BYTES_BIG_ENDIAN"
853 1.1 mrg "#"
854 1.1 mrg [(set_attr "length" "<insn_length>")]
855 1.1 mrg )
856 1.1 mrg
857 1.1 mrg ;; Unpredicated structure moves (big-endian). Memory accesses require
858 1.1 mrg ;; secondary reloads.
859 1.1.1.3 mrg (define_insn "*aarch64_sve_mov<mode>_be"
860 1.1 mrg [(set (match_operand:SVE_STRUCT 0 "register_operand" "=w, w")
861 1.1 mrg (match_operand:SVE_STRUCT 1 "aarch64_nonmemory_operand" "w, Dn"))]
862 1.1 mrg "TARGET_SVE && BYTES_BIG_ENDIAN"
863 1.1 mrg "#"
864 1.1 mrg [(set_attr "length" "<insn_length>")]
865 1.1 mrg )
866 1.1 mrg
867 1.1 mrg ;; Split unpredicated structure moves into pieces. This is the same
868 1.1 mrg ;; for both big-endian and little-endian code, although it only needs
869 1.1 mrg ;; to handle memory operands for little-endian code.
870 1.1 mrg (define_split
871 1.1 mrg [(set (match_operand:SVE_STRUCT 0 "aarch64_sve_nonimmediate_operand")
872 1.1 mrg (match_operand:SVE_STRUCT 1 "aarch64_sve_general_operand"))]
873 1.1 mrg "TARGET_SVE && reload_completed"
874 1.1 mrg [(const_int 0)]
875 1.1 mrg {
876 1.1 mrg rtx dest = operands[0];
877 1.1 mrg rtx src = operands[1];
878 1.1 mrg if (REG_P (dest) && REG_P (src))
879 1.1 mrg aarch64_simd_emit_reg_reg_move (operands, <VSINGLE>mode, <vector_count>);
880 1.1 mrg else
881 1.1 mrg for (unsigned int i = 0; i < <vector_count>; ++i)
882 1.1 mrg {
883 1.1 mrg rtx subdest = simplify_gen_subreg (<VSINGLE>mode, dest, <MODE>mode,
884 1.1 mrg i * BYTES_PER_SVE_VECTOR);
885 1.1 mrg rtx subsrc = simplify_gen_subreg (<VSINGLE>mode, src, <MODE>mode,
886 1.1 mrg i * BYTES_PER_SVE_VECTOR);
887 1.1 mrg emit_insn (gen_rtx_SET (subdest, subsrc));
888 1.1 mrg }
889 1.1 mrg DONE;
890 1.1 mrg }
891 1.1 mrg )
892 1.1 mrg
893 1.1 mrg ;; Predicated structure moves. This works for both endiannesses but in
894 1.1 mrg ;; practice is only useful for big-endian.
895 1.1.1.2 mrg (define_insn_and_split "@aarch64_pred_mov<mode>"
896 1.1.1.2 mrg [(set (match_operand:SVE_STRUCT 0 "aarch64_sve_struct_nonimmediate_operand" "=w, w, Utx")
897 1.1 mrg (unspec:SVE_STRUCT
898 1.1.1.2 mrg [(match_operand:<VPRED> 1 "register_operand" "Upl, Upl, Upl")
899 1.1.1.2 mrg (match_operand:SVE_STRUCT 2 "aarch64_sve_struct_nonimmediate_operand" "w, Utx, w")]
900 1.1.1.3 mrg UNSPEC_PRED_X))]
901 1.1 mrg "TARGET_SVE
902 1.1 mrg && (register_operand (operands[0], <MODE>mode)
903 1.1 mrg || register_operand (operands[2], <MODE>mode))"
904 1.1 mrg "#"
905 1.1 mrg "&& reload_completed"
906 1.1 mrg [(const_int 0)]
907 1.1 mrg {
908 1.1 mrg for (unsigned int i = 0; i < <vector_count>; ++i)
909 1.1 mrg {
910 1.1 mrg rtx subdest = simplify_gen_subreg (<VSINGLE>mode, operands[0],
911 1.1 mrg <MODE>mode,
912 1.1 mrg i * BYTES_PER_SVE_VECTOR);
913 1.1 mrg rtx subsrc = simplify_gen_subreg (<VSINGLE>mode, operands[2],
914 1.1 mrg <MODE>mode,
915 1.1 mrg i * BYTES_PER_SVE_VECTOR);
916 1.1 mrg aarch64_emit_sve_pred_move (subdest, operands[1], subsrc);
917 1.1 mrg }
918 1.1 mrg DONE;
919 1.1 mrg }
920 1.1 mrg [(set_attr "length" "<insn_length>")]
921 1.1 mrg )
922 1.1 mrg
923 1.1.1.3 mrg ;; -------------------------------------------------------------------------
924 1.1.1.3 mrg ;; ---- Moves of predicates
925 1.1.1.3 mrg ;; -------------------------------------------------------------------------
926 1.1.1.3 mrg ;; Includes:
927 1.1.1.3 mrg ;; - MOV
928 1.1.1.3 mrg ;; - LDR
929 1.1.1.3 mrg ;; - PFALSE
930 1.1.1.3 mrg ;; - PTRUE
931 1.1.1.3 mrg ;; - PTRUES
932 1.1.1.3 mrg ;; - STR
933 1.1.1.3 mrg ;; -------------------------------------------------------------------------
934 1.1.1.3 mrg
935 1.1 mrg (define_expand "mov<mode>"
936 1.1 mrg [(set (match_operand:PRED_ALL 0 "nonimmediate_operand")
937 1.1 mrg (match_operand:PRED_ALL 1 "general_operand"))]
938 1.1 mrg "TARGET_SVE"
939 1.1 mrg {
940 1.1 mrg if (GET_CODE (operands[0]) == MEM)
941 1.1 mrg operands[1] = force_reg (<MODE>mode, operands[1]);
942 1.1.1.3 mrg
943 1.1.1.3 mrg if (CONSTANT_P (operands[1]))
944 1.1.1.3 mrg {
945 1.1.1.3 mrg aarch64_expand_mov_immediate (operands[0], operands[1]);
946 1.1.1.3 mrg DONE;
947 1.1.1.3 mrg }
948 1.1 mrg }
949 1.1 mrg )
950 1.1 mrg
951 1.1 mrg (define_insn "*aarch64_sve_mov<mode>"
952 1.1.1.3 mrg [(set (match_operand:PRED_ALL 0 "nonimmediate_operand" "=Upa, m, Upa, Upa")
953 1.1.1.3 mrg (match_operand:PRED_ALL 1 "aarch64_mov_operand" "Upa, Upa, m, Dn"))]
954 1.1 mrg "TARGET_SVE
955 1.1 mrg && (register_operand (operands[0], <MODE>mode)
956 1.1 mrg || register_operand (operands[1], <MODE>mode))"
957 1.1 mrg "@
958 1.1 mrg mov\t%0.b, %1.b
959 1.1 mrg str\t%1, %0
960 1.1 mrg ldr\t%0, %1
961 1.1.1.3 mrg * return aarch64_output_sve_mov_immediate (operands[1]);"
962 1.1 mrg )
963 1.1 mrg
964 1.1.1.3 mrg ;; Match PTRUES Pn.B when both the predicate and flags are useful.
965 1.1.1.3 mrg (define_insn_and_rewrite "*aarch64_sve_ptruevnx16bi_cc"
966 1.1.1.3 mrg [(set (reg:CC_NZC CC_REGNUM)
967 1.1.1.3 mrg (unspec:CC_NZC
968 1.1.1.3 mrg [(match_operand 2)
969 1.1.1.3 mrg (match_operand 3)
970 1.1.1.3 mrg (const_int SVE_KNOWN_PTRUE)
971 1.1.1.3 mrg (match_operator:VNx16BI 1 "aarch64_sve_ptrue_svpattern_immediate"
972 1.1.1.3 mrg [(unspec:VNx16BI
973 1.1.1.3 mrg [(match_operand:SI 4 "const_int_operand")
974 1.1.1.3 mrg (match_operand:VNx16BI 5 "aarch64_simd_imm_zero")]
975 1.1.1.3 mrg UNSPEC_PTRUE)])]
976 1.1.1.3 mrg UNSPEC_PTEST))
977 1.1.1.3 mrg (set (match_operand:VNx16BI 0 "register_operand" "=Upa")
978 1.1.1.3 mrg (match_dup 1))]
979 1.1 mrg "TARGET_SVE"
980 1.1 mrg {
981 1.1.1.3 mrg return aarch64_output_sve_ptrues (operands[1]);
982 1.1.1.3 mrg }
983 1.1.1.3 mrg "&& (!CONSTANT_P (operands[2]) || !CONSTANT_P (operands[3]))"
984 1.1.1.3 mrg {
985 1.1.1.3 mrg operands[2] = operands[3] = CONSTM1_RTX (VNx16BImode);
986 1.1 mrg }
987 1.1 mrg )
988 1.1 mrg
989 1.1.1.3 mrg ;; Match PTRUES Pn.[HSD] when both the predicate and flags are useful.
990 1.1.1.3 mrg (define_insn_and_rewrite "*aarch64_sve_ptrue<mode>_cc"
991 1.1.1.3 mrg [(set (reg:CC_NZC CC_REGNUM)
992 1.1.1.3 mrg (unspec:CC_NZC
993 1.1.1.3 mrg [(match_operand 2)
994 1.1.1.3 mrg (match_operand 3)
995 1.1.1.3 mrg (const_int SVE_KNOWN_PTRUE)
996 1.1.1.3 mrg (subreg:PRED_HSD
997 1.1.1.3 mrg (match_operator:VNx16BI 1 "aarch64_sve_ptrue_svpattern_immediate"
998 1.1.1.3 mrg [(unspec:VNx16BI
999 1.1.1.3 mrg [(match_operand:SI 4 "const_int_operand")
1000 1.1.1.3 mrg (match_operand:PRED_HSD 5 "aarch64_simd_imm_zero")]
1001 1.1.1.3 mrg UNSPEC_PTRUE)]) 0)]
1002 1.1.1.3 mrg UNSPEC_PTEST))
1003 1.1.1.3 mrg (set (match_operand:VNx16BI 0 "register_operand" "=Upa")
1004 1.1.1.3 mrg (match_dup 1))]
1005 1.1 mrg "TARGET_SVE"
1006 1.1 mrg {
1007 1.1.1.3 mrg return aarch64_output_sve_ptrues (operands[1]);
1008 1.1.1.3 mrg }
1009 1.1.1.3 mrg "&& (!CONSTANT_P (operands[2]) || !CONSTANT_P (operands[3]))"
1010 1.1.1.3 mrg {
1011 1.1.1.3 mrg operands[2] = CONSTM1_RTX (VNx16BImode);
1012 1.1.1.3 mrg operands[3] = CONSTM1_RTX (<MODE>mode);
1013 1.1 mrg }
1014 1.1 mrg )
1015 1.1 mrg
1016 1.1.1.3 mrg ;; Match PTRUES Pn.B when only the flags result is useful (which is
1017 1.1.1.3 mrg ;; a way of testing VL).
1018 1.1.1.3 mrg (define_insn_and_rewrite "*aarch64_sve_ptruevnx16bi_ptest"
1019 1.1.1.3 mrg [(set (reg:CC_NZC CC_REGNUM)
1020 1.1.1.3 mrg (unspec:CC_NZC
1021 1.1.1.3 mrg [(match_operand 2)
1022 1.1.1.3 mrg (match_operand 3)
1023 1.1.1.3 mrg (const_int SVE_KNOWN_PTRUE)
1024 1.1.1.3 mrg (match_operator:VNx16BI 1 "aarch64_sve_ptrue_svpattern_immediate"
1025 1.1.1.3 mrg [(unspec:VNx16BI
1026 1.1.1.3 mrg [(match_operand:SI 4 "const_int_operand")
1027 1.1.1.3 mrg (match_operand:VNx16BI 5 "aarch64_simd_imm_zero")]
1028 1.1.1.3 mrg UNSPEC_PTRUE)])]
1029 1.1.1.3 mrg UNSPEC_PTEST))
1030 1.1.1.3 mrg (clobber (match_scratch:VNx16BI 0 "=Upa"))]
1031 1.1 mrg "TARGET_SVE"
1032 1.1 mrg {
1033 1.1.1.3 mrg return aarch64_output_sve_ptrues (operands[1]);
1034 1.1 mrg }
1035 1.1.1.3 mrg "&& (!CONSTANT_P (operands[2]) || !CONSTANT_P (operands[3]))"
1036 1.1 mrg {
1037 1.1.1.3 mrg operands[2] = operands[3] = CONSTM1_RTX (VNx16BImode);
1038 1.1 mrg }
1039 1.1 mrg )
1040 1.1 mrg
1041 1.1.1.3 mrg ;; Match PTRUES Pn.[HWD] when only the flags result is useful (which is
1042 1.1.1.3 mrg ;; a way of testing VL).
1043 1.1.1.3 mrg (define_insn_and_rewrite "*aarch64_sve_ptrue<mode>_ptest"
1044 1.1.1.3 mrg [(set (reg:CC_NZC CC_REGNUM)
1045 1.1.1.3 mrg (unspec:CC_NZC
1046 1.1.1.3 mrg [(match_operand 2)
1047 1.1.1.3 mrg (match_operand 3)
1048 1.1.1.3 mrg (const_int SVE_KNOWN_PTRUE)
1049 1.1.1.3 mrg (subreg:PRED_HSD
1050 1.1.1.3 mrg (match_operator:VNx16BI 1 "aarch64_sve_ptrue_svpattern_immediate"
1051 1.1.1.3 mrg [(unspec:VNx16BI
1052 1.1.1.3 mrg [(match_operand:SI 4 "const_int_operand")
1053 1.1.1.3 mrg (match_operand:PRED_HSD 5 "aarch64_simd_imm_zero")]
1054 1.1.1.3 mrg UNSPEC_PTRUE)]) 0)]
1055 1.1.1.3 mrg UNSPEC_PTEST))
1056 1.1.1.3 mrg (clobber (match_scratch:VNx16BI 0 "=Upa"))]
1057 1.1.1.3 mrg "TARGET_SVE"
1058 1.1 mrg {
1059 1.1.1.3 mrg return aarch64_output_sve_ptrues (operands[1]);
1060 1.1 mrg }
1061 1.1.1.3 mrg "&& (!CONSTANT_P (operands[2]) || !CONSTANT_P (operands[3]))"
1062 1.1 mrg {
1063 1.1.1.3 mrg operands[2] = CONSTM1_RTX (VNx16BImode);
1064 1.1.1.3 mrg operands[3] = CONSTM1_RTX (<MODE>mode);
1065 1.1 mrg }
1066 1.1 mrg )
1067 1.1 mrg
1068 1.1.1.3 mrg ;; -------------------------------------------------------------------------
1069 1.1.1.3 mrg ;; ---- Moves relating to the FFR
1070 1.1.1.3 mrg ;; -------------------------------------------------------------------------
1071 1.1.1.3 mrg ;; RDFFR
1072 1.1.1.3 mrg ;; RDFFRS
1073 1.1.1.3 mrg ;; SETFFR
1074 1.1.1.3 mrg ;; WRFFR
1075 1.1.1.3 mrg ;; -------------------------------------------------------------------------
1076 1.1 mrg
1077 1.1.1.3 mrg ;; [W1 in the block comment above about FFR handling]
1078 1.1.1.3 mrg ;;
1079 1.1.1.3 mrg ;; Write to the FFR and start a new FFRT scheduling region.
1080 1.1.1.3 mrg (define_insn "aarch64_wrffr"
1081 1.1.1.3 mrg [(set (reg:VNx16BI FFR_REGNUM)
1082 1.1.1.3 mrg (match_operand:VNx16BI 0 "aarch64_simd_reg_or_minus_one" "Dm, Upa"))
1083 1.1.1.3 mrg (set (reg:VNx16BI FFRT_REGNUM)
1084 1.1.1.3 mrg (unspec:VNx16BI [(match_dup 0)] UNSPEC_WRFFR))]
1085 1.1 mrg "TARGET_SVE"
1086 1.1 mrg "@
1087 1.1.1.3 mrg setffr
1088 1.1.1.3 mrg wrffr\t%0.b"
1089 1.1 mrg )
1090 1.1 mrg
1091 1.1.1.3 mrg ;; [L2 in the block comment above about FFR handling]
1092 1.1.1.3 mrg ;;
1093 1.1.1.3 mrg ;; Introduce a read from and write to the FFR in the current FFRT region,
1094 1.1.1.3 mrg ;; so that the FFR value is live on entry to the region and so that the FFR
1095 1.1.1.3 mrg ;; value visibly changes within the region. This is used (possibly multiple
1096 1.1.1.3 mrg ;; times) in an FFRT region that includes LDFF1 or LDNF1 instructions.
1097 1.1.1.3 mrg (define_insn "aarch64_update_ffr_for_load"
1098 1.1.1.3 mrg [(set (reg:VNx16BI FFR_REGNUM)
1099 1.1.1.3 mrg (unspec:VNx16BI [(reg:VNx16BI FFRT_REGNUM)
1100 1.1.1.3 mrg (reg:VNx16BI FFR_REGNUM)] UNSPEC_UPDATE_FFR))]
1101 1.1 mrg "TARGET_SVE"
1102 1.1.1.3 mrg ""
1103 1.1.1.3 mrg [(set_attr "type" "no_insn")]
1104 1.1 mrg )
1105 1.1 mrg
1106 1.1.1.3 mrg ;; [R1 in the block comment above about FFR handling]
1107 1.1.1.3 mrg ;;
1108 1.1.1.3 mrg ;; Notionally copy the FFR to the FFRT, so that the current FFR value
1109 1.1.1.3 mrg ;; can be read from there by the RDFFR instructions below. This acts
1110 1.1.1.3 mrg ;; as a scheduling barrier for earlier LDFF1 and LDNF1 instructions and
1111 1.1.1.3 mrg ;; creates a natural dependency with earlier writes.
1112 1.1.1.3 mrg (define_insn "aarch64_copy_ffr_to_ffrt"
1113 1.1.1.3 mrg [(set (reg:VNx16BI FFRT_REGNUM)
1114 1.1.1.3 mrg (reg:VNx16BI FFR_REGNUM))]
1115 1.1 mrg "TARGET_SVE"
1116 1.1.1.3 mrg ""
1117 1.1.1.3 mrg [(set_attr "type" "no_insn")]
1118 1.1 mrg )
1119 1.1 mrg
1120 1.1.1.3 mrg ;; [R2 in the block comment above about FFR handling]
1121 1.1.1.3 mrg ;;
1122 1.1.1.3 mrg ;; Read the FFR via the FFRT.
1123 1.1.1.3 mrg (define_insn "aarch64_rdffr"
1124 1.1.1.3 mrg [(set (match_operand:VNx16BI 0 "register_operand" "=Upa")
1125 1.1.1.3 mrg (reg:VNx16BI FFRT_REGNUM))]
1126 1.1.1.3 mrg "TARGET_SVE"
1127 1.1.1.3 mrg "rdffr\t%0.b"
1128 1.1.1.3 mrg )
1129 1.1.1.3 mrg
1130 1.1.1.3 mrg ;; Likewise with zero predication.
1131 1.1.1.3 mrg (define_insn "aarch64_rdffr_z"
1132 1.1.1.3 mrg [(set (match_operand:VNx16BI 0 "register_operand" "=Upa")
1133 1.1.1.3 mrg (and:VNx16BI
1134 1.1.1.3 mrg (reg:VNx16BI FFRT_REGNUM)
1135 1.1.1.3 mrg (match_operand:VNx16BI 1 "register_operand" "Upa")))]
1136 1.1.1.3 mrg "TARGET_SVE"
1137 1.1.1.3 mrg "rdffr\t%0.b, %1/z"
1138 1.1.1.3 mrg )
1139 1.1.1.3 mrg
1140 1.1.1.3 mrg ;; Read the FFR to test for a fault, without using the predicate result.
1141 1.1.1.3 mrg (define_insn "*aarch64_rdffr_z_ptest"
1142 1.1.1.3 mrg [(set (reg:CC_NZC CC_REGNUM)
1143 1.1.1.3 mrg (unspec:CC_NZC
1144 1.1.1.3 mrg [(match_operand:VNx16BI 1 "register_operand" "Upa")
1145 1.1.1.3 mrg (match_dup 1)
1146 1.1.1.3 mrg (match_operand:SI 2 "aarch64_sve_ptrue_flag")
1147 1.1.1.3 mrg (and:VNx16BI
1148 1.1.1.3 mrg (reg:VNx16BI FFRT_REGNUM)
1149 1.1.1.3 mrg (match_dup 1))]
1150 1.1.1.3 mrg UNSPEC_PTEST))
1151 1.1.1.3 mrg (clobber (match_scratch:VNx16BI 0 "=Upa"))]
1152 1.1.1.3 mrg "TARGET_SVE"
1153 1.1.1.3 mrg "rdffrs\t%0.b, %1/z"
1154 1.1.1.3 mrg )
1155 1.1.1.3 mrg
1156 1.1.1.3 mrg ;; Same for unpredicated RDFFR when tested with a known PTRUE.
1157 1.1.1.3 mrg (define_insn "*aarch64_rdffr_ptest"
1158 1.1.1.3 mrg [(set (reg:CC_NZC CC_REGNUM)
1159 1.1.1.3 mrg (unspec:CC_NZC
1160 1.1.1.3 mrg [(match_operand:VNx16BI 1 "register_operand" "Upa")
1161 1.1.1.3 mrg (match_dup 1)
1162 1.1.1.3 mrg (const_int SVE_KNOWN_PTRUE)
1163 1.1.1.3 mrg (reg:VNx16BI FFRT_REGNUM)]
1164 1.1.1.3 mrg UNSPEC_PTEST))
1165 1.1.1.3 mrg (clobber (match_scratch:VNx16BI 0 "=Upa"))]
1166 1.1.1.3 mrg "TARGET_SVE"
1167 1.1.1.3 mrg "rdffrs\t%0.b, %1/z"
1168 1.1.1.3 mrg )
1169 1.1.1.3 mrg
1170 1.1.1.3 mrg ;; Read the FFR with zero predication and test the result.
1171 1.1.1.3 mrg (define_insn "*aarch64_rdffr_z_cc"
1172 1.1.1.3 mrg [(set (reg:CC_NZC CC_REGNUM)
1173 1.1.1.3 mrg (unspec:CC_NZC
1174 1.1.1.3 mrg [(match_operand:VNx16BI 1 "register_operand" "Upa")
1175 1.1.1.3 mrg (match_dup 1)
1176 1.1.1.3 mrg (match_operand:SI 2 "aarch64_sve_ptrue_flag")
1177 1.1.1.3 mrg (and:VNx16BI
1178 1.1.1.3 mrg (reg:VNx16BI FFRT_REGNUM)
1179 1.1.1.3 mrg (match_dup 1))]
1180 1.1.1.3 mrg UNSPEC_PTEST))
1181 1.1.1.3 mrg (set (match_operand:VNx16BI 0 "register_operand" "=Upa")
1182 1.1.1.3 mrg (and:VNx16BI
1183 1.1.1.3 mrg (reg:VNx16BI FFRT_REGNUM)
1184 1.1.1.3 mrg (match_dup 1)))]
1185 1.1.1.3 mrg "TARGET_SVE"
1186 1.1.1.3 mrg "rdffrs\t%0.b, %1/z"
1187 1.1.1.3 mrg )
1188 1.1.1.3 mrg
1189 1.1.1.3 mrg ;; Same for unpredicated RDFFR when tested with a known PTRUE.
1190 1.1.1.3 mrg (define_insn "*aarch64_rdffr_cc"
1191 1.1.1.3 mrg [(set (reg:CC_NZC CC_REGNUM)
1192 1.1.1.3 mrg (unspec:CC_NZC
1193 1.1.1.3 mrg [(match_operand:VNx16BI 1 "register_operand" "Upa")
1194 1.1.1.3 mrg (match_dup 1)
1195 1.1.1.3 mrg (const_int SVE_KNOWN_PTRUE)
1196 1.1.1.3 mrg (reg:VNx16BI FFRT_REGNUM)]
1197 1.1.1.3 mrg UNSPEC_PTEST))
1198 1.1.1.3 mrg (set (match_operand:VNx16BI 0 "register_operand" "=Upa")
1199 1.1.1.3 mrg (reg:VNx16BI FFRT_REGNUM))]
1200 1.1 mrg "TARGET_SVE"
1201 1.1.1.3 mrg "rdffrs\t%0.b, %1/z"
1202 1.1 mrg )
1203 1.1 mrg
1204 1.1.1.3 mrg ;; [R3 in the block comment above about FFR handling]
1205 1.1.1.3 mrg ;;
1206 1.1.1.3 mrg ;; Arbitrarily update the FFRT after a read from the FFR. This acts as
1207 1.1.1.3 mrg ;; a scheduling barrier for later LDFF1 and LDNF1 instructions.
1208 1.1.1.3 mrg (define_insn "aarch64_update_ffrt"
1209 1.1.1.3 mrg [(set (reg:VNx16BI FFRT_REGNUM)
1210 1.1.1.3 mrg (unspec:VNx16BI [(reg:VNx16BI FFRT_REGNUM)] UNSPEC_UPDATE_FFRT))]
1211 1.1 mrg "TARGET_SVE"
1212 1.1.1.3 mrg ""
1213 1.1.1.3 mrg [(set_attr "type" "no_insn")]
1214 1.1 mrg )
1215 1.1 mrg
1216 1.1.1.3 mrg ;; =========================================================================
1217 1.1.1.3 mrg ;; == Loads
1218 1.1.1.3 mrg ;; =========================================================================
1219 1.1.1.3 mrg
1220 1.1.1.3 mrg ;; -------------------------------------------------------------------------
1221 1.1.1.3 mrg ;; ---- Normal contiguous loads
1222 1.1.1.3 mrg ;; -------------------------------------------------------------------------
1223 1.1.1.3 mrg ;; Includes contiguous forms of:
1224 1.1.1.3 mrg ;; - LD1B
1225 1.1.1.3 mrg ;; - LD1D
1226 1.1.1.3 mrg ;; - LD1H
1227 1.1.1.3 mrg ;; - LD1W
1228 1.1.1.3 mrg ;; - LD2B
1229 1.1.1.3 mrg ;; - LD2D
1230 1.1.1.3 mrg ;; - LD2H
1231 1.1.1.3 mrg ;; - LD2W
1232 1.1.1.3 mrg ;; - LD3B
1233 1.1.1.3 mrg ;; - LD3D
1234 1.1.1.3 mrg ;; - LD3H
1235 1.1.1.3 mrg ;; - LD3W
1236 1.1.1.3 mrg ;; - LD4B
1237 1.1.1.3 mrg ;; - LD4D
1238 1.1.1.3 mrg ;; - LD4H
1239 1.1.1.3 mrg ;; - LD4W
1240 1.1.1.3 mrg ;; -------------------------------------------------------------------------
1241 1.1 mrg
1242 1.1.1.3 mrg ;; Predicated LD1.
1243 1.1.1.3 mrg (define_insn "maskload<mode><vpred>"
1244 1.1.1.3 mrg [(set (match_operand:SVE_ALL 0 "register_operand" "=w")
1245 1.1.1.3 mrg (unspec:SVE_ALL
1246 1.1.1.3 mrg [(match_operand:<VPRED> 2 "register_operand" "Upl")
1247 1.1.1.3 mrg (match_operand:SVE_ALL 1 "memory_operand" "m")]
1248 1.1.1.3 mrg UNSPEC_LD1_SVE))]
1249 1.1 mrg "TARGET_SVE"
1250 1.1.1.3 mrg "ld1<Vesize>\t%0.<Vctype>, %2/z, %1"
1251 1.1 mrg )
1252 1.1 mrg
1253 1.1 mrg ;; Unpredicated LD[234].
1254 1.1 mrg (define_expand "vec_load_lanes<mode><vsingle>"
1255 1.1 mrg [(set (match_operand:SVE_STRUCT 0 "register_operand")
1256 1.1 mrg (unspec:SVE_STRUCT
1257 1.1 mrg [(match_dup 2)
1258 1.1 mrg (match_operand:SVE_STRUCT 1 "memory_operand")]
1259 1.1 mrg UNSPEC_LDN))]
1260 1.1 mrg "TARGET_SVE"
1261 1.1 mrg {
1262 1.1.1.3 mrg operands[2] = aarch64_ptrue_reg (<VPRED>mode);
1263 1.1 mrg }
1264 1.1 mrg )
1265 1.1 mrg
1266 1.1 mrg ;; Predicated LD[234].
1267 1.1 mrg (define_insn "vec_mask_load_lanes<mode><vsingle>"
1268 1.1 mrg [(set (match_operand:SVE_STRUCT 0 "register_operand" "=w")
1269 1.1 mrg (unspec:SVE_STRUCT
1270 1.1 mrg [(match_operand:<VPRED> 2 "register_operand" "Upl")
1271 1.1 mrg (match_operand:SVE_STRUCT 1 "memory_operand" "m")]
1272 1.1 mrg UNSPEC_LDN))]
1273 1.1 mrg "TARGET_SVE"
1274 1.1 mrg "ld<vector_count><Vesize>\t%0, %2/z, %1"
1275 1.1 mrg )
1276 1.1 mrg
1277 1.1.1.3 mrg ;; -------------------------------------------------------------------------
1278 1.1.1.3 mrg ;; ---- Extending contiguous loads
1279 1.1.1.3 mrg ;; -------------------------------------------------------------------------
1280 1.1.1.3 mrg ;; Includes contiguous forms of:
1281 1.1.1.3 mrg ;; LD1B
1282 1.1.1.3 mrg ;; LD1H
1283 1.1.1.3 mrg ;; LD1SB
1284 1.1.1.3 mrg ;; LD1SH
1285 1.1.1.3 mrg ;; LD1SW
1286 1.1.1.3 mrg ;; LD1W
1287 1.1.1.3 mrg ;; -------------------------------------------------------------------------
1288 1.1.1.3 mrg
1289 1.1.1.3 mrg ;; Predicated load and extend, with 8 elements per 128-bit block.
1290 1.1.1.3 mrg (define_insn_and_rewrite "@aarch64_load_<ANY_EXTEND:optab><SVE_HSDI:mode><SVE_PARTIAL_I:mode>"
1291 1.1.1.3 mrg [(set (match_operand:SVE_HSDI 0 "register_operand" "=w")
1292 1.1.1.3 mrg (unspec:SVE_HSDI
1293 1.1.1.3 mrg [(match_operand:<SVE_HSDI:VPRED> 3 "general_operand" "UplDnm")
1294 1.1.1.3 mrg (ANY_EXTEND:SVE_HSDI
1295 1.1.1.3 mrg (unspec:SVE_PARTIAL_I
1296 1.1.1.3 mrg [(match_operand:<SVE_PARTIAL_I:VPRED> 2 "register_operand" "Upl")
1297 1.1.1.3 mrg (match_operand:SVE_PARTIAL_I 1 "memory_operand" "m")]
1298 1.1.1.3 mrg UNSPEC_LD1_SVE))]
1299 1.1.1.3 mrg UNSPEC_PRED_X))]
1300 1.1.1.3 mrg "TARGET_SVE && (~<SVE_HSDI:narrower_mask> & <SVE_PARTIAL_I:self_mask>) == 0"
1301 1.1.1.3 mrg "ld1<ANY_EXTEND:s><SVE_PARTIAL_I:Vesize>\t%0.<SVE_HSDI:Vctype>, %2/z, %1"
1302 1.1.1.3 mrg "&& !CONSTANT_P (operands[3])"
1303 1.1.1.3 mrg {
1304 1.1.1.3 mrg operands[3] = CONSTM1_RTX (<SVE_HSDI:VPRED>mode);
1305 1.1 mrg }
1306 1.1 mrg )
1307 1.1 mrg
1308 1.1.1.3 mrg ;; -------------------------------------------------------------------------
1309 1.1.1.3 mrg ;; ---- First-faulting contiguous loads
1310 1.1.1.3 mrg ;; -------------------------------------------------------------------------
1311 1.1.1.3 mrg ;; Includes contiguous forms of:
1312 1.1.1.3 mrg ;; - LDFF1B
1313 1.1.1.3 mrg ;; - LDFF1D
1314 1.1.1.3 mrg ;; - LDFF1H
1315 1.1.1.3 mrg ;; - LDFF1W
1316 1.1.1.3 mrg ;; - LDNF1B
1317 1.1.1.3 mrg ;; - LDNF1D
1318 1.1.1.3 mrg ;; - LDNF1H
1319 1.1.1.3 mrg ;; - LDNF1W
1320 1.1.1.3 mrg ;; -------------------------------------------------------------------------
1321 1.1.1.3 mrg
1322 1.1.1.3 mrg ;; Contiguous non-extending first-faulting or non-faulting loads.
1323 1.1.1.3 mrg (define_insn "@aarch64_ld<fn>f1<mode>"
1324 1.1.1.3 mrg [(set (match_operand:SVE_FULL 0 "register_operand" "=w")
1325 1.1.1.3 mrg (unspec:SVE_FULL
1326 1.1 mrg [(match_operand:<VPRED> 2 "register_operand" "Upl")
1327 1.1.1.3 mrg (match_operand:SVE_FULL 1 "aarch64_sve_ld<fn>f1_operand" "Ut<fn>")
1328 1.1.1.3 mrg (reg:VNx16BI FFRT_REGNUM)]
1329 1.1.1.3 mrg SVE_LDFF1_LDNF1))]
1330 1.1.1.3 mrg "TARGET_SVE"
1331 1.1.1.3 mrg "ld<fn>f1<Vesize>\t%0.<Vetype>, %2/z, %1"
1332 1.1.1.3 mrg )
1333 1.1.1.3 mrg
1334 1.1.1.3 mrg ;; -------------------------------------------------------------------------
1335 1.1.1.3 mrg ;; ---- First-faulting extending contiguous loads
1336 1.1.1.3 mrg ;; -------------------------------------------------------------------------
1337 1.1.1.3 mrg ;; Includes contiguous forms of:
1338 1.1.1.3 mrg ;; - LDFF1B
1339 1.1.1.3 mrg ;; - LDFF1H
1340 1.1.1.3 mrg ;; - LDFF1SB
1341 1.1.1.3 mrg ;; - LDFF1SH
1342 1.1.1.3 mrg ;; - LDFF1SW
1343 1.1.1.3 mrg ;; - LDFF1W
1344 1.1.1.3 mrg ;; - LDNF1B
1345 1.1.1.3 mrg ;; - LDNF1H
1346 1.1.1.3 mrg ;; - LDNF1SB
1347 1.1.1.3 mrg ;; - LDNF1SH
1348 1.1.1.3 mrg ;; - LDNF1SW
1349 1.1.1.3 mrg ;; - LDNF1W
1350 1.1.1.3 mrg ;; -------------------------------------------------------------------------
1351 1.1 mrg
1352 1.1.1.3 mrg ;; Predicated first-faulting or non-faulting load and extend.
1353 1.1.1.3 mrg (define_insn_and_rewrite "@aarch64_ld<fn>f1_<ANY_EXTEND:optab><SVE_HSDI:mode><SVE_PARTIAL_I:mode>"
1354 1.1.1.3 mrg [(set (match_operand:SVE_HSDI 0 "register_operand" "=w")
1355 1.1.1.3 mrg (unspec:SVE_HSDI
1356 1.1.1.3 mrg [(match_operand:<SVE_HSDI:VPRED> 3 "general_operand" "UplDnm")
1357 1.1.1.3 mrg (ANY_EXTEND:SVE_HSDI
1358 1.1.1.3 mrg (unspec:SVE_PARTIAL_I
1359 1.1.1.3 mrg [(match_operand:<SVE_PARTIAL_I:VPRED> 2 "register_operand" "Upl")
1360 1.1.1.3 mrg (match_operand:SVE_PARTIAL_I 1 "aarch64_sve_ld<fn>f1_operand" "Ut<fn>")
1361 1.1.1.3 mrg (reg:VNx16BI FFRT_REGNUM)]
1362 1.1.1.3 mrg SVE_LDFF1_LDNF1))]
1363 1.1.1.3 mrg UNSPEC_PRED_X))]
1364 1.1.1.3 mrg "TARGET_SVE && (~<SVE_HSDI:narrower_mask> & <SVE_PARTIAL_I:self_mask>) == 0"
1365 1.1.1.3 mrg "ld<fn>f1<ANY_EXTEND:s><SVE_PARTIAL_I:Vesize>\t%0.<SVE_HSDI:Vctype>, %2/z, %1"
1366 1.1.1.3 mrg "&& !CONSTANT_P (operands[3])"
1367 1.1.1.3 mrg {
1368 1.1.1.3 mrg operands[3] = CONSTM1_RTX (<SVE_HSDI:VPRED>mode);
1369 1.1 mrg }
1370 1.1 mrg )
1371 1.1 mrg
1372 1.1.1.3 mrg ;; -------------------------------------------------------------------------
1373 1.1.1.3 mrg ;; ---- Non-temporal contiguous loads
1374 1.1.1.3 mrg ;; -------------------------------------------------------------------------
1375 1.1.1.3 mrg ;; Includes:
1376 1.1.1.3 mrg ;; - LDNT1B
1377 1.1.1.3 mrg ;; - LDNT1D
1378 1.1.1.3 mrg ;; - LDNT1H
1379 1.1.1.3 mrg ;; - LDNT1W
1380 1.1.1.3 mrg ;; -------------------------------------------------------------------------
1381 1.1.1.3 mrg
1382 1.1.1.3 mrg ;; Predicated contiguous non-temporal load.
1383 1.1.1.3 mrg (define_insn "@aarch64_ldnt1<mode>"
1384 1.1.1.3 mrg [(set (match_operand:SVE_FULL 0 "register_operand" "=w")
1385 1.1.1.3 mrg (unspec:SVE_FULL
1386 1.1.1.3 mrg [(match_operand:<VPRED> 2 "register_operand" "Upl")
1387 1.1.1.3 mrg (match_operand:SVE_FULL 1 "memory_operand" "m")]
1388 1.1.1.3 mrg UNSPEC_LDNT1_SVE))]
1389 1.1 mrg "TARGET_SVE"
1390 1.1.1.3 mrg "ldnt1<Vesize>\t%0.<Vetype>, %2/z, %1"
1391 1.1 mrg )
1392 1.1 mrg
1393 1.1.1.3 mrg ;; -------------------------------------------------------------------------
1394 1.1.1.3 mrg ;; ---- Normal gather loads
1395 1.1.1.3 mrg ;; -------------------------------------------------------------------------
1396 1.1.1.3 mrg ;; Includes gather forms of:
1397 1.1.1.3 mrg ;; - LD1D
1398 1.1.1.3 mrg ;; - LD1W
1399 1.1.1.3 mrg ;; -------------------------------------------------------------------------
1400 1.1 mrg
1401 1.1.1.3 mrg ;; Unpredicated gather loads.
1402 1.1.1.3 mrg (define_expand "gather_load<mode><v_int_container>"
1403 1.1.1.3 mrg [(set (match_operand:SVE_24 0 "register_operand")
1404 1.1.1.3 mrg (unspec:SVE_24
1405 1.1.1.3 mrg [(match_dup 5)
1406 1.1.1.3 mrg (match_operand:DI 1 "aarch64_sve_gather_offset_<Vesize>")
1407 1.1.1.3 mrg (match_operand:<V_INT_CONTAINER> 2 "register_operand")
1408 1.1.1.3 mrg (match_operand:DI 3 "const_int_operand")
1409 1.1.1.3 mrg (match_operand:DI 4 "aarch64_gather_scale_operand_<Vesize>")
1410 1.1.1.3 mrg (mem:BLK (scratch))]
1411 1.1.1.3 mrg UNSPEC_LD1_GATHER))]
1412 1.1 mrg "TARGET_SVE"
1413 1.1 mrg {
1414 1.1.1.3 mrg operands[5] = aarch64_ptrue_reg (<VPRED>mode);
1415 1.1 mrg }
1416 1.1 mrg )
1417 1.1 mrg
1418 1.1.1.3 mrg ;; Predicated gather loads for 32-bit elements. Operand 3 is true for
1419 1.1.1.3 mrg ;; unsigned extension and false for signed extension.
1420 1.1.1.3 mrg (define_insn "mask_gather_load<mode><v_int_container>"
1421 1.1.1.3 mrg [(set (match_operand:SVE_4 0 "register_operand" "=w, w, w, w, w, w")
1422 1.1.1.3 mrg (unspec:SVE_4
1423 1.1.1.3 mrg [(match_operand:VNx4BI 5 "register_operand" "Upl, Upl, Upl, Upl, Upl, Upl")
1424 1.1.1.3 mrg (match_operand:DI 1 "aarch64_sve_gather_offset_<Vesize>" "Z, vgw, rk, rk, rk, rk")
1425 1.1.1.3 mrg (match_operand:VNx4SI 2 "register_operand" "w, w, w, w, w, w")
1426 1.1.1.3 mrg (match_operand:DI 3 "const_int_operand" "Ui1, Ui1, Z, Ui1, Z, Ui1")
1427 1.1.1.3 mrg (match_operand:DI 4 "aarch64_gather_scale_operand_<Vesize>" "Ui1, Ui1, Ui1, Ui1, i, i")
1428 1.1.1.3 mrg (mem:BLK (scratch))]
1429 1.1.1.3 mrg UNSPEC_LD1_GATHER))]
1430 1.1 mrg "TARGET_SVE"
1431 1.1 mrg "@
1432 1.1.1.3 mrg ld1<Vesize>\t%0.s, %5/z, [%2.s]
1433 1.1.1.3 mrg ld1<Vesize>\t%0.s, %5/z, [%2.s, #%1]
1434 1.1.1.3 mrg ld1<Vesize>\t%0.s, %5/z, [%1, %2.s, sxtw]
1435 1.1.1.3 mrg ld1<Vesize>\t%0.s, %5/z, [%1, %2.s, uxtw]
1436 1.1.1.3 mrg ld1<Vesize>\t%0.s, %5/z, [%1, %2.s, sxtw %p4]
1437 1.1.1.3 mrg ld1<Vesize>\t%0.s, %5/z, [%1, %2.s, uxtw %p4]"
1438 1.1 mrg )
1439 1.1 mrg
1440 1.1.1.3 mrg ;; Predicated gather loads for 64-bit elements. The value of operand 3
1441 1.1.1.3 mrg ;; doesn't matter in this case.
1442 1.1.1.3 mrg (define_insn "mask_gather_load<mode><v_int_container>"
1443 1.1.1.3 mrg [(set (match_operand:SVE_2 0 "register_operand" "=w, w, w, w")
1444 1.1.1.3 mrg (unspec:SVE_2
1445 1.1.1.3 mrg [(match_operand:VNx2BI 5 "register_operand" "Upl, Upl, Upl, Upl")
1446 1.1.1.3 mrg (match_operand:DI 1 "aarch64_sve_gather_offset_<Vesize>" "Z, vgd, rk, rk")
1447 1.1.1.3 mrg (match_operand:VNx2DI 2 "register_operand" "w, w, w, w")
1448 1.1.1.3 mrg (match_operand:DI 3 "const_int_operand")
1449 1.1.1.3 mrg (match_operand:DI 4 "aarch64_gather_scale_operand_<Vesize>" "Ui1, Ui1, Ui1, i")
1450 1.1.1.3 mrg (mem:BLK (scratch))]
1451 1.1.1.3 mrg UNSPEC_LD1_GATHER))]
1452 1.1 mrg "TARGET_SVE"
1453 1.1 mrg "@
1454 1.1.1.3 mrg ld1<Vesize>\t%0.d, %5/z, [%2.d]
1455 1.1.1.3 mrg ld1<Vesize>\t%0.d, %5/z, [%2.d, #%1]
1456 1.1.1.3 mrg ld1<Vesize>\t%0.d, %5/z, [%1, %2.d]
1457 1.1.1.3 mrg ld1<Vesize>\t%0.d, %5/z, [%1, %2.d, lsl %p4]"
1458 1.1.1.3 mrg )
1459 1.1.1.3 mrg
1460 1.1.1.3 mrg ;; Likewise, but with the offset being extended from 32 bits.
1461 1.1.1.3 mrg (define_insn_and_rewrite "*mask_gather_load<mode><v_int_container>_<su>xtw_unpacked"
1462 1.1.1.3 mrg [(set (match_operand:SVE_2 0 "register_operand" "=w, w")
1463 1.1.1.3 mrg (unspec:SVE_2
1464 1.1.1.3 mrg [(match_operand:VNx2BI 5 "register_operand" "Upl, Upl")
1465 1.1.1.3 mrg (match_operand:DI 1 "register_operand" "rk, rk")
1466 1.1.1.3 mrg (unspec:VNx2DI
1467 1.1.1.3 mrg [(match_operand 6)
1468 1.1.1.3 mrg (ANY_EXTEND:VNx2DI
1469 1.1.1.3 mrg (match_operand:VNx2SI 2 "register_operand" "w, w"))]
1470 1.1.1.3 mrg UNSPEC_PRED_X)
1471 1.1.1.3 mrg (match_operand:DI 3 "const_int_operand")
1472 1.1.1.3 mrg (match_operand:DI 4 "aarch64_gather_scale_operand_<Vesize>" "Ui1, i")
1473 1.1.1.3 mrg (mem:BLK (scratch))]
1474 1.1.1.3 mrg UNSPEC_LD1_GATHER))]
1475 1.1 mrg "TARGET_SVE"
1476 1.1.1.3 mrg "@
1477 1.1.1.3 mrg ld1<Vesize>\t%0.d, %5/z, [%1, %2.d, <su>xtw]
1478 1.1.1.3 mrg ld1<Vesize>\t%0.d, %5/z, [%1, %2.d, <su>xtw %p4]"
1479 1.1.1.3 mrg "&& !CONSTANT_P (operands[6])"
1480 1.1.1.3 mrg {
1481 1.1.1.3 mrg operands[6] = CONSTM1_RTX (VNx2BImode);
1482 1.1 mrg }
1483 1.1 mrg )
1484 1.1 mrg
1485 1.1.1.3 mrg ;; Likewise, but with the offset being truncated to 32 bits and then
1486 1.1.1.3 mrg ;; sign-extended.
1487 1.1.1.3 mrg (define_insn_and_rewrite "*mask_gather_load<mode><v_int_container>_sxtw"
1488 1.1.1.3 mrg [(set (match_operand:SVE_2 0 "register_operand" "=w, w")
1489 1.1.1.3 mrg (unspec:SVE_2
1490 1.1.1.3 mrg [(match_operand:VNx2BI 5 "register_operand" "Upl, Upl")
1491 1.1.1.3 mrg (match_operand:DI 1 "register_operand" "rk, rk")
1492 1.1.1.3 mrg (unspec:VNx2DI
1493 1.1.1.3 mrg [(match_operand 6)
1494 1.1.1.3 mrg (sign_extend:VNx2DI
1495 1.1.1.3 mrg (truncate:VNx2SI
1496 1.1.1.3 mrg (match_operand:VNx2DI 2 "register_operand" "w, w")))]
1497 1.1.1.3 mrg UNSPEC_PRED_X)
1498 1.1.1.3 mrg (match_operand:DI 3 "const_int_operand")
1499 1.1.1.3 mrg (match_operand:DI 4 "aarch64_gather_scale_operand_<Vesize>" "Ui1, i")
1500 1.1.1.3 mrg (mem:BLK (scratch))]
1501 1.1.1.3 mrg UNSPEC_LD1_GATHER))]
1502 1.1 mrg "TARGET_SVE"
1503 1.1 mrg "@
1504 1.1.1.3 mrg ld1<Vesize>\t%0.d, %5/z, [%1, %2.d, sxtw]
1505 1.1.1.3 mrg ld1<Vesize>\t%0.d, %5/z, [%1, %2.d, sxtw %p4]"
1506 1.1.1.3 mrg "&& !CONSTANT_P (operands[6])"
1507 1.1.1.3 mrg {
1508 1.1.1.3 mrg operands[6] = CONSTM1_RTX (VNx2BImode);
1509 1.1.1.3 mrg }
1510 1.1 mrg )
1511 1.1 mrg
1512 1.1.1.3 mrg ;; Likewise, but with the offset being truncated to 32 bits and then
1513 1.1.1.3 mrg ;; zero-extended.
1514 1.1.1.3 mrg (define_insn "*mask_gather_load<mode><v_int_container>_uxtw"
1515 1.1.1.3 mrg [(set (match_operand:SVE_2 0 "register_operand" "=w, w")
1516 1.1.1.3 mrg (unspec:SVE_2
1517 1.1.1.3 mrg [(match_operand:VNx2BI 5 "register_operand" "Upl, Upl")
1518 1.1.1.3 mrg (match_operand:DI 1 "register_operand" "rk, rk")
1519 1.1.1.3 mrg (and:VNx2DI
1520 1.1.1.3 mrg (match_operand:VNx2DI 2 "register_operand" "w, w")
1521 1.1.1.3 mrg (match_operand:VNx2DI 6 "aarch64_sve_uxtw_immediate"))
1522 1.1.1.3 mrg (match_operand:DI 3 "const_int_operand")
1523 1.1.1.3 mrg (match_operand:DI 4 "aarch64_gather_scale_operand_<Vesize>" "Ui1, i")
1524 1.1.1.3 mrg (mem:BLK (scratch))]
1525 1.1.1.3 mrg UNSPEC_LD1_GATHER))]
1526 1.1 mrg "TARGET_SVE"
1527 1.1 mrg "@
1528 1.1.1.3 mrg ld1<Vesize>\t%0.d, %5/z, [%1, %2.d, uxtw]
1529 1.1.1.3 mrg ld1<Vesize>\t%0.d, %5/z, [%1, %2.d, uxtw %p4]"
1530 1.1 mrg )
1531 1.1 mrg
1532 1.1.1.3 mrg ;; -------------------------------------------------------------------------
1533 1.1.1.3 mrg ;; ---- Extending gather loads
1534 1.1.1.3 mrg ;; -------------------------------------------------------------------------
1535 1.1.1.3 mrg ;; Includes gather forms of:
1536 1.1.1.3 mrg ;; - LD1B
1537 1.1.1.3 mrg ;; - LD1H
1538 1.1.1.3 mrg ;; - LD1SB
1539 1.1.1.3 mrg ;; - LD1SH
1540 1.1.1.3 mrg ;; - LD1SW
1541 1.1.1.3 mrg ;; - LD1W
1542 1.1.1.3 mrg ;; -------------------------------------------------------------------------
1543 1.1.1.3 mrg
1544 1.1.1.3 mrg ;; Predicated extending gather loads for 32-bit elements. Operand 3 is
1545 1.1.1.3 mrg ;; true for unsigned extension and false for signed extension.
1546 1.1.1.3 mrg (define_insn_and_rewrite "@aarch64_gather_load_<ANY_EXTEND:optab><SVE_4HSI:mode><SVE_4BHI:mode>"
1547 1.1.1.3 mrg [(set (match_operand:SVE_4HSI 0 "register_operand" "=w, w, w, w, w, w")
1548 1.1.1.3 mrg (unspec:SVE_4HSI
1549 1.1.1.3 mrg [(match_operand:VNx4BI 6 "general_operand" "UplDnm, UplDnm, UplDnm, UplDnm, UplDnm, UplDnm")
1550 1.1.1.3 mrg (ANY_EXTEND:SVE_4HSI
1551 1.1.1.3 mrg (unspec:SVE_4BHI
1552 1.1.1.3 mrg [(match_operand:VNx4BI 5 "register_operand" "Upl, Upl, Upl, Upl, Upl, Upl")
1553 1.1.1.3 mrg (match_operand:DI 1 "aarch64_sve_gather_offset_<SVE_4BHI:Vesize>" "Z, vg<SVE_4BHI:Vesize>, rk, rk, rk, rk")
1554 1.1.1.3 mrg (match_operand:VNx4SI 2 "register_operand" "w, w, w, w, w, w")
1555 1.1.1.3 mrg (match_operand:DI 3 "const_int_operand" "Ui1, Ui1, Z, Ui1, Z, Ui1")
1556 1.1.1.3 mrg (match_operand:DI 4 "aarch64_gather_scale_operand_<SVE_4BHI:Vesize>" "Ui1, Ui1, Ui1, Ui1, i, i")
1557 1.1.1.3 mrg (mem:BLK (scratch))]
1558 1.1.1.3 mrg UNSPEC_LD1_GATHER))]
1559 1.1.1.3 mrg UNSPEC_PRED_X))]
1560 1.1.1.3 mrg "TARGET_SVE && (~<SVE_4HSI:narrower_mask> & <SVE_4BHI:self_mask>) == 0"
1561 1.1.1.3 mrg "@
1562 1.1.1.3 mrg ld1<ANY_EXTEND:s><SVE_4BHI:Vesize>\t%0.s, %5/z, [%2.s]
1563 1.1.1.3 mrg ld1<ANY_EXTEND:s><SVE_4BHI:Vesize>\t%0.s, %5/z, [%2.s, #%1]
1564 1.1.1.3 mrg ld1<ANY_EXTEND:s><SVE_4BHI:Vesize>\t%0.s, %5/z, [%1, %2.s, sxtw]
1565 1.1.1.3 mrg ld1<ANY_EXTEND:s><SVE_4BHI:Vesize>\t%0.s, %5/z, [%1, %2.s, uxtw]
1566 1.1.1.3 mrg ld1<ANY_EXTEND:s><SVE_4BHI:Vesize>\t%0.s, %5/z, [%1, %2.s, sxtw %p4]
1567 1.1.1.3 mrg ld1<ANY_EXTEND:s><SVE_4BHI:Vesize>\t%0.s, %5/z, [%1, %2.s, uxtw %p4]"
1568 1.1.1.3 mrg "&& !CONSTANT_P (operands[6])"
1569 1.1.1.3 mrg {
1570 1.1.1.3 mrg operands[6] = CONSTM1_RTX (VNx4BImode);
1571 1.1.1.3 mrg }
1572 1.1.1.3 mrg )
1573 1.1.1.3 mrg
1574 1.1.1.3 mrg ;; Predicated extending gather loads for 64-bit elements. The value of
1575 1.1.1.3 mrg ;; operand 3 doesn't matter in this case.
1576 1.1.1.3 mrg (define_insn_and_rewrite "@aarch64_gather_load_<ANY_EXTEND:optab><SVE_2HSDI:mode><SVE_2BHSI:mode>"
1577 1.1.1.3 mrg [(set (match_operand:SVE_2HSDI 0 "register_operand" "=w, w, w, w")
1578 1.1.1.3 mrg (unspec:SVE_2HSDI
1579 1.1.1.3 mrg [(match_operand:VNx2BI 6 "general_operand" "UplDnm, UplDnm, UplDnm, UplDnm")
1580 1.1.1.3 mrg (ANY_EXTEND:SVE_2HSDI
1581 1.1.1.3 mrg (unspec:SVE_2BHSI
1582 1.1.1.3 mrg [(match_operand:VNx2BI 5 "register_operand" "Upl, Upl, Upl, Upl")
1583 1.1.1.3 mrg (match_operand:DI 1 "aarch64_sve_gather_offset_<SVE_2BHSI:Vesize>" "Z, vg<SVE_2BHSI:Vesize>, rk, rk")
1584 1.1.1.3 mrg (match_operand:VNx2DI 2 "register_operand" "w, w, w, w")
1585 1.1.1.3 mrg (match_operand:DI 3 "const_int_operand")
1586 1.1.1.3 mrg (match_operand:DI 4 "aarch64_gather_scale_operand_<SVE_2BHSI:Vesize>" "Ui1, Ui1, Ui1, i")
1587 1.1.1.3 mrg (mem:BLK (scratch))]
1588 1.1.1.3 mrg UNSPEC_LD1_GATHER))]
1589 1.1.1.3 mrg UNSPEC_PRED_X))]
1590 1.1.1.3 mrg "TARGET_SVE && (~<SVE_2HSDI:narrower_mask> & <SVE_2BHSI:self_mask>) == 0"
1591 1.1.1.3 mrg "@
1592 1.1.1.3 mrg ld1<ANY_EXTEND:s><SVE_2BHSI:Vesize>\t%0.d, %5/z, [%2.d]
1593 1.1.1.3 mrg ld1<ANY_EXTEND:s><SVE_2BHSI:Vesize>\t%0.d, %5/z, [%2.d, #%1]
1594 1.1.1.3 mrg ld1<ANY_EXTEND:s><SVE_2BHSI:Vesize>\t%0.d, %5/z, [%1, %2.d]
1595 1.1.1.3 mrg ld1<ANY_EXTEND:s><SVE_2BHSI:Vesize>\t%0.d, %5/z, [%1, %2.d, lsl %p4]"
1596 1.1.1.3 mrg "&& !CONSTANT_P (operands[6])"
1597 1.1.1.3 mrg {
1598 1.1.1.3 mrg operands[6] = CONSTM1_RTX (VNx2BImode);
1599 1.1.1.3 mrg }
1600 1.1.1.3 mrg )
1601 1.1.1.3 mrg
1602 1.1.1.3 mrg ;; Likewise, but with the offset being extended from 32 bits.
1603 1.1.1.3 mrg (define_insn_and_rewrite "*aarch64_gather_load_<ANY_EXTEND:optab><SVE_2HSDI:mode><SVE_2BHSI:mode>_<ANY_EXTEND2:su>xtw_unpacked"
1604 1.1.1.3 mrg [(set (match_operand:SVE_2HSDI 0 "register_operand" "=w, w")
1605 1.1.1.3 mrg (unspec:SVE_2HSDI
1606 1.1.1.3 mrg [(match_operand 6)
1607 1.1.1.3 mrg (ANY_EXTEND:SVE_2HSDI
1608 1.1.1.3 mrg (unspec:SVE_2BHSI
1609 1.1.1.3 mrg [(match_operand:VNx2BI 5 "register_operand" "Upl, Upl")
1610 1.1.1.3 mrg (match_operand:DI 1 "aarch64_reg_or_zero" "rk, rk")
1611 1.1.1.3 mrg (unspec:VNx2DI
1612 1.1.1.3 mrg [(match_operand 7)
1613 1.1.1.3 mrg (ANY_EXTEND2:VNx2DI
1614 1.1.1.3 mrg (match_operand:VNx2SI 2 "register_operand" "w, w"))]
1615 1.1.1.3 mrg UNSPEC_PRED_X)
1616 1.1.1.3 mrg (match_operand:DI 3 "const_int_operand")
1617 1.1.1.3 mrg (match_operand:DI 4 "aarch64_gather_scale_operand_<SVE_2BHSI:Vesize>" "Ui1, i")
1618 1.1.1.3 mrg (mem:BLK (scratch))]
1619 1.1.1.3 mrg UNSPEC_LD1_GATHER))]
1620 1.1.1.3 mrg UNSPEC_PRED_X))]
1621 1.1.1.3 mrg "TARGET_SVE && (~<SVE_2HSDI:narrower_mask> & <SVE_2BHSI:self_mask>) == 0"
1622 1.1.1.3 mrg "@
1623 1.1.1.3 mrg ld1<ANY_EXTEND:s><SVE_2BHSI:Vesize>\t%0.d, %5/z, [%1, %2.d, <ANY_EXTEND2:su>xtw]
1624 1.1.1.3 mrg ld1<ANY_EXTEND:s><SVE_2BHSI:Vesize>\t%0.d, %5/z, [%1, %2.d, <ANY_EXTEND2:su>xtw %p4]"
1625 1.1.1.3 mrg "&& (!CONSTANT_P (operands[6]) || !CONSTANT_P (operands[7]))"
1626 1.1.1.3 mrg {
1627 1.1.1.3 mrg operands[6] = CONSTM1_RTX (VNx2BImode);
1628 1.1.1.3 mrg operands[7] = CONSTM1_RTX (VNx2BImode);
1629 1.1.1.3 mrg }
1630 1.1.1.3 mrg )
1631 1.1.1.3 mrg
1632 1.1.1.3 mrg ;; Likewise, but with the offset being truncated to 32 bits and then
1633 1.1.1.3 mrg ;; sign-extended.
1634 1.1.1.3 mrg (define_insn_and_rewrite "*aarch64_gather_load_<ANY_EXTEND:optab><SVE_2HSDI:mode><SVE_2BHSI:mode>_sxtw"
1635 1.1.1.3 mrg [(set (match_operand:SVE_2HSDI 0 "register_operand" "=w, w")
1636 1.1.1.3 mrg (unspec:SVE_2HSDI
1637 1.1.1.3 mrg [(match_operand 6)
1638 1.1.1.3 mrg (ANY_EXTEND:SVE_2HSDI
1639 1.1.1.3 mrg (unspec:SVE_2BHSI
1640 1.1.1.3 mrg [(match_operand:VNx2BI 5 "register_operand" "Upl, Upl")
1641 1.1.1.3 mrg (match_operand:DI 1 "aarch64_reg_or_zero" "rk, rk")
1642 1.1.1.3 mrg (unspec:VNx2DI
1643 1.1.1.3 mrg [(match_operand 7)
1644 1.1.1.3 mrg (sign_extend:VNx2DI
1645 1.1.1.3 mrg (truncate:VNx2SI
1646 1.1.1.3 mrg (match_operand:VNx2DI 2 "register_operand" "w, w")))]
1647 1.1.1.3 mrg UNSPEC_PRED_X)
1648 1.1.1.3 mrg (match_operand:DI 3 "const_int_operand")
1649 1.1.1.3 mrg (match_operand:DI 4 "aarch64_gather_scale_operand_<SVE_2BHSI:Vesize>" "Ui1, i")
1650 1.1.1.3 mrg (mem:BLK (scratch))]
1651 1.1.1.3 mrg UNSPEC_LD1_GATHER))]
1652 1.1.1.3 mrg UNSPEC_PRED_X))]
1653 1.1.1.3 mrg "TARGET_SVE && (~<SVE_2HSDI:narrower_mask> & <SVE_2BHSI:self_mask>) == 0"
1654 1.1.1.3 mrg "@
1655 1.1.1.3 mrg ld1<ANY_EXTEND:s><SVE_2BHSI:Vesize>\t%0.d, %5/z, [%1, %2.d, sxtw]
1656 1.1.1.3 mrg ld1<ANY_EXTEND:s><SVE_2BHSI:Vesize>\t%0.d, %5/z, [%1, %2.d, sxtw %p4]"
1657 1.1.1.3 mrg "&& (!CONSTANT_P (operands[6]) || !CONSTANT_P (operands[7]))"
1658 1.1.1.3 mrg {
1659 1.1.1.3 mrg operands[6] = CONSTM1_RTX (VNx2BImode);
1660 1.1.1.3 mrg operands[7] = CONSTM1_RTX (VNx2BImode);
1661 1.1.1.3 mrg }
1662 1.1.1.3 mrg )
1663 1.1.1.3 mrg
1664 1.1.1.3 mrg ;; Likewise, but with the offset being truncated to 32 bits and then
1665 1.1.1.3 mrg ;; zero-extended.
1666 1.1.1.3 mrg (define_insn_and_rewrite "*aarch64_gather_load_<ANY_EXTEND:optab><SVE_2HSDI:mode><SVE_2BHSI:mode>_uxtw"
1667 1.1.1.3 mrg [(set (match_operand:SVE_2HSDI 0 "register_operand" "=w, w")
1668 1.1.1.3 mrg (unspec:SVE_2HSDI
1669 1.1.1.3 mrg [(match_operand 7)
1670 1.1.1.3 mrg (ANY_EXTEND:SVE_2HSDI
1671 1.1.1.3 mrg (unspec:SVE_2BHSI
1672 1.1.1.3 mrg [(match_operand:VNx2BI 5 "register_operand" "Upl, Upl")
1673 1.1.1.3 mrg (match_operand:DI 1 "aarch64_reg_or_zero" "rk, rk")
1674 1.1.1.3 mrg (and:VNx2DI
1675 1.1.1.3 mrg (match_operand:VNx2DI 2 "register_operand" "w, w")
1676 1.1.1.3 mrg (match_operand:VNx2DI 6 "aarch64_sve_uxtw_immediate"))
1677 1.1.1.3 mrg (match_operand:DI 3 "const_int_operand")
1678 1.1.1.3 mrg (match_operand:DI 4 "aarch64_gather_scale_operand_<SVE_2BHSI:Vesize>" "Ui1, i")
1679 1.1.1.3 mrg (mem:BLK (scratch))]
1680 1.1.1.3 mrg UNSPEC_LD1_GATHER))]
1681 1.1.1.3 mrg UNSPEC_PRED_X))]
1682 1.1.1.3 mrg "TARGET_SVE && (~<SVE_2HSDI:narrower_mask> & <SVE_2BHSI:self_mask>) == 0"
1683 1.1.1.3 mrg "@
1684 1.1.1.3 mrg ld1<ANY_EXTEND:s><SVE_2BHSI:Vesize>\t%0.d, %5/z, [%1, %2.d, uxtw]
1685 1.1.1.3 mrg ld1<ANY_EXTEND:s><SVE_2BHSI:Vesize>\t%0.d, %5/z, [%1, %2.d, uxtw %p4]"
1686 1.1.1.3 mrg "&& !CONSTANT_P (operands[7])"
1687 1.1.1.3 mrg {
1688 1.1.1.3 mrg operands[7] = CONSTM1_RTX (VNx2BImode);
1689 1.1.1.3 mrg }
1690 1.1.1.3 mrg )
1691 1.1.1.3 mrg
1692 1.1.1.3 mrg ;; -------------------------------------------------------------------------
1693 1.1.1.3 mrg ;; ---- First-faulting gather loads
1694 1.1.1.3 mrg ;; -------------------------------------------------------------------------
1695 1.1.1.3 mrg ;; Includes gather forms of:
1696 1.1.1.3 mrg ;; - LDFF1D
1697 1.1.1.3 mrg ;; - LDFF1W
1698 1.1.1.3 mrg ;; -------------------------------------------------------------------------
1699 1.1.1.3 mrg
1700 1.1.1.3 mrg ;; Predicated first-faulting gather loads for 32-bit elements. Operand
1701 1.1.1.3 mrg ;; 3 is true for unsigned extension and false for signed extension.
1702 1.1.1.3 mrg (define_insn "@aarch64_ldff1_gather<mode>"
1703 1.1.1.3 mrg [(set (match_operand:SVE_FULL_S 0 "register_operand" "=w, w, w, w, w, w")
1704 1.1.1.3 mrg (unspec:SVE_FULL_S
1705 1.1.1.3 mrg [(match_operand:VNx4BI 5 "register_operand" "Upl, Upl, Upl, Upl, Upl, Upl")
1706 1.1.1.3 mrg (match_operand:DI 1 "aarch64_sve_gather_offset_w" "Z, vgw, rk, rk, rk, rk")
1707 1.1.1.3 mrg (match_operand:VNx4SI 2 "register_operand" "w, w, w, w, w, w")
1708 1.1.1.3 mrg (match_operand:DI 3 "const_int_operand" "i, i, Z, Ui1, Z, Ui1")
1709 1.1.1.3 mrg (match_operand:DI 4 "aarch64_gather_scale_operand_w" "Ui1, Ui1, Ui1, Ui1, i, i")
1710 1.1.1.3 mrg (mem:BLK (scratch))
1711 1.1.1.3 mrg (reg:VNx16BI FFRT_REGNUM)]
1712 1.1.1.3 mrg UNSPEC_LDFF1_GATHER))]
1713 1.1.1.3 mrg "TARGET_SVE"
1714 1.1.1.3 mrg "@
1715 1.1.1.3 mrg ldff1w\t%0.s, %5/z, [%2.s]
1716 1.1.1.3 mrg ldff1w\t%0.s, %5/z, [%2.s, #%1]
1717 1.1.1.3 mrg ldff1w\t%0.s, %5/z, [%1, %2.s, sxtw]
1718 1.1.1.3 mrg ldff1w\t%0.s, %5/z, [%1, %2.s, uxtw]
1719 1.1.1.3 mrg ldff1w\t%0.s, %5/z, [%1, %2.s, sxtw %p4]
1720 1.1.1.3 mrg ldff1w\t%0.s, %5/z, [%1, %2.s, uxtw %p4]"
1721 1.1.1.3 mrg )
1722 1.1.1.3 mrg
1723 1.1.1.3 mrg ;; Predicated first-faulting gather loads for 64-bit elements. The value
1724 1.1.1.3 mrg ;; of operand 3 doesn't matter in this case.
1725 1.1.1.3 mrg (define_insn "@aarch64_ldff1_gather<mode>"
1726 1.1.1.3 mrg [(set (match_operand:SVE_FULL_D 0 "register_operand" "=w, w, w, w")
1727 1.1.1.3 mrg (unspec:SVE_FULL_D
1728 1.1.1.3 mrg [(match_operand:VNx2BI 5 "register_operand" "Upl, Upl, Upl, Upl")
1729 1.1.1.3 mrg (match_operand:DI 1 "aarch64_sve_gather_offset_d" "Z, vgd, rk, rk")
1730 1.1.1.3 mrg (match_operand:VNx2DI 2 "register_operand" "w, w, w, w")
1731 1.1.1.3 mrg (match_operand:DI 3 "const_int_operand")
1732 1.1.1.3 mrg (match_operand:DI 4 "aarch64_gather_scale_operand_d" "Ui1, Ui1, Ui1, i")
1733 1.1.1.3 mrg (mem:BLK (scratch))
1734 1.1.1.3 mrg (reg:VNx16BI FFRT_REGNUM)]
1735 1.1.1.3 mrg UNSPEC_LDFF1_GATHER))]
1736 1.1.1.3 mrg "TARGET_SVE"
1737 1.1.1.3 mrg "@
1738 1.1.1.3 mrg ldff1d\t%0.d, %5/z, [%2.d]
1739 1.1.1.3 mrg ldff1d\t%0.d, %5/z, [%2.d, #%1]
1740 1.1.1.3 mrg ldff1d\t%0.d, %5/z, [%1, %2.d]
1741 1.1.1.3 mrg ldff1d\t%0.d, %5/z, [%1, %2.d, lsl %p4]"
1742 1.1.1.3 mrg )
1743 1.1.1.3 mrg
1744 1.1.1.3 mrg ;; Likewise, but with the offset being sign-extended from 32 bits.
1745 1.1.1.3 mrg (define_insn_and_rewrite "*aarch64_ldff1_gather<mode>_sxtw"
1746 1.1.1.3 mrg [(set (match_operand:SVE_FULL_D 0 "register_operand" "=w, w")
1747 1.1.1.3 mrg (unspec:SVE_FULL_D
1748 1.1.1.3 mrg [(match_operand:VNx2BI 5 "register_operand" "Upl, Upl")
1749 1.1.1.3 mrg (match_operand:DI 1 "register_operand" "rk, rk")
1750 1.1.1.3 mrg (unspec:VNx2DI
1751 1.1.1.3 mrg [(match_operand 6)
1752 1.1.1.3 mrg (sign_extend:VNx2DI
1753 1.1.1.3 mrg (truncate:VNx2SI
1754 1.1.1.3 mrg (match_operand:VNx2DI 2 "register_operand" "w, w")))]
1755 1.1.1.3 mrg UNSPEC_PRED_X)
1756 1.1.1.3 mrg (match_operand:DI 3 "const_int_operand")
1757 1.1.1.3 mrg (match_operand:DI 4 "aarch64_gather_scale_operand_d" "Ui1, i")
1758 1.1.1.3 mrg (mem:BLK (scratch))
1759 1.1.1.3 mrg (reg:VNx16BI FFRT_REGNUM)]
1760 1.1.1.3 mrg UNSPEC_LDFF1_GATHER))]
1761 1.1 mrg "TARGET_SVE"
1762 1.1 mrg "@
1763 1.1.1.3 mrg ldff1d\t%0.d, %5/z, [%1, %2.d, sxtw]
1764 1.1.1.3 mrg ldff1d\t%0.d, %5/z, [%1, %2.d, sxtw %p4]"
1765 1.1.1.3 mrg "&& !CONSTANT_P (operands[6])"
1766 1.1 mrg {
1767 1.1.1.3 mrg operands[6] = CONSTM1_RTX (VNx2BImode);
1768 1.1 mrg }
1769 1.1 mrg )
1770 1.1 mrg
1771 1.1.1.3 mrg ;; Likewise, but with the offset being zero-extended from 32 bits.
1772 1.1.1.3 mrg (define_insn "*aarch64_ldff1_gather<mode>_uxtw"
1773 1.1.1.3 mrg [(set (match_operand:SVE_FULL_D 0 "register_operand" "=w, w")
1774 1.1.1.3 mrg (unspec:SVE_FULL_D
1775 1.1.1.3 mrg [(match_operand:VNx2BI 5 "register_operand" "Upl, Upl")
1776 1.1.1.3 mrg (match_operand:DI 1 "register_operand" "rk, rk")
1777 1.1.1.3 mrg (and:VNx2DI
1778 1.1.1.3 mrg (match_operand:VNx2DI 2 "register_operand" "w, w")
1779 1.1.1.3 mrg (match_operand:VNx2DI 6 "aarch64_sve_uxtw_immediate"))
1780 1.1.1.3 mrg (match_operand:DI 3 "const_int_operand")
1781 1.1.1.3 mrg (match_operand:DI 4 "aarch64_gather_scale_operand_d" "Ui1, i")
1782 1.1.1.3 mrg (mem:BLK (scratch))
1783 1.1.1.3 mrg (reg:VNx16BI FFRT_REGNUM)]
1784 1.1.1.3 mrg UNSPEC_LDFF1_GATHER))]
1785 1.1.1.3 mrg "TARGET_SVE"
1786 1.1.1.3 mrg "@
1787 1.1.1.3 mrg ldff1d\t%0.d, %5/z, [%1, %2.d, uxtw]
1788 1.1.1.3 mrg ldff1d\t%0.d, %5/z, [%1, %2.d, uxtw %p4]"
1789 1.1.1.3 mrg )
1790 1.1.1.3 mrg
1791 1.1.1.3 mrg ;; -------------------------------------------------------------------------
1792 1.1.1.3 mrg ;; ---- First-faulting extending gather loads
1793 1.1.1.3 mrg ;; -------------------------------------------------------------------------
1794 1.1.1.3 mrg ;; Includes gather forms of:
1795 1.1.1.3 mrg ;; - LDFF1B
1796 1.1.1.3 mrg ;; - LDFF1H
1797 1.1.1.3 mrg ;; - LDFF1SB
1798 1.1.1.3 mrg ;; - LDFF1SH
1799 1.1.1.3 mrg ;; - LDFF1SW
1800 1.1.1.3 mrg ;; - LDFF1W
1801 1.1.1.3 mrg ;; -------------------------------------------------------------------------
1802 1.1.1.3 mrg
1803 1.1.1.3 mrg ;; Predicated extending first-faulting gather loads for 32-bit elements.
1804 1.1.1.3 mrg ;; Operand 3 is true for unsigned extension and false for signed extension.
1805 1.1.1.3 mrg (define_insn_and_rewrite "@aarch64_ldff1_gather_<ANY_EXTEND:optab><VNx4_WIDE:mode><VNx4_NARROW:mode>"
1806 1.1.1.3 mrg [(set (match_operand:VNx4_WIDE 0 "register_operand" "=w, w, w, w, w, w")
1807 1.1.1.3 mrg (unspec:VNx4_WIDE
1808 1.1.1.3 mrg [(match_operand:VNx4BI 6 "general_operand" "UplDnm, UplDnm, UplDnm, UplDnm, UplDnm, UplDnm")
1809 1.1.1.3 mrg (ANY_EXTEND:VNx4_WIDE
1810 1.1.1.3 mrg (unspec:VNx4_NARROW
1811 1.1.1.3 mrg [(match_operand:VNx4BI 5 "register_operand" "Upl, Upl, Upl, Upl, Upl, Upl")
1812 1.1.1.3 mrg (match_operand:DI 1 "aarch64_sve_gather_offset_<VNx4_NARROW:Vesize>" "Z, vg<VNx4_NARROW:Vesize>, rk, rk, rk, rk")
1813 1.1.1.3 mrg (match_operand:VNx4_WIDE 2 "register_operand" "w, w, w, w, w, w")
1814 1.1.1.3 mrg (match_operand:DI 3 "const_int_operand" "i, i, Z, Ui1, Z, Ui1")
1815 1.1.1.3 mrg (match_operand:DI 4 "aarch64_gather_scale_operand_<VNx4_NARROW:Vesize>" "Ui1, Ui1, Ui1, Ui1, i, i")
1816 1.1.1.3 mrg (mem:BLK (scratch))
1817 1.1.1.3 mrg (reg:VNx16BI FFRT_REGNUM)]
1818 1.1.1.3 mrg UNSPEC_LDFF1_GATHER))]
1819 1.1.1.3 mrg UNSPEC_PRED_X))]
1820 1.1.1.3 mrg "TARGET_SVE"
1821 1.1.1.3 mrg "@
1822 1.1.1.3 mrg ldff1<ANY_EXTEND:s><VNx4_NARROW:Vesize>\t%0.s, %5/z, [%2.s]
1823 1.1.1.3 mrg ldff1<ANY_EXTEND:s><VNx4_NARROW:Vesize>\t%0.s, %5/z, [%2.s, #%1]
1824 1.1.1.3 mrg ldff1<ANY_EXTEND:s><VNx4_NARROW:Vesize>\t%0.s, %5/z, [%1, %2.s, sxtw]
1825 1.1.1.3 mrg ldff1<ANY_EXTEND:s><VNx4_NARROW:Vesize>\t%0.s, %5/z, [%1, %2.s, uxtw]
1826 1.1.1.3 mrg ldff1<ANY_EXTEND:s><VNx4_NARROW:Vesize>\t%0.s, %5/z, [%1, %2.s, sxtw %p4]
1827 1.1.1.3 mrg ldff1<ANY_EXTEND:s><VNx4_NARROW:Vesize>\t%0.s, %5/z, [%1, %2.s, uxtw %p4]"
1828 1.1.1.3 mrg "&& !CONSTANT_P (operands[6])"
1829 1.1.1.3 mrg {
1830 1.1.1.3 mrg operands[6] = CONSTM1_RTX (VNx4BImode);
1831 1.1.1.3 mrg }
1832 1.1.1.3 mrg )
1833 1.1.1.3 mrg
1834 1.1.1.3 mrg ;; Predicated extending first-faulting gather loads for 64-bit elements.
1835 1.1.1.3 mrg ;; The value of operand 3 doesn't matter in this case.
1836 1.1.1.3 mrg (define_insn_and_rewrite "@aarch64_ldff1_gather_<ANY_EXTEND:optab><VNx2_WIDE:mode><VNx2_NARROW:mode>"
1837 1.1.1.3 mrg [(set (match_operand:VNx2_WIDE 0 "register_operand" "=w, w, w, w")
1838 1.1.1.3 mrg (unspec:VNx2_WIDE
1839 1.1.1.3 mrg [(match_operand:VNx2BI 6 "general_operand" "UplDnm, UplDnm, UplDnm, UplDnm")
1840 1.1.1.3 mrg (ANY_EXTEND:VNx2_WIDE
1841 1.1.1.3 mrg (unspec:VNx2_NARROW
1842 1.1.1.3 mrg [(match_operand:VNx2BI 5 "register_operand" "Upl, Upl, Upl, Upl")
1843 1.1.1.3 mrg (match_operand:DI 1 "aarch64_sve_gather_offset_<VNx2_NARROW:Vesize>" "Z, vg<VNx2_NARROW:Vesize>, rk, rk")
1844 1.1.1.3 mrg (match_operand:VNx2_WIDE 2 "register_operand" "w, w, w, w")
1845 1.1.1.3 mrg (match_operand:DI 3 "const_int_operand")
1846 1.1.1.3 mrg (match_operand:DI 4 "aarch64_gather_scale_operand_<VNx2_NARROW:Vesize>" "Ui1, Ui1, Ui1, i")
1847 1.1.1.3 mrg (mem:BLK (scratch))
1848 1.1.1.3 mrg (reg:VNx16BI FFRT_REGNUM)]
1849 1.1.1.3 mrg UNSPEC_LDFF1_GATHER))]
1850 1.1.1.3 mrg UNSPEC_PRED_X))]
1851 1.1.1.3 mrg "TARGET_SVE"
1852 1.1.1.3 mrg "@
1853 1.1.1.3 mrg ldff1<ANY_EXTEND:s><VNx2_NARROW:Vesize>\t%0.d, %5/z, [%2.d]
1854 1.1.1.3 mrg ldff1<ANY_EXTEND:s><VNx2_NARROW:Vesize>\t%0.d, %5/z, [%2.d, #%1]
1855 1.1.1.3 mrg ldff1<ANY_EXTEND:s><VNx2_NARROW:Vesize>\t%0.d, %5/z, [%1, %2.d]
1856 1.1.1.3 mrg ldff1<ANY_EXTEND:s><VNx2_NARROW:Vesize>\t%0.d, %5/z, [%1, %2.d, lsl %p4]"
1857 1.1.1.3 mrg "&& !CONSTANT_P (operands[6])"
1858 1.1.1.3 mrg {
1859 1.1.1.3 mrg operands[6] = CONSTM1_RTX (VNx2BImode);
1860 1.1.1.3 mrg }
1861 1.1.1.3 mrg )
1862 1.1.1.3 mrg
1863 1.1.1.3 mrg ;; Likewise, but with the offset being sign-extended from 32 bits.
1864 1.1.1.3 mrg (define_insn_and_rewrite "*aarch64_ldff1_gather_<ANY_EXTEND:optab><VNx2_WIDE:mode><VNx2_NARROW:mode>_sxtw"
1865 1.1.1.3 mrg [(set (match_operand:VNx2_WIDE 0 "register_operand" "=w, w")
1866 1.1.1.3 mrg (unspec:VNx2_WIDE
1867 1.1.1.3 mrg [(match_operand 6)
1868 1.1.1.3 mrg (ANY_EXTEND:VNx2_WIDE
1869 1.1.1.3 mrg (unspec:VNx2_NARROW
1870 1.1.1.3 mrg [(match_operand:VNx2BI 5 "register_operand" "Upl, Upl")
1871 1.1.1.3 mrg (match_operand:DI 1 "aarch64_reg_or_zero" "rk, rk")
1872 1.1.1.3 mrg (unspec:VNx2DI
1873 1.1.1.3 mrg [(match_operand 7)
1874 1.1.1.3 mrg (sign_extend:VNx2DI
1875 1.1.1.3 mrg (truncate:VNx2SI
1876 1.1.1.3 mrg (match_operand:VNx2DI 2 "register_operand" "w, w")))]
1877 1.1.1.3 mrg UNSPEC_PRED_X)
1878 1.1.1.3 mrg (match_operand:DI 3 "const_int_operand")
1879 1.1.1.3 mrg (match_operand:DI 4 "aarch64_gather_scale_operand_<VNx2_NARROW:Vesize>" "Ui1, i")
1880 1.1.1.3 mrg (mem:BLK (scratch))
1881 1.1.1.3 mrg (reg:VNx16BI FFRT_REGNUM)]
1882 1.1.1.3 mrg UNSPEC_LDFF1_GATHER))]
1883 1.1.1.3 mrg UNSPEC_PRED_X))]
1884 1.1.1.3 mrg "TARGET_SVE"
1885 1.1.1.3 mrg "@
1886 1.1.1.3 mrg ldff1<ANY_EXTEND:s><VNx2_NARROW:Vesize>\t%0.d, %5/z, [%1, %2.d, sxtw]
1887 1.1.1.3 mrg ldff1<ANY_EXTEND:s><VNx2_NARROW:Vesize>\t%0.d, %5/z, [%1, %2.d, sxtw %p4]"
1888 1.1.1.3 mrg "&& (!CONSTANT_P (operands[6]) || !CONSTANT_P (operands[7]))"
1889 1.1.1.3 mrg {
1890 1.1.1.3 mrg operands[6] = CONSTM1_RTX (VNx2BImode);
1891 1.1.1.3 mrg operands[7] = CONSTM1_RTX (VNx2BImode);
1892 1.1.1.3 mrg }
1893 1.1.1.3 mrg )
1894 1.1.1.3 mrg
1895 1.1.1.3 mrg ;; Likewise, but with the offset being zero-extended from 32 bits.
1896 1.1.1.3 mrg (define_insn_and_rewrite "*aarch64_ldff1_gather_<ANY_EXTEND:optab><VNx2_WIDE:mode><VNx2_NARROW:mode>_uxtw"
1897 1.1.1.3 mrg [(set (match_operand:VNx2_WIDE 0 "register_operand" "=w, w")
1898 1.1.1.3 mrg (unspec:VNx2_WIDE
1899 1.1.1.3 mrg [(match_operand 7)
1900 1.1.1.3 mrg (ANY_EXTEND:VNx2_WIDE
1901 1.1.1.3 mrg (unspec:VNx2_NARROW
1902 1.1.1.3 mrg [(match_operand:VNx2BI 5 "register_operand" "Upl, Upl")
1903 1.1.1.3 mrg (match_operand:DI 1 "aarch64_reg_or_zero" "rk, rk")
1904 1.1.1.3 mrg (and:VNx2DI
1905 1.1.1.3 mrg (match_operand:VNx2DI 2 "register_operand" "w, w")
1906 1.1.1.3 mrg (match_operand:VNx2DI 6 "aarch64_sve_uxtw_immediate"))
1907 1.1.1.3 mrg (match_operand:DI 3 "const_int_operand")
1908 1.1.1.3 mrg (match_operand:DI 4 "aarch64_gather_scale_operand_<VNx2_NARROW:Vesize>" "Ui1, i")
1909 1.1.1.3 mrg (mem:BLK (scratch))
1910 1.1.1.3 mrg (reg:VNx16BI FFRT_REGNUM)]
1911 1.1.1.3 mrg UNSPEC_LDFF1_GATHER))]
1912 1.1.1.3 mrg UNSPEC_PRED_X))]
1913 1.1.1.3 mrg "TARGET_SVE"
1914 1.1.1.3 mrg "@
1915 1.1.1.3 mrg ldff1<ANY_EXTEND:s><VNx2_NARROW:Vesize>\t%0.d, %5/z, [%1, %2.d, uxtw]
1916 1.1.1.3 mrg ldff1<ANY_EXTEND:s><VNx2_NARROW:Vesize>\t%0.d, %5/z, [%1, %2.d, uxtw %p4]"
1917 1.1.1.3 mrg "&& !CONSTANT_P (operands[7])"
1918 1.1.1.3 mrg {
1919 1.1.1.3 mrg operands[7] = CONSTM1_RTX (VNx2BImode);
1920 1.1.1.3 mrg }
1921 1.1.1.3 mrg )
1922 1.1.1.3 mrg
1923 1.1.1.3 mrg ;; =========================================================================
1924 1.1.1.3 mrg ;; == Prefetches
1925 1.1.1.3 mrg ;; =========================================================================
1926 1.1.1.3 mrg
1927 1.1.1.3 mrg ;; -------------------------------------------------------------------------
1928 1.1.1.3 mrg ;; ---- Contiguous prefetches
1929 1.1.1.3 mrg ;; -------------------------------------------------------------------------
1930 1.1.1.3 mrg ;; Includes contiguous forms of:
1931 1.1.1.3 mrg ;; - PRFB
1932 1.1.1.3 mrg ;; - PRFD
1933 1.1.1.3 mrg ;; - PRFH
1934 1.1.1.3 mrg ;; - PRFW
1935 1.1.1.3 mrg ;; -------------------------------------------------------------------------
1936 1.1.1.3 mrg
1937 1.1.1.3 mrg ;; Contiguous predicated prefetches. Operand 2 gives the real prefetch
1938 1.1.1.3 mrg ;; operation (as an svprfop), with operands 3 and 4 providing distilled
1939 1.1.1.3 mrg ;; information.
1940 1.1.1.3 mrg (define_insn "@aarch64_sve_prefetch<mode>"
1941 1.1.1.3 mrg [(prefetch (unspec:DI
1942 1.1.1.3 mrg [(match_operand:<VPRED> 0 "register_operand" "Upl")
1943 1.1.1.3 mrg (match_operand:SVE_FULL_I 1 "aarch64_sve_prefetch_operand" "UP<Vesize>")
1944 1.1.1.3 mrg (match_operand:DI 2 "const_int_operand")]
1945 1.1.1.3 mrg UNSPEC_SVE_PREFETCH)
1946 1.1.1.3 mrg (match_operand:DI 3 "const_int_operand")
1947 1.1.1.3 mrg (match_operand:DI 4 "const_int_operand"))]
1948 1.1.1.3 mrg "TARGET_SVE"
1949 1.1.1.3 mrg {
1950 1.1.1.3 mrg operands[1] = gen_rtx_MEM (<MODE>mode, operands[1]);
1951 1.1.1.3 mrg return aarch64_output_sve_prefetch ("prf<Vesize>", operands[2], "%0, %1");
1952 1.1.1.3 mrg }
1953 1.1.1.3 mrg )
1954 1.1.1.3 mrg
1955 1.1.1.3 mrg ;; -------------------------------------------------------------------------
1956 1.1.1.3 mrg ;; ---- Gather prefetches
1957 1.1.1.3 mrg ;; -------------------------------------------------------------------------
1958 1.1.1.3 mrg ;; Includes gather forms of:
1959 1.1.1.3 mrg ;; - PRFB
1960 1.1.1.3 mrg ;; - PRFD
1961 1.1.1.3 mrg ;; - PRFH
1962 1.1.1.3 mrg ;; - PRFW
1963 1.1.1.3 mrg ;; -------------------------------------------------------------------------
1964 1.1.1.3 mrg
1965 1.1.1.3 mrg ;; Predicated gather prefetches for 32-bit bases and offsets. The operands
1966 1.1.1.3 mrg ;; are:
1967 1.1.1.3 mrg ;; 0: the governing predicate
1968 1.1.1.3 mrg ;; 1: the scalar component of the address
1969 1.1.1.3 mrg ;; 2: the vector component of the address
1970 1.1.1.3 mrg ;; 3: 1 for zero extension, 0 for sign extension
1971 1.1.1.3 mrg ;; 4: the scale multiplier
1972 1.1.1.3 mrg ;; 5: a vector zero that identifies the mode of data being accessed
1973 1.1.1.3 mrg ;; 6: the prefetch operator (an svprfop)
1974 1.1.1.3 mrg ;; 7: the normal RTL prefetch rw flag
1975 1.1.1.3 mrg ;; 8: the normal RTL prefetch locality value
1976 1.1.1.3 mrg (define_insn "@aarch64_sve_gather_prefetch<SVE_FULL_I:mode><VNx4SI_ONLY:mode>"
1977 1.1.1.3 mrg [(prefetch (unspec:DI
1978 1.1.1.3 mrg [(match_operand:VNx4BI 0 "register_operand" "Upl, Upl, Upl, Upl, Upl, Upl")
1979 1.1.1.3 mrg (match_operand:DI 1 "aarch64_sve_gather_offset_<SVE_FULL_I:Vesize>" "Z, vg<SVE_FULL_I:Vesize>, rk, rk, rk, rk")
1980 1.1.1.3 mrg (match_operand:VNx4SI_ONLY 2 "register_operand" "w, w, w, w, w, w")
1981 1.1.1.3 mrg (match_operand:DI 3 "const_int_operand" "i, i, Z, Ui1, Z, Ui1")
1982 1.1.1.3 mrg (match_operand:DI 4 "aarch64_gather_scale_operand_<SVE_FULL_I:Vesize>" "Ui1, Ui1, Ui1, Ui1, i, i")
1983 1.1.1.3 mrg (match_operand:SVE_FULL_I 5 "aarch64_simd_imm_zero")
1984 1.1.1.3 mrg (match_operand:DI 6 "const_int_operand")]
1985 1.1.1.3 mrg UNSPEC_SVE_PREFETCH_GATHER)
1986 1.1.1.3 mrg (match_operand:DI 7 "const_int_operand")
1987 1.1.1.3 mrg (match_operand:DI 8 "const_int_operand"))]
1988 1.1.1.3 mrg "TARGET_SVE"
1989 1.1.1.3 mrg {
1990 1.1.1.3 mrg static const char *const insns[][2] = {
1991 1.1.1.3 mrg "prf<SVE_FULL_I:Vesize>", "%0, [%2.s]",
1992 1.1.1.3 mrg "prf<SVE_FULL_I:Vesize>", "%0, [%2.s, #%1]",
1993 1.1.1.3 mrg "prfb", "%0, [%1, %2.s, sxtw]",
1994 1.1.1.3 mrg "prfb", "%0, [%1, %2.s, uxtw]",
1995 1.1.1.3 mrg "prf<SVE_FULL_I:Vesize>", "%0, [%1, %2.s, sxtw %p4]",
1996 1.1.1.3 mrg "prf<SVE_FULL_I:Vesize>", "%0, [%1, %2.s, uxtw %p4]"
1997 1.1.1.3 mrg };
1998 1.1.1.3 mrg const char *const *parts = insns[which_alternative];
1999 1.1.1.3 mrg return aarch64_output_sve_prefetch (parts[0], operands[6], parts[1]);
2000 1.1.1.2 mrg }
2001 1.1.1.2 mrg )
2002 1.1.1.2 mrg
2003 1.1.1.3 mrg ;; Predicated gather prefetches for 64-bit elements. The value of operand 3
2004 1.1.1.3 mrg ;; doesn't matter in this case.
2005 1.1.1.3 mrg (define_insn "@aarch64_sve_gather_prefetch<SVE_FULL_I:mode><VNx2DI_ONLY:mode>"
2006 1.1.1.3 mrg [(prefetch (unspec:DI
2007 1.1.1.3 mrg [(match_operand:VNx2BI 0 "register_operand" "Upl, Upl, Upl, Upl")
2008 1.1.1.3 mrg (match_operand:DI 1 "aarch64_sve_gather_offset_<SVE_FULL_I:Vesize>" "Z, vg<SVE_FULL_I:Vesize>, rk, rk")
2009 1.1.1.3 mrg (match_operand:VNx2DI_ONLY 2 "register_operand" "w, w, w, w")
2010 1.1.1.3 mrg (match_operand:DI 3 "const_int_operand")
2011 1.1.1.3 mrg (match_operand:DI 4 "aarch64_gather_scale_operand_<SVE_FULL_I:Vesize>" "Ui1, Ui1, Ui1, i")
2012 1.1.1.3 mrg (match_operand:SVE_FULL_I 5 "aarch64_simd_imm_zero")
2013 1.1.1.3 mrg (match_operand:DI 6 "const_int_operand")]
2014 1.1.1.3 mrg UNSPEC_SVE_PREFETCH_GATHER)
2015 1.1.1.3 mrg (match_operand:DI 7 "const_int_operand")
2016 1.1.1.3 mrg (match_operand:DI 8 "const_int_operand"))]
2017 1.1.1.3 mrg "TARGET_SVE"
2018 1.1.1.3 mrg {
2019 1.1.1.3 mrg static const char *const insns[][2] = {
2020 1.1.1.3 mrg "prf<SVE_FULL_I:Vesize>", "%0, [%2.d]",
2021 1.1.1.3 mrg "prf<SVE_FULL_I:Vesize>", "%0, [%2.d, #%1]",
2022 1.1.1.3 mrg "prfb", "%0, [%1, %2.d]",
2023 1.1.1.3 mrg "prf<SVE_FULL_I:Vesize>", "%0, [%1, %2.d, lsl %p4]"
2024 1.1.1.3 mrg };
2025 1.1.1.3 mrg const char *const *parts = insns[which_alternative];
2026 1.1.1.3 mrg return aarch64_output_sve_prefetch (parts[0], operands[6], parts[1]);
2027 1.1.1.3 mrg }
2028 1.1.1.3 mrg )
2029 1.1.1.3 mrg
2030 1.1.1.3 mrg ;; Likewise, but with the offset being sign-extended from 32 bits.
2031 1.1.1.3 mrg (define_insn_and_rewrite "*aarch64_sve_gather_prefetch<SVE_FULL_I:mode><VNx2DI_ONLY:mode>_sxtw"
2032 1.1.1.3 mrg [(prefetch (unspec:DI
2033 1.1.1.3 mrg [(match_operand:VNx2BI 0 "register_operand" "Upl, Upl")
2034 1.1.1.3 mrg (match_operand:DI 1 "register_operand" "rk, rk")
2035 1.1.1.3 mrg (unspec:VNx2DI_ONLY
2036 1.1.1.3 mrg [(match_operand 9)
2037 1.1.1.3 mrg (sign_extend:VNx2DI
2038 1.1.1.3 mrg (truncate:VNx2SI
2039 1.1.1.3 mrg (match_operand:VNx2DI 2 "register_operand" "w, w")))]
2040 1.1.1.3 mrg UNSPEC_PRED_X)
2041 1.1.1.3 mrg (match_operand:DI 3 "const_int_operand")
2042 1.1.1.3 mrg (match_operand:DI 4 "aarch64_gather_scale_operand_<SVE_FULL_I:Vesize>" "Ui1, i")
2043 1.1.1.3 mrg (match_operand:SVE_FULL_I 5 "aarch64_simd_imm_zero")
2044 1.1.1.3 mrg (match_operand:DI 6 "const_int_operand")]
2045 1.1.1.3 mrg UNSPEC_SVE_PREFETCH_GATHER)
2046 1.1.1.3 mrg (match_operand:DI 7 "const_int_operand")
2047 1.1.1.3 mrg (match_operand:DI 8 "const_int_operand"))]
2048 1.1.1.3 mrg "TARGET_SVE"
2049 1.1.1.3 mrg {
2050 1.1.1.3 mrg static const char *const insns[][2] = {
2051 1.1.1.3 mrg "prfb", "%0, [%1, %2.d, sxtw]",
2052 1.1.1.3 mrg "prf<SVE_FULL_I:Vesize>", "%0, [%1, %2.d, sxtw %p4]"
2053 1.1.1.3 mrg };
2054 1.1.1.3 mrg const char *const *parts = insns[which_alternative];
2055 1.1.1.3 mrg return aarch64_output_sve_prefetch (parts[0], operands[6], parts[1]);
2056 1.1.1.3 mrg }
2057 1.1.1.3 mrg "&& !rtx_equal_p (operands[0], operands[9])"
2058 1.1.1.3 mrg {
2059 1.1.1.3 mrg operands[9] = copy_rtx (operands[0]);
2060 1.1.1.3 mrg }
2061 1.1.1.3 mrg )
2062 1.1.1.3 mrg
2063 1.1.1.3 mrg ;; Likewise, but with the offset being zero-extended from 32 bits.
2064 1.1.1.3 mrg (define_insn "*aarch64_sve_gather_prefetch<SVE_FULL_I:mode><VNx2DI_ONLY:mode>_uxtw"
2065 1.1.1.3 mrg [(prefetch (unspec:DI
2066 1.1.1.3 mrg [(match_operand:VNx2BI 0 "register_operand" "Upl, Upl")
2067 1.1.1.3 mrg (match_operand:DI 1 "register_operand" "rk, rk")
2068 1.1.1.3 mrg (and:VNx2DI_ONLY
2069 1.1.1.3 mrg (match_operand:VNx2DI 2 "register_operand" "w, w")
2070 1.1.1.3 mrg (match_operand:VNx2DI 9 "aarch64_sve_uxtw_immediate"))
2071 1.1.1.3 mrg (match_operand:DI 3 "const_int_operand")
2072 1.1.1.3 mrg (match_operand:DI 4 "aarch64_gather_scale_operand_<SVE_FULL_I:Vesize>" "Ui1, i")
2073 1.1.1.3 mrg (match_operand:SVE_FULL_I 5 "aarch64_simd_imm_zero")
2074 1.1.1.3 mrg (match_operand:DI 6 "const_int_operand")]
2075 1.1.1.3 mrg UNSPEC_SVE_PREFETCH_GATHER)
2076 1.1.1.3 mrg (match_operand:DI 7 "const_int_operand")
2077 1.1.1.3 mrg (match_operand:DI 8 "const_int_operand"))]
2078 1.1.1.3 mrg "TARGET_SVE"
2079 1.1.1.3 mrg {
2080 1.1.1.3 mrg static const char *const insns[][2] = {
2081 1.1.1.3 mrg "prfb", "%0, [%1, %2.d, uxtw]",
2082 1.1.1.3 mrg "prf<SVE_FULL_I:Vesize>", "%0, [%1, %2.d, uxtw %p4]"
2083 1.1.1.3 mrg };
2084 1.1.1.3 mrg const char *const *parts = insns[which_alternative];
2085 1.1.1.3 mrg return aarch64_output_sve_prefetch (parts[0], operands[6], parts[1]);
2086 1.1.1.3 mrg }
2087 1.1.1.3 mrg )
2088 1.1.1.3 mrg
2089 1.1.1.3 mrg ;; =========================================================================
2090 1.1.1.3 mrg ;; == Stores
2091 1.1.1.3 mrg ;; =========================================================================
2092 1.1.1.3 mrg
2093 1.1.1.3 mrg ;; -------------------------------------------------------------------------
2094 1.1.1.3 mrg ;; ---- Normal contiguous stores
2095 1.1.1.3 mrg ;; -------------------------------------------------------------------------
2096 1.1.1.3 mrg ;; Includes contiguous forms of:
2097 1.1.1.3 mrg ;; - ST1B
2098 1.1.1.3 mrg ;; - ST1D
2099 1.1.1.3 mrg ;; - ST1H
2100 1.1.1.3 mrg ;; - ST1W
2101 1.1.1.3 mrg ;; - ST2B
2102 1.1.1.3 mrg ;; - ST2D
2103 1.1.1.3 mrg ;; - ST2H
2104 1.1.1.3 mrg ;; - ST2W
2105 1.1.1.3 mrg ;; - ST3B
2106 1.1.1.3 mrg ;; - ST3D
2107 1.1.1.3 mrg ;; - ST3H
2108 1.1.1.3 mrg ;; - ST3W
2109 1.1.1.3 mrg ;; - ST4B
2110 1.1.1.3 mrg ;; - ST4D
2111 1.1.1.3 mrg ;; - ST4H
2112 1.1.1.3 mrg ;; - ST4W
2113 1.1.1.3 mrg ;; -------------------------------------------------------------------------
2114 1.1.1.3 mrg
2115 1.1.1.3 mrg ;; Predicated ST1.
2116 1.1.1.3 mrg (define_insn "maskstore<mode><vpred>"
2117 1.1.1.3 mrg [(set (match_operand:SVE_ALL 0 "memory_operand" "+m")
2118 1.1.1.3 mrg (unspec:SVE_ALL
2119 1.1.1.3 mrg [(match_operand:<VPRED> 2 "register_operand" "Upl")
2120 1.1.1.3 mrg (match_operand:SVE_ALL 1 "register_operand" "w")
2121 1.1.1.3 mrg (match_dup 0)]
2122 1.1.1.3 mrg UNSPEC_ST1_SVE))]
2123 1.1.1.2 mrg "TARGET_SVE"
2124 1.1.1.3 mrg "st1<Vesize>\t%1.<Vctype>, %2, %0"
2125 1.1 mrg )
2126 1.1 mrg
2127 1.1.1.3 mrg ;; Unpredicated ST[234]. This is always a full update, so the dependence
2128 1.1.1.3 mrg ;; on the old value of the memory location (via (match_dup 0)) is redundant.
2129 1.1.1.3 mrg ;; There doesn't seem to be any obvious benefit to treating the all-true
2130 1.1.1.3 mrg ;; case differently though. In particular, it's very unlikely that we'll
2131 1.1.1.3 mrg ;; only find out during RTL that a store_lanes is dead.
2132 1.1.1.3 mrg (define_expand "vec_store_lanes<mode><vsingle>"
2133 1.1.1.3 mrg [(set (match_operand:SVE_STRUCT 0 "memory_operand")
2134 1.1.1.3 mrg (unspec:SVE_STRUCT
2135 1.1 mrg [(match_dup 2)
2136 1.1.1.3 mrg (match_operand:SVE_STRUCT 1 "register_operand")
2137 1.1.1.3 mrg (match_dup 0)]
2138 1.1.1.3 mrg UNSPEC_STN))]
2139 1.1 mrg "TARGET_SVE"
2140 1.1 mrg {
2141 1.1.1.3 mrg operands[2] = aarch64_ptrue_reg (<VPRED>mode);
2142 1.1 mrg }
2143 1.1 mrg )
2144 1.1 mrg
2145 1.1.1.3 mrg ;; Predicated ST[234].
2146 1.1.1.3 mrg (define_insn "vec_mask_store_lanes<mode><vsingle>"
2147 1.1.1.3 mrg [(set (match_operand:SVE_STRUCT 0 "memory_operand" "+m")
2148 1.1.1.3 mrg (unspec:SVE_STRUCT
2149 1.1.1.3 mrg [(match_operand:<VPRED> 2 "register_operand" "Upl")
2150 1.1.1.3 mrg (match_operand:SVE_STRUCT 1 "register_operand" "w")
2151 1.1.1.3 mrg (match_dup 0)]
2152 1.1.1.3 mrg UNSPEC_STN))]
2153 1.1 mrg "TARGET_SVE"
2154 1.1.1.3 mrg "st<vector_count><Vesize>\t%1, %2, %0"
2155 1.1 mrg )
2156 1.1 mrg
2157 1.1.1.3 mrg ;; -------------------------------------------------------------------------
2158 1.1.1.3 mrg ;; ---- Truncating contiguous stores
2159 1.1.1.3 mrg ;; -------------------------------------------------------------------------
2160 1.1.1.3 mrg ;; Includes:
2161 1.1.1.3 mrg ;; - ST1B
2162 1.1.1.3 mrg ;; - ST1H
2163 1.1.1.3 mrg ;; - ST1W
2164 1.1.1.3 mrg ;; -------------------------------------------------------------------------
2165 1.1.1.3 mrg
2166 1.1.1.3 mrg ;; Predicated truncate and store, with 8 elements per 128-bit block.
2167 1.1.1.3 mrg (define_insn "@aarch64_store_trunc<VNx8_NARROW:mode><VNx8_WIDE:mode>"
2168 1.1.1.3 mrg [(set (match_operand:VNx8_NARROW 0 "memory_operand" "+m")
2169 1.1.1.3 mrg (unspec:VNx8_NARROW
2170 1.1.1.3 mrg [(match_operand:VNx8BI 2 "register_operand" "Upl")
2171 1.1.1.3 mrg (truncate:VNx8_NARROW
2172 1.1.1.3 mrg (match_operand:VNx8_WIDE 1 "register_operand" "w"))
2173 1.1.1.3 mrg (match_dup 0)]
2174 1.1.1.3 mrg UNSPEC_ST1_SVE))]
2175 1.1 mrg "TARGET_SVE"
2176 1.1.1.3 mrg "st1<VNx8_NARROW:Vesize>\t%1.<VNx8_WIDE:Vetype>, %2, %0"
2177 1.1 mrg )
2178 1.1 mrg
2179 1.1.1.3 mrg ;; Predicated truncate and store, with 4 elements per 128-bit block.
2180 1.1.1.3 mrg (define_insn "@aarch64_store_trunc<VNx4_NARROW:mode><VNx4_WIDE:mode>"
2181 1.1.1.3 mrg [(set (match_operand:VNx4_NARROW 0 "memory_operand" "+m")
2182 1.1.1.3 mrg (unspec:VNx4_NARROW
2183 1.1.1.3 mrg [(match_operand:VNx4BI 2 "register_operand" "Upl")
2184 1.1.1.3 mrg (truncate:VNx4_NARROW
2185 1.1.1.3 mrg (match_operand:VNx4_WIDE 1 "register_operand" "w"))
2186 1.1.1.3 mrg (match_dup 0)]
2187 1.1.1.3 mrg UNSPEC_ST1_SVE))]
2188 1.1 mrg "TARGET_SVE"
2189 1.1.1.3 mrg "st1<VNx4_NARROW:Vesize>\t%1.<VNx4_WIDE:Vetype>, %2, %0"
2190 1.1 mrg )
2191 1.1 mrg
2192 1.1.1.3 mrg ;; Predicated truncate and store, with 2 elements per 128-bit block.
2193 1.1.1.3 mrg (define_insn "@aarch64_store_trunc<VNx2_NARROW:mode><VNx2_WIDE:mode>"
2194 1.1.1.3 mrg [(set (match_operand:VNx2_NARROW 0 "memory_operand" "+m")
2195 1.1.1.3 mrg (unspec:VNx2_NARROW
2196 1.1.1.3 mrg [(match_operand:VNx2BI 2 "register_operand" "Upl")
2197 1.1.1.3 mrg (truncate:VNx2_NARROW
2198 1.1.1.3 mrg (match_operand:VNx2_WIDE 1 "register_operand" "w"))
2199 1.1.1.3 mrg (match_dup 0)]
2200 1.1.1.3 mrg UNSPEC_ST1_SVE))]
2201 1.1 mrg "TARGET_SVE"
2202 1.1.1.3 mrg "st1<VNx2_NARROW:Vesize>\t%1.<VNx2_WIDE:Vetype>, %2, %0"
2203 1.1 mrg )
2204 1.1 mrg
2205 1.1.1.3 mrg ;; -------------------------------------------------------------------------
2206 1.1.1.3 mrg ;; ---- Non-temporal contiguous stores
2207 1.1.1.3 mrg ;; -------------------------------------------------------------------------
2208 1.1.1.3 mrg ;; Includes:
2209 1.1.1.3 mrg ;; - STNT1B
2210 1.1.1.3 mrg ;; - STNT1D
2211 1.1.1.3 mrg ;; - STNT1H
2212 1.1.1.3 mrg ;; - STNT1W
2213 1.1.1.3 mrg ;; -------------------------------------------------------------------------
2214 1.1.1.3 mrg
2215 1.1.1.3 mrg (define_insn "@aarch64_stnt1<mode>"
2216 1.1.1.3 mrg [(set (match_operand:SVE_FULL 0 "memory_operand" "+m")
2217 1.1.1.3 mrg (unspec:SVE_FULL
2218 1.1.1.3 mrg [(match_operand:<VPRED> 2 "register_operand" "Upl")
2219 1.1.1.3 mrg (match_operand:SVE_FULL 1 "register_operand" "w")
2220 1.1.1.3 mrg (match_dup 0)]
2221 1.1.1.3 mrg UNSPEC_STNT1_SVE))]
2222 1.1 mrg "TARGET_SVE"
2223 1.1.1.3 mrg "stnt1<Vesize>\t%1.<Vetype>, %2, %0"
2224 1.1 mrg )
2225 1.1 mrg
2226 1.1.1.3 mrg ;; -------------------------------------------------------------------------
2227 1.1.1.3 mrg ;; ---- Normal scatter stores
2228 1.1.1.3 mrg ;; -------------------------------------------------------------------------
2229 1.1.1.3 mrg ;; Includes scatter forms of:
2230 1.1.1.3 mrg ;; - ST1D
2231 1.1.1.3 mrg ;; - ST1W
2232 1.1.1.3 mrg ;; -------------------------------------------------------------------------
2233 1.1.1.3 mrg
2234 1.1.1.3 mrg ;; Unpredicated scatter stores.
2235 1.1.1.3 mrg (define_expand "scatter_store<mode><v_int_container>"
2236 1.1.1.3 mrg [(set (mem:BLK (scratch))
2237 1.1.1.3 mrg (unspec:BLK
2238 1.1.1.3 mrg [(match_dup 5)
2239 1.1.1.3 mrg (match_operand:DI 0 "aarch64_sve_gather_offset_<Vesize>")
2240 1.1.1.3 mrg (match_operand:<V_INT_CONTAINER> 1 "register_operand")
2241 1.1.1.3 mrg (match_operand:DI 2 "const_int_operand")
2242 1.1.1.3 mrg (match_operand:DI 3 "aarch64_gather_scale_operand_<Vesize>")
2243 1.1.1.3 mrg (match_operand:SVE_24 4 "register_operand")]
2244 1.1.1.3 mrg UNSPEC_ST1_SCATTER))]
2245 1.1 mrg "TARGET_SVE"
2246 1.1 mrg {
2247 1.1.1.3 mrg operands[5] = aarch64_ptrue_reg (<VPRED>mode);
2248 1.1 mrg }
2249 1.1 mrg )
2250 1.1 mrg
2251 1.1.1.3 mrg ;; Predicated scatter stores for 32-bit elements. Operand 2 is true for
2252 1.1.1.3 mrg ;; unsigned extension and false for signed extension.
2253 1.1.1.3 mrg (define_insn "mask_scatter_store<mode><v_int_container>"
2254 1.1.1.3 mrg [(set (mem:BLK (scratch))
2255 1.1.1.3 mrg (unspec:BLK
2256 1.1.1.3 mrg [(match_operand:VNx4BI 5 "register_operand" "Upl, Upl, Upl, Upl, Upl, Upl")
2257 1.1.1.3 mrg (match_operand:DI 0 "aarch64_sve_gather_offset_<Vesize>" "Z, vgw, rk, rk, rk, rk")
2258 1.1.1.3 mrg (match_operand:VNx4SI 1 "register_operand" "w, w, w, w, w, w")
2259 1.1.1.3 mrg (match_operand:DI 2 "const_int_operand" "Ui1, Ui1, Z, Ui1, Z, Ui1")
2260 1.1.1.3 mrg (match_operand:DI 3 "aarch64_gather_scale_operand_<Vesize>" "Ui1, Ui1, Ui1, Ui1, i, i")
2261 1.1.1.3 mrg (match_operand:SVE_4 4 "register_operand" "w, w, w, w, w, w")]
2262 1.1.1.3 mrg UNSPEC_ST1_SCATTER))]
2263 1.1 mrg "TARGET_SVE"
2264 1.1.1.3 mrg "@
2265 1.1.1.3 mrg st1<Vesize>\t%4.s, %5, [%1.s]
2266 1.1.1.3 mrg st1<Vesize>\t%4.s, %5, [%1.s, #%0]
2267 1.1.1.3 mrg st1<Vesize>\t%4.s, %5, [%0, %1.s, sxtw]
2268 1.1.1.3 mrg st1<Vesize>\t%4.s, %5, [%0, %1.s, uxtw]
2269 1.1.1.3 mrg st1<Vesize>\t%4.s, %5, [%0, %1.s, sxtw %p3]
2270 1.1.1.3 mrg st1<Vesize>\t%4.s, %5, [%0, %1.s, uxtw %p3]"
2271 1.1 mrg )
2272 1.1 mrg
2273 1.1.1.3 mrg ;; Predicated scatter stores for 64-bit elements. The value of operand 2
2274 1.1.1.3 mrg ;; doesn't matter in this case.
2275 1.1.1.3 mrg (define_insn "mask_scatter_store<mode><v_int_container>"
2276 1.1.1.3 mrg [(set (mem:BLK (scratch))
2277 1.1.1.3 mrg (unspec:BLK
2278 1.1.1.3 mrg [(match_operand:VNx2BI 5 "register_operand" "Upl, Upl, Upl, Upl")
2279 1.1.1.3 mrg (match_operand:DI 0 "aarch64_sve_gather_offset_<Vesize>" "Z, vgd, rk, rk")
2280 1.1.1.3 mrg (match_operand:VNx2DI 1 "register_operand" "w, w, w, w")
2281 1.1.1.3 mrg (match_operand:DI 2 "const_int_operand")
2282 1.1.1.3 mrg (match_operand:DI 3 "aarch64_gather_scale_operand_<Vesize>" "Ui1, Ui1, Ui1, i")
2283 1.1.1.3 mrg (match_operand:SVE_2 4 "register_operand" "w, w, w, w")]
2284 1.1.1.3 mrg UNSPEC_ST1_SCATTER))]
2285 1.1 mrg "TARGET_SVE"
2286 1.1.1.3 mrg "@
2287 1.1.1.3 mrg st1<Vesize>\t%4.d, %5, [%1.d]
2288 1.1.1.3 mrg st1<Vesize>\t%4.d, %5, [%1.d, #%0]
2289 1.1.1.3 mrg st1<Vesize>\t%4.d, %5, [%0, %1.d]
2290 1.1.1.3 mrg st1<Vesize>\t%4.d, %5, [%0, %1.d, lsl %p3]"
2291 1.1 mrg )
2292 1.1 mrg
2293 1.1.1.3 mrg ;; Likewise, but with the offset being extended from 32 bits.
2294 1.1.1.3 mrg (define_insn_and_rewrite "*mask_scatter_store<mode><v_int_container>_<su>xtw_unpacked"
2295 1.1.1.3 mrg [(set (mem:BLK (scratch))
2296 1.1.1.3 mrg (unspec:BLK
2297 1.1.1.3 mrg [(match_operand:VNx2BI 5 "register_operand" "Upl, Upl")
2298 1.1.1.3 mrg (match_operand:DI 0 "register_operand" "rk, rk")
2299 1.1.1.3 mrg (unspec:VNx2DI
2300 1.1.1.3 mrg [(match_operand 6)
2301 1.1.1.3 mrg (ANY_EXTEND:VNx2DI
2302 1.1.1.3 mrg (match_operand:VNx2SI 1 "register_operand" "w, w"))]
2303 1.1.1.3 mrg UNSPEC_PRED_X)
2304 1.1.1.3 mrg (match_operand:DI 2 "const_int_operand")
2305 1.1.1.3 mrg (match_operand:DI 3 "aarch64_gather_scale_operand_<Vesize>" "Ui1, i")
2306 1.1.1.3 mrg (match_operand:SVE_2 4 "register_operand" "w, w")]
2307 1.1.1.3 mrg UNSPEC_ST1_SCATTER))]
2308 1.1 mrg "TARGET_SVE"
2309 1.1.1.3 mrg "@
2310 1.1.1.3 mrg st1<Vesize>\t%4.d, %5, [%0, %1.d, <su>xtw]
2311 1.1.1.3 mrg st1<Vesize>\t%4.d, %5, [%0, %1.d, <su>xtw %p3]"
2312 1.1.1.3 mrg "&& !CONSTANT_P (operands[6])"
2313 1.1 mrg {
2314 1.1.1.3 mrg operands[6] = CONSTM1_RTX (<VPRED>mode);
2315 1.1 mrg }
2316 1.1 mrg )
2317 1.1 mrg
2318 1.1.1.3 mrg ;; Likewise, but with the offset being truncated to 32 bits and then
2319 1.1.1.3 mrg ;; sign-extended.
2320 1.1.1.3 mrg (define_insn_and_rewrite "*mask_scatter_store<mode><v_int_container>_sxtw"
2321 1.1.1.3 mrg [(set (mem:BLK (scratch))
2322 1.1.1.3 mrg (unspec:BLK
2323 1.1.1.3 mrg [(match_operand:VNx2BI 5 "register_operand" "Upl, Upl")
2324 1.1.1.3 mrg (match_operand:DI 0 "register_operand" "rk, rk")
2325 1.1.1.3 mrg (unspec:VNx2DI
2326 1.1.1.3 mrg [(match_operand 6)
2327 1.1.1.3 mrg (sign_extend:VNx2DI
2328 1.1.1.3 mrg (truncate:VNx2SI
2329 1.1.1.3 mrg (match_operand:VNx2DI 1 "register_operand" "w, w")))]
2330 1.1.1.3 mrg UNSPEC_PRED_X)
2331 1.1.1.3 mrg (match_operand:DI 2 "const_int_operand")
2332 1.1.1.3 mrg (match_operand:DI 3 "aarch64_gather_scale_operand_<Vesize>" "Ui1, i")
2333 1.1.1.3 mrg (match_operand:SVE_2 4 "register_operand" "w, w")]
2334 1.1.1.3 mrg UNSPEC_ST1_SCATTER))]
2335 1.1 mrg "TARGET_SVE"
2336 1.1.1.3 mrg "@
2337 1.1.1.3 mrg st1<Vesize>\t%4.d, %5, [%0, %1.d, sxtw]
2338 1.1.1.3 mrg st1<Vesize>\t%4.d, %5, [%0, %1.d, sxtw %p3]"
2339 1.1.1.3 mrg "&& !CONSTANT_P (operands[6])"
2340 1.1.1.3 mrg {
2341 1.1.1.3 mrg operands[6] = CONSTM1_RTX (<VPRED>mode);
2342 1.1.1.3 mrg }
2343 1.1 mrg )
2344 1.1 mrg
2345 1.1.1.3 mrg ;; Likewise, but with the offset being truncated to 32 bits and then
2346 1.1.1.3 mrg ;; zero-extended.
2347 1.1.1.3 mrg (define_insn "*mask_scatter_store<mode><v_int_container>_uxtw"
2348 1.1.1.3 mrg [(set (mem:BLK (scratch))
2349 1.1.1.3 mrg (unspec:BLK
2350 1.1.1.3 mrg [(match_operand:VNx2BI 5 "register_operand" "Upl, Upl")
2351 1.1.1.3 mrg (match_operand:DI 0 "aarch64_reg_or_zero" "rk, rk")
2352 1.1.1.3 mrg (and:VNx2DI
2353 1.1.1.3 mrg (match_operand:VNx2DI 1 "register_operand" "w, w")
2354 1.1.1.3 mrg (match_operand:VNx2DI 6 "aarch64_sve_uxtw_immediate"))
2355 1.1.1.3 mrg (match_operand:DI 2 "const_int_operand")
2356 1.1.1.3 mrg (match_operand:DI 3 "aarch64_gather_scale_operand_<Vesize>" "Ui1, i")
2357 1.1.1.3 mrg (match_operand:SVE_2 4 "register_operand" "w, w")]
2358 1.1.1.3 mrg UNSPEC_ST1_SCATTER))]
2359 1.1 mrg "TARGET_SVE"
2360 1.1.1.3 mrg "@
2361 1.1.1.3 mrg st1<Vesize>\t%4.d, %5, [%0, %1.d, uxtw]
2362 1.1.1.3 mrg st1<Vesize>\t%4.d, %5, [%0, %1.d, uxtw %p3]"
2363 1.1 mrg )
2364 1.1 mrg
2365 1.1.1.3 mrg ;; -------------------------------------------------------------------------
2366 1.1.1.3 mrg ;; ---- Truncating scatter stores
2367 1.1.1.3 mrg ;; -------------------------------------------------------------------------
2368 1.1.1.3 mrg ;; Includes scatter forms of:
2369 1.1.1.3 mrg ;; - ST1B
2370 1.1.1.3 mrg ;; - ST1H
2371 1.1.1.3 mrg ;; - ST1W
2372 1.1.1.3 mrg ;; -------------------------------------------------------------------------
2373 1.1.1.3 mrg
2374 1.1.1.3 mrg ;; Predicated truncating scatter stores for 32-bit elements. Operand 2 is
2375 1.1.1.3 mrg ;; true for unsigned extension and false for signed extension.
2376 1.1.1.3 mrg (define_insn "@aarch64_scatter_store_trunc<VNx4_NARROW:mode><VNx4_WIDE:mode>"
2377 1.1.1.3 mrg [(set (mem:BLK (scratch))
2378 1.1.1.3 mrg (unspec:BLK
2379 1.1.1.3 mrg [(match_operand:VNx4BI 5 "register_operand" "Upl, Upl, Upl, Upl, Upl, Upl")
2380 1.1.1.3 mrg (match_operand:DI 0 "aarch64_sve_gather_offset_<VNx4_NARROW:Vesize>" "Z, vg<VNx4_NARROW:Vesize>, rk, rk, rk, rk")
2381 1.1.1.3 mrg (match_operand:VNx4SI 1 "register_operand" "w, w, w, w, w, w")
2382 1.1.1.3 mrg (match_operand:DI 2 "const_int_operand" "Ui1, Ui1, Z, Ui1, Z, Ui1")
2383 1.1.1.3 mrg (match_operand:DI 3 "aarch64_gather_scale_operand_<VNx4_NARROW:Vesize>" "Ui1, Ui1, Ui1, Ui1, i, i")
2384 1.1.1.3 mrg (truncate:VNx4_NARROW
2385 1.1.1.3 mrg (match_operand:VNx4_WIDE 4 "register_operand" "w, w, w, w, w, w"))]
2386 1.1.1.3 mrg UNSPEC_ST1_SCATTER))]
2387 1.1 mrg "TARGET_SVE"
2388 1.1.1.3 mrg "@
2389 1.1.1.3 mrg st1<VNx4_NARROW:Vesize>\t%4.s, %5, [%1.s]
2390 1.1.1.3 mrg st1<VNx4_NARROW:Vesize>\t%4.s, %5, [%1.s, #%0]
2391 1.1.1.3 mrg st1<VNx4_NARROW:Vesize>\t%4.s, %5, [%0, %1.s, sxtw]
2392 1.1.1.3 mrg st1<VNx4_NARROW:Vesize>\t%4.s, %5, [%0, %1.s, uxtw]
2393 1.1.1.3 mrg st1<VNx4_NARROW:Vesize>\t%4.s, %5, [%0, %1.s, sxtw %p3]
2394 1.1.1.3 mrg st1<VNx4_NARROW:Vesize>\t%4.s, %5, [%0, %1.s, uxtw %p3]"
2395 1.1 mrg )
2396 1.1 mrg
2397 1.1.1.3 mrg ;; Predicated truncating scatter stores for 64-bit elements. The value of
2398 1.1.1.3 mrg ;; operand 2 doesn't matter in this case.
2399 1.1.1.3 mrg (define_insn "@aarch64_scatter_store_trunc<VNx2_NARROW:mode><VNx2_WIDE:mode>"
2400 1.1.1.3 mrg [(set (mem:BLK (scratch))
2401 1.1.1.3 mrg (unspec:BLK
2402 1.1.1.3 mrg [(match_operand:VNx2BI 5 "register_operand" "Upl, Upl, Upl, Upl")
2403 1.1.1.3 mrg (match_operand:DI 0 "aarch64_sve_gather_offset_<VNx2_NARROW:Vesize>" "Z, vg<VNx2_NARROW:Vesize>, rk, rk")
2404 1.1.1.3 mrg (match_operand:VNx2DI 1 "register_operand" "w, w, w, w")
2405 1.1.1.3 mrg (match_operand:DI 2 "const_int_operand")
2406 1.1.1.3 mrg (match_operand:DI 3 "aarch64_gather_scale_operand_<VNx2_NARROW:Vesize>" "Ui1, Ui1, Ui1, i")
2407 1.1.1.3 mrg (truncate:VNx2_NARROW
2408 1.1.1.3 mrg (match_operand:VNx2_WIDE 4 "register_operand" "w, w, w, w"))]
2409 1.1.1.3 mrg UNSPEC_ST1_SCATTER))]
2410 1.1.1.3 mrg "TARGET_SVE"
2411 1.1.1.3 mrg "@
2412 1.1.1.3 mrg st1<VNx2_NARROW:Vesize>\t%4.d, %5, [%1.d]
2413 1.1.1.3 mrg st1<VNx2_NARROW:Vesize>\t%4.d, %5, [%1.d, #%0]
2414 1.1.1.3 mrg st1<VNx2_NARROW:Vesize>\t%4.d, %5, [%0, %1.d]
2415 1.1.1.3 mrg st1<VNx2_NARROW:Vesize>\t%4.d, %5, [%0, %1.d, lsl %p3]"
2416 1.1.1.3 mrg )
2417 1.1.1.3 mrg
2418 1.1.1.3 mrg ;; Likewise, but with the offset being sign-extended from 32 bits.
2419 1.1.1.3 mrg (define_insn_and_rewrite "*aarch64_scatter_store_trunc<VNx2_NARROW:mode><VNx2_WIDE:mode>_sxtw"
2420 1.1.1.3 mrg [(set (mem:BLK (scratch))
2421 1.1.1.3 mrg (unspec:BLK
2422 1.1.1.3 mrg [(match_operand:VNx2BI 5 "register_operand" "Upl, Upl")
2423 1.1.1.3 mrg (match_operand:DI 0 "register_operand" "rk, rk")
2424 1.1.1.3 mrg (unspec:VNx2DI
2425 1.1.1.3 mrg [(match_operand 6)
2426 1.1.1.3 mrg (sign_extend:VNx2DI
2427 1.1.1.3 mrg (truncate:VNx2SI
2428 1.1.1.3 mrg (match_operand:VNx2DI 1 "register_operand" "w, w")))]
2429 1.1.1.3 mrg UNSPEC_PRED_X)
2430 1.1.1.3 mrg (match_operand:DI 2 "const_int_operand")
2431 1.1.1.3 mrg (match_operand:DI 3 "aarch64_gather_scale_operand_<VNx2_NARROW:Vesize>" "Ui1, i")
2432 1.1.1.3 mrg (truncate:VNx2_NARROW
2433 1.1.1.3 mrg (match_operand:VNx2_WIDE 4 "register_operand" "w, w"))]
2434 1.1.1.3 mrg UNSPEC_ST1_SCATTER))]
2435 1.1.1.3 mrg "TARGET_SVE"
2436 1.1.1.3 mrg "@
2437 1.1.1.3 mrg st1<VNx2_NARROW:Vesize>\t%4.d, %5, [%0, %1.d, sxtw]
2438 1.1.1.3 mrg st1<VNx2_NARROW:Vesize>\t%4.d, %5, [%0, %1.d, sxtw %p3]"
2439 1.1.1.3 mrg "&& !rtx_equal_p (operands[5], operands[6])"
2440 1.1.1.3 mrg {
2441 1.1.1.3 mrg operands[6] = copy_rtx (operands[5]);
2442 1.1.1.3 mrg }
2443 1.1.1.3 mrg )
2444 1.1.1.3 mrg
2445 1.1.1.3 mrg ;; Likewise, but with the offset being zero-extended from 32 bits.
2446 1.1.1.3 mrg (define_insn "*aarch64_scatter_store_trunc<VNx2_NARROW:mode><VNx2_WIDE:mode>_uxtw"
2447 1.1.1.3 mrg [(set (mem:BLK (scratch))
2448 1.1.1.3 mrg (unspec:BLK
2449 1.1.1.3 mrg [(match_operand:VNx2BI 5 "register_operand" "Upl, Upl")
2450 1.1.1.3 mrg (match_operand:DI 0 "aarch64_reg_or_zero" "rk, rk")
2451 1.1.1.3 mrg (and:VNx2DI
2452 1.1.1.3 mrg (match_operand:VNx2DI 1 "register_operand" "w, w")
2453 1.1.1.3 mrg (match_operand:VNx2DI 6 "aarch64_sve_uxtw_immediate"))
2454 1.1.1.3 mrg (match_operand:DI 2 "const_int_operand")
2455 1.1.1.3 mrg (match_operand:DI 3 "aarch64_gather_scale_operand_<VNx2_NARROW:Vesize>" "Ui1, i")
2456 1.1.1.3 mrg (truncate:VNx2_NARROW
2457 1.1.1.3 mrg (match_operand:VNx2_WIDE 4 "register_operand" "w, w"))]
2458 1.1.1.3 mrg UNSPEC_ST1_SCATTER))]
2459 1.1.1.3 mrg "TARGET_SVE"
2460 1.1.1.3 mrg "@
2461 1.1.1.3 mrg st1<VNx2_NARROW:Vesize>\t%4.d, %5, [%0, %1.d, uxtw]
2462 1.1.1.3 mrg st1<VNx2_NARROW:Vesize>\t%4.d, %5, [%0, %1.d, uxtw %p3]"
2463 1.1.1.3 mrg )
2464 1.1.1.3 mrg
2465 1.1.1.3 mrg ;; =========================================================================
2466 1.1.1.3 mrg ;; == Vector creation
2467 1.1.1.3 mrg ;; =========================================================================
2468 1.1.1.3 mrg
2469 1.1.1.3 mrg ;; -------------------------------------------------------------------------
2470 1.1.1.3 mrg ;; ---- [INT,FP] Duplicate element
2471 1.1.1.3 mrg ;; -------------------------------------------------------------------------
2472 1.1.1.3 mrg ;; Includes:
2473 1.1.1.3 mrg ;; - DUP
2474 1.1.1.3 mrg ;; - MOV
2475 1.1.1.3 mrg ;; - LD1RB
2476 1.1.1.3 mrg ;; - LD1RD
2477 1.1.1.3 mrg ;; - LD1RH
2478 1.1.1.3 mrg ;; - LD1RW
2479 1.1.1.3 mrg ;; - LD1ROB (F64MM)
2480 1.1.1.3 mrg ;; - LD1ROD (F64MM)
2481 1.1.1.3 mrg ;; - LD1ROH (F64MM)
2482 1.1.1.3 mrg ;; - LD1ROW (F64MM)
2483 1.1.1.3 mrg ;; - LD1RQB
2484 1.1.1.3 mrg ;; - LD1RQD
2485 1.1.1.3 mrg ;; - LD1RQH
2486 1.1.1.3 mrg ;; - LD1RQW
2487 1.1.1.3 mrg ;; -------------------------------------------------------------------------
2488 1.1.1.3 mrg
2489 1.1.1.3 mrg (define_expand "vec_duplicate<mode>"
2490 1.1.1.3 mrg [(parallel
2491 1.1.1.3 mrg [(set (match_operand:SVE_ALL 0 "register_operand")
2492 1.1.1.3 mrg (vec_duplicate:SVE_ALL
2493 1.1.1.3 mrg (match_operand:<VEL> 1 "aarch64_sve_dup_operand")))
2494 1.1.1.3 mrg (clobber (scratch:VNx16BI))])]
2495 1.1.1.3 mrg "TARGET_SVE"
2496 1.1.1.3 mrg {
2497 1.1.1.3 mrg if (MEM_P (operands[1]))
2498 1.1.1.3 mrg {
2499 1.1.1.3 mrg rtx ptrue = aarch64_ptrue_reg (<VPRED>mode);
2500 1.1.1.3 mrg emit_insn (gen_sve_ld1r<mode> (operands[0], ptrue, operands[1],
2501 1.1.1.3 mrg CONST0_RTX (<MODE>mode)));
2502 1.1.1.3 mrg DONE;
2503 1.1.1.3 mrg }
2504 1.1.1.3 mrg }
2505 1.1.1.3 mrg )
2506 1.1.1.3 mrg
2507 1.1.1.3 mrg ;; Accept memory operands for the benefit of combine, and also in case
2508 1.1.1.3 mrg ;; the scalar input gets spilled to memory during RA. We want to split
2509 1.1.1.3 mrg ;; the load at the first opportunity in order to allow the PTRUE to be
2510 1.1.1.3 mrg ;; optimized with surrounding code.
2511 1.1.1.3 mrg (define_insn_and_split "*vec_duplicate<mode>_reg"
2512 1.1.1.3 mrg [(set (match_operand:SVE_ALL 0 "register_operand" "=w, w, w")
2513 1.1.1.3 mrg (vec_duplicate:SVE_ALL
2514 1.1.1.3 mrg (match_operand:<VEL> 1 "aarch64_sve_dup_operand" "r, w, Uty")))
2515 1.1.1.3 mrg (clobber (match_scratch:VNx16BI 2 "=X, X, Upl"))]
2516 1.1.1.3 mrg "TARGET_SVE"
2517 1.1.1.3 mrg "@
2518 1.1.1.3 mrg mov\t%0.<Vetype>, %<vwcore>1
2519 1.1.1.3 mrg mov\t%0.<Vetype>, %<Vetype>1
2520 1.1.1.3 mrg #"
2521 1.1.1.3 mrg "&& MEM_P (operands[1])"
2522 1.1.1.3 mrg [(const_int 0)]
2523 1.1.1.3 mrg {
2524 1.1.1.3 mrg if (GET_CODE (operands[2]) == SCRATCH)
2525 1.1.1.3 mrg operands[2] = gen_reg_rtx (VNx16BImode);
2526 1.1.1.3 mrg emit_move_insn (operands[2], CONSTM1_RTX (VNx16BImode));
2527 1.1.1.3 mrg rtx gp = gen_lowpart (<VPRED>mode, operands[2]);
2528 1.1.1.3 mrg emit_insn (gen_sve_ld1r<mode> (operands[0], gp, operands[1],
2529 1.1.1.3 mrg CONST0_RTX (<MODE>mode)));
2530 1.1.1.3 mrg DONE;
2531 1.1.1.3 mrg }
2532 1.1.1.3 mrg [(set_attr "length" "4,4,8")]
2533 1.1.1.3 mrg )
2534 1.1.1.3 mrg
2535 1.1.1.3 mrg ;; Duplicate an Advanced SIMD vector to fill an SVE vector (LE version).
2536 1.1.1.3 mrg (define_insn "@aarch64_vec_duplicate_vq<mode>_le"
2537 1.1.1.3 mrg [(set (match_operand:SVE_FULL 0 "register_operand" "=w")
2538 1.1.1.3 mrg (vec_duplicate:SVE_FULL
2539 1.1.1.3 mrg (match_operand:<V128> 1 "register_operand" "w")))]
2540 1.1.1.3 mrg "TARGET_SVE && !BYTES_BIG_ENDIAN"
2541 1.1.1.3 mrg {
2542 1.1.1.3 mrg operands[1] = gen_rtx_REG (<MODE>mode, REGNO (operands[1]));
2543 1.1.1.3 mrg return "dup\t%0.q, %1.q[0]";
2544 1.1.1.3 mrg }
2545 1.1.1.3 mrg )
2546 1.1.1.3 mrg
2547 1.1.1.3 mrg ;; Duplicate an Advanced SIMD vector to fill an SVE vector (BE version).
2548 1.1.1.3 mrg ;; The SVE register layout puts memory lane N into (architectural)
2549 1.1.1.3 mrg ;; register lane N, whereas the Advanced SIMD layout puts the memory
2550 1.1.1.3 mrg ;; lsb into the register lsb. We therefore have to describe this in rtl
2551 1.1.1.3 mrg ;; terms as a reverse of the V128 vector followed by a duplicate.
2552 1.1.1.3 mrg (define_insn "@aarch64_vec_duplicate_vq<mode>_be"
2553 1.1.1.3 mrg [(set (match_operand:SVE_FULL 0 "register_operand" "=w")
2554 1.1.1.3 mrg (vec_duplicate:SVE_FULL
2555 1.1.1.3 mrg (vec_select:<V128>
2556 1.1.1.3 mrg (match_operand:<V128> 1 "register_operand" "w")
2557 1.1.1.3 mrg (match_operand 2 "descending_int_parallel"))))]
2558 1.1.1.3 mrg "TARGET_SVE
2559 1.1.1.3 mrg && BYTES_BIG_ENDIAN
2560 1.1.1.3 mrg && known_eq (INTVAL (XVECEXP (operands[2], 0, 0)),
2561 1.1.1.3 mrg GET_MODE_NUNITS (<V128>mode) - 1)"
2562 1.1.1.3 mrg {
2563 1.1.1.3 mrg operands[1] = gen_rtx_REG (<MODE>mode, REGNO (operands[1]));
2564 1.1.1.3 mrg return "dup\t%0.q, %1.q[0]";
2565 1.1.1.3 mrg }
2566 1.1.1.3 mrg )
2567 1.1.1.3 mrg
2568 1.1.1.3 mrg ;; This is used for vec_duplicate<mode>s from memory, but can also
2569 1.1.1.3 mrg ;; be used by combine to optimize selects of a vec_duplicate<mode>
2570 1.1.1.3 mrg ;; with zero.
2571 1.1.1.3 mrg (define_insn "sve_ld1r<mode>"
2572 1.1.1.3 mrg [(set (match_operand:SVE_ALL 0 "register_operand" "=w")
2573 1.1.1.3 mrg (unspec:SVE_ALL
2574 1.1.1.3 mrg [(match_operand:<VPRED> 1 "register_operand" "Upl")
2575 1.1.1.3 mrg (vec_duplicate:SVE_ALL
2576 1.1.1.3 mrg (match_operand:<VEL> 2 "aarch64_sve_ld1r_operand" "Uty"))
2577 1.1.1.3 mrg (match_operand:SVE_ALL 3 "aarch64_simd_imm_zero")]
2578 1.1.1.3 mrg UNSPEC_SEL))]
2579 1.1.1.3 mrg "TARGET_SVE"
2580 1.1.1.3 mrg "ld1r<Vesize>\t%0.<Vetype>, %1/z, %2"
2581 1.1.1.3 mrg )
2582 1.1.1.3 mrg
2583 1.1.1.3 mrg ;; Load 128 bits from memory under predicate control and duplicate to
2584 1.1.1.3 mrg ;; fill a vector.
2585 1.1.1.3 mrg (define_insn "@aarch64_sve_ld1rq<mode>"
2586 1.1.1.3 mrg [(set (match_operand:SVE_FULL 0 "register_operand" "=w")
2587 1.1.1.3 mrg (unspec:SVE_FULL
2588 1.1.1.3 mrg [(match_operand:<VPRED> 2 "register_operand" "Upl")
2589 1.1.1.3 mrg (match_operand:<V128> 1 "aarch64_sve_ld1rq_operand" "UtQ")]
2590 1.1.1.3 mrg UNSPEC_LD1RQ))]
2591 1.1.1.3 mrg "TARGET_SVE"
2592 1.1.1.3 mrg {
2593 1.1.1.3 mrg operands[1] = gen_rtx_MEM (<VEL>mode, XEXP (operands[1], 0));
2594 1.1.1.3 mrg return "ld1rq<Vesize>\t%0.<Vetype>, %2/z, %1";
2595 1.1.1.3 mrg }
2596 1.1.1.3 mrg )
2597 1.1.1.3 mrg
2598 1.1.1.3 mrg (define_insn "@aarch64_sve_ld1ro<mode>"
2599 1.1.1.3 mrg [(set (match_operand:SVE_FULL 0 "register_operand" "=w")
2600 1.1.1.3 mrg (unspec:SVE_FULL
2601 1.1.1.3 mrg [(match_operand:<VPRED> 2 "register_operand" "Upl")
2602 1.1.1.3 mrg (match_operand:OI 1 "aarch64_sve_ld1ro_operand_<Vesize>"
2603 1.1.1.3 mrg "UO<Vesize>")]
2604 1.1.1.3 mrg UNSPEC_LD1RO))]
2605 1.1.1.3 mrg "TARGET_SVE_F64MM"
2606 1.1.1.3 mrg {
2607 1.1.1.3 mrg operands[1] = gen_rtx_MEM (<VEL>mode, XEXP (operands[1], 0));
2608 1.1.1.3 mrg return "ld1ro<Vesize>\t%0.<Vetype>, %2/z, %1";
2609 1.1.1.3 mrg }
2610 1.1.1.3 mrg )
2611 1.1.1.3 mrg
2612 1.1.1.3 mrg ;; -------------------------------------------------------------------------
2613 1.1.1.3 mrg ;; ---- [INT,FP] Initialize from individual elements
2614 1.1.1.3 mrg ;; -------------------------------------------------------------------------
2615 1.1.1.3 mrg ;; Includes:
2616 1.1.1.3 mrg ;; - INSR
2617 1.1.1.3 mrg ;; -------------------------------------------------------------------------
2618 1.1.1.3 mrg
2619 1.1.1.3 mrg (define_expand "vec_init<mode><Vel>"
2620 1.1.1.3 mrg [(match_operand:SVE_FULL 0 "register_operand")
2621 1.1.1.3 mrg (match_operand 1 "")]
2622 1.1.1.3 mrg "TARGET_SVE"
2623 1.1.1.3 mrg {
2624 1.1.1.3 mrg aarch64_sve_expand_vector_init (operands[0], operands[1]);
2625 1.1.1.3 mrg DONE;
2626 1.1.1.3 mrg }
2627 1.1.1.3 mrg )
2628 1.1.1.3 mrg
2629 1.1.1.3 mrg ;; Shift an SVE vector left and insert a scalar into element 0.
2630 1.1.1.3 mrg (define_insn "vec_shl_insert_<mode>"
2631 1.1.1.3 mrg [(set (match_operand:SVE_FULL 0 "register_operand" "=?w, w, ??&w, ?&w")
2632 1.1.1.3 mrg (unspec:SVE_FULL
2633 1.1.1.3 mrg [(match_operand:SVE_FULL 1 "register_operand" "0, 0, w, w")
2634 1.1.1.3 mrg (match_operand:<VEL> 2 "aarch64_reg_or_zero" "rZ, w, rZ, w")]
2635 1.1.1.3 mrg UNSPEC_INSR))]
2636 1.1.1.3 mrg "TARGET_SVE"
2637 1.1.1.3 mrg "@
2638 1.1.1.3 mrg insr\t%0.<Vetype>, %<vwcore>2
2639 1.1.1.3 mrg insr\t%0.<Vetype>, %<Vetype>2
2640 1.1.1.3 mrg movprfx\t%0, %1\;insr\t%0.<Vetype>, %<vwcore>2
2641 1.1.1.3 mrg movprfx\t%0, %1\;insr\t%0.<Vetype>, %<Vetype>2"
2642 1.1.1.3 mrg [(set_attr "movprfx" "*,*,yes,yes")]
2643 1.1.1.3 mrg )
2644 1.1.1.3 mrg
2645 1.1.1.3 mrg ;; -------------------------------------------------------------------------
2646 1.1.1.3 mrg ;; ---- [INT] Linear series
2647 1.1.1.3 mrg ;; -------------------------------------------------------------------------
2648 1.1.1.3 mrg ;; Includes:
2649 1.1.1.3 mrg ;; - INDEX
2650 1.1.1.3 mrg ;; -------------------------------------------------------------------------
2651 1.1.1.3 mrg
2652 1.1.1.3 mrg (define_insn "vec_series<mode>"
2653 1.1.1.3 mrg [(set (match_operand:SVE_I 0 "register_operand" "=w, w, w")
2654 1.1.1.3 mrg (vec_series:SVE_I
2655 1.1.1.3 mrg (match_operand:<VEL> 1 "aarch64_sve_index_operand" "Usi, r, r")
2656 1.1.1.3 mrg (match_operand:<VEL> 2 "aarch64_sve_index_operand" "r, Usi, r")))]
2657 1.1.1.3 mrg "TARGET_SVE"
2658 1.1.1.3 mrg "@
2659 1.1.1.3 mrg index\t%0.<Vctype>, #%1, %<vccore>2
2660 1.1.1.3 mrg index\t%0.<Vctype>, %<vccore>1, #%2
2661 1.1.1.3 mrg index\t%0.<Vctype>, %<vccore>1, %<vccore>2"
2662 1.1.1.3 mrg )
2663 1.1.1.3 mrg
2664 1.1.1.3 mrg ;; Optimize {x, x, x, x, ...} + {0, n, 2*n, 3*n, ...} if n is in range
2665 1.1.1.3 mrg ;; of an INDEX instruction.
2666 1.1.1.3 mrg (define_insn "*vec_series<mode>_plus"
2667 1.1.1.3 mrg [(set (match_operand:SVE_I 0 "register_operand" "=w")
2668 1.1.1.3 mrg (plus:SVE_I
2669 1.1.1.3 mrg (vec_duplicate:SVE_I
2670 1.1.1.3 mrg (match_operand:<VEL> 1 "register_operand" "r"))
2671 1.1.1.3 mrg (match_operand:SVE_I 2 "immediate_operand")))]
2672 1.1.1.3 mrg "TARGET_SVE && aarch64_check_zero_based_sve_index_immediate (operands[2])"
2673 1.1.1.3 mrg {
2674 1.1.1.3 mrg operands[2] = aarch64_check_zero_based_sve_index_immediate (operands[2]);
2675 1.1.1.3 mrg return "index\t%0.<Vctype>, %<vccore>1, #%2";
2676 1.1.1.3 mrg }
2677 1.1.1.3 mrg )
2678 1.1.1.3 mrg
2679 1.1.1.3 mrg ;; -------------------------------------------------------------------------
2680 1.1.1.3 mrg ;; ---- [PRED] Duplicate element
2681 1.1.1.3 mrg ;; -------------------------------------------------------------------------
2682 1.1.1.3 mrg ;; The patterns in this section are synthetic.
2683 1.1.1.3 mrg ;; -------------------------------------------------------------------------
2684 1.1.1.3 mrg
2685 1.1.1.3 mrg ;; Implement a predicate broadcast by shifting the low bit of the scalar
2686 1.1.1.3 mrg ;; input into the top bit and using a WHILELO. An alternative would be to
2687 1.1.1.3 mrg ;; duplicate the input and do a compare with zero.
2688 1.1.1.3 mrg (define_expand "vec_duplicate<mode>"
2689 1.1.1.3 mrg [(set (match_operand:PRED_ALL 0 "register_operand")
2690 1.1.1.3 mrg (vec_duplicate:PRED_ALL (match_operand:QI 1 "register_operand")))]
2691 1.1.1.3 mrg "TARGET_SVE"
2692 1.1.1.3 mrg {
2693 1.1.1.3 mrg rtx tmp = gen_reg_rtx (DImode);
2694 1.1.1.3 mrg rtx op1 = gen_lowpart (DImode, operands[1]);
2695 1.1.1.3 mrg emit_insn (gen_ashldi3 (tmp, op1, gen_int_mode (63, DImode)));
2696 1.1.1.3 mrg emit_insn (gen_while_ultdi<mode> (operands[0], const0_rtx, tmp));
2697 1.1.1.3 mrg DONE;
2698 1.1.1.3 mrg }
2699 1.1.1.3 mrg )
2700 1.1.1.3 mrg
2701 1.1.1.3 mrg ;; =========================================================================
2702 1.1.1.3 mrg ;; == Vector decomposition
2703 1.1.1.3 mrg ;; =========================================================================
2704 1.1.1.3 mrg
2705 1.1.1.3 mrg ;; -------------------------------------------------------------------------
2706 1.1.1.3 mrg ;; ---- [INT,FP] Extract index
2707 1.1.1.3 mrg ;; -------------------------------------------------------------------------
2708 1.1.1.3 mrg ;; Includes:
2709 1.1.1.3 mrg ;; - DUP (Advanced SIMD)
2710 1.1.1.3 mrg ;; - DUP (SVE)
2711 1.1.1.3 mrg ;; - EXT (SVE)
2712 1.1.1.3 mrg ;; - ST1 (Advanced SIMD)
2713 1.1.1.3 mrg ;; - UMOV (Advanced SIMD)
2714 1.1.1.3 mrg ;; -------------------------------------------------------------------------
2715 1.1.1.3 mrg
2716 1.1.1.3 mrg (define_expand "vec_extract<mode><Vel>"
2717 1.1.1.3 mrg [(set (match_operand:<VEL> 0 "register_operand")
2718 1.1.1.3 mrg (vec_select:<VEL>
2719 1.1.1.3 mrg (match_operand:SVE_FULL 1 "register_operand")
2720 1.1.1.3 mrg (parallel [(match_operand:SI 2 "nonmemory_operand")])))]
2721 1.1.1.3 mrg "TARGET_SVE"
2722 1.1.1.3 mrg {
2723 1.1.1.3 mrg poly_int64 val;
2724 1.1.1.3 mrg if (poly_int_rtx_p (operands[2], &val)
2725 1.1.1.3 mrg && known_eq (val, GET_MODE_NUNITS (<MODE>mode) - 1))
2726 1.1.1.3 mrg {
2727 1.1.1.3 mrg /* The last element can be extracted with a LASTB and a false
2728 1.1.1.3 mrg predicate. */
2729 1.1.1.3 mrg rtx sel = aarch64_pfalse_reg (<VPRED>mode);
2730 1.1.1.3 mrg emit_insn (gen_extract_last_<mode> (operands[0], sel, operands[1]));
2731 1.1.1.3 mrg DONE;
2732 1.1.1.3 mrg }
2733 1.1.1.3 mrg if (!CONST_INT_P (operands[2]))
2734 1.1.1.3 mrg {
2735 1.1.1.3 mrg /* Create an index with operand[2] as the base and -1 as the step.
2736 1.1.1.3 mrg It will then be zero for the element we care about. */
2737 1.1.1.3 mrg rtx index = gen_lowpart (<VEL_INT>mode, operands[2]);
2738 1.1.1.3 mrg index = force_reg (<VEL_INT>mode, index);
2739 1.1.1.3 mrg rtx series = gen_reg_rtx (<V_INT_EQUIV>mode);
2740 1.1.1.3 mrg emit_insn (gen_vec_series<v_int_equiv> (series, index, constm1_rtx));
2741 1.1.1.3 mrg
2742 1.1.1.3 mrg /* Get a predicate that is true for only that element. */
2743 1.1.1.3 mrg rtx zero = CONST0_RTX (<V_INT_EQUIV>mode);
2744 1.1.1.3 mrg rtx cmp = gen_rtx_EQ (<V_INT_EQUIV>mode, series, zero);
2745 1.1.1.3 mrg rtx sel = gen_reg_rtx (<VPRED>mode);
2746 1.1.1.3 mrg emit_insn (gen_vec_cmp<v_int_equiv><vpred> (sel, cmp, series, zero));
2747 1.1.1.3 mrg
2748 1.1.1.3 mrg /* Select the element using LASTB. */
2749 1.1.1.3 mrg emit_insn (gen_extract_last_<mode> (operands[0], sel, operands[1]));
2750 1.1.1.3 mrg DONE;
2751 1.1.1.3 mrg }
2752 1.1.1.3 mrg }
2753 1.1.1.3 mrg )
2754 1.1.1.3 mrg
2755 1.1.1.3 mrg ;; Extract element zero. This is a special case because we want to force
2756 1.1.1.3 mrg ;; the registers to be the same for the second alternative, and then
2757 1.1.1.3 mrg ;; split the instruction into nothing after RA.
2758 1.1.1.3 mrg (define_insn_and_split "*vec_extract<mode><Vel>_0"
2759 1.1.1.3 mrg [(set (match_operand:<VEL> 0 "aarch64_simd_nonimmediate_operand" "=r, w, Utv")
2760 1.1.1.3 mrg (vec_select:<VEL>
2761 1.1.1.3 mrg (match_operand:SVE_FULL 1 "register_operand" "w, 0, w")
2762 1.1.1.3 mrg (parallel [(const_int 0)])))]
2763 1.1.1.3 mrg "TARGET_SVE"
2764 1.1.1.3 mrg {
2765 1.1.1.3 mrg operands[1] = gen_rtx_REG (<V128>mode, REGNO (operands[1]));
2766 1.1.1.3 mrg switch (which_alternative)
2767 1.1.1.3 mrg {
2768 1.1.1.3 mrg case 0:
2769 1.1.1.3 mrg return "umov\\t%<vwcore>0, %1.<Vetype>[0]";
2770 1.1.1.3 mrg case 1:
2771 1.1.1.3 mrg return "#";
2772 1.1.1.3 mrg case 2:
2773 1.1.1.3 mrg return "st1\\t{%1.<Vetype>}[0], %0";
2774 1.1.1.3 mrg default:
2775 1.1.1.3 mrg gcc_unreachable ();
2776 1.1.1.3 mrg }
2777 1.1.1.3 mrg }
2778 1.1.1.3 mrg "&& reload_completed
2779 1.1.1.3 mrg && REG_P (operands[0])
2780 1.1.1.3 mrg && REGNO (operands[0]) == REGNO (operands[1])"
2781 1.1.1.3 mrg [(const_int 0)]
2782 1.1.1.3 mrg {
2783 1.1.1.3 mrg emit_note (NOTE_INSN_DELETED);
2784 1.1.1.3 mrg DONE;
2785 1.1.1.3 mrg }
2786 1.1.1.3 mrg [(set_attr "type" "neon_to_gp_q, untyped, neon_store1_one_lane_q")]
2787 1.1.1.3 mrg )
2788 1.1.1.3 mrg
2789 1.1.1.3 mrg ;; Extract an element from the Advanced SIMD portion of the register.
2790 1.1.1.3 mrg ;; We don't just reuse the aarch64-simd.md pattern because we don't
2791 1.1.1.3 mrg ;; want any change in lane number on big-endian targets.
2792 1.1.1.3 mrg (define_insn "*vec_extract<mode><Vel>_v128"
2793 1.1.1.3 mrg [(set (match_operand:<VEL> 0 "aarch64_simd_nonimmediate_operand" "=r, w, Utv")
2794 1.1.1.3 mrg (vec_select:<VEL>
2795 1.1.1.3 mrg (match_operand:SVE_FULL 1 "register_operand" "w, w, w")
2796 1.1.1.3 mrg (parallel [(match_operand:SI 2 "const_int_operand")])))]
2797 1.1.1.3 mrg "TARGET_SVE
2798 1.1.1.3 mrg && IN_RANGE (INTVAL (operands[2]) * GET_MODE_SIZE (<VEL>mode), 1, 15)"
2799 1.1.1.3 mrg {
2800 1.1.1.3 mrg operands[1] = gen_rtx_REG (<V128>mode, REGNO (operands[1]));
2801 1.1.1.3 mrg switch (which_alternative)
2802 1.1.1.3 mrg {
2803 1.1.1.3 mrg case 0:
2804 1.1.1.3 mrg return "umov\\t%<vwcore>0, %1.<Vetype>[%2]";
2805 1.1.1.3 mrg case 1:
2806 1.1.1.3 mrg return "dup\\t%<Vetype>0, %1.<Vetype>[%2]";
2807 1.1.1.3 mrg case 2:
2808 1.1.1.3 mrg return "st1\\t{%1.<Vetype>}[%2], %0";
2809 1.1.1.3 mrg default:
2810 1.1.1.3 mrg gcc_unreachable ();
2811 1.1.1.3 mrg }
2812 1.1.1.3 mrg }
2813 1.1.1.3 mrg [(set_attr "type" "neon_to_gp_q, neon_dup_q, neon_store1_one_lane_q")]
2814 1.1.1.3 mrg )
2815 1.1.1.3 mrg
2816 1.1.1.3 mrg ;; Extract an element in the range of DUP. This pattern allows the
2817 1.1.1.3 mrg ;; source and destination to be different.
2818 1.1.1.3 mrg (define_insn "*vec_extract<mode><Vel>_dup"
2819 1.1.1.3 mrg [(set (match_operand:<VEL> 0 "register_operand" "=w")
2820 1.1.1.3 mrg (vec_select:<VEL>
2821 1.1.1.3 mrg (match_operand:SVE_FULL 1 "register_operand" "w")
2822 1.1.1.3 mrg (parallel [(match_operand:SI 2 "const_int_operand")])))]
2823 1.1.1.3 mrg "TARGET_SVE
2824 1.1.1.3 mrg && IN_RANGE (INTVAL (operands[2]) * GET_MODE_SIZE (<VEL>mode), 16, 63)"
2825 1.1.1.3 mrg {
2826 1.1.1.3 mrg operands[0] = gen_rtx_REG (<MODE>mode, REGNO (operands[0]));
2827 1.1.1.3 mrg return "dup\t%0.<Vetype>, %1.<Vetype>[%2]";
2828 1.1.1.3 mrg }
2829 1.1.1.3 mrg )
2830 1.1.1.3 mrg
2831 1.1.1.3 mrg ;; Extract an element outside the range of DUP. This pattern requires the
2832 1.1.1.3 mrg ;; source and destination to be the same.
2833 1.1.1.3 mrg (define_insn "*vec_extract<mode><Vel>_ext"
2834 1.1.1.3 mrg [(set (match_operand:<VEL> 0 "register_operand" "=w, ?&w")
2835 1.1.1.3 mrg (vec_select:<VEL>
2836 1.1.1.3 mrg (match_operand:SVE_FULL 1 "register_operand" "0, w")
2837 1.1.1.3 mrg (parallel [(match_operand:SI 2 "const_int_operand")])))]
2838 1.1.1.3 mrg "TARGET_SVE && INTVAL (operands[2]) * GET_MODE_SIZE (<VEL>mode) >= 64"
2839 1.1.1.3 mrg {
2840 1.1.1.3 mrg operands[0] = gen_rtx_REG (<MODE>mode, REGNO (operands[0]));
2841 1.1.1.3 mrg operands[2] = GEN_INT (INTVAL (operands[2]) * GET_MODE_SIZE (<VEL>mode));
2842 1.1.1.3 mrg return (which_alternative == 0
2843 1.1.1.3 mrg ? "ext\t%0.b, %0.b, %0.b, #%2"
2844 1.1.1.3 mrg : "movprfx\t%0, %1\;ext\t%0.b, %0.b, %1.b, #%2");
2845 1.1.1.3 mrg }
2846 1.1.1.3 mrg [(set_attr "movprfx" "*,yes")]
2847 1.1.1.3 mrg )
2848 1.1.1.3 mrg
2849 1.1.1.3 mrg ;; -------------------------------------------------------------------------
2850 1.1.1.3 mrg ;; ---- [INT,FP] Extract active element
2851 1.1.1.3 mrg ;; -------------------------------------------------------------------------
2852 1.1.1.3 mrg ;; Includes:
2853 1.1.1.3 mrg ;; - LASTA
2854 1.1.1.3 mrg ;; - LASTB
2855 1.1.1.3 mrg ;; -------------------------------------------------------------------------
2856 1.1.1.3 mrg
2857 1.1.1.3 mrg ;; Extract the last active element of operand 1 into operand 0.
2858 1.1.1.3 mrg ;; If no elements are active, extract the last inactive element instead.
2859 1.1.1.3 mrg (define_insn "@extract_<last_op>_<mode>"
2860 1.1.1.3 mrg [(set (match_operand:<VEL> 0 "register_operand" "=?r, w")
2861 1.1.1.3 mrg (unspec:<VEL>
2862 1.1.1.3 mrg [(match_operand:<VPRED> 1 "register_operand" "Upl, Upl")
2863 1.1.1.3 mrg (match_operand:SVE_FULL 2 "register_operand" "w, w")]
2864 1.1.1.3 mrg LAST))]
2865 1.1.1.3 mrg "TARGET_SVE"
2866 1.1.1.3 mrg "@
2867 1.1.1.3 mrg last<ab>\t%<vwcore>0, %1, %2.<Vetype>
2868 1.1.1.3 mrg last<ab>\t%<Vetype>0, %1, %2.<Vetype>"
2869 1.1.1.3 mrg )
2870 1.1.1.3 mrg
2871 1.1.1.3 mrg ;; -------------------------------------------------------------------------
2872 1.1.1.3 mrg ;; ---- [PRED] Extract index
2873 1.1.1.3 mrg ;; -------------------------------------------------------------------------
2874 1.1.1.3 mrg ;; The patterns in this section are synthetic.
2875 1.1.1.3 mrg ;; -------------------------------------------------------------------------
2876 1.1.1.3 mrg
2877 1.1.1.3 mrg ;; Handle extractions from a predicate by converting to an integer vector
2878 1.1.1.3 mrg ;; and extracting from there.
2879 1.1.1.3 mrg (define_expand "vec_extract<vpred><Vel>"
2880 1.1.1.3 mrg [(match_operand:<VEL> 0 "register_operand")
2881 1.1.1.3 mrg (match_operand:<VPRED> 1 "register_operand")
2882 1.1.1.3 mrg (match_operand:SI 2 "nonmemory_operand")
2883 1.1.1.3 mrg ;; Dummy operand to which we can attach the iterator.
2884 1.1.1.3 mrg (reg:SVE_FULL_I V0_REGNUM)]
2885 1.1.1.3 mrg "TARGET_SVE"
2886 1.1.1.3 mrg {
2887 1.1.1.3 mrg rtx tmp = gen_reg_rtx (<MODE>mode);
2888 1.1.1.3 mrg emit_insn (gen_vcond_mask_<mode><vpred> (tmp, operands[1],
2889 1.1.1.3 mrg CONST1_RTX (<MODE>mode),
2890 1.1.1.3 mrg CONST0_RTX (<MODE>mode)));
2891 1.1.1.3 mrg emit_insn (gen_vec_extract<mode><Vel> (operands[0], tmp, operands[2]));
2892 1.1.1.3 mrg DONE;
2893 1.1.1.3 mrg }
2894 1.1.1.3 mrg )
2895 1.1.1.3 mrg
2896 1.1.1.3 mrg ;; =========================================================================
2897 1.1.1.3 mrg ;; == Unary arithmetic
2898 1.1.1.3 mrg ;; =========================================================================
2899 1.1.1.3 mrg
2900 1.1.1.3 mrg ;; -------------------------------------------------------------------------
2901 1.1.1.3 mrg ;; ---- [INT] General unary arithmetic corresponding to rtx codes
2902 1.1.1.3 mrg ;; -------------------------------------------------------------------------
2903 1.1.1.3 mrg ;; Includes:
2904 1.1.1.3 mrg ;; - ABS
2905 1.1.1.3 mrg ;; - CLS (= clrsb)
2906 1.1.1.3 mrg ;; - CLZ
2907 1.1.1.3 mrg ;; - CNT (= popcount)
2908 1.1.1.3 mrg ;; - NEG
2909 1.1.1.3 mrg ;; - NOT
2910 1.1.1.3 mrg ;; -------------------------------------------------------------------------
2911 1.1.1.3 mrg
2912 1.1.1.3 mrg ;; Unpredicated integer unary arithmetic.
2913 1.1.1.3 mrg (define_expand "<optab><mode>2"
2914 1.1.1.3 mrg [(set (match_operand:SVE_FULL_I 0 "register_operand")
2915 1.1.1.3 mrg (unspec:SVE_FULL_I
2916 1.1.1.3 mrg [(match_dup 2)
2917 1.1.1.3 mrg (SVE_INT_UNARY:SVE_FULL_I
2918 1.1.1.3 mrg (match_operand:SVE_FULL_I 1 "register_operand"))]
2919 1.1.1.3 mrg UNSPEC_PRED_X))]
2920 1.1.1.3 mrg "TARGET_SVE"
2921 1.1.1.3 mrg {
2922 1.1.1.3 mrg operands[2] = aarch64_ptrue_reg (<VPRED>mode);
2923 1.1.1.3 mrg }
2924 1.1.1.3 mrg )
2925 1.1.1.3 mrg
2926 1.1.1.3 mrg ;; Integer unary arithmetic predicated with a PTRUE.
2927 1.1.1.3 mrg (define_insn "@aarch64_pred_<optab><mode>"
2928 1.1.1.3 mrg [(set (match_operand:SVE_FULL_I 0 "register_operand" "=w, ?&w")
2929 1.1.1.3 mrg (unspec:SVE_FULL_I
2930 1.1.1.3 mrg [(match_operand:<VPRED> 1 "register_operand" "Upl, Upl")
2931 1.1.1.3 mrg (SVE_INT_UNARY:SVE_FULL_I
2932 1.1.1.3 mrg (match_operand:SVE_FULL_I 2 "register_operand" "0, w"))]
2933 1.1.1.3 mrg UNSPEC_PRED_X))]
2934 1.1.1.3 mrg "TARGET_SVE"
2935 1.1.1.3 mrg "@
2936 1.1.1.3 mrg <sve_int_op>\t%0.<Vetype>, %1/m, %2.<Vetype>
2937 1.1.1.3 mrg movprfx\t%0, %2\;<sve_int_op>\t%0.<Vetype>, %1/m, %2.<Vetype>"
2938 1.1.1.3 mrg [(set_attr "movprfx" "*,yes")]
2939 1.1.1.3 mrg )
2940 1.1.1.3 mrg
2941 1.1.1.3 mrg ;; Predicated integer unary arithmetic with merging.
2942 1.1.1.3 mrg (define_expand "@cond_<optab><mode>"
2943 1.1.1.3 mrg [(set (match_operand:SVE_FULL_I 0 "register_operand")
2944 1.1.1.3 mrg (unspec:SVE_FULL_I
2945 1.1.1.3 mrg [(match_operand:<VPRED> 1 "register_operand")
2946 1.1.1.3 mrg (SVE_INT_UNARY:SVE_FULL_I
2947 1.1.1.3 mrg (match_operand:SVE_FULL_I 2 "register_operand"))
2948 1.1.1.3 mrg (match_operand:SVE_FULL_I 3 "aarch64_simd_reg_or_zero")]
2949 1.1.1.3 mrg UNSPEC_SEL))]
2950 1.1.1.3 mrg "TARGET_SVE"
2951 1.1.1.3 mrg )
2952 1.1.1.3 mrg
2953 1.1.1.3 mrg ;; Predicated integer unary arithmetic, merging with the first input.
2954 1.1.1.3 mrg (define_insn "*cond_<optab><mode>_2"
2955 1.1.1.3 mrg [(set (match_operand:SVE_FULL_I 0 "register_operand" "=w, ?&w")
2956 1.1.1.3 mrg (unspec:SVE_FULL_I
2957 1.1.1.3 mrg [(match_operand:<VPRED> 1 "register_operand" "Upl, Upl")
2958 1.1.1.3 mrg (SVE_INT_UNARY:SVE_FULL_I
2959 1.1.1.3 mrg (match_operand:SVE_FULL_I 2 "register_operand" "0, w"))
2960 1.1.1.3 mrg (match_dup 2)]
2961 1.1.1.3 mrg UNSPEC_SEL))]
2962 1.1.1.3 mrg "TARGET_SVE"
2963 1.1.1.3 mrg "@
2964 1.1.1.3 mrg <sve_int_op>\t%0.<Vetype>, %1/m, %0.<Vetype>
2965 1.1.1.3 mrg movprfx\t%0, %2\;<sve_int_op>\t%0.<Vetype>, %1/m, %2.<Vetype>"
2966 1.1.1.3 mrg [(set_attr "movprfx" "*,yes")]
2967 1.1.1.3 mrg )
2968 1.1.1.3 mrg
2969 1.1.1.3 mrg ;; Predicated integer unary arithmetic, merging with an independent value.
2970 1.1.1.3 mrg ;;
2971 1.1.1.3 mrg ;; The earlyclobber isn't needed for the first alternative, but omitting
2972 1.1.1.3 mrg ;; it would only help the case in which operands 2 and 3 are the same,
2973 1.1.1.3 mrg ;; which is handled above rather than here. Marking all the alternatives
2974 1.1.1.3 mrg ;; as earlyclobber helps to make the instruction more regular to the
2975 1.1.1.3 mrg ;; register allocator.
2976 1.1.1.3 mrg (define_insn "*cond_<optab><mode>_any"
2977 1.1.1.3 mrg [(set (match_operand:SVE_FULL_I 0 "register_operand" "=&w, ?&w, ?&w")
2978 1.1.1.3 mrg (unspec:SVE_FULL_I
2979 1.1.1.3 mrg [(match_operand:<VPRED> 1 "register_operand" "Upl, Upl, Upl")
2980 1.1.1.3 mrg (SVE_INT_UNARY:SVE_FULL_I
2981 1.1.1.3 mrg (match_operand:SVE_FULL_I 2 "register_operand" "w, w, w"))
2982 1.1.1.3 mrg (match_operand:SVE_FULL_I 3 "aarch64_simd_reg_or_zero" "0, Dz, w")]
2983 1.1.1.3 mrg UNSPEC_SEL))]
2984 1.1.1.3 mrg "TARGET_SVE && !rtx_equal_p (operands[2], operands[3])"
2985 1.1.1.3 mrg "@
2986 1.1.1.3 mrg <sve_int_op>\t%0.<Vetype>, %1/m, %2.<Vetype>
2987 1.1.1.3 mrg movprfx\t%0.<Vetype>, %1/z, %2.<Vetype>\;<sve_int_op>\t%0.<Vetype>, %1/m, %2.<Vetype>
2988 1.1.1.3 mrg movprfx\t%0, %3\;<sve_int_op>\t%0.<Vetype>, %1/m, %2.<Vetype>"
2989 1.1.1.3 mrg [(set_attr "movprfx" "*,yes,yes")]
2990 1.1.1.3 mrg )
2991 1.1.1.3 mrg
2992 1.1.1.3 mrg ;; -------------------------------------------------------------------------
2993 1.1.1.3 mrg ;; ---- [INT] General unary arithmetic corresponding to unspecs
2994 1.1.1.3 mrg ;; -------------------------------------------------------------------------
2995 1.1.1.3 mrg ;; Includes
2996 1.1.1.3 mrg ;; - RBIT
2997 1.1.1.3 mrg ;; - REVB
2998 1.1.1.3 mrg ;; - REVH
2999 1.1.1.3 mrg ;; - REVW
3000 1.1.1.3 mrg ;; -------------------------------------------------------------------------
3001 1.1.1.3 mrg
3002 1.1.1.3 mrg ;; Predicated integer unary operations.
3003 1.1.1.3 mrg (define_insn "@aarch64_pred_<optab><mode>"
3004 1.1.1.3 mrg [(set (match_operand:SVE_FULL_I 0 "register_operand" "=w, ?&w")
3005 1.1.1.3 mrg (unspec:SVE_FULL_I
3006 1.1.1.3 mrg [(match_operand:<VPRED> 1 "register_operand" "Upl, Upl")
3007 1.1.1.3 mrg (unspec:SVE_FULL_I
3008 1.1.1.3 mrg [(match_operand:SVE_FULL_I 2 "register_operand" "0, w")]
3009 1.1.1.3 mrg SVE_INT_UNARY)]
3010 1.1.1.3 mrg UNSPEC_PRED_X))]
3011 1.1.1.3 mrg "TARGET_SVE && <elem_bits> >= <min_elem_bits>"
3012 1.1.1.3 mrg "@
3013 1.1.1.3 mrg <sve_int_op>\t%0.<Vetype>, %1/m, %2.<Vetype>
3014 1.1.1.3 mrg movprfx\t%0, %2\;<sve_int_op>\t%0.<Vetype>, %1/m, %2.<Vetype>"
3015 1.1.1.3 mrg [(set_attr "movprfx" "*,yes")]
3016 1.1.1.3 mrg )
3017 1.1.1.3 mrg
3018 1.1.1.3 mrg ;; Predicated integer unary operations with merging.
3019 1.1.1.3 mrg (define_insn "@cond_<optab><mode>"
3020 1.1.1.3 mrg [(set (match_operand:SVE_FULL_I 0 "register_operand" "=w, ?&w, ?&w")
3021 1.1.1.3 mrg (unspec:SVE_FULL_I
3022 1.1.1.3 mrg [(match_operand:<VPRED> 1 "register_operand" "Upl, Upl, Upl")
3023 1.1.1.3 mrg (unspec:SVE_FULL_I
3024 1.1.1.3 mrg [(match_operand:SVE_FULL_I 2 "register_operand" "w, w, w")]
3025 1.1.1.3 mrg SVE_INT_UNARY)
3026 1.1.1.3 mrg (match_operand:SVE_FULL_I 3 "aarch64_simd_reg_or_zero" "0, Dz, w")]
3027 1.1.1.3 mrg UNSPEC_SEL))]
3028 1.1.1.3 mrg "TARGET_SVE && <elem_bits> >= <min_elem_bits>"
3029 1.1.1.3 mrg "@
3030 1.1.1.3 mrg <sve_int_op>\t%0.<Vetype>, %1/m, %2.<Vetype>
3031 1.1.1.3 mrg movprfx\t%0.<Vetype>, %1/z, %2.<Vetype>\;<sve_int_op>\t%0.<Vetype>, %1/m, %2.<Vetype>
3032 1.1.1.3 mrg movprfx\t%0, %3\;<sve_int_op>\t%0.<Vetype>, %1/m, %2.<Vetype>"
3033 1.1.1.3 mrg [(set_attr "movprfx" "*,yes,yes")]
3034 1.1.1.3 mrg )
3035 1.1.1.3 mrg
3036 1.1.1.3 mrg ;; -------------------------------------------------------------------------
3037 1.1.1.3 mrg ;; ---- [INT] Sign and zero extension
3038 1.1.1.3 mrg ;; -------------------------------------------------------------------------
3039 1.1.1.3 mrg ;; Includes:
3040 1.1.1.3 mrg ;; - SXTB
3041 1.1.1.3 mrg ;; - SXTH
3042 1.1.1.3 mrg ;; - SXTW
3043 1.1.1.3 mrg ;; - UXTB
3044 1.1.1.3 mrg ;; - UXTH
3045 1.1.1.3 mrg ;; - UXTW
3046 1.1.1.3 mrg ;; -------------------------------------------------------------------------
3047 1.1.1.3 mrg
3048 1.1.1.3 mrg ;; Unpredicated sign and zero extension from a narrower mode.
3049 1.1.1.3 mrg (define_expand "<optab><SVE_PARTIAL_I:mode><SVE_HSDI:mode>2"
3050 1.1.1.3 mrg [(set (match_operand:SVE_HSDI 0 "register_operand")
3051 1.1.1.3 mrg (unspec:SVE_HSDI
3052 1.1.1.3 mrg [(match_dup 2)
3053 1.1.1.3 mrg (ANY_EXTEND:SVE_HSDI
3054 1.1.1.3 mrg (match_operand:SVE_PARTIAL_I 1 "register_operand"))]
3055 1.1.1.3 mrg UNSPEC_PRED_X))]
3056 1.1.1.3 mrg "TARGET_SVE && (~<SVE_HSDI:narrower_mask> & <SVE_PARTIAL_I:self_mask>) == 0"
3057 1.1.1.3 mrg {
3058 1.1.1.3 mrg operands[2] = aarch64_ptrue_reg (<SVE_HSDI:VPRED>mode);
3059 1.1.1.3 mrg }
3060 1.1.1.3 mrg )
3061 1.1.1.3 mrg
3062 1.1.1.3 mrg ;; Predicated sign and zero extension from a narrower mode.
3063 1.1.1.3 mrg (define_insn "*<optab><SVE_PARTIAL_I:mode><SVE_HSDI:mode>2"
3064 1.1.1.3 mrg [(set (match_operand:SVE_HSDI 0 "register_operand" "=w, ?&w")
3065 1.1.1.3 mrg (unspec:SVE_HSDI
3066 1.1.1.3 mrg [(match_operand:<SVE_HSDI:VPRED> 1 "register_operand" "Upl, Upl")
3067 1.1.1.3 mrg (ANY_EXTEND:SVE_HSDI
3068 1.1.1.3 mrg (match_operand:SVE_PARTIAL_I 2 "register_operand" "0, w"))]
3069 1.1.1.3 mrg UNSPEC_PRED_X))]
3070 1.1.1.3 mrg "TARGET_SVE && (~<SVE_HSDI:narrower_mask> & <SVE_PARTIAL_I:self_mask>) == 0"
3071 1.1.1.3 mrg "@
3072 1.1.1.3 mrg <su>xt<SVE_PARTIAL_I:Vesize>\t%0.<SVE_HSDI:Vetype>, %1/m, %2.<SVE_HSDI:Vetype>
3073 1.1.1.3 mrg movprfx\t%0, %2\;<su>xt<SVE_PARTIAL_I:Vesize>\t%0.<SVE_HSDI:Vetype>, %1/m, %2.<SVE_HSDI:Vetype>"
3074 1.1.1.3 mrg [(set_attr "movprfx" "*,yes")]
3075 1.1.1.3 mrg )
3076 1.1.1.3 mrg
3077 1.1.1.3 mrg ;; Predicated truncate-and-sign-extend operations.
3078 1.1.1.3 mrg (define_insn "@aarch64_pred_sxt<SVE_FULL_HSDI:mode><SVE_PARTIAL_I:mode>"
3079 1.1.1.3 mrg [(set (match_operand:SVE_FULL_HSDI 0 "register_operand" "=w, ?&w")
3080 1.1.1.3 mrg (unspec:SVE_FULL_HSDI
3081 1.1.1.3 mrg [(match_operand:<SVE_FULL_HSDI:VPRED> 1 "register_operand" "Upl, Upl")
3082 1.1.1.3 mrg (sign_extend:SVE_FULL_HSDI
3083 1.1.1.3 mrg (truncate:SVE_PARTIAL_I
3084 1.1.1.3 mrg (match_operand:SVE_FULL_HSDI 2 "register_operand" "0, w")))]
3085 1.1.1.3 mrg UNSPEC_PRED_X))]
3086 1.1.1.3 mrg "TARGET_SVE
3087 1.1.1.3 mrg && (~<SVE_FULL_HSDI:narrower_mask> & <SVE_PARTIAL_I:self_mask>) == 0"
3088 1.1.1.3 mrg "@
3089 1.1.1.3 mrg sxt<SVE_PARTIAL_I:Vesize>\t%0.<SVE_FULL_HSDI:Vetype>, %1/m, %2.<SVE_FULL_HSDI:Vetype>
3090 1.1.1.3 mrg movprfx\t%0, %2\;sxt<SVE_PARTIAL_I:Vesize>\t%0.<SVE_FULL_HSDI:Vetype>, %1/m, %2.<SVE_FULL_HSDI:Vetype>"
3091 1.1.1.3 mrg [(set_attr "movprfx" "*,yes")]
3092 1.1.1.3 mrg )
3093 1.1.1.3 mrg
3094 1.1.1.3 mrg ;; Predicated truncate-and-sign-extend operations with merging.
3095 1.1.1.3 mrg (define_insn "@aarch64_cond_sxt<SVE_FULL_HSDI:mode><SVE_PARTIAL_I:mode>"
3096 1.1.1.3 mrg [(set (match_operand:SVE_FULL_HSDI 0 "register_operand" "=w, ?&w, ?&w")
3097 1.1.1.3 mrg (unspec:SVE_FULL_HSDI
3098 1.1.1.3 mrg [(match_operand:<SVE_FULL_HSDI:VPRED> 1 "register_operand" "Upl, Upl, Upl")
3099 1.1.1.3 mrg (sign_extend:SVE_FULL_HSDI
3100 1.1.1.3 mrg (truncate:SVE_PARTIAL_I
3101 1.1.1.3 mrg (match_operand:SVE_FULL_HSDI 2 "register_operand" "w, w, w")))
3102 1.1.1.3 mrg (match_operand:SVE_FULL_HSDI 3 "aarch64_simd_reg_or_zero" "0, Dz, w")]
3103 1.1.1.3 mrg UNSPEC_SEL))]
3104 1.1.1.3 mrg "TARGET_SVE
3105 1.1.1.3 mrg && (~<SVE_FULL_HSDI:narrower_mask> & <SVE_PARTIAL_I:self_mask>) == 0"
3106 1.1.1.3 mrg "@
3107 1.1.1.3 mrg sxt<SVE_PARTIAL_I:Vesize>\t%0.<SVE_FULL_HSDI:Vetype>, %1/m, %2.<SVE_FULL_HSDI:Vetype>
3108 1.1.1.3 mrg movprfx\t%0.<SVE_FULL_HSDI:Vetype>, %1/z, %2.<SVE_FULL_HSDI:Vetype>\;sxt<SVE_PARTIAL_I:Vesize>\t%0.<SVE_FULL_HSDI:Vetype>, %1/m, %2.<SVE_FULL_HSDI:Vetype>
3109 1.1.1.3 mrg movprfx\t%0, %3\;sxt<SVE_PARTIAL_I:Vesize>\t%0.<SVE_FULL_HSDI:Vetype>, %1/m, %2.<SVE_FULL_HSDI:Vetype>"
3110 1.1.1.3 mrg [(set_attr "movprfx" "*,yes,yes")]
3111 1.1.1.3 mrg )
3112 1.1.1.3 mrg
3113 1.1.1.3 mrg ;; Predicated truncate-and-zero-extend operations, merging with the
3114 1.1.1.3 mrg ;; first input.
3115 1.1.1.3 mrg ;;
3116 1.1.1.3 mrg ;; The canonical form of this operation is an AND of a constant rather
3117 1.1.1.3 mrg ;; than (zero_extend (truncate ...)).
3118 1.1.1.3 mrg (define_insn "*cond_uxt<mode>_2"
3119 1.1.1.3 mrg [(set (match_operand:SVE_FULL_I 0 "register_operand" "=w, ?&w")
3120 1.1.1.3 mrg (unspec:SVE_FULL_I
3121 1.1.1.3 mrg [(match_operand:<VPRED> 1 "register_operand" "Upl, Upl")
3122 1.1.1.3 mrg (and:SVE_FULL_I
3123 1.1.1.3 mrg (match_operand:SVE_FULL_I 2 "register_operand" "0, w")
3124 1.1.1.3 mrg (match_operand:SVE_FULL_I 3 "aarch64_sve_uxt_immediate"))
3125 1.1.1.3 mrg (match_dup 2)]
3126 1.1.1.3 mrg UNSPEC_SEL))]
3127 1.1.1.3 mrg "TARGET_SVE"
3128 1.1.1.3 mrg "@
3129 1.1.1.3 mrg uxt%e3\t%0.<Vetype>, %1/m, %0.<Vetype>
3130 1.1.1.3 mrg movprfx\t%0, %2\;uxt%e3\t%0.<Vetype>, %1/m, %2.<Vetype>"
3131 1.1.1.3 mrg [(set_attr "movprfx" "*,yes")]
3132 1.1.1.3 mrg )
3133 1.1.1.3 mrg
3134 1.1.1.3 mrg ;; Predicated truncate-and-zero-extend operations, merging with an
3135 1.1.1.3 mrg ;; independent value.
3136 1.1.1.3 mrg ;;
3137 1.1.1.3 mrg ;; The earlyclobber isn't needed for the first alternative, but omitting
3138 1.1.1.3 mrg ;; it would only help the case in which operands 2 and 4 are the same,
3139 1.1.1.3 mrg ;; which is handled above rather than here. Marking all the alternatives
3140 1.1.1.3 mrg ;; as early-clobber helps to make the instruction more regular to the
3141 1.1.1.3 mrg ;; register allocator.
3142 1.1.1.3 mrg (define_insn "*cond_uxt<mode>_any"
3143 1.1.1.3 mrg [(set (match_operand:SVE_FULL_I 0 "register_operand" "=&w, ?&w, ?&w")
3144 1.1.1.3 mrg (unspec:SVE_FULL_I
3145 1.1.1.3 mrg [(match_operand:<VPRED> 1 "register_operand" "Upl, Upl, Upl")
3146 1.1.1.3 mrg (and:SVE_FULL_I
3147 1.1.1.3 mrg (match_operand:SVE_FULL_I 2 "register_operand" "w, w, w")
3148 1.1.1.3 mrg (match_operand:SVE_FULL_I 3 "aarch64_sve_uxt_immediate"))
3149 1.1.1.3 mrg (match_operand:SVE_FULL_I 4 "aarch64_simd_reg_or_zero" "0, Dz, w")]
3150 1.1.1.3 mrg UNSPEC_SEL))]
3151 1.1.1.3 mrg "TARGET_SVE && !rtx_equal_p (operands[2], operands[4])"
3152 1.1.1.3 mrg "@
3153 1.1.1.3 mrg uxt%e3\t%0.<Vetype>, %1/m, %2.<Vetype>
3154 1.1.1.3 mrg movprfx\t%0.<Vetype>, %1/z, %2.<Vetype>\;uxt%e3\t%0.<Vetype>, %1/m, %2.<Vetype>
3155 1.1.1.3 mrg movprfx\t%0, %4\;uxt%e3\t%0.<Vetype>, %1/m, %2.<Vetype>"
3156 1.1.1.3 mrg [(set_attr "movprfx" "*,yes,yes")]
3157 1.1.1.3 mrg )
3158 1.1.1.3 mrg
3159 1.1.1.3 mrg ;; -------------------------------------------------------------------------
3160 1.1.1.3 mrg ;; ---- [INT] Truncation
3161 1.1.1.3 mrg ;; -------------------------------------------------------------------------
3162 1.1.1.3 mrg ;; The patterns in this section are synthetic.
3163 1.1.1.3 mrg ;; -------------------------------------------------------------------------
3164 1.1.1.3 mrg
3165 1.1.1.3 mrg ;; Truncate to a partial SVE vector from either a full vector or a
3166 1.1.1.3 mrg ;; wider partial vector. This is a no-op, because we can just ignore
3167 1.1.1.3 mrg ;; the unused upper bits of the source.
3168 1.1.1.3 mrg (define_insn_and_split "trunc<SVE_HSDI:mode><SVE_PARTIAL_I:mode>2"
3169 1.1.1.3 mrg [(set (match_operand:SVE_PARTIAL_I 0 "register_operand" "=w")
3170 1.1.1.3 mrg (truncate:SVE_PARTIAL_I
3171 1.1.1.3 mrg (match_operand:SVE_HSDI 1 "register_operand" "w")))]
3172 1.1.1.3 mrg "TARGET_SVE && (~<SVE_HSDI:narrower_mask> & <SVE_PARTIAL_I:self_mask>) == 0"
3173 1.1.1.3 mrg "#"
3174 1.1.1.3 mrg "&& reload_completed"
3175 1.1.1.3 mrg [(set (match_dup 0) (match_dup 1))]
3176 1.1.1.3 mrg {
3177 1.1.1.3 mrg operands[1] = aarch64_replace_reg_mode (operands[1],
3178 1.1.1.3 mrg <SVE_PARTIAL_I:MODE>mode);
3179 1.1.1.3 mrg }
3180 1.1.1.3 mrg )
3181 1.1.1.3 mrg
3182 1.1.1.3 mrg ;; -------------------------------------------------------------------------
3183 1.1.1.3 mrg ;; ---- [INT] Logical inverse
3184 1.1.1.3 mrg ;; -------------------------------------------------------------------------
3185 1.1.1.3 mrg ;; Includes:
3186 1.1.1.3 mrg ;; - CNOT
3187 1.1.1.3 mrg ;; -------------------------------------------------------------------------
3188 1.1.1.3 mrg
3189 1.1.1.3 mrg ;; Predicated logical inverse.
3190 1.1.1.3 mrg (define_expand "@aarch64_pred_cnot<mode>"
3191 1.1.1.3 mrg [(set (match_operand:SVE_FULL_I 0 "register_operand")
3192 1.1.1.3 mrg (unspec:SVE_FULL_I
3193 1.1.1.3 mrg [(unspec:<VPRED>
3194 1.1.1.3 mrg [(match_operand:<VPRED> 1 "register_operand")
3195 1.1.1.3 mrg (match_operand:SI 2 "aarch64_sve_ptrue_flag")
3196 1.1.1.3 mrg (eq:<VPRED>
3197 1.1.1.3 mrg (match_operand:SVE_FULL_I 3 "register_operand")
3198 1.1.1.3 mrg (match_dup 4))]
3199 1.1.1.3 mrg UNSPEC_PRED_Z)
3200 1.1.1.3 mrg (match_dup 5)
3201 1.1.1.3 mrg (match_dup 4)]
3202 1.1.1.3 mrg UNSPEC_SEL))]
3203 1.1.1.3 mrg "TARGET_SVE"
3204 1.1.1.3 mrg {
3205 1.1.1.3 mrg operands[4] = CONST0_RTX (<MODE>mode);
3206 1.1.1.3 mrg operands[5] = CONST1_RTX (<MODE>mode);
3207 1.1.1.3 mrg }
3208 1.1.1.3 mrg )
3209 1.1.1.3 mrg
3210 1.1.1.3 mrg (define_insn "*cnot<mode>"
3211 1.1.1.3 mrg [(set (match_operand:SVE_FULL_I 0 "register_operand" "=w, ?&w")
3212 1.1.1.3 mrg (unspec:SVE_FULL_I
3213 1.1.1.3 mrg [(unspec:<VPRED>
3214 1.1.1.3 mrg [(match_operand:<VPRED> 1 "register_operand" "Upl, Upl")
3215 1.1.1.3 mrg (match_operand:SI 5 "aarch64_sve_ptrue_flag")
3216 1.1.1.3 mrg (eq:<VPRED>
3217 1.1.1.3 mrg (match_operand:SVE_FULL_I 2 "register_operand" "0, w")
3218 1.1.1.3 mrg (match_operand:SVE_FULL_I 3 "aarch64_simd_imm_zero"))]
3219 1.1.1.3 mrg UNSPEC_PRED_Z)
3220 1.1.1.3 mrg (match_operand:SVE_FULL_I 4 "aarch64_simd_imm_one")
3221 1.1.1.3 mrg (match_dup 3)]
3222 1.1.1.3 mrg UNSPEC_SEL))]
3223 1.1.1.3 mrg "TARGET_SVE"
3224 1.1.1.3 mrg "@
3225 1.1.1.3 mrg cnot\t%0.<Vetype>, %1/m, %2.<Vetype>
3226 1.1.1.3 mrg movprfx\t%0, %2\;cnot\t%0.<Vetype>, %1/m, %2.<Vetype>"
3227 1.1.1.3 mrg [(set_attr "movprfx" "*,yes")]
3228 1.1.1.3 mrg )
3229 1.1.1.3 mrg
3230 1.1.1.3 mrg ;; Predicated logical inverse with merging.
3231 1.1.1.3 mrg (define_expand "@cond_cnot<mode>"
3232 1.1.1.3 mrg [(set (match_operand:SVE_FULL_I 0 "register_operand")
3233 1.1.1.3 mrg (unspec:SVE_FULL_I
3234 1.1.1.3 mrg [(match_operand:<VPRED> 1 "register_operand")
3235 1.1.1.3 mrg (unspec:SVE_FULL_I
3236 1.1.1.3 mrg [(unspec:<VPRED>
3237 1.1.1.3 mrg [(match_dup 4)
3238 1.1.1.3 mrg (const_int SVE_KNOWN_PTRUE)
3239 1.1.1.3 mrg (eq:<VPRED>
3240 1.1.1.3 mrg (match_operand:SVE_FULL_I 2 "register_operand")
3241 1.1.1.3 mrg (match_dup 5))]
3242 1.1.1.3 mrg UNSPEC_PRED_Z)
3243 1.1.1.3 mrg (match_dup 6)
3244 1.1.1.3 mrg (match_dup 5)]
3245 1.1.1.3 mrg UNSPEC_SEL)
3246 1.1.1.3 mrg (match_operand:SVE_FULL_I 3 "aarch64_simd_reg_or_zero")]
3247 1.1.1.3 mrg UNSPEC_SEL))]
3248 1.1.1.3 mrg "TARGET_SVE"
3249 1.1.1.3 mrg {
3250 1.1.1.3 mrg operands[4] = CONSTM1_RTX (<VPRED>mode);
3251 1.1.1.3 mrg operands[5] = CONST0_RTX (<MODE>mode);
3252 1.1.1.3 mrg operands[6] = CONST1_RTX (<MODE>mode);
3253 1.1.1.3 mrg }
3254 1.1.1.3 mrg )
3255 1.1.1.3 mrg
3256 1.1.1.3 mrg ;; Predicated logical inverse, merging with the first input.
3257 1.1.1.3 mrg (define_insn_and_rewrite "*cond_cnot<mode>_2"
3258 1.1.1.3 mrg [(set (match_operand:SVE_FULL_I 0 "register_operand" "=w, ?&w")
3259 1.1.1.3 mrg (unspec:SVE_FULL_I
3260 1.1.1.3 mrg [(match_operand:<VPRED> 1 "register_operand" "Upl, Upl")
3261 1.1.1.3 mrg ;; Logical inverse of operand 2 (as above).
3262 1.1.1.3 mrg (unspec:SVE_FULL_I
3263 1.1.1.3 mrg [(unspec:<VPRED>
3264 1.1.1.3 mrg [(match_operand 5)
3265 1.1.1.3 mrg (const_int SVE_KNOWN_PTRUE)
3266 1.1.1.3 mrg (eq:<VPRED>
3267 1.1.1.3 mrg (match_operand:SVE_FULL_I 2 "register_operand" "0, w")
3268 1.1.1.3 mrg (match_operand:SVE_FULL_I 3 "aarch64_simd_imm_zero"))]
3269 1.1.1.3 mrg UNSPEC_PRED_Z)
3270 1.1.1.3 mrg (match_operand:SVE_FULL_I 4 "aarch64_simd_imm_one")
3271 1.1.1.3 mrg (match_dup 3)]
3272 1.1.1.3 mrg UNSPEC_SEL)
3273 1.1.1.3 mrg (match_dup 2)]
3274 1.1.1.3 mrg UNSPEC_SEL))]
3275 1.1.1.3 mrg "TARGET_SVE"
3276 1.1.1.3 mrg "@
3277 1.1.1.3 mrg cnot\t%0.<Vetype>, %1/m, %0.<Vetype>
3278 1.1.1.3 mrg movprfx\t%0, %2\;cnot\t%0.<Vetype>, %1/m, %2.<Vetype>"
3279 1.1.1.3 mrg "&& !CONSTANT_P (operands[5])"
3280 1.1.1.3 mrg {
3281 1.1.1.3 mrg operands[5] = CONSTM1_RTX (<VPRED>mode);
3282 1.1.1.3 mrg }
3283 1.1.1.3 mrg [(set_attr "movprfx" "*,yes")]
3284 1.1.1.3 mrg )
3285 1.1.1.3 mrg
3286 1.1.1.3 mrg ;; Predicated logical inverse, merging with an independent value.
3287 1.1.1.3 mrg ;;
3288 1.1.1.3 mrg ;; The earlyclobber isn't needed for the first alternative, but omitting
3289 1.1.1.3 mrg ;; it would only help the case in which operands 2 and 6 are the same,
3290 1.1.1.3 mrg ;; which is handled above rather than here. Marking all the alternatives
3291 1.1.1.3 mrg ;; as earlyclobber helps to make the instruction more regular to the
3292 1.1.1.3 mrg ;; register allocator.
3293 1.1.1.3 mrg (define_insn_and_rewrite "*cond_cnot<mode>_any"
3294 1.1.1.3 mrg [(set (match_operand:SVE_FULL_I 0 "register_operand" "=&w, ?&w, ?&w")
3295 1.1.1.3 mrg (unspec:SVE_FULL_I
3296 1.1.1.3 mrg [(match_operand:<VPRED> 1 "register_operand" "Upl, Upl, Upl")
3297 1.1.1.3 mrg ;; Logical inverse of operand 2 (as above).
3298 1.1.1.3 mrg (unspec:SVE_FULL_I
3299 1.1.1.3 mrg [(unspec:<VPRED>
3300 1.1.1.3 mrg [(match_operand 5)
3301 1.1.1.3 mrg (const_int SVE_KNOWN_PTRUE)
3302 1.1.1.3 mrg (eq:<VPRED>
3303 1.1.1.3 mrg (match_operand:SVE_FULL_I 2 "register_operand" "w, w, w")
3304 1.1.1.3 mrg (match_operand:SVE_FULL_I 3 "aarch64_simd_imm_zero"))]
3305 1.1.1.3 mrg UNSPEC_PRED_Z)
3306 1.1.1.3 mrg (match_operand:SVE_FULL_I 4 "aarch64_simd_imm_one")
3307 1.1.1.3 mrg (match_dup 3)]
3308 1.1.1.3 mrg UNSPEC_SEL)
3309 1.1.1.3 mrg (match_operand:SVE_FULL_I 6 "aarch64_simd_reg_or_zero" "0, Dz, w")]
3310 1.1.1.3 mrg UNSPEC_SEL))]
3311 1.1.1.3 mrg "TARGET_SVE && !rtx_equal_p (operands[2], operands[6])"
3312 1.1.1.3 mrg "@
3313 1.1.1.3 mrg cnot\t%0.<Vetype>, %1/m, %2.<Vetype>
3314 1.1.1.3 mrg movprfx\t%0.<Vetype>, %1/z, %2.<Vetype>\;cnot\t%0.<Vetype>, %1/m, %2.<Vetype>
3315 1.1.1.3 mrg movprfx\t%0, %6\;cnot\t%0.<Vetype>, %1/m, %2.<Vetype>"
3316 1.1.1.3 mrg "&& !CONSTANT_P (operands[5])"
3317 1.1.1.3 mrg {
3318 1.1.1.3 mrg operands[5] = CONSTM1_RTX (<VPRED>mode);
3319 1.1.1.3 mrg }
3320 1.1.1.3 mrg [(set_attr "movprfx" "*,yes,yes")]
3321 1.1.1.3 mrg )
3322 1.1.1.3 mrg
3323 1.1.1.3 mrg ;; -------------------------------------------------------------------------
3324 1.1.1.3 mrg ;; ---- [FP<-INT] General unary arithmetic that maps to unspecs
3325 1.1.1.3 mrg ;; -------------------------------------------------------------------------
3326 1.1.1.3 mrg ;; Includes:
3327 1.1.1.3 mrg ;; - FEXPA
3328 1.1.1.3 mrg ;; -------------------------------------------------------------------------
3329 1.1.1.3 mrg
3330 1.1.1.3 mrg ;; Unpredicated unary operations that take an integer and return a float.
3331 1.1.1.3 mrg (define_insn "@aarch64_sve_<optab><mode>"
3332 1.1.1.3 mrg [(set (match_operand:SVE_FULL_F 0 "register_operand" "=w")
3333 1.1.1.3 mrg (unspec:SVE_FULL_F
3334 1.1.1.3 mrg [(match_operand:<V_INT_EQUIV> 1 "register_operand" "w")]
3335 1.1.1.3 mrg SVE_FP_UNARY_INT))]
3336 1.1.1.3 mrg "TARGET_SVE"
3337 1.1.1.3 mrg "<sve_fp_op>\t%0.<Vetype>, %1.<Vetype>"
3338 1.1.1.3 mrg )
3339 1.1.1.3 mrg
3340 1.1.1.3 mrg ;; -------------------------------------------------------------------------
3341 1.1.1.3 mrg ;; ---- [FP] General unary arithmetic corresponding to unspecs
3342 1.1.1.3 mrg ;; -------------------------------------------------------------------------
3343 1.1.1.3 mrg ;; Includes:
3344 1.1.1.3 mrg ;; - FABS
3345 1.1.1.3 mrg ;; - FNEG
3346 1.1.1.3 mrg ;; - FRECPE
3347 1.1.1.3 mrg ;; - FRECPX
3348 1.1.1.3 mrg ;; - FRINTA
3349 1.1.1.3 mrg ;; - FRINTI
3350 1.1.1.3 mrg ;; - FRINTM
3351 1.1.1.3 mrg ;; - FRINTN
3352 1.1.1.3 mrg ;; - FRINTP
3353 1.1.1.3 mrg ;; - FRINTX
3354 1.1.1.3 mrg ;; - FRINTZ
3355 1.1.1.3 mrg ;; - FRSQRTE
3356 1.1.1.3 mrg ;; - FSQRT
3357 1.1.1.3 mrg ;; -------------------------------------------------------------------------
3358 1.1.1.3 mrg
3359 1.1.1.3 mrg ;; Unpredicated floating-point unary operations.
3360 1.1.1.3 mrg (define_insn "@aarch64_sve_<optab><mode>"
3361 1.1.1.3 mrg [(set (match_operand:SVE_FULL_F 0 "register_operand" "=w")
3362 1.1.1.3 mrg (unspec:SVE_FULL_F
3363 1.1.1.3 mrg [(match_operand:SVE_FULL_F 1 "register_operand" "w")]
3364 1.1.1.3 mrg SVE_FP_UNARY))]
3365 1.1.1.3 mrg "TARGET_SVE"
3366 1.1.1.3 mrg "<sve_fp_op>\t%0.<Vetype>, %1.<Vetype>"
3367 1.1.1.3 mrg )
3368 1.1.1.3 mrg
3369 1.1.1.3 mrg ;; Unpredicated floating-point unary operations.
3370 1.1.1.3 mrg (define_expand "<optab><mode>2"
3371 1.1.1.3 mrg [(set (match_operand:SVE_FULL_F 0 "register_operand")
3372 1.1.1.3 mrg (unspec:SVE_FULL_F
3373 1.1.1.3 mrg [(match_dup 2)
3374 1.1.1.3 mrg (const_int SVE_RELAXED_GP)
3375 1.1.1.3 mrg (match_operand:SVE_FULL_F 1 "register_operand")]
3376 1.1.1.3 mrg SVE_COND_FP_UNARY_OPTAB))]
3377 1.1.1.3 mrg "TARGET_SVE"
3378 1.1.1.3 mrg {
3379 1.1.1.3 mrg operands[2] = aarch64_ptrue_reg (<VPRED>mode);
3380 1.1.1.3 mrg }
3381 1.1.1.3 mrg )
3382 1.1.1.3 mrg
3383 1.1.1.3 mrg ;; Predicated floating-point unary operations.
3384 1.1.1.3 mrg (define_insn "@aarch64_pred_<optab><mode>"
3385 1.1.1.3 mrg [(set (match_operand:SVE_FULL_F 0 "register_operand" "=w, ?&w")
3386 1.1.1.3 mrg (unspec:SVE_FULL_F
3387 1.1.1.3 mrg [(match_operand:<VPRED> 1 "register_operand" "Upl, Upl")
3388 1.1.1.3 mrg (match_operand:SI 3 "aarch64_sve_gp_strictness")
3389 1.1.1.3 mrg (match_operand:SVE_FULL_F 2 "register_operand" "0, w")]
3390 1.1.1.3 mrg SVE_COND_FP_UNARY))]
3391 1.1.1.3 mrg "TARGET_SVE"
3392 1.1.1.3 mrg "@
3393 1.1.1.3 mrg <sve_fp_op>\t%0.<Vetype>, %1/m, %2.<Vetype>
3394 1.1.1.3 mrg movprfx\t%0, %2\;<sve_fp_op>\t%0.<Vetype>, %1/m, %2.<Vetype>"
3395 1.1.1.3 mrg [(set_attr "movprfx" "*,yes")]
3396 1.1.1.3 mrg )
3397 1.1.1.3 mrg
3398 1.1.1.3 mrg ;; Predicated floating-point unary arithmetic with merging.
3399 1.1.1.3 mrg (define_expand "@cond_<optab><mode>"
3400 1.1.1.3 mrg [(set (match_operand:SVE_FULL_F 0 "register_operand")
3401 1.1.1.3 mrg (unspec:SVE_FULL_F
3402 1.1.1.3 mrg [(match_operand:<VPRED> 1 "register_operand")
3403 1.1.1.3 mrg (unspec:SVE_FULL_F
3404 1.1.1.3 mrg [(match_dup 1)
3405 1.1.1.3 mrg (const_int SVE_STRICT_GP)
3406 1.1.1.3 mrg (match_operand:SVE_FULL_F 2 "register_operand")]
3407 1.1.1.3 mrg SVE_COND_FP_UNARY)
3408 1.1.1.3 mrg (match_operand:SVE_FULL_F 3 "aarch64_simd_reg_or_zero")]
3409 1.1.1.3 mrg UNSPEC_SEL))]
3410 1.1.1.3 mrg "TARGET_SVE"
3411 1.1.1.3 mrg )
3412 1.1.1.3 mrg
3413 1.1.1.3 mrg ;; Predicated floating-point unary arithmetic, merging with the first input.
3414 1.1.1.3 mrg (define_insn_and_rewrite "*cond_<optab><mode>_2_relaxed"
3415 1.1.1.3 mrg [(set (match_operand:SVE_FULL_F 0 "register_operand" "=w, ?&w")
3416 1.1.1.3 mrg (unspec:SVE_FULL_F
3417 1.1.1.3 mrg [(match_operand:<VPRED> 1 "register_operand" "Upl, Upl")
3418 1.1.1.3 mrg (unspec:SVE_FULL_F
3419 1.1.1.3 mrg [(match_operand 3)
3420 1.1.1.3 mrg (const_int SVE_RELAXED_GP)
3421 1.1.1.3 mrg (match_operand:SVE_FULL_F 2 "register_operand" "0, w")]
3422 1.1.1.3 mrg SVE_COND_FP_UNARY)
3423 1.1.1.3 mrg (match_dup 2)]
3424 1.1.1.3 mrg UNSPEC_SEL))]
3425 1.1.1.3 mrg "TARGET_SVE"
3426 1.1.1.3 mrg "@
3427 1.1.1.3 mrg <sve_fp_op>\t%0.<Vetype>, %1/m, %0.<Vetype>
3428 1.1.1.3 mrg movprfx\t%0, %2\;<sve_fp_op>\t%0.<Vetype>, %1/m, %2.<Vetype>"
3429 1.1.1.3 mrg "&& !rtx_equal_p (operands[1], operands[3])"
3430 1.1.1.3 mrg {
3431 1.1.1.3 mrg operands[3] = copy_rtx (operands[1]);
3432 1.1.1.3 mrg }
3433 1.1.1.3 mrg [(set_attr "movprfx" "*,yes")]
3434 1.1.1.3 mrg )
3435 1.1.1.3 mrg
3436 1.1.1.3 mrg (define_insn "*cond_<optab><mode>_2_strict"
3437 1.1.1.3 mrg [(set (match_operand:SVE_FULL_F 0 "register_operand" "=w, ?&w")
3438 1.1.1.3 mrg (unspec:SVE_FULL_F
3439 1.1.1.3 mrg [(match_operand:<VPRED> 1 "register_operand" "Upl, Upl")
3440 1.1.1.3 mrg (unspec:SVE_FULL_F
3441 1.1.1.3 mrg [(match_dup 1)
3442 1.1.1.3 mrg (const_int SVE_STRICT_GP)
3443 1.1.1.3 mrg (match_operand:SVE_FULL_F 2 "register_operand" "0, w")]
3444 1.1.1.3 mrg SVE_COND_FP_UNARY)
3445 1.1.1.3 mrg (match_dup 2)]
3446 1.1.1.3 mrg UNSPEC_SEL))]
3447 1.1.1.3 mrg "TARGET_SVE"
3448 1.1.1.3 mrg "@
3449 1.1.1.3 mrg <sve_fp_op>\t%0.<Vetype>, %1/m, %0.<Vetype>
3450 1.1.1.3 mrg movprfx\t%0, %2\;<sve_fp_op>\t%0.<Vetype>, %1/m, %2.<Vetype>"
3451 1.1.1.3 mrg [(set_attr "movprfx" "*,yes")]
3452 1.1.1.3 mrg )
3453 1.1.1.3 mrg
3454 1.1.1.3 mrg ;; Predicated floating-point unary arithmetic, merging with an independent
3455 1.1.1.3 mrg ;; value.
3456 1.1.1.3 mrg ;;
3457 1.1.1.3 mrg ;; The earlyclobber isn't needed for the first alternative, but omitting
3458 1.1.1.3 mrg ;; it would only help the case in which operands 2 and 3 are the same,
3459 1.1.1.3 mrg ;; which is handled above rather than here. Marking all the alternatives
3460 1.1.1.3 mrg ;; as earlyclobber helps to make the instruction more regular to the
3461 1.1.1.3 mrg ;; register allocator.
3462 1.1.1.3 mrg (define_insn_and_rewrite "*cond_<optab><mode>_any_relaxed"
3463 1.1.1.3 mrg [(set (match_operand:SVE_FULL_F 0 "register_operand" "=&w, ?&w, ?&w")
3464 1.1.1.3 mrg (unspec:SVE_FULL_F
3465 1.1.1.3 mrg [(match_operand:<VPRED> 1 "register_operand" "Upl, Upl, Upl")
3466 1.1.1.3 mrg (unspec:SVE_FULL_F
3467 1.1.1.3 mrg [(match_operand 4)
3468 1.1.1.3 mrg (const_int SVE_RELAXED_GP)
3469 1.1.1.3 mrg (match_operand:SVE_FULL_F 2 "register_operand" "w, w, w")]
3470 1.1.1.3 mrg SVE_COND_FP_UNARY)
3471 1.1.1.3 mrg (match_operand:SVE_FULL_F 3 "aarch64_simd_reg_or_zero" "0, Dz, w")]
3472 1.1.1.3 mrg UNSPEC_SEL))]
3473 1.1.1.3 mrg "TARGET_SVE && !rtx_equal_p (operands[2], operands[3])"
3474 1.1.1.3 mrg "@
3475 1.1.1.3 mrg <sve_fp_op>\t%0.<Vetype>, %1/m, %2.<Vetype>
3476 1.1.1.3 mrg movprfx\t%0.<Vetype>, %1/z, %2.<Vetype>\;<sve_fp_op>\t%0.<Vetype>, %1/m, %2.<Vetype>
3477 1.1.1.3 mrg movprfx\t%0, %3\;<sve_fp_op>\t%0.<Vetype>, %1/m, %2.<Vetype>"
3478 1.1.1.3 mrg "&& !rtx_equal_p (operands[1], operands[4])"
3479 1.1.1.3 mrg {
3480 1.1.1.3 mrg operands[4] = copy_rtx (operands[1]);
3481 1.1.1.3 mrg }
3482 1.1.1.3 mrg [(set_attr "movprfx" "*,yes,yes")]
3483 1.1.1.3 mrg )
3484 1.1.1.3 mrg
3485 1.1.1.3 mrg (define_insn "*cond_<optab><mode>_any_strict"
3486 1.1.1.3 mrg [(set (match_operand:SVE_FULL_F 0 "register_operand" "=&w, ?&w, ?&w")
3487 1.1.1.3 mrg (unspec:SVE_FULL_F
3488 1.1.1.3 mrg [(match_operand:<VPRED> 1 "register_operand" "Upl, Upl, Upl")
3489 1.1.1.3 mrg (unspec:SVE_FULL_F
3490 1.1.1.3 mrg [(match_dup 1)
3491 1.1.1.3 mrg (const_int SVE_STRICT_GP)
3492 1.1.1.3 mrg (match_operand:SVE_FULL_F 2 "register_operand" "w, w, w")]
3493 1.1.1.3 mrg SVE_COND_FP_UNARY)
3494 1.1.1.3 mrg (match_operand:SVE_FULL_F 3 "aarch64_simd_reg_or_zero" "0, Dz, w")]
3495 1.1.1.3 mrg UNSPEC_SEL))]
3496 1.1.1.3 mrg "TARGET_SVE && !rtx_equal_p (operands[2], operands[3])"
3497 1.1.1.3 mrg "@
3498 1.1.1.3 mrg <sve_fp_op>\t%0.<Vetype>, %1/m, %2.<Vetype>
3499 1.1.1.3 mrg movprfx\t%0.<Vetype>, %1/z, %2.<Vetype>\;<sve_fp_op>\t%0.<Vetype>, %1/m, %2.<Vetype>
3500 1.1.1.3 mrg movprfx\t%0, %3\;<sve_fp_op>\t%0.<Vetype>, %1/m, %2.<Vetype>"
3501 1.1.1.3 mrg [(set_attr "movprfx" "*,yes,yes")]
3502 1.1.1.3 mrg )
3503 1.1.1.3 mrg
3504 1.1.1.3 mrg ;; -------------------------------------------------------------------------
3505 1.1.1.3 mrg ;; ---- [FP] Square root
3506 1.1.1.3 mrg ;; -------------------------------------------------------------------------
3507 1.1.1.3 mrg
3508 1.1.1.3 mrg (define_expand "sqrt<mode>2"
3509 1.1.1.3 mrg [(set (match_operand:SVE_FULL_F 0 "register_operand")
3510 1.1.1.3 mrg (unspec:SVE_FULL_F
3511 1.1.1.3 mrg [(match_dup 2)
3512 1.1.1.3 mrg (const_int SVE_RELAXED_GP)
3513 1.1.1.3 mrg (match_operand:SVE_FULL_F 1 "register_operand")]
3514 1.1.1.3 mrg UNSPEC_COND_FSQRT))]
3515 1.1.1.3 mrg "TARGET_SVE"
3516 1.1.1.3 mrg {
3517 1.1.1.3 mrg if (aarch64_emit_approx_sqrt (operands[0], operands[1], false))
3518 1.1.1.3 mrg DONE;
3519 1.1.1.3 mrg operands[2] = aarch64_ptrue_reg (<VPRED>mode);
3520 1.1.1.3 mrg })
3521 1.1.1.3 mrg
3522 1.1.1.3 mrg ;; -------------------------------------------------------------------------
3523 1.1.1.3 mrg ;; ---- [FP] Reciprocal square root
3524 1.1.1.3 mrg ;; -------------------------------------------------------------------------
3525 1.1.1.3 mrg
3526 1.1.1.3 mrg (define_expand "rsqrt<mode>2"
3527 1.1.1.3 mrg [(set (match_operand:SVE_FULL_SDF 0 "register_operand")
3528 1.1.1.3 mrg (unspec:SVE_FULL_SDF
3529 1.1.1.3 mrg [(match_operand:SVE_FULL_SDF 1 "register_operand")]
3530 1.1.1.3 mrg UNSPEC_RSQRT))]
3531 1.1.1.3 mrg "TARGET_SVE"
3532 1.1.1.3 mrg {
3533 1.1.1.3 mrg aarch64_emit_approx_sqrt (operands[0], operands[1], true);
3534 1.1.1.3 mrg DONE;
3535 1.1.1.3 mrg })
3536 1.1.1.3 mrg
3537 1.1.1.3 mrg (define_expand "@aarch64_rsqrte<mode>"
3538 1.1.1.3 mrg [(set (match_operand:SVE_FULL_SDF 0 "register_operand")
3539 1.1.1.3 mrg (unspec:SVE_FULL_SDF
3540 1.1.1.3 mrg [(match_operand:SVE_FULL_SDF 1 "register_operand")]
3541 1.1.1.3 mrg UNSPEC_RSQRTE))]
3542 1.1.1.3 mrg "TARGET_SVE"
3543 1.1.1.3 mrg )
3544 1.1.1.3 mrg
3545 1.1.1.3 mrg (define_expand "@aarch64_rsqrts<mode>"
3546 1.1.1.3 mrg [(set (match_operand:SVE_FULL_SDF 0 "register_operand")
3547 1.1.1.3 mrg (unspec:SVE_FULL_SDF
3548 1.1.1.3 mrg [(match_operand:SVE_FULL_SDF 1 "register_operand")
3549 1.1.1.3 mrg (match_operand:SVE_FULL_SDF 2 "register_operand")]
3550 1.1.1.3 mrg UNSPEC_RSQRTS))]
3551 1.1.1.3 mrg "TARGET_SVE"
3552 1.1.1.3 mrg )
3553 1.1.1.3 mrg
3554 1.1.1.3 mrg ;; -------------------------------------------------------------------------
3555 1.1.1.3 mrg ;; ---- [PRED] Inverse
3556 1.1.1.3 mrg ;; -------------------------------------------------------------------------
3557 1.1.1.3 mrg ;; Includes:
3558 1.1.1.3 mrg ;; - NOT
3559 1.1.1.3 mrg ;; -------------------------------------------------------------------------
3560 1.1.1.3 mrg
3561 1.1.1.3 mrg ;; Unpredicated predicate inverse.
3562 1.1.1.3 mrg (define_expand "one_cmpl<mode>2"
3563 1.1.1.3 mrg [(set (match_operand:PRED_ALL 0 "register_operand")
3564 1.1.1.3 mrg (and:PRED_ALL
3565 1.1.1.3 mrg (not:PRED_ALL (match_operand:PRED_ALL 1 "register_operand"))
3566 1.1.1.3 mrg (match_dup 2)))]
3567 1.1.1.3 mrg "TARGET_SVE"
3568 1.1.1.3 mrg {
3569 1.1.1.3 mrg operands[2] = aarch64_ptrue_reg (<MODE>mode);
3570 1.1.1.3 mrg }
3571 1.1.1.3 mrg )
3572 1.1.1.3 mrg
3573 1.1.1.3 mrg ;; Predicated predicate inverse.
3574 1.1.1.3 mrg (define_insn "*one_cmpl<mode>3"
3575 1.1.1.3 mrg [(set (match_operand:PRED_ALL 0 "register_operand" "=Upa")
3576 1.1.1.3 mrg (and:PRED_ALL
3577 1.1.1.3 mrg (not:PRED_ALL (match_operand:PRED_ALL 2 "register_operand" "Upa"))
3578 1.1.1.3 mrg (match_operand:PRED_ALL 1 "register_operand" "Upa")))]
3579 1.1.1.3 mrg "TARGET_SVE"
3580 1.1.1.3 mrg "not\t%0.b, %1/z, %2.b"
3581 1.1.1.3 mrg )
3582 1.1.1.3 mrg
3583 1.1.1.3 mrg ;; =========================================================================
3584 1.1.1.3 mrg ;; == Binary arithmetic
3585 1.1.1.3 mrg ;; =========================================================================
3586 1.1.1.3 mrg
3587 1.1.1.3 mrg ;; -------------------------------------------------------------------------
3588 1.1.1.3 mrg ;; ---- [INT] General binary arithmetic corresponding to rtx codes
3589 1.1.1.3 mrg ;; -------------------------------------------------------------------------
3590 1.1.1.3 mrg ;; Includes:
3591 1.1.1.3 mrg ;; - ADD (merging form only)
3592 1.1.1.3 mrg ;; - AND (merging form only)
3593 1.1.1.3 mrg ;; - ASR (merging form only)
3594 1.1.1.3 mrg ;; - EOR (merging form only)
3595 1.1.1.3 mrg ;; - LSL (merging form only)
3596 1.1.1.3 mrg ;; - LSR (merging form only)
3597 1.1.1.3 mrg ;; - MUL
3598 1.1.1.3 mrg ;; - ORR (merging form only)
3599 1.1.1.3 mrg ;; - SMAX
3600 1.1.1.3 mrg ;; - SMIN
3601 1.1.1.3 mrg ;; - SQADD (SVE2 merging form only)
3602 1.1.1.3 mrg ;; - SQSUB (SVE2 merging form only)
3603 1.1.1.3 mrg ;; - SUB (merging form only)
3604 1.1.1.3 mrg ;; - UMAX
3605 1.1.1.3 mrg ;; - UMIN
3606 1.1.1.3 mrg ;; - UQADD (SVE2 merging form only)
3607 1.1.1.3 mrg ;; - UQSUB (SVE2 merging form only)
3608 1.1.1.3 mrg ;; -------------------------------------------------------------------------
3609 1.1.1.3 mrg
3610 1.1.1.3 mrg ;; Unpredicated integer binary operations that have an immediate form.
3611 1.1.1.3 mrg (define_expand "<optab><mode>3"
3612 1.1.1.3 mrg [(set (match_operand:SVE_FULL_I 0 "register_operand")
3613 1.1.1.3 mrg (unspec:SVE_FULL_I
3614 1.1.1.3 mrg [(match_dup 3)
3615 1.1.1.3 mrg (SVE_INT_BINARY_IMM:SVE_FULL_I
3616 1.1.1.3 mrg (match_operand:SVE_FULL_I 1 "register_operand")
3617 1.1.1.3 mrg (match_operand:SVE_FULL_I 2 "aarch64_sve_<sve_imm_con>_operand"))]
3618 1.1.1.3 mrg UNSPEC_PRED_X))]
3619 1.1.1.3 mrg "TARGET_SVE"
3620 1.1.1.3 mrg {
3621 1.1.1.3 mrg operands[3] = aarch64_ptrue_reg (<VPRED>mode);
3622 1.1.1.3 mrg }
3623 1.1.1.3 mrg )
3624 1.1.1.3 mrg
3625 1.1.1.3 mrg ;; Integer binary operations that have an immediate form, predicated
3626 1.1.1.3 mrg ;; with a PTRUE. We don't actually need the predicate for the first
3627 1.1.1.3 mrg ;; and third alternatives, but using Upa or X isn't likely to gain much
3628 1.1.1.3 mrg ;; and would make the instruction seem less uniform to the register
3629 1.1.1.3 mrg ;; allocator.
3630 1.1.1.3 mrg (define_insn_and_split "@aarch64_pred_<optab><mode>"
3631 1.1.1.3 mrg [(set (match_operand:SVE_FULL_I 0 "register_operand" "=w, w, ?&w, ?&w")
3632 1.1.1.3 mrg (unspec:SVE_FULL_I
3633 1.1.1.3 mrg [(match_operand:<VPRED> 1 "register_operand" "Upl, Upl, Upl, Upl")
3634 1.1.1.3 mrg (SVE_INT_BINARY_IMM:SVE_FULL_I
3635 1.1.1.3 mrg (match_operand:SVE_FULL_I 2 "register_operand" "%0, 0, w, w")
3636 1.1.1.3 mrg (match_operand:SVE_FULL_I 3 "aarch64_sve_<sve_imm_con>_operand" "<sve_imm_con>, w, <sve_imm_con>, w"))]
3637 1.1.1.3 mrg UNSPEC_PRED_X))]
3638 1.1.1.3 mrg "TARGET_SVE"
3639 1.1.1.3 mrg "@
3640 1.1.1.3 mrg #
3641 1.1.1.3 mrg <sve_int_op>\t%0.<Vetype>, %1/m, %0.<Vetype>, %3.<Vetype>
3642 1.1.1.3 mrg #
3643 1.1.1.3 mrg movprfx\t%0, %2\;<sve_int_op>\t%0.<Vetype>, %1/m, %0.<Vetype>, %3.<Vetype>"
3644 1.1.1.3 mrg ; Split the unpredicated form after reload, so that we don't have
3645 1.1.1.3 mrg ; the unnecessary PTRUE.
3646 1.1.1.3 mrg "&& reload_completed
3647 1.1.1.3 mrg && !register_operand (operands[3], <MODE>mode)"
3648 1.1.1.3 mrg [(set (match_dup 0)
3649 1.1.1.3 mrg (SVE_INT_BINARY_IMM:SVE_FULL_I (match_dup 2) (match_dup 3)))]
3650 1.1.1.3 mrg ""
3651 1.1.1.3 mrg [(set_attr "movprfx" "*,*,yes,yes")]
3652 1.1.1.3 mrg )
3653 1.1.1.3 mrg
3654 1.1.1.3 mrg ;; Unpredicated binary operations with a constant (post-RA only).
3655 1.1.1.3 mrg ;; These are generated by splitting a predicated instruction whose
3656 1.1.1.3 mrg ;; predicate is unused.
3657 1.1.1.3 mrg (define_insn "*post_ra_<optab><mode>3"
3658 1.1.1.3 mrg [(set (match_operand:SVE_FULL_I 0 "register_operand" "=w, ?&w")
3659 1.1.1.3 mrg (SVE_INT_BINARY_IMM:SVE_FULL_I
3660 1.1.1.3 mrg (match_operand:SVE_FULL_I 1 "register_operand" "0, w")
3661 1.1.1.3 mrg (match_operand:SVE_FULL_I 2 "aarch64_sve_<sve_imm_con>_immediate")))]
3662 1.1.1.3 mrg "TARGET_SVE && reload_completed"
3663 1.1.1.3 mrg "@
3664 1.1.1.3 mrg <sve_int_op>\t%0.<Vetype>, %0.<Vetype>, #%<sve_imm_prefix>2
3665 1.1.1.3 mrg movprfx\t%0, %1\;<sve_int_op>\t%0.<Vetype>, %0.<Vetype>, #%<sve_imm_prefix>2"
3666 1.1.1.3 mrg [(set_attr "movprfx" "*,yes")]
3667 1.1.1.3 mrg )
3668 1.1.1.3 mrg
3669 1.1.1.3 mrg ;; Predicated integer operations with merging.
3670 1.1.1.3 mrg (define_expand "@cond_<optab><mode>"
3671 1.1.1.3 mrg [(set (match_operand:SVE_FULL_I 0 "register_operand")
3672 1.1.1.3 mrg (unspec:SVE_FULL_I
3673 1.1.1.3 mrg [(match_operand:<VPRED> 1 "register_operand")
3674 1.1.1.3 mrg (SVE_INT_BINARY:SVE_FULL_I
3675 1.1.1.3 mrg (match_operand:SVE_FULL_I 2 "register_operand")
3676 1.1.1.3 mrg (match_operand:SVE_FULL_I 3 "<sve_pred_int_rhs2_operand>"))
3677 1.1.1.3 mrg (match_operand:SVE_FULL_I 4 "aarch64_simd_reg_or_zero")]
3678 1.1.1.3 mrg UNSPEC_SEL))]
3679 1.1.1.3 mrg "TARGET_SVE"
3680 1.1.1.3 mrg )
3681 1.1.1.3 mrg
3682 1.1.1.3 mrg ;; Predicated integer operations, merging with the first input.
3683 1.1.1.3 mrg (define_insn "*cond_<optab><mode>_2"
3684 1.1.1.3 mrg [(set (match_operand:SVE_FULL_I 0 "register_operand" "=w, ?&w")
3685 1.1.1.3 mrg (unspec:SVE_FULL_I
3686 1.1.1.3 mrg [(match_operand:<VPRED> 1 "register_operand" "Upl, Upl")
3687 1.1.1.3 mrg (SVE_INT_BINARY:SVE_FULL_I
3688 1.1.1.3 mrg (match_operand:SVE_FULL_I 2 "register_operand" "0, w")
3689 1.1.1.3 mrg (match_operand:SVE_FULL_I 3 "register_operand" "w, w"))
3690 1.1.1.3 mrg (match_dup 2)]
3691 1.1.1.3 mrg UNSPEC_SEL))]
3692 1.1.1.3 mrg "TARGET_SVE"
3693 1.1.1.3 mrg "@
3694 1.1.1.3 mrg <sve_int_op>\t%0.<Vetype>, %1/m, %0.<Vetype>, %3.<Vetype>
3695 1.1.1.3 mrg movprfx\t%0, %2\;<sve_int_op>\t%0.<Vetype>, %1/m, %0.<Vetype>, %3.<Vetype>"
3696 1.1.1.3 mrg [(set_attr "movprfx" "*,yes")]
3697 1.1.1.3 mrg )
3698 1.1.1.3 mrg
3699 1.1.1.3 mrg ;; Predicated integer operations, merging with the second input.
3700 1.1.1.3 mrg (define_insn "*cond_<optab><mode>_3"
3701 1.1.1.3 mrg [(set (match_operand:SVE_FULL_I 0 "register_operand" "=w, ?&w")
3702 1.1.1.3 mrg (unspec:SVE_FULL_I
3703 1.1.1.3 mrg [(match_operand:<VPRED> 1 "register_operand" "Upl, Upl")
3704 1.1.1.3 mrg (SVE_INT_BINARY:SVE_FULL_I
3705 1.1.1.3 mrg (match_operand:SVE_FULL_I 2 "register_operand" "w, w")
3706 1.1.1.3 mrg (match_operand:SVE_FULL_I 3 "register_operand" "0, w"))
3707 1.1.1.3 mrg (match_dup 3)]
3708 1.1.1.3 mrg UNSPEC_SEL))]
3709 1.1.1.3 mrg "TARGET_SVE"
3710 1.1.1.3 mrg "@
3711 1.1.1.3 mrg <sve_int_op_rev>\t%0.<Vetype>, %1/m, %0.<Vetype>, %2.<Vetype>
3712 1.1.1.3 mrg movprfx\t%0, %3\;<sve_int_op_rev>\t%0.<Vetype>, %1/m, %0.<Vetype>, %2.<Vetype>"
3713 1.1.1.3 mrg [(set_attr "movprfx" "*,yes")]
3714 1.1.1.3 mrg )
3715 1.1.1.3 mrg
3716 1.1.1.3 mrg ;; Predicated integer operations, merging with an independent value.
3717 1.1.1.3 mrg (define_insn_and_rewrite "*cond_<optab><mode>_any"
3718 1.1.1.3 mrg [(set (match_operand:SVE_FULL_I 0 "register_operand" "=&w, &w, &w, &w, ?&w")
3719 1.1.1.3 mrg (unspec:SVE_FULL_I
3720 1.1.1.3 mrg [(match_operand:<VPRED> 1 "register_operand" "Upl, Upl, Upl, Upl, Upl")
3721 1.1.1.3 mrg (SVE_INT_BINARY:SVE_FULL_I
3722 1.1.1.3 mrg (match_operand:SVE_FULL_I 2 "register_operand" "0, w, w, w, w")
3723 1.1.1.3 mrg (match_operand:SVE_FULL_I 3 "register_operand" "w, 0, w, w, w"))
3724 1.1.1.3 mrg (match_operand:SVE_FULL_I 4 "aarch64_simd_reg_or_zero" "Dz, Dz, Dz, 0, w")]
3725 1.1.1.3 mrg UNSPEC_SEL))]
3726 1.1.1.3 mrg "TARGET_SVE
3727 1.1.1.3 mrg && !rtx_equal_p (operands[2], operands[4])
3728 1.1.1.3 mrg && !rtx_equal_p (operands[3], operands[4])"
3729 1.1.1.3 mrg "@
3730 1.1.1.3 mrg movprfx\t%0.<Vetype>, %1/z, %0.<Vetype>\;<sve_int_op>\t%0.<Vetype>, %1/m, %0.<Vetype>, %3.<Vetype>
3731 1.1.1.3 mrg movprfx\t%0.<Vetype>, %1/z, %0.<Vetype>\;<sve_int_op_rev>\t%0.<Vetype>, %1/m, %0.<Vetype>, %2.<Vetype>
3732 1.1.1.3 mrg movprfx\t%0.<Vetype>, %1/z, %2.<Vetype>\;<sve_int_op>\t%0.<Vetype>, %1/m, %0.<Vetype>, %3.<Vetype>
3733 1.1.1.3 mrg movprfx\t%0.<Vetype>, %1/m, %2.<Vetype>\;<sve_int_op>\t%0.<Vetype>, %1/m, %0.<Vetype>, %3.<Vetype>
3734 1.1.1.3 mrg #"
3735 1.1.1.3 mrg "&& reload_completed
3736 1.1.1.3 mrg && register_operand (operands[4], <MODE>mode)
3737 1.1.1.3 mrg && !rtx_equal_p (operands[0], operands[4])"
3738 1.1.1.3 mrg {
3739 1.1.1.3 mrg emit_insn (gen_vcond_mask_<mode><vpred> (operands[0], operands[2],
3740 1.1.1.3 mrg operands[4], operands[1]));
3741 1.1.1.3 mrg operands[4] = operands[2] = operands[0];
3742 1.1.1.3 mrg }
3743 1.1.1.3 mrg [(set_attr "movprfx" "yes")]
3744 1.1.1.3 mrg )
3745 1.1.1.3 mrg
3746 1.1.1.3 mrg ;; -------------------------------------------------------------------------
3747 1.1.1.3 mrg ;; ---- [INT] Addition
3748 1.1.1.3 mrg ;; -------------------------------------------------------------------------
3749 1.1.1.3 mrg ;; Includes:
3750 1.1.1.3 mrg ;; - ADD
3751 1.1.1.3 mrg ;; - DECB
3752 1.1.1.3 mrg ;; - DECD
3753 1.1.1.3 mrg ;; - DECH
3754 1.1.1.3 mrg ;; - DECW
3755 1.1.1.3 mrg ;; - INCB
3756 1.1.1.3 mrg ;; - INCD
3757 1.1.1.3 mrg ;; - INCH
3758 1.1.1.3 mrg ;; - INCW
3759 1.1.1.3 mrg ;; - SUB
3760 1.1.1.3 mrg ;; -------------------------------------------------------------------------
3761 1.1.1.3 mrg
3762 1.1.1.3 mrg (define_insn "add<mode>3"
3763 1.1.1.3 mrg [(set (match_operand:SVE_I 0 "register_operand" "=w, w, w, ?w, ?w, w")
3764 1.1.1.3 mrg (plus:SVE_I
3765 1.1.1.3 mrg (match_operand:SVE_I 1 "register_operand" "%0, 0, 0, w, w, w")
3766 1.1.1.3 mrg (match_operand:SVE_I 2 "aarch64_sve_add_operand" "vsa, vsn, vsi, vsa, vsn, w")))]
3767 1.1.1.3 mrg "TARGET_SVE"
3768 1.1.1.3 mrg "@
3769 1.1.1.3 mrg add\t%0.<Vetype>, %0.<Vetype>, #%D2
3770 1.1.1.3 mrg sub\t%0.<Vetype>, %0.<Vetype>, #%N2
3771 1.1.1.3 mrg * return aarch64_output_sve_vector_inc_dec (\"%0.<Vetype>\", operands[2]);
3772 1.1.1.3 mrg movprfx\t%0, %1\;add\t%0.<Vetype>, %0.<Vetype>, #%D2
3773 1.1.1.3 mrg movprfx\t%0, %1\;sub\t%0.<Vetype>, %0.<Vetype>, #%N2
3774 1.1.1.3 mrg add\t%0.<Vetype>, %1.<Vetype>, %2.<Vetype>"
3775 1.1.1.3 mrg [(set_attr "movprfx" "*,*,*,yes,yes,*")]
3776 1.1.1.3 mrg )
3777 1.1.1.3 mrg
3778 1.1.1.3 mrg ;; Merging forms are handled through SVE_INT_BINARY.
3779 1.1.1.3 mrg
3780 1.1.1.3 mrg ;; -------------------------------------------------------------------------
3781 1.1.1.3 mrg ;; ---- [INT] Subtraction
3782 1.1.1.3 mrg ;; -------------------------------------------------------------------------
3783 1.1.1.3 mrg ;; Includes:
3784 1.1.1.3 mrg ;; - SUB
3785 1.1.1.3 mrg ;; - SUBR
3786 1.1.1.3 mrg ;; -------------------------------------------------------------------------
3787 1.1.1.3 mrg
3788 1.1.1.3 mrg (define_insn "sub<mode>3"
3789 1.1.1.3 mrg [(set (match_operand:SVE_FULL_I 0 "register_operand" "=w, w, ?&w")
3790 1.1.1.3 mrg (minus:SVE_FULL_I
3791 1.1.1.3 mrg (match_operand:SVE_FULL_I 1 "aarch64_sve_arith_operand" "w, vsa, vsa")
3792 1.1.1.3 mrg (match_operand:SVE_FULL_I 2 "register_operand" "w, 0, w")))]
3793 1.1.1.3 mrg "TARGET_SVE"
3794 1.1.1.3 mrg "@
3795 1.1.1.3 mrg sub\t%0.<Vetype>, %1.<Vetype>, %2.<Vetype>
3796 1.1.1.3 mrg subr\t%0.<Vetype>, %0.<Vetype>, #%D1
3797 1.1.1.3 mrg movprfx\t%0, %2\;subr\t%0.<Vetype>, %0.<Vetype>, #%D1"
3798 1.1.1.3 mrg [(set_attr "movprfx" "*,*,yes")]
3799 1.1.1.3 mrg )
3800 1.1.1.3 mrg
3801 1.1.1.3 mrg ;; Merging forms are handled through SVE_INT_BINARY.
3802 1.1.1.3 mrg
3803 1.1.1.3 mrg ;; -------------------------------------------------------------------------
3804 1.1.1.3 mrg ;; ---- [INT] Take address
3805 1.1.1.3 mrg ;; -------------------------------------------------------------------------
3806 1.1.1.3 mrg ;; Includes:
3807 1.1.1.3 mrg ;; - ADR
3808 1.1.1.3 mrg ;; -------------------------------------------------------------------------
3809 1.1.1.3 mrg
3810 1.1.1.3 mrg ;; An unshifted and unscaled ADR. This is functionally equivalent to an ADD,
3811 1.1.1.3 mrg ;; but the svadrb intrinsics should preserve the user's choice.
3812 1.1.1.3 mrg (define_insn "@aarch64_adr<mode>"
3813 1.1.1.3 mrg [(set (match_operand:SVE_FULL_SDI 0 "register_operand" "=w")
3814 1.1.1.3 mrg (unspec:SVE_FULL_SDI
3815 1.1.1.3 mrg [(match_operand:SVE_FULL_SDI 1 "register_operand" "w")
3816 1.1.1.3 mrg (match_operand:SVE_FULL_SDI 2 "register_operand" "w")]
3817 1.1.1.3 mrg UNSPEC_ADR))]
3818 1.1.1.3 mrg "TARGET_SVE"
3819 1.1.1.3 mrg "adr\t%0.<Vetype>, [%1.<Vetype>, %2.<Vetype>]"
3820 1.1.1.3 mrg )
3821 1.1.1.3 mrg
3822 1.1.1.3 mrg ;; Same, but with the offset being sign-extended from the low 32 bits.
3823 1.1.1.3 mrg (define_insn_and_rewrite "*aarch64_adr_sxtw"
3824 1.1.1.3 mrg [(set (match_operand:VNx2DI 0 "register_operand" "=w")
3825 1.1.1.3 mrg (unspec:VNx2DI
3826 1.1.1.3 mrg [(match_operand:VNx2DI 1 "register_operand" "w")
3827 1.1.1.3 mrg (unspec:VNx2DI
3828 1.1.1.3 mrg [(match_operand 3)
3829 1.1.1.3 mrg (sign_extend:VNx2DI
3830 1.1.1.3 mrg (truncate:VNx2SI
3831 1.1.1.3 mrg (match_operand:VNx2DI 2 "register_operand" "w")))]
3832 1.1.1.3 mrg UNSPEC_PRED_X)]
3833 1.1.1.3 mrg UNSPEC_ADR))]
3834 1.1.1.3 mrg "TARGET_SVE"
3835 1.1.1.3 mrg "adr\t%0.d, [%1.d, %2.d, sxtw]"
3836 1.1.1.3 mrg "&& !CONSTANT_P (operands[3])"
3837 1.1.1.3 mrg {
3838 1.1.1.3 mrg operands[3] = CONSTM1_RTX (VNx2BImode);
3839 1.1.1.3 mrg }
3840 1.1.1.3 mrg )
3841 1.1.1.3 mrg
3842 1.1.1.3 mrg ;; Same, but with the offset being zero-extended from the low 32 bits.
3843 1.1.1.3 mrg (define_insn "*aarch64_adr_uxtw_unspec"
3844 1.1.1.3 mrg [(set (match_operand:VNx2DI 0 "register_operand" "=w")
3845 1.1.1.3 mrg (unspec:VNx2DI
3846 1.1.1.3 mrg [(match_operand:VNx2DI 1 "register_operand" "w")
3847 1.1.1.3 mrg (and:VNx2DI
3848 1.1.1.3 mrg (match_operand:VNx2DI 2 "register_operand" "w")
3849 1.1.1.3 mrg (match_operand:VNx2DI 3 "aarch64_sve_uxtw_immediate"))]
3850 1.1.1.3 mrg UNSPEC_ADR))]
3851 1.1.1.3 mrg "TARGET_SVE"
3852 1.1.1.3 mrg "adr\t%0.d, [%1.d, %2.d, uxtw]"
3853 1.1.1.3 mrg )
3854 1.1.1.3 mrg
3855 1.1.1.3 mrg ;; Same, matching as a PLUS rather than unspec.
3856 1.1.1.3 mrg (define_insn "*aarch64_adr_uxtw_and"
3857 1.1.1.3 mrg [(set (match_operand:VNx2DI 0 "register_operand" "=w")
3858 1.1.1.3 mrg (plus:VNx2DI
3859 1.1.1.3 mrg (and:VNx2DI
3860 1.1.1.3 mrg (match_operand:VNx2DI 2 "register_operand" "w")
3861 1.1.1.3 mrg (match_operand:VNx2DI 3 "aarch64_sve_uxtw_immediate"))
3862 1.1.1.3 mrg (match_operand:VNx2DI 1 "register_operand" "w")))]
3863 1.1.1.3 mrg "TARGET_SVE"
3864 1.1.1.3 mrg "adr\t%0.d, [%1.d, %2.d, uxtw]"
3865 1.1.1.3 mrg )
3866 1.1.1.3 mrg
3867 1.1.1.3 mrg ;; ADR with a nonzero shift.
3868 1.1.1.3 mrg (define_expand "@aarch64_adr<mode>_shift"
3869 1.1.1.3 mrg [(set (match_operand:SVE_FULL_SDI 0 "register_operand")
3870 1.1.1.3 mrg (plus:SVE_FULL_SDI
3871 1.1.1.3 mrg (unspec:SVE_FULL_SDI
3872 1.1.1.3 mrg [(match_dup 4)
3873 1.1.1.3 mrg (ashift:SVE_FULL_SDI
3874 1.1.1.3 mrg (match_operand:SVE_FULL_SDI 2 "register_operand")
3875 1.1.1.3 mrg (match_operand:SVE_FULL_SDI 3 "const_1_to_3_operand"))]
3876 1.1.1.3 mrg UNSPEC_PRED_X)
3877 1.1.1.3 mrg (match_operand:SVE_FULL_SDI 1 "register_operand")))]
3878 1.1.1.3 mrg "TARGET_SVE"
3879 1.1.1.3 mrg {
3880 1.1.1.3 mrg operands[4] = CONSTM1_RTX (<VPRED>mode);
3881 1.1.1.3 mrg }
3882 1.1.1.3 mrg )
3883 1.1.1.3 mrg
3884 1.1.1.3 mrg (define_insn_and_rewrite "*aarch64_adr<mode>_shift"
3885 1.1.1.3 mrg [(set (match_operand:SVE_FULL_SDI 0 "register_operand" "=w")
3886 1.1.1.3 mrg (plus:SVE_FULL_SDI
3887 1.1.1.3 mrg (unspec:SVE_FULL_SDI
3888 1.1.1.3 mrg [(match_operand 4)
3889 1.1.1.3 mrg (ashift:SVE_FULL_SDI
3890 1.1.1.3 mrg (match_operand:SVE_FULL_SDI 2 "register_operand" "w")
3891 1.1.1.3 mrg (match_operand:SVE_FULL_SDI 3 "const_1_to_3_operand"))]
3892 1.1.1.3 mrg UNSPEC_PRED_X)
3893 1.1.1.3 mrg (match_operand:SVE_FULL_SDI 1 "register_operand" "w")))]
3894 1.1.1.3 mrg "TARGET_SVE"
3895 1.1.1.3 mrg "adr\t%0.<Vetype>, [%1.<Vetype>, %2.<Vetype>, lsl %3]"
3896 1.1.1.3 mrg "&& !CONSTANT_P (operands[4])"
3897 1.1.1.3 mrg {
3898 1.1.1.3 mrg operands[4] = CONSTM1_RTX (<VPRED>mode);
3899 1.1.1.3 mrg }
3900 1.1.1.3 mrg )
3901 1.1.1.3 mrg
3902 1.1.1.3 mrg ;; Same, but with the index being sign-extended from the low 32 bits.
3903 1.1.1.3 mrg (define_insn_and_rewrite "*aarch64_adr_shift_sxtw"
3904 1.1.1.3 mrg [(set (match_operand:VNx2DI 0 "register_operand" "=w")
3905 1.1.1.3 mrg (plus:VNx2DI
3906 1.1.1.3 mrg (unspec:VNx2DI
3907 1.1.1.3 mrg [(match_operand 4)
3908 1.1.1.3 mrg (ashift:VNx2DI
3909 1.1.1.3 mrg (unspec:VNx2DI
3910 1.1.1.3 mrg [(match_operand 5)
3911 1.1.1.3 mrg (sign_extend:VNx2DI
3912 1.1.1.3 mrg (truncate:VNx2SI
3913 1.1.1.3 mrg (match_operand:VNx2DI 2 "register_operand" "w")))]
3914 1.1.1.3 mrg UNSPEC_PRED_X)
3915 1.1.1.3 mrg (match_operand:VNx2DI 3 "const_1_to_3_operand"))]
3916 1.1.1.3 mrg UNSPEC_PRED_X)
3917 1.1.1.3 mrg (match_operand:VNx2DI 1 "register_operand" "w")))]
3918 1.1.1.3 mrg "TARGET_SVE"
3919 1.1.1.3 mrg "adr\t%0.d, [%1.d, %2.d, sxtw %3]"
3920 1.1.1.3 mrg "&& (!CONSTANT_P (operands[4]) || !CONSTANT_P (operands[5]))"
3921 1.1.1.3 mrg {
3922 1.1.1.3 mrg operands[5] = operands[4] = CONSTM1_RTX (VNx2BImode);
3923 1.1.1.3 mrg }
3924 1.1.1.3 mrg )
3925 1.1.1.3 mrg
3926 1.1.1.3 mrg ;; Same, but with the index being zero-extended from the low 32 bits.
3927 1.1.1.3 mrg (define_insn_and_rewrite "*aarch64_adr_shift_uxtw"
3928 1.1.1.3 mrg [(set (match_operand:VNx2DI 0 "register_operand" "=w")
3929 1.1.1.3 mrg (plus:VNx2DI
3930 1.1.1.3 mrg (unspec:VNx2DI
3931 1.1.1.3 mrg [(match_operand 5)
3932 1.1.1.3 mrg (ashift:VNx2DI
3933 1.1.1.3 mrg (and:VNx2DI
3934 1.1.1.3 mrg (match_operand:VNx2DI 2 "register_operand" "w")
3935 1.1.1.3 mrg (match_operand:VNx2DI 4 "aarch64_sve_uxtw_immediate"))
3936 1.1.1.3 mrg (match_operand:VNx2DI 3 "const_1_to_3_operand"))]
3937 1.1.1.3 mrg UNSPEC_PRED_X)
3938 1.1.1.3 mrg (match_operand:VNx2DI 1 "register_operand" "w")))]
3939 1.1.1.3 mrg "TARGET_SVE"
3940 1.1.1.3 mrg "adr\t%0.d, [%1.d, %2.d, uxtw %3]"
3941 1.1.1.3 mrg "&& !CONSTANT_P (operands[5])"
3942 1.1.1.3 mrg {
3943 1.1.1.3 mrg operands[5] = CONSTM1_RTX (VNx2BImode);
3944 1.1.1.3 mrg }
3945 1.1.1.3 mrg )
3946 1.1.1.3 mrg
3947 1.1.1.3 mrg ;; -------------------------------------------------------------------------
3948 1.1.1.3 mrg ;; ---- [INT] Absolute difference
3949 1.1.1.3 mrg ;; -------------------------------------------------------------------------
3950 1.1.1.3 mrg ;; Includes:
3951 1.1.1.3 mrg ;; - SABD
3952 1.1.1.3 mrg ;; - UABD
3953 1.1.1.3 mrg ;; -------------------------------------------------------------------------
3954 1.1.1.3 mrg
3955 1.1.1.3 mrg ;; Unpredicated integer absolute difference.
3956 1.1.1.3 mrg (define_expand "<su>abd<mode>_3"
3957 1.1.1.3 mrg [(use (match_operand:SVE_FULL_I 0 "register_operand"))
3958 1.1.1.3 mrg (USMAX:SVE_FULL_I
3959 1.1.1.3 mrg (match_operand:SVE_FULL_I 1 "register_operand")
3960 1.1.1.3 mrg (match_operand:SVE_FULL_I 2 "register_operand"))]
3961 1.1.1.3 mrg "TARGET_SVE"
3962 1.1.1.3 mrg {
3963 1.1.1.3 mrg rtx pred = aarch64_ptrue_reg (<VPRED>mode);
3964 1.1.1.3 mrg emit_insn (gen_aarch64_pred_<su>abd<mode> (operands[0], pred, operands[1],
3965 1.1.1.3 mrg operands[2]));
3966 1.1.1.3 mrg DONE;
3967 1.1.1.3 mrg }
3968 1.1.1.3 mrg )
3969 1.1.1.3 mrg
3970 1.1.1.3 mrg ;; Predicated integer absolute difference.
3971 1.1.1.3 mrg (define_insn "@aarch64_pred_<su>abd<mode>"
3972 1.1.1.3 mrg [(set (match_operand:SVE_FULL_I 0 "register_operand" "=w, ?&w")
3973 1.1.1.3 mrg (unspec:SVE_FULL_I
3974 1.1.1.3 mrg [(match_operand:<VPRED> 1 "register_operand" "Upl, Upl")
3975 1.1.1.3 mrg (minus:SVE_FULL_I
3976 1.1.1.3 mrg (USMAX:SVE_FULL_I
3977 1.1.1.3 mrg (match_operand:SVE_FULL_I 2 "register_operand" "%0, w")
3978 1.1.1.3 mrg (match_operand:SVE_FULL_I 3 "register_operand" "w, w"))
3979 1.1.1.3 mrg (<max_opp>:SVE_FULL_I
3980 1.1.1.3 mrg (match_dup 2)
3981 1.1.1.3 mrg (match_dup 3)))]
3982 1.1.1.3 mrg UNSPEC_PRED_X))]
3983 1.1.1.3 mrg "TARGET_SVE"
3984 1.1.1.3 mrg "@
3985 1.1.1.3 mrg <su>abd\t%0.<Vetype>, %1/m, %0.<Vetype>, %3.<Vetype>
3986 1.1.1.3 mrg movprfx\t%0, %2\;<su>abd\t%0.<Vetype>, %1/m, %0.<Vetype>, %3.<Vetype>"
3987 1.1.1.3 mrg [(set_attr "movprfx" "*,yes")]
3988 1.1.1.3 mrg )
3989 1.1.1.3 mrg
3990 1.1.1.3 mrg (define_expand "@aarch64_cond_<su>abd<mode>"
3991 1.1.1.3 mrg [(set (match_operand:SVE_FULL_I 0 "register_operand")
3992 1.1.1.3 mrg (unspec:SVE_FULL_I
3993 1.1.1.3 mrg [(match_operand:<VPRED> 1 "register_operand")
3994 1.1.1.3 mrg (minus:SVE_FULL_I
3995 1.1.1.3 mrg (unspec:SVE_FULL_I
3996 1.1.1.3 mrg [(match_dup 1)
3997 1.1.1.3 mrg (USMAX:SVE_FULL_I
3998 1.1.1.3 mrg (match_operand:SVE_FULL_I 2 "register_operand")
3999 1.1.1.3 mrg (match_operand:SVE_FULL_I 3 "register_operand"))]
4000 1.1.1.3 mrg UNSPEC_PRED_X)
4001 1.1.1.3 mrg (unspec:SVE_FULL_I
4002 1.1.1.3 mrg [(match_dup 1)
4003 1.1.1.3 mrg (<max_opp>:SVE_FULL_I
4004 1.1.1.3 mrg (match_dup 2)
4005 1.1.1.3 mrg (match_dup 3))]
4006 1.1.1.3 mrg UNSPEC_PRED_X))
4007 1.1.1.3 mrg (match_operand:SVE_FULL_I 4 "aarch64_simd_reg_or_zero")]
4008 1.1.1.3 mrg UNSPEC_SEL))]
4009 1.1.1.3 mrg "TARGET_SVE"
4010 1.1.1.3 mrg {
4011 1.1.1.3 mrg if (rtx_equal_p (operands[3], operands[4]))
4012 1.1.1.3 mrg std::swap (operands[2], operands[3]);
4013 1.1.1.3 mrg })
4014 1.1.1.3 mrg
4015 1.1.1.3 mrg ;; Predicated integer absolute difference, merging with the first input.
4016 1.1.1.3 mrg (define_insn_and_rewrite "*aarch64_cond_<su>abd<mode>_2"
4017 1.1.1.3 mrg [(set (match_operand:SVE_FULL_I 0 "register_operand" "=w, ?&w")
4018 1.1.1.3 mrg (unspec:SVE_FULL_I
4019 1.1.1.3 mrg [(match_operand:<VPRED> 1 "register_operand" "Upl, Upl")
4020 1.1.1.3 mrg (minus:SVE_FULL_I
4021 1.1.1.3 mrg (unspec:SVE_FULL_I
4022 1.1.1.3 mrg [(match_operand 4)
4023 1.1.1.3 mrg (USMAX:SVE_FULL_I
4024 1.1.1.3 mrg (match_operand:SVE_FULL_I 2 "register_operand" "0, w")
4025 1.1.1.3 mrg (match_operand:SVE_FULL_I 3 "register_operand" "w, w"))]
4026 1.1.1.3 mrg UNSPEC_PRED_X)
4027 1.1.1.3 mrg (unspec:SVE_FULL_I
4028 1.1.1.3 mrg [(match_operand 5)
4029 1.1.1.3 mrg (<max_opp>:SVE_FULL_I
4030 1.1.1.3 mrg (match_dup 2)
4031 1.1.1.3 mrg (match_dup 3))]
4032 1.1.1.3 mrg UNSPEC_PRED_X))
4033 1.1.1.3 mrg (match_dup 2)]
4034 1.1.1.3 mrg UNSPEC_SEL))]
4035 1.1.1.3 mrg "TARGET_SVE"
4036 1.1.1.3 mrg "@
4037 1.1.1.3 mrg <su>abd\t%0.<Vetype>, %1/m, %0.<Vetype>, %3.<Vetype>
4038 1.1.1.3 mrg movprfx\t%0, %2\;<su>abd\t%0.<Vetype>, %1/m, %0.<Vetype>, %3.<Vetype>"
4039 1.1.1.3 mrg "&& (!CONSTANT_P (operands[4]) || !CONSTANT_P (operands[5]))"
4040 1.1.1.3 mrg {
4041 1.1.1.3 mrg operands[4] = operands[5] = CONSTM1_RTX (<VPRED>mode);
4042 1.1.1.3 mrg }
4043 1.1.1.3 mrg [(set_attr "movprfx" "*,yes")]
4044 1.1.1.3 mrg )
4045 1.1.1.3 mrg
4046 1.1.1.3 mrg ;; Predicated integer absolute difference, merging with an independent value.
4047 1.1.1.3 mrg (define_insn_and_rewrite "*aarch64_cond_<su>abd<mode>_any"
4048 1.1.1.3 mrg [(set (match_operand:SVE_FULL_I 0 "register_operand" "=&w, &w, &w, &w, ?&w")
4049 1.1.1.3 mrg (unspec:SVE_FULL_I
4050 1.1.1.3 mrg [(match_operand:<VPRED> 1 "register_operand" "Upl, Upl, Upl, Upl, Upl")
4051 1.1.1.3 mrg (minus:SVE_FULL_I
4052 1.1.1.3 mrg (unspec:SVE_FULL_I
4053 1.1.1.3 mrg [(match_operand 5)
4054 1.1.1.3 mrg (USMAX:SVE_FULL_I
4055 1.1.1.3 mrg (match_operand:SVE_FULL_I 2 "register_operand" "0, w, w, w, w")
4056 1.1.1.3 mrg (match_operand:SVE_FULL_I 3 "register_operand" "w, 0, w, w, w"))]
4057 1.1.1.3 mrg UNSPEC_PRED_X)
4058 1.1.1.3 mrg (unspec:SVE_FULL_I
4059 1.1.1.3 mrg [(match_operand 6)
4060 1.1.1.3 mrg (<max_opp>:SVE_FULL_I
4061 1.1.1.3 mrg (match_dup 2)
4062 1.1.1.3 mrg (match_dup 3))]
4063 1.1.1.3 mrg UNSPEC_PRED_X))
4064 1.1.1.3 mrg (match_operand:SVE_FULL_I 4 "aarch64_simd_reg_or_zero" "Dz, Dz, Dz, 0, w")]
4065 1.1.1.3 mrg UNSPEC_SEL))]
4066 1.1.1.3 mrg "TARGET_SVE
4067 1.1.1.3 mrg && !rtx_equal_p (operands[2], operands[4])
4068 1.1.1.3 mrg && !rtx_equal_p (operands[3], operands[4])"
4069 1.1.1.3 mrg "@
4070 1.1.1.3 mrg movprfx\t%0.<Vetype>, %1/z, %0.<Vetype>\;<su>abd\t%0.<Vetype>, %1/m, %0.<Vetype>, %3.<Vetype>
4071 1.1.1.3 mrg movprfx\t%0.<Vetype>, %1/z, %0.<Vetype>\;<su>abd\t%0.<Vetype>, %1/m, %0.<Vetype>, %2.<Vetype>
4072 1.1.1.3 mrg movprfx\t%0.<Vetype>, %1/z, %2.<Vetype>\;<su>abd\t%0.<Vetype>, %1/m, %0.<Vetype>, %3.<Vetype>
4073 1.1.1.3 mrg movprfx\t%0.<Vetype>, %1/m, %2.<Vetype>\;<su>abd\t%0.<Vetype>, %1/m, %0.<Vetype>, %3.<Vetype>
4074 1.1.1.3 mrg #"
4075 1.1.1.3 mrg "&& 1"
4076 1.1.1.3 mrg {
4077 1.1.1.3 mrg if (!CONSTANT_P (operands[5]) || !CONSTANT_P (operands[6]))
4078 1.1.1.3 mrg operands[5] = operands[6] = CONSTM1_RTX (<VPRED>mode);
4079 1.1.1.3 mrg else if (reload_completed
4080 1.1.1.3 mrg && register_operand (operands[4], <MODE>mode)
4081 1.1.1.3 mrg && !rtx_equal_p (operands[0], operands[4]))
4082 1.1.1.3 mrg {
4083 1.1.1.3 mrg emit_insn (gen_vcond_mask_<mode><vpred> (operands[0], operands[2],
4084 1.1.1.3 mrg operands[4], operands[1]));
4085 1.1.1.3 mrg operands[4] = operands[2] = operands[0];
4086 1.1.1.3 mrg }
4087 1.1.1.3 mrg else
4088 1.1.1.3 mrg FAIL;
4089 1.1.1.3 mrg }
4090 1.1.1.3 mrg [(set_attr "movprfx" "yes")]
4091 1.1.1.3 mrg )
4092 1.1.1.3 mrg
4093 1.1.1.3 mrg ;; -------------------------------------------------------------------------
4094 1.1.1.3 mrg ;; ---- [INT] Saturating addition and subtraction
4095 1.1.1.3 mrg ;; -------------------------------------------------------------------------
4096 1.1.1.3 mrg ;; - SQADD
4097 1.1.1.3 mrg ;; - SQSUB
4098 1.1.1.3 mrg ;; - UQADD
4099 1.1.1.3 mrg ;; - UQSUB
4100 1.1.1.3 mrg ;; -------------------------------------------------------------------------
4101 1.1.1.3 mrg
4102 1.1.1.3 mrg ;; Unpredicated saturating signed addition and subtraction.
4103 1.1.1.3 mrg (define_insn "@aarch64_sve_<optab><mode>"
4104 1.1.1.3 mrg [(set (match_operand:SVE_FULL_I 0 "register_operand" "=w, w, ?&w, ?&w, w")
4105 1.1.1.3 mrg (SBINQOPS:SVE_FULL_I
4106 1.1.1.3 mrg (match_operand:SVE_FULL_I 1 "register_operand" "0, 0, w, w, w")
4107 1.1.1.3 mrg (match_operand:SVE_FULL_I 2 "aarch64_sve_sqadd_operand" "vsQ, vsS, vsQ, vsS, w")))]
4108 1.1.1.3 mrg "TARGET_SVE"
4109 1.1.1.3 mrg "@
4110 1.1.1.3 mrg <binqops_op>\t%0.<Vetype>, %0.<Vetype>, #%D2
4111 1.1.1.3 mrg <binqops_op_rev>\t%0.<Vetype>, %0.<Vetype>, #%N2
4112 1.1.1.3 mrg movprfx\t%0, %1\;<binqops_op>\t%0.<Vetype>, %0.<Vetype>, #%D2
4113 1.1.1.3 mrg movprfx\t%0, %1\;<binqops_op_rev>\t%0.<Vetype>, %0.<Vetype>, #%N2
4114 1.1.1.3 mrg <binqops_op>\t%0.<Vetype>, %1.<Vetype>, %2.<Vetype>"
4115 1.1.1.3 mrg [(set_attr "movprfx" "*,*,yes,yes,*")]
4116 1.1.1.3 mrg )
4117 1.1.1.3 mrg
4118 1.1.1.3 mrg ;; Unpredicated saturating unsigned addition and subtraction.
4119 1.1.1.3 mrg (define_insn "@aarch64_sve_<optab><mode>"
4120 1.1.1.3 mrg [(set (match_operand:SVE_FULL_I 0 "register_operand" "=w, ?&w, w")
4121 1.1.1.3 mrg (UBINQOPS:SVE_FULL_I
4122 1.1.1.3 mrg (match_operand:SVE_FULL_I 1 "register_operand" "0, w, w")
4123 1.1.1.3 mrg (match_operand:SVE_FULL_I 2 "aarch64_sve_arith_operand" "vsa, vsa, w")))]
4124 1.1.1.3 mrg "TARGET_SVE"
4125 1.1.1.3 mrg "@
4126 1.1.1.3 mrg <binqops_op>\t%0.<Vetype>, %0.<Vetype>, #%D2
4127 1.1.1.3 mrg movprfx\t%0, %1\;<binqops_op>\t%0.<Vetype>, %0.<Vetype>, #%D2
4128 1.1.1.3 mrg <binqops_op>\t%0.<Vetype>, %1.<Vetype>, %2.<Vetype>"
4129 1.1.1.3 mrg [(set_attr "movprfx" "*,yes,*")]
4130 1.1.1.3 mrg )
4131 1.1.1.3 mrg
4132 1.1.1.3 mrg ;; -------------------------------------------------------------------------
4133 1.1.1.3 mrg ;; ---- [INT] Highpart multiplication
4134 1.1.1.3 mrg ;; -------------------------------------------------------------------------
4135 1.1.1.3 mrg ;; Includes:
4136 1.1.1.3 mrg ;; - SMULH
4137 1.1.1.3 mrg ;; - UMULH
4138 1.1.1.3 mrg ;; -------------------------------------------------------------------------
4139 1.1.1.3 mrg
4140 1.1.1.3 mrg ;; Unpredicated highpart multiplication.
4141 1.1.1.3 mrg (define_expand "<su>mul<mode>3_highpart"
4142 1.1.1.3 mrg [(set (match_operand:SVE_FULL_I 0 "register_operand")
4143 1.1.1.3 mrg (unspec:SVE_FULL_I
4144 1.1.1.3 mrg [(match_dup 3)
4145 1.1.1.3 mrg (unspec:SVE_FULL_I
4146 1.1.1.3 mrg [(match_operand:SVE_FULL_I 1 "register_operand")
4147 1.1.1.3 mrg (match_operand:SVE_FULL_I 2 "register_operand")]
4148 1.1.1.3 mrg MUL_HIGHPART)]
4149 1.1.1.3 mrg UNSPEC_PRED_X))]
4150 1.1.1.3 mrg "TARGET_SVE"
4151 1.1.1.3 mrg {
4152 1.1.1.3 mrg operands[3] = aarch64_ptrue_reg (<VPRED>mode);
4153 1.1.1.3 mrg }
4154 1.1.1.3 mrg )
4155 1.1.1.3 mrg
4156 1.1.1.3 mrg ;; Predicated highpart multiplication.
4157 1.1.1.3 mrg (define_insn "@aarch64_pred_<optab><mode>"
4158 1.1.1.3 mrg [(set (match_operand:SVE_FULL_I 0 "register_operand" "=w, ?&w")
4159 1.1.1.3 mrg (unspec:SVE_FULL_I
4160 1.1.1.3 mrg [(match_operand:<VPRED> 1 "register_operand" "Upl, Upl")
4161 1.1.1.3 mrg (unspec:SVE_FULL_I
4162 1.1.1.3 mrg [(match_operand:SVE_FULL_I 2 "register_operand" "%0, w")
4163 1.1.1.3 mrg (match_operand:SVE_FULL_I 3 "register_operand" "w, w")]
4164 1.1.1.3 mrg MUL_HIGHPART)]
4165 1.1.1.3 mrg UNSPEC_PRED_X))]
4166 1.1.1.3 mrg "TARGET_SVE"
4167 1.1.1.3 mrg "@
4168 1.1.1.3 mrg <su>mulh\t%0.<Vetype>, %1/m, %0.<Vetype>, %3.<Vetype>
4169 1.1.1.3 mrg movprfx\t%0, %2\;<su>mulh\t%0.<Vetype>, %1/m, %0.<Vetype>, %3.<Vetype>"
4170 1.1.1.3 mrg [(set_attr "movprfx" "*,yes")]
4171 1.1.1.3 mrg )
4172 1.1.1.3 mrg
4173 1.1.1.3 mrg ;; Predicated highpart multiplications with merging.
4174 1.1.1.3 mrg (define_expand "@cond_<optab><mode>"
4175 1.1.1.3 mrg [(set (match_operand:SVE_FULL_I 0 "register_operand")
4176 1.1.1.3 mrg (unspec:SVE_FULL_I
4177 1.1.1.3 mrg [(match_operand:<VPRED> 1 "register_operand")
4178 1.1.1.3 mrg (unspec:SVE_FULL_I
4179 1.1.1.3 mrg [(match_operand:SVE_FULL_I 2 "register_operand")
4180 1.1.1.3 mrg (match_operand:SVE_FULL_I 3 "register_operand")]
4181 1.1.1.3 mrg MUL_HIGHPART)
4182 1.1.1.3 mrg (match_operand:SVE_FULL_I 4 "aarch64_simd_reg_or_zero")]
4183 1.1.1.3 mrg UNSPEC_SEL))]
4184 1.1.1.3 mrg "TARGET_SVE"
4185 1.1.1.3 mrg {
4186 1.1.1.3 mrg /* Only target code is aware of these operations, so we don't need
4187 1.1.1.3 mrg to handle the fully-general case. */
4188 1.1.1.3 mrg gcc_assert (rtx_equal_p (operands[2], operands[4])
4189 1.1.1.3 mrg || CONSTANT_P (operands[4]));
4190 1.1.1.3 mrg })
4191 1.1.1.3 mrg
4192 1.1.1.3 mrg ;; Predicated highpart multiplications, merging with the first input.
4193 1.1.1.3 mrg (define_insn "*cond_<optab><mode>_2"
4194 1.1.1.3 mrg [(set (match_operand:SVE_FULL_I 0 "register_operand" "=w, ?&w")
4195 1.1.1.3 mrg (unspec:SVE_FULL_I
4196 1.1.1.3 mrg [(match_operand:<VPRED> 1 "register_operand" "Upl, Upl")
4197 1.1.1.3 mrg (unspec:SVE_FULL_I
4198 1.1.1.3 mrg [(match_operand:SVE_FULL_I 2 "register_operand" "0, w")
4199 1.1.1.3 mrg (match_operand:SVE_FULL_I 3 "register_operand" "w, w")]
4200 1.1.1.3 mrg MUL_HIGHPART)
4201 1.1.1.3 mrg (match_dup 2)]
4202 1.1.1.3 mrg UNSPEC_SEL))]
4203 1.1.1.3 mrg "TARGET_SVE"
4204 1.1.1.3 mrg "@
4205 1.1.1.3 mrg <sve_int_op>\t%0.<Vetype>, %1/m, %0.<Vetype>, %3.<Vetype>
4206 1.1.1.3 mrg movprfx\t%0, %2\;<sve_int_op>\t%0.<Vetype>, %1/m, %0.<Vetype>, %3.<Vetype>"
4207 1.1.1.3 mrg [(set_attr "movprfx" "*,yes")])
4208 1.1.1.3 mrg
4209 1.1.1.3 mrg ;; Predicated highpart multiplications, merging with zero.
4210 1.1.1.3 mrg (define_insn "*cond_<optab><mode>_z"
4211 1.1.1.3 mrg [(set (match_operand:SVE_FULL_I 0 "register_operand" "=&w, &w")
4212 1.1.1.3 mrg (unspec:SVE_FULL_I
4213 1.1.1.3 mrg [(match_operand:<VPRED> 1 "register_operand" "Upl, Upl")
4214 1.1.1.3 mrg (unspec:SVE_FULL_I
4215 1.1.1.3 mrg [(match_operand:SVE_FULL_I 2 "register_operand" "%0, w")
4216 1.1.1.3 mrg (match_operand:SVE_FULL_I 3 "register_operand" "w, w")]
4217 1.1.1.3 mrg MUL_HIGHPART)
4218 1.1.1.3 mrg (match_operand:SVE_FULL_I 4 "aarch64_simd_imm_zero")]
4219 1.1.1.3 mrg UNSPEC_SEL))]
4220 1.1.1.3 mrg "TARGET_SVE"
4221 1.1.1.3 mrg "@
4222 1.1.1.3 mrg movprfx\t%0.<Vetype>, %1/z, %0.<Vetype>\;<sve_int_op>\t%0.<Vetype>, %1/m, %0.<Vetype>, %3.<Vetype>
4223 1.1.1.3 mrg movprfx\t%0.<Vetype>, %1/z, %2.<Vetype>\;<sve_int_op>\t%0.<Vetype>, %1/m, %0.<Vetype>, %3.<Vetype>"
4224 1.1.1.3 mrg [(set_attr "movprfx" "yes")])
4225 1.1.1.3 mrg
4226 1.1.1.3 mrg ;; -------------------------------------------------------------------------
4227 1.1.1.3 mrg ;; ---- [INT] Division
4228 1.1.1.3 mrg ;; -------------------------------------------------------------------------
4229 1.1.1.3 mrg ;; Includes:
4230 1.1.1.3 mrg ;; - SDIV
4231 1.1.1.3 mrg ;; - SDIVR
4232 1.1.1.3 mrg ;; - UDIV
4233 1.1.1.3 mrg ;; - UDIVR
4234 1.1.1.3 mrg ;; -------------------------------------------------------------------------
4235 1.1.1.3 mrg
4236 1.1.1.3 mrg ;; Unpredicated integer division.
4237 1.1.1.3 mrg (define_expand "<optab><mode>3"
4238 1.1.1.3 mrg [(set (match_operand:SVE_FULL_SDI 0 "register_operand")
4239 1.1.1.3 mrg (unspec:SVE_FULL_SDI
4240 1.1.1.3 mrg [(match_dup 3)
4241 1.1.1.3 mrg (SVE_INT_BINARY_SD:SVE_FULL_SDI
4242 1.1.1.3 mrg (match_operand:SVE_FULL_SDI 1 "register_operand")
4243 1.1.1.3 mrg (match_operand:SVE_FULL_SDI 2 "register_operand"))]
4244 1.1.1.3 mrg UNSPEC_PRED_X))]
4245 1.1.1.3 mrg "TARGET_SVE"
4246 1.1.1.3 mrg {
4247 1.1.1.3 mrg operands[3] = aarch64_ptrue_reg (<VPRED>mode);
4248 1.1.1.3 mrg }
4249 1.1.1.3 mrg )
4250 1.1.1.3 mrg
4251 1.1.1.3 mrg ;; Integer division predicated with a PTRUE.
4252 1.1.1.3 mrg (define_insn "@aarch64_pred_<optab><mode>"
4253 1.1.1.3 mrg [(set (match_operand:SVE_FULL_SDI 0 "register_operand" "=w, w, ?&w")
4254 1.1.1.3 mrg (unspec:SVE_FULL_SDI
4255 1.1.1.3 mrg [(match_operand:<VPRED> 1 "register_operand" "Upl, Upl, Upl")
4256 1.1.1.3 mrg (SVE_INT_BINARY_SD:SVE_FULL_SDI
4257 1.1.1.3 mrg (match_operand:SVE_FULL_SDI 2 "register_operand" "0, w, w")
4258 1.1.1.3 mrg (match_operand:SVE_FULL_SDI 3 "register_operand" "w, 0, w"))]
4259 1.1.1.3 mrg UNSPEC_PRED_X))]
4260 1.1.1.3 mrg "TARGET_SVE"
4261 1.1.1.3 mrg "@
4262 1.1.1.3 mrg <sve_int_op>\t%0.<Vetype>, %1/m, %0.<Vetype>, %3.<Vetype>
4263 1.1.1.3 mrg <sve_int_op>r\t%0.<Vetype>, %1/m, %0.<Vetype>, %2.<Vetype>
4264 1.1.1.3 mrg movprfx\t%0, %2\;<sve_int_op>\t%0.<Vetype>, %1/m, %0.<Vetype>, %3.<Vetype>"
4265 1.1.1.3 mrg [(set_attr "movprfx" "*,*,yes")]
4266 1.1.1.3 mrg )
4267 1.1.1.3 mrg
4268 1.1.1.3 mrg ;; Predicated integer division with merging.
4269 1.1.1.3 mrg (define_expand "@cond_<optab><mode>"
4270 1.1.1.3 mrg [(set (match_operand:SVE_FULL_SDI 0 "register_operand")
4271 1.1.1.3 mrg (unspec:SVE_FULL_SDI
4272 1.1.1.3 mrg [(match_operand:<VPRED> 1 "register_operand")
4273 1.1.1.3 mrg (SVE_INT_BINARY_SD:SVE_FULL_SDI
4274 1.1.1.3 mrg (match_operand:SVE_FULL_SDI 2 "register_operand")
4275 1.1.1.3 mrg (match_operand:SVE_FULL_SDI 3 "register_operand"))
4276 1.1.1.3 mrg (match_operand:SVE_FULL_SDI 4 "aarch64_simd_reg_or_zero")]
4277 1.1.1.3 mrg UNSPEC_SEL))]
4278 1.1.1.3 mrg "TARGET_SVE"
4279 1.1.1.3 mrg )
4280 1.1.1.3 mrg
4281 1.1.1.3 mrg ;; Predicated integer division, merging with the first input.
4282 1.1.1.3 mrg (define_insn "*cond_<optab><mode>_2"
4283 1.1.1.3 mrg [(set (match_operand:SVE_FULL_SDI 0 "register_operand" "=w, ?&w")
4284 1.1.1.3 mrg (unspec:SVE_FULL_SDI
4285 1.1.1.3 mrg [(match_operand:<VPRED> 1 "register_operand" "Upl, Upl")
4286 1.1.1.3 mrg (SVE_INT_BINARY_SD:SVE_FULL_SDI
4287 1.1.1.3 mrg (match_operand:SVE_FULL_SDI 2 "register_operand" "0, w")
4288 1.1.1.3 mrg (match_operand:SVE_FULL_SDI 3 "register_operand" "w, w"))
4289 1.1.1.3 mrg (match_dup 2)]
4290 1.1.1.3 mrg UNSPEC_SEL))]
4291 1.1.1.3 mrg "TARGET_SVE"
4292 1.1.1.3 mrg "@
4293 1.1.1.3 mrg <sve_int_op>\t%0.<Vetype>, %1/m, %0.<Vetype>, %3.<Vetype>
4294 1.1.1.3 mrg movprfx\t%0, %2\;<sve_int_op>\t%0.<Vetype>, %1/m, %0.<Vetype>, %3.<Vetype>"
4295 1.1.1.3 mrg [(set_attr "movprfx" "*,yes")]
4296 1.1.1.3 mrg )
4297 1.1.1.3 mrg
4298 1.1.1.3 mrg ;; Predicated integer division, merging with the second input.
4299 1.1.1.3 mrg (define_insn "*cond_<optab><mode>_3"
4300 1.1.1.3 mrg [(set (match_operand:SVE_FULL_SDI 0 "register_operand" "=w, ?&w")
4301 1.1.1.3 mrg (unspec:SVE_FULL_SDI
4302 1.1.1.3 mrg [(match_operand:<VPRED> 1 "register_operand" "Upl, Upl")
4303 1.1.1.3 mrg (SVE_INT_BINARY_SD:SVE_FULL_SDI
4304 1.1.1.3 mrg (match_operand:SVE_FULL_SDI 2 "register_operand" "w, w")
4305 1.1.1.3 mrg (match_operand:SVE_FULL_SDI 3 "register_operand" "0, w"))
4306 1.1.1.3 mrg (match_dup 3)]
4307 1.1.1.3 mrg UNSPEC_SEL))]
4308 1.1.1.3 mrg "TARGET_SVE"
4309 1.1.1.3 mrg "@
4310 1.1.1.3 mrg <sve_int_op_rev>\t%0.<Vetype>, %1/m, %0.<Vetype>, %2.<Vetype>
4311 1.1.1.3 mrg movprfx\t%0, %3\;<sve_int_op_rev>\t%0.<Vetype>, %1/m, %0.<Vetype>, %2.<Vetype>"
4312 1.1.1.3 mrg [(set_attr "movprfx" "*,yes")]
4313 1.1.1.3 mrg )
4314 1.1.1.3 mrg
4315 1.1.1.3 mrg ;; Predicated integer division, merging with an independent value.
4316 1.1.1.3 mrg (define_insn_and_rewrite "*cond_<optab><mode>_any"
4317 1.1.1.3 mrg [(set (match_operand:SVE_FULL_SDI 0 "register_operand" "=&w, &w, &w, &w, ?&w")
4318 1.1.1.3 mrg (unspec:SVE_FULL_SDI
4319 1.1.1.3 mrg [(match_operand:<VPRED> 1 "register_operand" "Upl, Upl, Upl, Upl, Upl")
4320 1.1.1.3 mrg (SVE_INT_BINARY_SD:SVE_FULL_SDI
4321 1.1.1.3 mrg (match_operand:SVE_FULL_SDI 2 "register_operand" "0, w, w, w, w")
4322 1.1.1.3 mrg (match_operand:SVE_FULL_SDI 3 "register_operand" "w, 0, w, w, w"))
4323 1.1.1.3 mrg (match_operand:SVE_FULL_SDI 4 "aarch64_simd_reg_or_zero" "Dz, Dz, Dz, 0, w")]
4324 1.1.1.3 mrg UNSPEC_SEL))]
4325 1.1.1.3 mrg "TARGET_SVE
4326 1.1.1.3 mrg && !rtx_equal_p (operands[2], operands[4])
4327 1.1.1.3 mrg && !rtx_equal_p (operands[3], operands[4])"
4328 1.1.1.3 mrg "@
4329 1.1.1.3 mrg movprfx\t%0.<Vetype>, %1/z, %0.<Vetype>\;<sve_int_op>\t%0.<Vetype>, %1/m, %0.<Vetype>, %3.<Vetype>
4330 1.1.1.3 mrg movprfx\t%0.<Vetype>, %1/z, %0.<Vetype>\;<sve_int_op_rev>\t%0.<Vetype>, %1/m, %0.<Vetype>, %2.<Vetype>
4331 1.1.1.3 mrg movprfx\t%0.<Vetype>, %1/z, %2.<Vetype>\;<sve_int_op>\t%0.<Vetype>, %1/m, %0.<Vetype>, %3.<Vetype>
4332 1.1.1.3 mrg movprfx\t%0.<Vetype>, %1/m, %2.<Vetype>\;<sve_int_op>\t%0.<Vetype>, %1/m, %0.<Vetype>, %3.<Vetype>
4333 1.1.1.3 mrg #"
4334 1.1.1.3 mrg "&& reload_completed
4335 1.1.1.3 mrg && register_operand (operands[4], <MODE>mode)
4336 1.1.1.3 mrg && !rtx_equal_p (operands[0], operands[4])"
4337 1.1.1.3 mrg {
4338 1.1.1.3 mrg emit_insn (gen_vcond_mask_<mode><vpred> (operands[0], operands[2],
4339 1.1.1.3 mrg operands[4], operands[1]));
4340 1.1.1.3 mrg operands[4] = operands[2] = operands[0];
4341 1.1.1.3 mrg }
4342 1.1.1.3 mrg [(set_attr "movprfx" "yes")]
4343 1.1.1.3 mrg )
4344 1.1.1.3 mrg
4345 1.1.1.3 mrg ;; -------------------------------------------------------------------------
4346 1.1.1.3 mrg ;; ---- [INT] Binary logical operations
4347 1.1.1.3 mrg ;; -------------------------------------------------------------------------
4348 1.1.1.3 mrg ;; Includes:
4349 1.1.1.3 mrg ;; - AND
4350 1.1.1.3 mrg ;; - EOR
4351 1.1.1.3 mrg ;; - ORR
4352 1.1.1.3 mrg ;; -------------------------------------------------------------------------
4353 1.1.1.3 mrg
4354 1.1.1.3 mrg ;; Unpredicated integer binary logical operations.
4355 1.1.1.3 mrg (define_insn "<optab><mode>3"
4356 1.1.1.3 mrg [(set (match_operand:SVE_FULL_I 0 "register_operand" "=w, ?w, w")
4357 1.1.1.3 mrg (LOGICAL:SVE_FULL_I
4358 1.1.1.3 mrg (match_operand:SVE_FULL_I 1 "register_operand" "%0, w, w")
4359 1.1.1.3 mrg (match_operand:SVE_FULL_I 2 "aarch64_sve_logical_operand" "vsl, vsl, w")))]
4360 1.1.1.3 mrg "TARGET_SVE"
4361 1.1.1.3 mrg "@
4362 1.1.1.3 mrg <logical>\t%0.<Vetype>, %0.<Vetype>, #%C2
4363 1.1.1.3 mrg movprfx\t%0, %1\;<logical>\t%0.<Vetype>, %0.<Vetype>, #%C2
4364 1.1.1.3 mrg <logical>\t%0.d, %1.d, %2.d"
4365 1.1.1.3 mrg [(set_attr "movprfx" "*,yes,*")]
4366 1.1.1.3 mrg )
4367 1.1.1.3 mrg
4368 1.1.1.3 mrg ;; Merging forms are handled through SVE_INT_BINARY.
4369 1.1.1.3 mrg
4370 1.1.1.3 mrg ;; -------------------------------------------------------------------------
4371 1.1.1.3 mrg ;; ---- [INT] Binary logical operations (inverted second input)
4372 1.1.1.3 mrg ;; -------------------------------------------------------------------------
4373 1.1.1.3 mrg ;; Includes:
4374 1.1.1.3 mrg ;; - BIC
4375 1.1.1.3 mrg ;; -------------------------------------------------------------------------
4376 1.1.1.3 mrg
4377 1.1.1.3 mrg ;; Unpredicated BIC.
4378 1.1.1.3 mrg (define_expand "@aarch64_bic<mode>"
4379 1.1.1.3 mrg [(set (match_operand:SVE_FULL_I 0 "register_operand")
4380 1.1.1.3 mrg (and:SVE_FULL_I
4381 1.1.1.3 mrg (unspec:SVE_FULL_I
4382 1.1.1.3 mrg [(match_dup 3)
4383 1.1.1.3 mrg (not:SVE_FULL_I (match_operand:SVE_FULL_I 2 "register_operand"))]
4384 1.1.1.3 mrg UNSPEC_PRED_X)
4385 1.1.1.3 mrg (match_operand:SVE_FULL_I 1 "register_operand")))]
4386 1.1.1.3 mrg "TARGET_SVE"
4387 1.1.1.3 mrg {
4388 1.1.1.3 mrg operands[3] = CONSTM1_RTX (<VPRED>mode);
4389 1.1.1.3 mrg }
4390 1.1.1.3 mrg )
4391 1.1.1.3 mrg
4392 1.1.1.3 mrg ;; Predicated BIC.
4393 1.1.1.3 mrg (define_insn_and_rewrite "*bic<mode>3"
4394 1.1.1.3 mrg [(set (match_operand:SVE_FULL_I 0 "register_operand" "=w")
4395 1.1.1.3 mrg (and:SVE_FULL_I
4396 1.1.1.3 mrg (unspec:SVE_FULL_I
4397 1.1.1.3 mrg [(match_operand 3)
4398 1.1.1.3 mrg (not:SVE_FULL_I
4399 1.1.1.3 mrg (match_operand:SVE_FULL_I 2 "register_operand" "w"))]
4400 1.1.1.3 mrg UNSPEC_PRED_X)
4401 1.1.1.3 mrg (match_operand:SVE_FULL_I 1 "register_operand" "w")))]
4402 1.1.1.3 mrg "TARGET_SVE"
4403 1.1.1.3 mrg "bic\t%0.d, %1.d, %2.d"
4404 1.1.1.3 mrg "&& !CONSTANT_P (operands[3])"
4405 1.1.1.3 mrg {
4406 1.1.1.3 mrg operands[3] = CONSTM1_RTX (<VPRED>mode);
4407 1.1.1.3 mrg }
4408 1.1.1.3 mrg )
4409 1.1.1.3 mrg
4410 1.1.1.3 mrg ;; Predicated BIC with merging.
4411 1.1.1.3 mrg (define_expand "@cond_bic<mode>"
4412 1.1.1.3 mrg [(set (match_operand:SVE_FULL_I 0 "register_operand")
4413 1.1.1.3 mrg (unspec:SVE_FULL_I
4414 1.1.1.3 mrg [(match_operand:<VPRED> 1 "register_operand")
4415 1.1.1.3 mrg (and:SVE_FULL_I
4416 1.1.1.3 mrg (not:SVE_FULL_I (match_operand:SVE_FULL_I 3 "register_operand"))
4417 1.1.1.3 mrg (match_operand:SVE_FULL_I 2 "register_operand"))
4418 1.1.1.3 mrg (match_operand:SVE_FULL_I 4 "aarch64_simd_reg_or_zero")]
4419 1.1.1.3 mrg UNSPEC_SEL))]
4420 1.1.1.3 mrg "TARGET_SVE"
4421 1.1.1.3 mrg )
4422 1.1.1.3 mrg
4423 1.1.1.3 mrg ;; Predicated integer BIC, merging with the first input.
4424 1.1.1.3 mrg (define_insn "*cond_bic<mode>_2"
4425 1.1.1.3 mrg [(set (match_operand:SVE_FULL_I 0 "register_operand" "=w, ?&w")
4426 1.1.1.3 mrg (unspec:SVE_FULL_I
4427 1.1.1.3 mrg [(match_operand:<VPRED> 1 "register_operand" "Upl, Upl")
4428 1.1.1.3 mrg (and:SVE_FULL_I
4429 1.1.1.3 mrg (not:SVE_FULL_I
4430 1.1.1.3 mrg (match_operand:SVE_FULL_I 3 "register_operand" "w, w"))
4431 1.1.1.3 mrg (match_operand:SVE_FULL_I 2 "register_operand" "0, w"))
4432 1.1.1.3 mrg (match_dup 2)]
4433 1.1.1.3 mrg UNSPEC_SEL))]
4434 1.1.1.3 mrg "TARGET_SVE"
4435 1.1.1.3 mrg "@
4436 1.1.1.3 mrg bic\t%0.<Vetype>, %1/m, %0.<Vetype>, %3.<Vetype>
4437 1.1.1.3 mrg movprfx\t%0, %2\;bic\t%0.<Vetype>, %1/m, %0.<Vetype>, %3.<Vetype>"
4438 1.1.1.3 mrg [(set_attr "movprfx" "*,yes")]
4439 1.1.1.3 mrg )
4440 1.1.1.3 mrg
4441 1.1.1.3 mrg ;; Predicated integer BIC, merging with an independent value.
4442 1.1.1.3 mrg (define_insn_and_rewrite "*cond_bic<mode>_any"
4443 1.1.1.3 mrg [(set (match_operand:SVE_FULL_I 0 "register_operand" "=&w, &w, &w, ?&w")
4444 1.1.1.3 mrg (unspec:SVE_FULL_I
4445 1.1.1.3 mrg [(match_operand:<VPRED> 1 "register_operand" "Upl, Upl, Upl, Upl")
4446 1.1.1.3 mrg (and:SVE_FULL_I
4447 1.1.1.3 mrg (not:SVE_FULL_I
4448 1.1.1.3 mrg (match_operand:SVE_FULL_I 3 "register_operand" "w, w, w, w"))
4449 1.1.1.3 mrg (match_operand:SVE_FULL_I 2 "register_operand" "0, w, w, w"))
4450 1.1.1.3 mrg (match_operand:SVE_FULL_I 4 "aarch64_simd_reg_or_zero" "Dz, Dz, 0, w")]
4451 1.1.1.3 mrg UNSPEC_SEL))]
4452 1.1.1.3 mrg "TARGET_SVE && !rtx_equal_p (operands[2], operands[4])"
4453 1.1.1.3 mrg "@
4454 1.1.1.3 mrg movprfx\t%0.<Vetype>, %1/z, %0.<Vetype>\;bic\t%0.<Vetype>, %1/m, %0.<Vetype>, %3.<Vetype>
4455 1.1.1.3 mrg movprfx\t%0.<Vetype>, %1/z, %2.<Vetype>\;bic\t%0.<Vetype>, %1/m, %0.<Vetype>, %3.<Vetype>
4456 1.1.1.3 mrg movprfx\t%0.<Vetype>, %1/m, %2.<Vetype>\;bic\t%0.<Vetype>, %1/m, %0.<Vetype>, %3.<Vetype>
4457 1.1.1.3 mrg #"
4458 1.1.1.3 mrg "&& reload_completed
4459 1.1.1.3 mrg && register_operand (operands[4], <MODE>mode)
4460 1.1.1.3 mrg && !rtx_equal_p (operands[0], operands[4])"
4461 1.1.1.3 mrg {
4462 1.1.1.3 mrg emit_insn (gen_vcond_mask_<mode><vpred> (operands[0], operands[2],
4463 1.1.1.3 mrg operands[4], operands[1]));
4464 1.1.1.3 mrg operands[4] = operands[2] = operands[0];
4465 1.1.1.3 mrg }
4466 1.1.1.3 mrg [(set_attr "movprfx" "yes")]
4467 1.1.1.3 mrg )
4468 1.1.1.3 mrg
4469 1.1.1.3 mrg ;; -------------------------------------------------------------------------
4470 1.1.1.3 mrg ;; ---- [INT] Shifts (rounding towards -Inf)
4471 1.1.1.3 mrg ;; -------------------------------------------------------------------------
4472 1.1.1.3 mrg ;; Includes:
4473 1.1.1.3 mrg ;; - ASR
4474 1.1.1.3 mrg ;; - ASRR
4475 1.1.1.3 mrg ;; - LSL
4476 1.1.1.3 mrg ;; - LSLR
4477 1.1.1.3 mrg ;; - LSR
4478 1.1.1.3 mrg ;; - LSRR
4479 1.1.1.3 mrg ;; -------------------------------------------------------------------------
4480 1.1.1.3 mrg
4481 1.1.1.3 mrg ;; Unpredicated shift by a scalar, which expands into one of the vector
4482 1.1.1.3 mrg ;; shifts below.
4483 1.1.1.3 mrg (define_expand "<ASHIFT:optab><mode>3"
4484 1.1.1.3 mrg [(set (match_operand:SVE_FULL_I 0 "register_operand")
4485 1.1.1.3 mrg (ASHIFT:SVE_FULL_I
4486 1.1.1.3 mrg (match_operand:SVE_FULL_I 1 "register_operand")
4487 1.1.1.3 mrg (match_operand:<VEL> 2 "general_operand")))]
4488 1.1.1.3 mrg "TARGET_SVE"
4489 1.1.1.3 mrg {
4490 1.1.1.3 mrg rtx amount;
4491 1.1.1.3 mrg if (CONST_INT_P (operands[2]))
4492 1.1.1.3 mrg {
4493 1.1.1.3 mrg amount = gen_const_vec_duplicate (<MODE>mode, operands[2]);
4494 1.1.1.3 mrg if (!aarch64_sve_<lr>shift_operand (operands[2], <MODE>mode))
4495 1.1.1.3 mrg amount = force_reg (<MODE>mode, amount);
4496 1.1.1.3 mrg }
4497 1.1.1.3 mrg else
4498 1.1.1.3 mrg {
4499 1.1.1.3 mrg amount = gen_reg_rtx (<MODE>mode);
4500 1.1.1.3 mrg emit_insn (gen_vec_duplicate<mode> (amount,
4501 1.1.1.3 mrg convert_to_mode (<VEL>mode,
4502 1.1.1.3 mrg operands[2], 0)));
4503 1.1.1.3 mrg }
4504 1.1.1.3 mrg emit_insn (gen_v<optab><mode>3 (operands[0], operands[1], amount));
4505 1.1.1.3 mrg DONE;
4506 1.1.1.3 mrg }
4507 1.1.1.3 mrg )
4508 1.1.1.3 mrg
4509 1.1.1.3 mrg ;; Unpredicated shift by a vector.
4510 1.1.1.3 mrg (define_expand "v<optab><mode>3"
4511 1.1.1.3 mrg [(set (match_operand:SVE_FULL_I 0 "register_operand")
4512 1.1.1.3 mrg (unspec:SVE_FULL_I
4513 1.1.1.3 mrg [(match_dup 3)
4514 1.1.1.3 mrg (ASHIFT:SVE_FULL_I
4515 1.1.1.3 mrg (match_operand:SVE_FULL_I 1 "register_operand")
4516 1.1.1.3 mrg (match_operand:SVE_FULL_I 2 "aarch64_sve_<lr>shift_operand"))]
4517 1.1.1.3 mrg UNSPEC_PRED_X))]
4518 1.1.1.3 mrg "TARGET_SVE"
4519 1.1.1.3 mrg {
4520 1.1.1.3 mrg operands[3] = aarch64_ptrue_reg (<VPRED>mode);
4521 1.1.1.3 mrg }
4522 1.1.1.3 mrg )
4523 1.1.1.3 mrg
4524 1.1.1.3 mrg ;; Shift by a vector, predicated with a PTRUE. We don't actually need
4525 1.1.1.3 mrg ;; the predicate for the first alternative, but using Upa or X isn't
4526 1.1.1.3 mrg ;; likely to gain much and would make the instruction seem less uniform
4527 1.1.1.3 mrg ;; to the register allocator.
4528 1.1.1.3 mrg (define_insn_and_split "@aarch64_pred_<optab><mode>"
4529 1.1.1.3 mrg [(set (match_operand:SVE_FULL_I 0 "register_operand" "=w, w, w, ?&w")
4530 1.1.1.3 mrg (unspec:SVE_FULL_I
4531 1.1.1.3 mrg [(match_operand:<VPRED> 1 "register_operand" "Upl, Upl, Upl, Upl")
4532 1.1.1.3 mrg (ASHIFT:SVE_FULL_I
4533 1.1.1.3 mrg (match_operand:SVE_FULL_I 2 "register_operand" "w, 0, w, w")
4534 1.1.1.3 mrg (match_operand:SVE_FULL_I 3 "aarch64_sve_<lr>shift_operand" "D<lr>, w, 0, w"))]
4535 1.1.1.3 mrg UNSPEC_PRED_X))]
4536 1.1.1.3 mrg "TARGET_SVE"
4537 1.1.1.3 mrg "@
4538 1.1.1.3 mrg #
4539 1.1.1.3 mrg <shift>\t%0.<Vetype>, %1/m, %0.<Vetype>, %3.<Vetype>
4540 1.1.1.3 mrg <shift>r\t%0.<Vetype>, %1/m, %3.<Vetype>, %2.<Vetype>
4541 1.1.1.3 mrg movprfx\t%0, %2\;<shift>\t%0.<Vetype>, %1/m, %0.<Vetype>, %3.<Vetype>"
4542 1.1.1.3 mrg "&& reload_completed
4543 1.1.1.3 mrg && !register_operand (operands[3], <MODE>mode)"
4544 1.1.1.3 mrg [(set (match_dup 0) (ASHIFT:SVE_FULL_I (match_dup 2) (match_dup 3)))]
4545 1.1.1.3 mrg ""
4546 1.1.1.3 mrg [(set_attr "movprfx" "*,*,*,yes")]
4547 1.1.1.3 mrg )
4548 1.1.1.3 mrg
4549 1.1.1.3 mrg ;; Unpredicated shift operations by a constant (post-RA only).
4550 1.1.1.3 mrg ;; These are generated by splitting a predicated instruction whose
4551 1.1.1.3 mrg ;; predicate is unused.
4552 1.1.1.3 mrg (define_insn "*post_ra_v<optab><mode>3"
4553 1.1.1.3 mrg [(set (match_operand:SVE_FULL_I 0 "register_operand" "=w")
4554 1.1.1.3 mrg (ASHIFT:SVE_FULL_I
4555 1.1.1.3 mrg (match_operand:SVE_FULL_I 1 "register_operand" "w")
4556 1.1.1.3 mrg (match_operand:SVE_FULL_I 2 "aarch64_simd_<lr>shift_imm")))]
4557 1.1.1.3 mrg "TARGET_SVE && reload_completed"
4558 1.1.1.3 mrg "<shift>\t%0.<Vetype>, %1.<Vetype>, #%2"
4559 1.1.1.3 mrg )
4560 1.1.1.3 mrg
4561 1.1.1.3 mrg ;; Predicated integer shift, merging with the first input.
4562 1.1.1.3 mrg (define_insn "*cond_<optab><mode>_2_const"
4563 1.1.1.3 mrg [(set (match_operand:SVE_FULL_I 0 "register_operand" "=w, ?&w")
4564 1.1.1.3 mrg (unspec:SVE_FULL_I
4565 1.1.1.3 mrg [(match_operand:<VPRED> 1 "register_operand" "Upl, Upl")
4566 1.1.1.3 mrg (ASHIFT:SVE_FULL_I
4567 1.1.1.3 mrg (match_operand:SVE_FULL_I 2 "register_operand" "0, w")
4568 1.1.1.3 mrg (match_operand:SVE_FULL_I 3 "aarch64_simd_<lr>shift_imm"))
4569 1.1.1.3 mrg (match_dup 2)]
4570 1.1.1.3 mrg UNSPEC_SEL))]
4571 1.1.1.3 mrg "TARGET_SVE"
4572 1.1.1.3 mrg "@
4573 1.1.1.3 mrg <shift>\t%0.<Vetype>, %1/m, %0.<Vetype>, #%3
4574 1.1.1.3 mrg movprfx\t%0, %2\;<shift>\t%0.<Vetype>, %1/m, %0.<Vetype>, #%3"
4575 1.1.1.3 mrg [(set_attr "movprfx" "*,yes")]
4576 1.1.1.3 mrg )
4577 1.1.1.3 mrg
4578 1.1.1.3 mrg ;; Predicated integer shift, merging with an independent value.
4579 1.1.1.3 mrg (define_insn_and_rewrite "*cond_<optab><mode>_any_const"
4580 1.1.1.3 mrg [(set (match_operand:SVE_FULL_I 0 "register_operand" "=w, &w, ?&w")
4581 1.1.1.3 mrg (unspec:SVE_FULL_I
4582 1.1.1.3 mrg [(match_operand:<VPRED> 1 "register_operand" "Upl, Upl, Upl")
4583 1.1.1.3 mrg (ASHIFT:SVE_FULL_I
4584 1.1.1.3 mrg (match_operand:SVE_FULL_I 2 "register_operand" "w, w, w")
4585 1.1.1.3 mrg (match_operand:SVE_FULL_I 3 "aarch64_simd_<lr>shift_imm"))
4586 1.1.1.3 mrg (match_operand:SVE_FULL_I 4 "aarch64_simd_reg_or_zero" "Dz, 0, w")]
4587 1.1.1.3 mrg UNSPEC_SEL))]
4588 1.1.1.3 mrg "TARGET_SVE && !rtx_equal_p (operands[2], operands[4])"
4589 1.1.1.3 mrg "@
4590 1.1.1.3 mrg movprfx\t%0.<Vetype>, %1/z, %2.<Vetype>\;<shift>\t%0.<Vetype>, %1/m, %0.<Vetype>, #%3
4591 1.1.1.3 mrg movprfx\t%0.<Vetype>, %1/m, %2.<Vetype>\;<shift>\t%0.<Vetype>, %1/m, %0.<Vetype>, #%3
4592 1.1.1.3 mrg #"
4593 1.1.1.3 mrg "&& reload_completed
4594 1.1.1.3 mrg && register_operand (operands[4], <MODE>mode)
4595 1.1.1.3 mrg && !rtx_equal_p (operands[0], operands[4])"
4596 1.1.1.3 mrg {
4597 1.1.1.3 mrg emit_insn (gen_vcond_mask_<mode><vpred> (operands[0], operands[2],
4598 1.1.1.3 mrg operands[4], operands[1]));
4599 1.1.1.3 mrg operands[4] = operands[2] = operands[0];
4600 1.1.1.3 mrg }
4601 1.1.1.3 mrg [(set_attr "movprfx" "yes")]
4602 1.1.1.3 mrg )
4603 1.1.1.3 mrg
4604 1.1.1.3 mrg ;; Unpredicated shifts of narrow elements by 64-bit amounts.
4605 1.1.1.3 mrg (define_insn "@aarch64_sve_<sve_int_op><mode>"
4606 1.1.1.3 mrg [(set (match_operand:SVE_FULL_BHSI 0 "register_operand" "=w")
4607 1.1.1.3 mrg (unspec:SVE_FULL_BHSI
4608 1.1.1.3 mrg [(match_operand:SVE_FULL_BHSI 1 "register_operand" "w")
4609 1.1.1.3 mrg (match_operand:VNx2DI 2 "register_operand" "w")]
4610 1.1.1.3 mrg SVE_SHIFT_WIDE))]
4611 1.1.1.3 mrg "TARGET_SVE"
4612 1.1.1.3 mrg "<sve_int_op>\t%0.<Vetype>, %1.<Vetype>, %2.d"
4613 1.1.1.3 mrg )
4614 1.1.1.3 mrg
4615 1.1.1.3 mrg ;; Merging predicated shifts of narrow elements by 64-bit amounts.
4616 1.1.1.3 mrg (define_expand "@cond_<sve_int_op><mode>"
4617 1.1.1.3 mrg [(set (match_operand:SVE_FULL_BHSI 0 "register_operand")
4618 1.1.1.3 mrg (unspec:SVE_FULL_BHSI
4619 1.1.1.3 mrg [(match_operand:<VPRED> 1 "register_operand")
4620 1.1.1.3 mrg (unspec:SVE_FULL_BHSI
4621 1.1.1.3 mrg [(match_operand:SVE_FULL_BHSI 2 "register_operand")
4622 1.1.1.3 mrg (match_operand:VNx2DI 3 "register_operand")]
4623 1.1.1.3 mrg SVE_SHIFT_WIDE)
4624 1.1.1.3 mrg (match_operand:SVE_FULL_BHSI 4 "aarch64_simd_reg_or_zero")]
4625 1.1.1.3 mrg UNSPEC_SEL))]
4626 1.1.1.3 mrg "TARGET_SVE"
4627 1.1.1.3 mrg )
4628 1.1.1.3 mrg
4629 1.1.1.3 mrg ;; Predicated shifts of narrow elements by 64-bit amounts, merging with
4630 1.1.1.3 mrg ;; the first input.
4631 1.1.1.3 mrg (define_insn "*cond_<sve_int_op><mode>_m"
4632 1.1.1.3 mrg [(set (match_operand:SVE_FULL_BHSI 0 "register_operand" "=w, ?&w")
4633 1.1.1.3 mrg (unspec:SVE_FULL_BHSI
4634 1.1.1.3 mrg [(match_operand:<VPRED> 1 "register_operand" "Upl, Upl")
4635 1.1.1.3 mrg (unspec:SVE_FULL_BHSI
4636 1.1.1.3 mrg [(match_operand:SVE_FULL_BHSI 2 "register_operand" "0, w")
4637 1.1.1.3 mrg (match_operand:VNx2DI 3 "register_operand" "w, w")]
4638 1.1.1.3 mrg SVE_SHIFT_WIDE)
4639 1.1.1.3 mrg (match_dup 2)]
4640 1.1.1.3 mrg UNSPEC_SEL))]
4641 1.1.1.3 mrg "TARGET_SVE"
4642 1.1.1.3 mrg "@
4643 1.1.1.3 mrg <sve_int_op>\t%0.<Vetype>, %1/m, %0.<Vetype>, %3.d
4644 1.1.1.3 mrg movprfx\t%0, %2\;<sve_int_op>\t%0.<Vetype>, %1/m, %0.<Vetype>, %3.d"
4645 1.1.1.3 mrg [(set_attr "movprfx" "*, yes")])
4646 1.1.1.3 mrg
4647 1.1.1.3 mrg ;; Predicated shifts of narrow elements by 64-bit amounts, merging with zero.
4648 1.1.1.3 mrg (define_insn "*cond_<sve_int_op><mode>_z"
4649 1.1.1.3 mrg [(set (match_operand:SVE_FULL_BHSI 0 "register_operand" "=&w, &w")
4650 1.1.1.3 mrg (unspec:SVE_FULL_BHSI
4651 1.1.1.3 mrg [(match_operand:<VPRED> 1 "register_operand" "Upl, Upl")
4652 1.1.1.3 mrg (unspec:SVE_FULL_BHSI
4653 1.1.1.3 mrg [(match_operand:SVE_FULL_BHSI 2 "register_operand" "0, w")
4654 1.1.1.3 mrg (match_operand:VNx2DI 3 "register_operand" "w, w")]
4655 1.1.1.3 mrg SVE_SHIFT_WIDE)
4656 1.1.1.3 mrg (match_operand:SVE_FULL_BHSI 4 "aarch64_simd_imm_zero")]
4657 1.1.1.3 mrg UNSPEC_SEL))]
4658 1.1.1.3 mrg "TARGET_SVE"
4659 1.1.1.3 mrg "@
4660 1.1.1.3 mrg movprfx\t%0.<Vetype>, %1/z, %0.<Vetype>\;<sve_int_op>\t%0.<Vetype>, %1/m, %0.<Vetype>, %3.d
4661 1.1.1.3 mrg movprfx\t%0.<Vetype>, %1/z, %2.<Vetype>\;<sve_int_op>\t%0.<Vetype>, %1/m, %0.<Vetype>, %3.d"
4662 1.1.1.3 mrg [(set_attr "movprfx" "yes")])
4663 1.1.1.3 mrg
4664 1.1.1.3 mrg ;; -------------------------------------------------------------------------
4665 1.1.1.3 mrg ;; ---- [INT] Shifts (rounding towards 0)
4666 1.1.1.3 mrg ;; -------------------------------------------------------------------------
4667 1.1.1.3 mrg ;; Includes:
4668 1.1.1.3 mrg ;; - ASRD
4669 1.1.1.3 mrg ;; - SQSHLU (SVE2)
4670 1.1.1.3 mrg ;; - SRSHR (SVE2)
4671 1.1.1.3 mrg ;; - URSHR (SVE2)
4672 1.1.1.3 mrg ;; -------------------------------------------------------------------------
4673 1.1.1.3 mrg
4674 1.1.1.3 mrg ;; Unpredicated <SVE_INT_OP>.
4675 1.1.1.3 mrg (define_expand "sdiv_pow2<mode>3"
4676 1.1.1.3 mrg [(set (match_operand:SVE_FULL_I 0 "register_operand")
4677 1.1.1.3 mrg (unspec:SVE_FULL_I
4678 1.1.1.3 mrg [(match_dup 3)
4679 1.1.1.3 mrg (unspec:SVE_FULL_I
4680 1.1.1.3 mrg [(match_operand:SVE_FULL_I 1 "register_operand")
4681 1.1.1.3 mrg (match_operand 2 "aarch64_simd_rshift_imm")]
4682 1.1.1.3 mrg UNSPEC_ASRD)
4683 1.1.1.3 mrg (match_dup 1)]
4684 1.1.1.3 mrg UNSPEC_SEL))]
4685 1.1.1.3 mrg "TARGET_SVE"
4686 1.1.1.3 mrg {
4687 1.1.1.3 mrg operands[3] = aarch64_ptrue_reg (<VPRED>mode);
4688 1.1.1.3 mrg }
4689 1.1.1.3 mrg )
4690 1.1.1.3 mrg
4691 1.1.1.3 mrg ;; Predicated right shift with merging.
4692 1.1.1.3 mrg (define_expand "@cond_<sve_int_op><mode>"
4693 1.1.1.3 mrg [(set (match_operand:SVE_FULL_I 0 "register_operand")
4694 1.1.1.3 mrg (unspec:SVE_FULL_I
4695 1.1.1.3 mrg [(match_operand:<VPRED> 1 "register_operand")
4696 1.1.1.3 mrg (unspec:SVE_FULL_I
4697 1.1.1.3 mrg [(match_operand:SVE_FULL_I 2 "register_operand")
4698 1.1.1.3 mrg (match_operand:SVE_FULL_I 3 "aarch64_simd_<lr>shift_imm")]
4699 1.1.1.3 mrg SVE_INT_SHIFT_IMM)
4700 1.1.1.3 mrg (match_operand:SVE_FULL_I 4 "aarch64_simd_reg_or_zero")]
4701 1.1.1.3 mrg UNSPEC_SEL))]
4702 1.1.1.3 mrg "TARGET_SVE"
4703 1.1.1.3 mrg )
4704 1.1.1.3 mrg
4705 1.1.1.3 mrg ;; Predicated right shift, merging with the first input.
4706 1.1.1.3 mrg (define_insn "*cond_<sve_int_op><mode>_2"
4707 1.1.1.3 mrg [(set (match_operand:SVE_FULL_I 0 "register_operand" "=w, ?&w")
4708 1.1.1.3 mrg (unspec:SVE_FULL_I
4709 1.1.1.3 mrg [(match_operand:<VPRED> 1 "register_operand" "Upl, Upl")
4710 1.1.1.3 mrg (unspec:SVE_FULL_I
4711 1.1.1.3 mrg [(match_operand:SVE_FULL_I 2 "register_operand" "0, w")
4712 1.1.1.3 mrg (match_operand:SVE_FULL_I 3 "aarch64_simd_<lr>shift_imm")]
4713 1.1.1.3 mrg SVE_INT_SHIFT_IMM)
4714 1.1.1.3 mrg (match_dup 2)]
4715 1.1.1.3 mrg UNSPEC_SEL))]
4716 1.1.1.3 mrg "TARGET_SVE"
4717 1.1.1.3 mrg "@
4718 1.1.1.3 mrg <sve_int_op>\t%0.<Vetype>, %1/m, %0.<Vetype>, #%3
4719 1.1.1.3 mrg movprfx\t%0, %2\;<sve_int_op>\t%0.<Vetype>, %1/m, %0.<Vetype>, #%3"
4720 1.1.1.3 mrg [(set_attr "movprfx" "*,yes")])
4721 1.1.1.3 mrg
4722 1.1.1.3 mrg ;; Predicated right shift, merging with zero.
4723 1.1.1.3 mrg (define_insn "*cond_<sve_int_op><mode>_z"
4724 1.1.1.3 mrg [(set (match_operand:SVE_FULL_I 0 "register_operand" "=w")
4725 1.1.1.3 mrg (unspec:SVE_FULL_I
4726 1.1.1.3 mrg [(match_operand:<VPRED> 1 "register_operand" "Upl")
4727 1.1.1.3 mrg (unspec:SVE_FULL_I
4728 1.1.1.3 mrg [(match_operand:SVE_FULL_I 2 "register_operand" "w")
4729 1.1.1.3 mrg (match_operand:SVE_FULL_I 3 "aarch64_simd_<lr>shift_imm")]
4730 1.1.1.3 mrg SVE_INT_SHIFT_IMM)
4731 1.1.1.3 mrg (match_operand:SVE_FULL_I 4 "aarch64_simd_imm_zero")]
4732 1.1.1.3 mrg UNSPEC_SEL))]
4733 1.1.1.3 mrg "TARGET_SVE"
4734 1.1.1.3 mrg "movprfx\t%0.<Vetype>, %1/z, %2.<Vetype>\;<sve_int_op>\t%0.<Vetype>, %1/m, %0.<Vetype>, #%3"
4735 1.1.1.3 mrg [(set_attr "movprfx" "yes")])
4736 1.1.1.3 mrg
4737 1.1.1.3 mrg ;; -------------------------------------------------------------------------
4738 1.1.1.3 mrg ;; ---- [FP<-INT] General binary arithmetic corresponding to unspecs
4739 1.1.1.3 mrg ;; -------------------------------------------------------------------------
4740 1.1.1.3 mrg ;; Includes:
4741 1.1.1.3 mrg ;; - FSCALE
4742 1.1.1.3 mrg ;; - FTSMUL
4743 1.1.1.3 mrg ;; - FTSSEL
4744 1.1.1.3 mrg ;; -------------------------------------------------------------------------
4745 1.1.1.3 mrg
4746 1.1.1.3 mrg ;; Unpredicated floating-point binary operations that take an integer as
4747 1.1.1.3 mrg ;; their second operand.
4748 1.1.1.3 mrg (define_insn "@aarch64_sve_<optab><mode>"
4749 1.1.1.3 mrg [(set (match_operand:SVE_FULL_F 0 "register_operand" "=w")
4750 1.1.1.3 mrg (unspec:SVE_FULL_F
4751 1.1.1.3 mrg [(match_operand:SVE_FULL_F 1 "register_operand" "w")
4752 1.1.1.3 mrg (match_operand:<V_INT_EQUIV> 2 "register_operand" "w")]
4753 1.1.1.3 mrg SVE_FP_BINARY_INT))]
4754 1.1.1.3 mrg "TARGET_SVE"
4755 1.1.1.3 mrg "<sve_fp_op>\t%0.<Vetype>, %1.<Vetype>, %2.<Vetype>"
4756 1.1.1.3 mrg )
4757 1.1.1.3 mrg
4758 1.1.1.3 mrg ;; Predicated floating-point binary operations that take an integer
4759 1.1.1.3 mrg ;; as their second operand.
4760 1.1.1.3 mrg (define_insn "@aarch64_pred_<optab><mode>"
4761 1.1.1.3 mrg [(set (match_operand:SVE_FULL_F 0 "register_operand" "=w, ?&w")
4762 1.1.1.3 mrg (unspec:SVE_FULL_F
4763 1.1.1.3 mrg [(match_operand:<VPRED> 1 "register_operand" "Upl, Upl")
4764 1.1.1.3 mrg (match_operand:SI 4 "aarch64_sve_gp_strictness")
4765 1.1.1.3 mrg (match_operand:SVE_FULL_F 2 "register_operand" "0, w")
4766 1.1.1.3 mrg (match_operand:<V_INT_EQUIV> 3 "register_operand" "w, w")]
4767 1.1.1.3 mrg SVE_COND_FP_BINARY_INT))]
4768 1.1.1.3 mrg "TARGET_SVE"
4769 1.1.1.3 mrg "@
4770 1.1.1.3 mrg <sve_fp_op>\t%0.<Vetype>, %1/m, %0.<Vetype>, %3.<Vetype>
4771 1.1.1.3 mrg movprfx\t%0, %2\;<sve_fp_op>\t%0.<Vetype>, %1/m, %0.<Vetype>, %3.<Vetype>"
4772 1.1.1.3 mrg [(set_attr "movprfx" "*,yes")]
4773 1.1.1.3 mrg )
4774 1.1.1.3 mrg
4775 1.1.1.3 mrg ;; Predicated floating-point binary operations with merging, taking an
4776 1.1.1.3 mrg ;; integer as their second operand.
4777 1.1.1.3 mrg (define_expand "@cond_<optab><mode>"
4778 1.1.1.3 mrg [(set (match_operand:SVE_FULL_F 0 "register_operand")
4779 1.1.1.3 mrg (unspec:SVE_FULL_F
4780 1.1.1.3 mrg [(match_operand:<VPRED> 1 "register_operand")
4781 1.1.1.3 mrg (unspec:SVE_FULL_F
4782 1.1.1.3 mrg [(match_dup 1)
4783 1.1.1.3 mrg (const_int SVE_STRICT_GP)
4784 1.1.1.3 mrg (match_operand:SVE_FULL_F 2 "register_operand")
4785 1.1.1.3 mrg (match_operand:<V_INT_EQUIV> 3 "register_operand")]
4786 1.1.1.3 mrg SVE_COND_FP_BINARY_INT)
4787 1.1.1.3 mrg (match_operand:SVE_FULL_F 4 "aarch64_simd_reg_or_zero")]
4788 1.1.1.3 mrg UNSPEC_SEL))]
4789 1.1.1.3 mrg "TARGET_SVE"
4790 1.1.1.3 mrg )
4791 1.1.1.3 mrg
4792 1.1.1.3 mrg ;; Predicated floating-point binary operations that take an integer as their
4793 1.1.1.3 mrg ;; second operand, with inactive lanes coming from the first operand.
4794 1.1.1.3 mrg (define_insn_and_rewrite "*cond_<optab><mode>_2_relaxed"
4795 1.1.1.3 mrg [(set (match_operand:SVE_FULL_F 0 "register_operand" "=w, ?&w")
4796 1.1.1.3 mrg (unspec:SVE_FULL_F
4797 1.1.1.3 mrg [(match_operand:<VPRED> 1 "register_operand" "Upl, Upl")
4798 1.1.1.3 mrg (unspec:SVE_FULL_F
4799 1.1.1.3 mrg [(match_operand 4)
4800 1.1.1.3 mrg (const_int SVE_RELAXED_GP)
4801 1.1.1.3 mrg (match_operand:SVE_FULL_F 2 "register_operand" "0, w")
4802 1.1.1.3 mrg (match_operand:<V_INT_EQUIV> 3 "register_operand" "w, w")]
4803 1.1.1.3 mrg SVE_COND_FP_BINARY_INT)
4804 1.1.1.3 mrg (match_dup 2)]
4805 1.1.1.3 mrg UNSPEC_SEL))]
4806 1.1.1.3 mrg "TARGET_SVE"
4807 1.1.1.3 mrg "@
4808 1.1.1.3 mrg <sve_fp_op>\t%0.<Vetype>, %1/m, %0.<Vetype>, %3.<Vetype>
4809 1.1.1.3 mrg movprfx\t%0, %2\;<sve_fp_op>\t%0.<Vetype>, %1/m, %0.<Vetype>, %3.<Vetype>"
4810 1.1.1.3 mrg "&& !rtx_equal_p (operands[1], operands[4])"
4811 1.1.1.3 mrg {
4812 1.1.1.3 mrg operands[4] = copy_rtx (operands[1]);
4813 1.1.1.3 mrg }
4814 1.1.1.3 mrg [(set_attr "movprfx" "*,yes")]
4815 1.1.1.3 mrg )
4816 1.1.1.3 mrg
4817 1.1.1.3 mrg (define_insn "*cond_<optab><mode>_2_strict"
4818 1.1.1.3 mrg [(set (match_operand:SVE_FULL_F 0 "register_operand" "=w, ?&w")
4819 1.1.1.3 mrg (unspec:SVE_FULL_F
4820 1.1.1.3 mrg [(match_operand:<VPRED> 1 "register_operand" "Upl, Upl")
4821 1.1.1.3 mrg (unspec:SVE_FULL_F
4822 1.1.1.3 mrg [(match_dup 1)
4823 1.1.1.3 mrg (const_int SVE_STRICT_GP)
4824 1.1.1.3 mrg (match_operand:SVE_FULL_F 2 "register_operand" "0, w")
4825 1.1.1.3 mrg (match_operand:<V_INT_EQUIV> 3 "register_operand" "w, w")]
4826 1.1.1.3 mrg SVE_COND_FP_BINARY_INT)
4827 1.1.1.3 mrg (match_dup 2)]
4828 1.1.1.3 mrg UNSPEC_SEL))]
4829 1.1.1.3 mrg "TARGET_SVE"
4830 1.1.1.3 mrg "@
4831 1.1.1.3 mrg <sve_fp_op>\t%0.<Vetype>, %1/m, %0.<Vetype>, %3.<Vetype>
4832 1.1.1.3 mrg movprfx\t%0, %2\;<sve_fp_op>\t%0.<Vetype>, %1/m, %0.<Vetype>, %3.<Vetype>"
4833 1.1.1.3 mrg [(set_attr "movprfx" "*,yes")]
4834 1.1.1.3 mrg )
4835 1.1.1.3 mrg
4836 1.1.1.3 mrg ;; Predicated floating-point binary operations that take an integer as
4837 1.1.1.3 mrg ;; their second operand, with the values of inactive lanes being distinct
4838 1.1.1.3 mrg ;; from the other inputs.
4839 1.1.1.3 mrg (define_insn_and_rewrite "*cond_<optab><mode>_any_relaxed"
4840 1.1.1.3 mrg [(set (match_operand:SVE_FULL_F 0 "register_operand" "=&w, &w, &w, ?&w")
4841 1.1.1.3 mrg (unspec:SVE_FULL_F
4842 1.1.1.3 mrg [(match_operand:<VPRED> 1 "register_operand" "Upl, Upl, Upl, Upl")
4843 1.1.1.3 mrg (unspec:SVE_FULL_F
4844 1.1.1.3 mrg [(match_operand 5)
4845 1.1.1.3 mrg (const_int SVE_RELAXED_GP)
4846 1.1.1.3 mrg (match_operand:SVE_FULL_F 2 "register_operand" "0, w, w, w")
4847 1.1.1.3 mrg (match_operand:<V_INT_EQUIV> 3 "register_operand" "w, w, w, w")]
4848 1.1.1.3 mrg SVE_COND_FP_BINARY_INT)
4849 1.1.1.3 mrg (match_operand:SVE_FULL_F 4 "aarch64_simd_reg_or_zero" "Dz, Dz, 0, w")]
4850 1.1.1.3 mrg UNSPEC_SEL))]
4851 1.1.1.3 mrg "TARGET_SVE && !rtx_equal_p (operands[2], operands[4])"
4852 1.1.1.3 mrg "@
4853 1.1.1.3 mrg movprfx\t%0.<Vetype>, %1/z, %2.<Vetype>\;<sve_fp_op>\t%0.<Vetype>, %1/m, %0.<Vetype>, %3.<Vetype>
4854 1.1.1.3 mrg movprfx\t%0.<Vetype>, %1/z, %2.<Vetype>\;<sve_fp_op>\t%0.<Vetype>, %1/m, %0.<Vetype>, %3.<Vetype>
4855 1.1.1.3 mrg movprfx\t%0.<Vetype>, %1/m, %2.<Vetype>\;<sve_fp_op>\t%0.<Vetype>, %1/m, %0.<Vetype>, %3.<Vetype>
4856 1.1.1.3 mrg #"
4857 1.1.1.3 mrg "&& 1"
4858 1.1.1.3 mrg {
4859 1.1.1.3 mrg if (reload_completed
4860 1.1.1.3 mrg && register_operand (operands[4], <MODE>mode)
4861 1.1.1.3 mrg && !rtx_equal_p (operands[0], operands[4]))
4862 1.1.1.3 mrg {
4863 1.1.1.3 mrg emit_insn (gen_vcond_mask_<mode><vpred> (operands[0], operands[2],
4864 1.1.1.3 mrg operands[4], operands[1]));
4865 1.1.1.3 mrg operands[4] = operands[2] = operands[0];
4866 1.1.1.3 mrg }
4867 1.1.1.3 mrg else if (!rtx_equal_p (operands[1], operands[5]))
4868 1.1.1.3 mrg operands[5] = copy_rtx (operands[1]);
4869 1.1.1.3 mrg else
4870 1.1.1.3 mrg FAIL;
4871 1.1.1.3 mrg }
4872 1.1.1.3 mrg [(set_attr "movprfx" "yes")]
4873 1.1.1.3 mrg )
4874 1.1.1.3 mrg
4875 1.1.1.3 mrg (define_insn_and_rewrite "*cond_<optab><mode>_any_strict"
4876 1.1.1.3 mrg [(set (match_operand:SVE_FULL_F 0 "register_operand" "=&w, &w, &w, ?&w")
4877 1.1.1.3 mrg (unspec:SVE_FULL_F
4878 1.1.1.3 mrg [(match_operand:<VPRED> 1 "register_operand" "Upl, Upl, Upl, Upl")
4879 1.1.1.3 mrg (unspec:SVE_FULL_F
4880 1.1.1.3 mrg [(match_dup 1)
4881 1.1.1.3 mrg (const_int SVE_STRICT_GP)
4882 1.1.1.3 mrg (match_operand:SVE_FULL_F 2 "register_operand" "0, w, w, w")
4883 1.1.1.3 mrg (match_operand:<V_INT_EQUIV> 3 "register_operand" "w, w, w, w")]
4884 1.1.1.3 mrg SVE_COND_FP_BINARY_INT)
4885 1.1.1.3 mrg (match_operand:SVE_FULL_F 4 "aarch64_simd_reg_or_zero" "Dz, Dz, 0, w")]
4886 1.1.1.3 mrg UNSPEC_SEL))]
4887 1.1.1.3 mrg "TARGET_SVE && !rtx_equal_p (operands[2], operands[4])"
4888 1.1.1.3 mrg "@
4889 1.1.1.3 mrg movprfx\t%0.<Vetype>, %1/z, %2.<Vetype>\;<sve_fp_op>\t%0.<Vetype>, %1/m, %0.<Vetype>, %3.<Vetype>
4890 1.1.1.3 mrg movprfx\t%0.<Vetype>, %1/z, %2.<Vetype>\;<sve_fp_op>\t%0.<Vetype>, %1/m, %0.<Vetype>, %3.<Vetype>
4891 1.1.1.3 mrg movprfx\t%0.<Vetype>, %1/m, %2.<Vetype>\;<sve_fp_op>\t%0.<Vetype>, %1/m, %0.<Vetype>, %3.<Vetype>
4892 1.1.1.3 mrg #"
4893 1.1.1.3 mrg "&& reload_completed
4894 1.1.1.3 mrg && register_operand (operands[4], <MODE>mode)
4895 1.1.1.3 mrg && !rtx_equal_p (operands[0], operands[4])"
4896 1.1.1.3 mrg {
4897 1.1.1.3 mrg emit_insn (gen_vcond_mask_<mode><vpred> (operands[0], operands[2],
4898 1.1.1.3 mrg operands[4], operands[1]));
4899 1.1.1.3 mrg operands[4] = operands[2] = operands[0];
4900 1.1.1.3 mrg }
4901 1.1.1.3 mrg [(set_attr "movprfx" "yes")]
4902 1.1.1.3 mrg )
4903 1.1.1.3 mrg
4904 1.1.1.3 mrg ;; -------------------------------------------------------------------------
4905 1.1.1.3 mrg ;; ---- [FP] General binary arithmetic corresponding to rtx codes
4906 1.1.1.3 mrg ;; -------------------------------------------------------------------------
4907 1.1.1.3 mrg ;; Includes post-RA forms of:
4908 1.1.1.3 mrg ;; - FADD
4909 1.1.1.3 mrg ;; - FMUL
4910 1.1.1.3 mrg ;; - FSUB
4911 1.1.1.3 mrg ;; -------------------------------------------------------------------------
4912 1.1.1.3 mrg
4913 1.1.1.3 mrg ;; Unpredicated floating-point binary operations (post-RA only).
4914 1.1.1.3 mrg ;; These are generated by splitting a predicated instruction whose
4915 1.1.1.3 mrg ;; predicate is unused.
4916 1.1.1.3 mrg (define_insn "*post_ra_<sve_fp_op><mode>3"
4917 1.1.1.3 mrg [(set (match_operand:SVE_FULL_F 0 "register_operand" "=w")
4918 1.1.1.3 mrg (SVE_UNPRED_FP_BINARY:SVE_FULL_F
4919 1.1.1.3 mrg (match_operand:SVE_FULL_F 1 "register_operand" "w")
4920 1.1.1.3 mrg (match_operand:SVE_FULL_F 2 "register_operand" "w")))]
4921 1.1.1.3 mrg "TARGET_SVE && reload_completed"
4922 1.1.1.3 mrg "<sve_fp_op>\t%0.<Vetype>, %1.<Vetype>, %2.<Vetype>")
4923 1.1.1.3 mrg
4924 1.1.1.3 mrg ;; -------------------------------------------------------------------------
4925 1.1.1.3 mrg ;; ---- [FP] General binary arithmetic corresponding to unspecs
4926 1.1.1.3 mrg ;; -------------------------------------------------------------------------
4927 1.1.1.3 mrg ;; Includes merging forms of:
4928 1.1.1.3 mrg ;; - FADD (constant forms handled in the "Addition" section)
4929 1.1.1.3 mrg ;; - FDIV
4930 1.1.1.3 mrg ;; - FDIVR
4931 1.1.1.3 mrg ;; - FMAX
4932 1.1.1.3 mrg ;; - FMAXNM (including #0.0 and #1.0)
4933 1.1.1.3 mrg ;; - FMIN
4934 1.1.1.3 mrg ;; - FMINNM (including #0.0 and #1.0)
4935 1.1.1.3 mrg ;; - FMUL (including #0.5 and #2.0)
4936 1.1.1.3 mrg ;; - FMULX
4937 1.1.1.3 mrg ;; - FRECPS
4938 1.1.1.3 mrg ;; - FRSQRTS
4939 1.1.1.3 mrg ;; - FSUB (constant forms handled in the "Addition" section)
4940 1.1.1.3 mrg ;; - FSUBR (constant forms handled in the "Subtraction" section)
4941 1.1.1.3 mrg ;; -------------------------------------------------------------------------
4942 1.1.1.3 mrg
4943 1.1.1.3 mrg ;; Unpredicated floating-point binary operations.
4944 1.1.1.3 mrg (define_insn "@aarch64_sve_<optab><mode>"
4945 1.1.1.3 mrg [(set (match_operand:SVE_FULL_F 0 "register_operand" "=w")
4946 1.1.1.3 mrg (unspec:SVE_FULL_F
4947 1.1.1.3 mrg [(match_operand:SVE_FULL_F 1 "register_operand" "w")
4948 1.1.1.3 mrg (match_operand:SVE_FULL_F 2 "register_operand" "w")]
4949 1.1.1.3 mrg SVE_FP_BINARY))]
4950 1.1.1.3 mrg "TARGET_SVE"
4951 1.1.1.3 mrg "<sve_fp_op>\t%0.<Vetype>, %1.<Vetype>, %2.<Vetype>"
4952 1.1.1.3 mrg )
4953 1.1.1.3 mrg
4954 1.1.1.3 mrg ;; Unpredicated floating-point binary operations that need to be predicated
4955 1.1.1.3 mrg ;; for SVE.
4956 1.1.1.3 mrg (define_expand "<optab><mode>3"
4957 1.1.1.3 mrg [(set (match_operand:SVE_FULL_F 0 "register_operand")
4958 1.1.1.3 mrg (unspec:SVE_FULL_F
4959 1.1.1.3 mrg [(match_dup 3)
4960 1.1.1.3 mrg (const_int SVE_RELAXED_GP)
4961 1.1.1.3 mrg (match_operand:SVE_FULL_F 1 "<sve_pred_fp_rhs1_operand>")
4962 1.1.1.3 mrg (match_operand:SVE_FULL_F 2 "<sve_pred_fp_rhs2_operand>")]
4963 1.1.1.3 mrg SVE_COND_FP_BINARY_OPTAB))]
4964 1.1.1.3 mrg "TARGET_SVE"
4965 1.1.1.3 mrg {
4966 1.1.1.3 mrg operands[3] = aarch64_ptrue_reg (<VPRED>mode);
4967 1.1.1.3 mrg }
4968 1.1.1.3 mrg )
4969 1.1.1.3 mrg
4970 1.1.1.3 mrg ;; Predicated floating-point binary operations that have no immediate forms.
4971 1.1.1.3 mrg (define_insn "@aarch64_pred_<optab><mode>"
4972 1.1.1.3 mrg [(set (match_operand:SVE_FULL_F 0 "register_operand" "=w, w, ?&w")
4973 1.1.1.3 mrg (unspec:SVE_FULL_F
4974 1.1.1.3 mrg [(match_operand:<VPRED> 1 "register_operand" "Upl, Upl, Upl")
4975 1.1.1.3 mrg (match_operand:SI 4 "aarch64_sve_gp_strictness")
4976 1.1.1.3 mrg (match_operand:SVE_FULL_F 2 "register_operand" "0, w, w")
4977 1.1.1.3 mrg (match_operand:SVE_FULL_F 3 "register_operand" "w, 0, w")]
4978 1.1.1.3 mrg SVE_COND_FP_BINARY_REG))]
4979 1.1.1.3 mrg "TARGET_SVE"
4980 1.1.1.3 mrg "@
4981 1.1.1.3 mrg <sve_fp_op>\t%0.<Vetype>, %1/m, %0.<Vetype>, %3.<Vetype>
4982 1.1.1.3 mrg <sve_fp_op_rev>\t%0.<Vetype>, %1/m, %0.<Vetype>, %2.<Vetype>
4983 1.1.1.3 mrg movprfx\t%0, %2\;<sve_fp_op>\t%0.<Vetype>, %1/m, %0.<Vetype>, %3.<Vetype>"
4984 1.1.1.3 mrg [(set_attr "movprfx" "*,*,yes")]
4985 1.1.1.3 mrg )
4986 1.1.1.3 mrg
4987 1.1.1.3 mrg ;; Predicated floating-point operations with merging.
4988 1.1.1.3 mrg (define_expand "@cond_<optab><mode>"
4989 1.1.1.3 mrg [(set (match_operand:SVE_FULL_F 0 "register_operand")
4990 1.1.1.3 mrg (unspec:SVE_FULL_F
4991 1.1.1.3 mrg [(match_operand:<VPRED> 1 "register_operand")
4992 1.1.1.3 mrg (unspec:SVE_FULL_F
4993 1.1.1.3 mrg [(match_dup 1)
4994 1.1.1.3 mrg (const_int SVE_STRICT_GP)
4995 1.1.1.3 mrg (match_operand:SVE_FULL_F 2 "<sve_pred_fp_rhs1_operand>")
4996 1.1.1.3 mrg (match_operand:SVE_FULL_F 3 "<sve_pred_fp_rhs2_operand>")]
4997 1.1.1.3 mrg SVE_COND_FP_BINARY)
4998 1.1.1.3 mrg (match_operand:SVE_FULL_F 4 "aarch64_simd_reg_or_zero")]
4999 1.1.1.3 mrg UNSPEC_SEL))]
5000 1.1.1.3 mrg "TARGET_SVE"
5001 1.1.1.3 mrg )
5002 1.1.1.3 mrg
5003 1.1.1.3 mrg ;; Predicated floating-point operations, merging with the first input.
5004 1.1.1.3 mrg (define_insn_and_rewrite "*cond_<optab><mode>_2_relaxed"
5005 1.1.1.3 mrg [(set (match_operand:SVE_FULL_F 0 "register_operand" "=w, ?&w")
5006 1.1.1.3 mrg (unspec:SVE_FULL_F
5007 1.1.1.3 mrg [(match_operand:<VPRED> 1 "register_operand" "Upl, Upl")
5008 1.1.1.3 mrg (unspec:SVE_FULL_F
5009 1.1.1.3 mrg [(match_operand 4)
5010 1.1.1.3 mrg (const_int SVE_RELAXED_GP)
5011 1.1.1.3 mrg (match_operand:SVE_FULL_F 2 "register_operand" "0, w")
5012 1.1.1.3 mrg (match_operand:SVE_FULL_F 3 "register_operand" "w, w")]
5013 1.1.1.3 mrg SVE_COND_FP_BINARY)
5014 1.1.1.3 mrg (match_dup 2)]
5015 1.1.1.3 mrg UNSPEC_SEL))]
5016 1.1.1.3 mrg "TARGET_SVE"
5017 1.1.1.3 mrg "@
5018 1.1.1.3 mrg <sve_fp_op>\t%0.<Vetype>, %1/m, %0.<Vetype>, %3.<Vetype>
5019 1.1.1.3 mrg movprfx\t%0, %2\;<sve_fp_op>\t%0.<Vetype>, %1/m, %0.<Vetype>, %3.<Vetype>"
5020 1.1.1.3 mrg "&& !rtx_equal_p (operands[1], operands[4])"
5021 1.1.1.3 mrg {
5022 1.1.1.3 mrg operands[4] = copy_rtx (operands[1]);
5023 1.1.1.3 mrg }
5024 1.1.1.3 mrg [(set_attr "movprfx" "*,yes")]
5025 1.1.1.3 mrg )
5026 1.1.1.3 mrg
5027 1.1.1.3 mrg (define_insn "*cond_<optab><mode>_2_strict"
5028 1.1.1.3 mrg [(set (match_operand:SVE_FULL_F 0 "register_operand" "=w, ?&w")
5029 1.1.1.3 mrg (unspec:SVE_FULL_F
5030 1.1.1.3 mrg [(match_operand:<VPRED> 1 "register_operand" "Upl, Upl")
5031 1.1.1.3 mrg (unspec:SVE_FULL_F
5032 1.1.1.3 mrg [(match_dup 1)
5033 1.1.1.3 mrg (const_int SVE_STRICT_GP)
5034 1.1.1.3 mrg (match_operand:SVE_FULL_F 2 "register_operand" "0, w")
5035 1.1.1.3 mrg (match_operand:SVE_FULL_F 3 "register_operand" "w, w")]
5036 1.1.1.3 mrg SVE_COND_FP_BINARY)
5037 1.1.1.3 mrg (match_dup 2)]
5038 1.1.1.3 mrg UNSPEC_SEL))]
5039 1.1.1.3 mrg "TARGET_SVE"
5040 1.1.1.3 mrg "@
5041 1.1.1.3 mrg <sve_fp_op>\t%0.<Vetype>, %1/m, %0.<Vetype>, %3.<Vetype>
5042 1.1.1.3 mrg movprfx\t%0, %2\;<sve_fp_op>\t%0.<Vetype>, %1/m, %0.<Vetype>, %3.<Vetype>"
5043 1.1.1.3 mrg [(set_attr "movprfx" "*,yes")]
5044 1.1.1.3 mrg )
5045 1.1.1.3 mrg
5046 1.1.1.3 mrg ;; Same for operations that take a 1-bit constant.
5047 1.1.1.3 mrg (define_insn_and_rewrite "*cond_<optab><mode>_2_const_relaxed"
5048 1.1.1.3 mrg [(set (match_operand:SVE_FULL_F 0 "register_operand" "=w, ?w")
5049 1.1.1.3 mrg (unspec:SVE_FULL_F
5050 1.1.1.3 mrg [(match_operand:<VPRED> 1 "register_operand" "Upl, Upl")
5051 1.1.1.3 mrg (unspec:SVE_FULL_F
5052 1.1.1.3 mrg [(match_operand 4)
5053 1.1.1.3 mrg (const_int SVE_RELAXED_GP)
5054 1.1.1.3 mrg (match_operand:SVE_FULL_F 2 "register_operand" "0, w")
5055 1.1.1.3 mrg (match_operand:SVE_FULL_F 3 "<sve_pred_fp_rhs2_immediate>")]
5056 1.1.1.3 mrg SVE_COND_FP_BINARY_I1)
5057 1.1.1.3 mrg (match_dup 2)]
5058 1.1.1.3 mrg UNSPEC_SEL))]
5059 1.1.1.3 mrg "TARGET_SVE"
5060 1.1.1.3 mrg "@
5061 1.1.1.3 mrg <sve_fp_op>\t%0.<Vetype>, %1/m, %0.<Vetype>, #%3
5062 1.1.1.3 mrg movprfx\t%0, %2\;<sve_fp_op>\t%0.<Vetype>, %1/m, %0.<Vetype>, #%3"
5063 1.1.1.3 mrg "&& !rtx_equal_p (operands[1], operands[4])"
5064 1.1.1.3 mrg {
5065 1.1.1.3 mrg operands[4] = copy_rtx (operands[1]);
5066 1.1.1.3 mrg }
5067 1.1.1.3 mrg [(set_attr "movprfx" "*,yes")]
5068 1.1.1.3 mrg )
5069 1.1.1.3 mrg
5070 1.1.1.3 mrg (define_insn "*cond_<optab><mode>_2_const_strict"
5071 1.1.1.3 mrg [(set (match_operand:SVE_FULL_F 0 "register_operand" "=w, ?w")
5072 1.1.1.3 mrg (unspec:SVE_FULL_F
5073 1.1.1.3 mrg [(match_operand:<VPRED> 1 "register_operand" "Upl, Upl")
5074 1.1.1.3 mrg (unspec:SVE_FULL_F
5075 1.1.1.3 mrg [(match_dup 1)
5076 1.1.1.3 mrg (const_int SVE_STRICT_GP)
5077 1.1.1.3 mrg (match_operand:SVE_FULL_F 2 "register_operand" "0, w")
5078 1.1.1.3 mrg (match_operand:SVE_FULL_F 3 "<sve_pred_fp_rhs2_immediate>")]
5079 1.1.1.3 mrg SVE_COND_FP_BINARY_I1)
5080 1.1.1.3 mrg (match_dup 2)]
5081 1.1.1.3 mrg UNSPEC_SEL))]
5082 1.1.1.3 mrg "TARGET_SVE"
5083 1.1.1.3 mrg "@
5084 1.1.1.3 mrg <sve_fp_op>\t%0.<Vetype>, %1/m, %0.<Vetype>, #%3
5085 1.1.1.3 mrg movprfx\t%0, %2\;<sve_fp_op>\t%0.<Vetype>, %1/m, %0.<Vetype>, #%3"
5086 1.1.1.3 mrg [(set_attr "movprfx" "*,yes")]
5087 1.1.1.3 mrg )
5088 1.1.1.3 mrg
5089 1.1.1.3 mrg ;; Predicated floating-point operations, merging with the second input.
5090 1.1.1.3 mrg (define_insn_and_rewrite "*cond_<optab><mode>_3_relaxed"
5091 1.1.1.3 mrg [(set (match_operand:SVE_FULL_F 0 "register_operand" "=w, ?&w")
5092 1.1.1.3 mrg (unspec:SVE_FULL_F
5093 1.1.1.3 mrg [(match_operand:<VPRED> 1 "register_operand" "Upl, Upl")
5094 1.1.1.3 mrg (unspec:SVE_FULL_F
5095 1.1.1.3 mrg [(match_operand 4)
5096 1.1.1.3 mrg (const_int SVE_RELAXED_GP)
5097 1.1.1.3 mrg (match_operand:SVE_FULL_F 2 "register_operand" "w, w")
5098 1.1.1.3 mrg (match_operand:SVE_FULL_F 3 "register_operand" "0, w")]
5099 1.1.1.3 mrg SVE_COND_FP_BINARY)
5100 1.1.1.3 mrg (match_dup 3)]
5101 1.1.1.3 mrg UNSPEC_SEL))]
5102 1.1.1.3 mrg "TARGET_SVE"
5103 1.1.1.3 mrg "@
5104 1.1.1.3 mrg <sve_fp_op_rev>\t%0.<Vetype>, %1/m, %0.<Vetype>, %2.<Vetype>
5105 1.1.1.3 mrg movprfx\t%0, %3\;<sve_fp_op_rev>\t%0.<Vetype>, %1/m, %0.<Vetype>, %2.<Vetype>"
5106 1.1.1.3 mrg "&& !rtx_equal_p (operands[1], operands[4])"
5107 1.1.1.3 mrg {
5108 1.1.1.3 mrg operands[4] = copy_rtx (operands[1]);
5109 1.1.1.3 mrg }
5110 1.1.1.3 mrg [(set_attr "movprfx" "*,yes")]
5111 1.1.1.3 mrg )
5112 1.1.1.3 mrg
5113 1.1.1.3 mrg (define_insn "*cond_<optab><mode>_3_strict"
5114 1.1.1.3 mrg [(set (match_operand:SVE_FULL_F 0 "register_operand" "=w, ?&w")
5115 1.1.1.3 mrg (unspec:SVE_FULL_F
5116 1.1.1.3 mrg [(match_operand:<VPRED> 1 "register_operand" "Upl, Upl")
5117 1.1.1.3 mrg (unspec:SVE_FULL_F
5118 1.1.1.3 mrg [(match_dup 1)
5119 1.1.1.3 mrg (const_int SVE_STRICT_GP)
5120 1.1.1.3 mrg (match_operand:SVE_FULL_F 2 "register_operand" "w, w")
5121 1.1.1.3 mrg (match_operand:SVE_FULL_F 3 "register_operand" "0, w")]
5122 1.1.1.3 mrg SVE_COND_FP_BINARY)
5123 1.1.1.3 mrg (match_dup 3)]
5124 1.1.1.3 mrg UNSPEC_SEL))]
5125 1.1.1.3 mrg "TARGET_SVE"
5126 1.1.1.3 mrg "@
5127 1.1.1.3 mrg <sve_fp_op_rev>\t%0.<Vetype>, %1/m, %0.<Vetype>, %2.<Vetype>
5128 1.1.1.3 mrg movprfx\t%0, %3\;<sve_fp_op_rev>\t%0.<Vetype>, %1/m, %0.<Vetype>, %2.<Vetype>"
5129 1.1.1.3 mrg [(set_attr "movprfx" "*,yes")]
5130 1.1.1.3 mrg )
5131 1.1.1.3 mrg
5132 1.1.1.3 mrg ;; Predicated floating-point operations, merging with an independent value.
5133 1.1.1.3 mrg (define_insn_and_rewrite "*cond_<optab><mode>_any_relaxed"
5134 1.1.1.3 mrg [(set (match_operand:SVE_FULL_F 0 "register_operand" "=&w, &w, &w, &w, ?&w")
5135 1.1.1.3 mrg (unspec:SVE_FULL_F
5136 1.1.1.3 mrg [(match_operand:<VPRED> 1 "register_operand" "Upl, Upl, Upl, Upl, Upl")
5137 1.1.1.3 mrg (unspec:SVE_FULL_F
5138 1.1.1.3 mrg [(match_operand 5)
5139 1.1.1.3 mrg (const_int SVE_RELAXED_GP)
5140 1.1.1.3 mrg (match_operand:SVE_FULL_F 2 "register_operand" "0, w, w, w, w")
5141 1.1.1.3 mrg (match_operand:SVE_FULL_F 3 "register_operand" "w, 0, w, w, w")]
5142 1.1.1.3 mrg SVE_COND_FP_BINARY)
5143 1.1.1.3 mrg (match_operand:SVE_FULL_F 4 "aarch64_simd_reg_or_zero" "Dz, Dz, Dz, 0, w")]
5144 1.1.1.3 mrg UNSPEC_SEL))]
5145 1.1.1.3 mrg "TARGET_SVE
5146 1.1.1.3 mrg && !rtx_equal_p (operands[2], operands[4])
5147 1.1.1.3 mrg && !rtx_equal_p (operands[3], operands[4])"
5148 1.1.1.3 mrg "@
5149 1.1.1.3 mrg movprfx\t%0.<Vetype>, %1/z, %0.<Vetype>\;<sve_fp_op>\t%0.<Vetype>, %1/m, %0.<Vetype>, %3.<Vetype>
5150 1.1.1.3 mrg movprfx\t%0.<Vetype>, %1/z, %0.<Vetype>\;<sve_fp_op_rev>\t%0.<Vetype>, %1/m, %0.<Vetype>, %2.<Vetype>
5151 1.1.1.3 mrg movprfx\t%0.<Vetype>, %1/z, %2.<Vetype>\;<sve_fp_op>\t%0.<Vetype>, %1/m, %0.<Vetype>, %3.<Vetype>
5152 1.1.1.3 mrg movprfx\t%0.<Vetype>, %1/m, %2.<Vetype>\;<sve_fp_op>\t%0.<Vetype>, %1/m, %0.<Vetype>, %3.<Vetype>
5153 1.1.1.3 mrg #"
5154 1.1.1.3 mrg "&& 1"
5155 1.1.1.3 mrg {
5156 1.1.1.3 mrg if (reload_completed
5157 1.1.1.3 mrg && register_operand (operands[4], <MODE>mode)
5158 1.1.1.3 mrg && !rtx_equal_p (operands[0], operands[4]))
5159 1.1.1.3 mrg {
5160 1.1.1.3 mrg emit_insn (gen_vcond_mask_<mode><vpred> (operands[0], operands[2],
5161 1.1.1.3 mrg operands[4], operands[1]));
5162 1.1.1.3 mrg operands[4] = operands[2] = operands[0];
5163 1.1.1.3 mrg }
5164 1.1.1.3 mrg else if (!rtx_equal_p (operands[1], operands[5]))
5165 1.1.1.3 mrg operands[5] = copy_rtx (operands[1]);
5166 1.1.1.3 mrg else
5167 1.1.1.3 mrg FAIL;
5168 1.1.1.3 mrg }
5169 1.1.1.3 mrg [(set_attr "movprfx" "yes")]
5170 1.1.1.3 mrg )
5171 1.1.1.3 mrg
5172 1.1.1.3 mrg (define_insn_and_rewrite "*cond_<optab><mode>_any_strict"
5173 1.1.1.3 mrg [(set (match_operand:SVE_FULL_F 0 "register_operand" "=&w, &w, &w, &w, ?&w")
5174 1.1.1.3 mrg (unspec:SVE_FULL_F
5175 1.1.1.3 mrg [(match_operand:<VPRED> 1 "register_operand" "Upl, Upl, Upl, Upl, Upl")
5176 1.1.1.3 mrg (unspec:SVE_FULL_F
5177 1.1.1.3 mrg [(match_dup 1)
5178 1.1.1.3 mrg (const_int SVE_STRICT_GP)
5179 1.1.1.3 mrg (match_operand:SVE_FULL_F 2 "register_operand" "0, w, w, w, w")
5180 1.1.1.3 mrg (match_operand:SVE_FULL_F 3 "register_operand" "w, 0, w, w, w")]
5181 1.1.1.3 mrg SVE_COND_FP_BINARY)
5182 1.1.1.3 mrg (match_operand:SVE_FULL_F 4 "aarch64_simd_reg_or_zero" "Dz, Dz, Dz, 0, w")]
5183 1.1.1.3 mrg UNSPEC_SEL))]
5184 1.1.1.3 mrg "TARGET_SVE
5185 1.1.1.3 mrg && !rtx_equal_p (operands[2], operands[4])
5186 1.1.1.3 mrg && !rtx_equal_p (operands[3], operands[4])"
5187 1.1.1.3 mrg "@
5188 1.1.1.3 mrg movprfx\t%0.<Vetype>, %1/z, %0.<Vetype>\;<sve_fp_op>\t%0.<Vetype>, %1/m, %0.<Vetype>, %3.<Vetype>
5189 1.1.1.3 mrg movprfx\t%0.<Vetype>, %1/z, %0.<Vetype>\;<sve_fp_op_rev>\t%0.<Vetype>, %1/m, %0.<Vetype>, %2.<Vetype>
5190 1.1.1.3 mrg movprfx\t%0.<Vetype>, %1/z, %2.<Vetype>\;<sve_fp_op>\t%0.<Vetype>, %1/m, %0.<Vetype>, %3.<Vetype>
5191 1.1.1.3 mrg movprfx\t%0.<Vetype>, %1/m, %2.<Vetype>\;<sve_fp_op>\t%0.<Vetype>, %1/m, %0.<Vetype>, %3.<Vetype>
5192 1.1.1.3 mrg #"
5193 1.1.1.3 mrg "&& reload_completed
5194 1.1.1.3 mrg && register_operand (operands[4], <MODE>mode)
5195 1.1.1.3 mrg && !rtx_equal_p (operands[0], operands[4])"
5196 1.1.1.3 mrg {
5197 1.1.1.3 mrg emit_insn (gen_vcond_mask_<mode><vpred> (operands[0], operands[2],
5198 1.1.1.3 mrg operands[4], operands[1]));
5199 1.1.1.3 mrg operands[4] = operands[2] = operands[0];
5200 1.1.1.3 mrg }
5201 1.1.1.3 mrg [(set_attr "movprfx" "yes")]
5202 1.1.1.3 mrg )
5203 1.1.1.3 mrg
5204 1.1.1.3 mrg ;; Same for operations that take a 1-bit constant.
5205 1.1.1.3 mrg (define_insn_and_rewrite "*cond_<optab><mode>_any_const_relaxed"
5206 1.1.1.3 mrg [(set (match_operand:SVE_FULL_F 0 "register_operand" "=w, w, ?w")
5207 1.1.1.3 mrg (unspec:SVE_FULL_F
5208 1.1.1.3 mrg [(match_operand:<VPRED> 1 "register_operand" "Upl, Upl, Upl")
5209 1.1.1.3 mrg (unspec:SVE_FULL_F
5210 1.1.1.3 mrg [(match_operand 5)
5211 1.1.1.3 mrg (const_int SVE_RELAXED_GP)
5212 1.1.1.3 mrg (match_operand:SVE_FULL_F 2 "register_operand" "w, w, w")
5213 1.1.1.3 mrg (match_operand:SVE_FULL_F 3 "<sve_pred_fp_rhs2_immediate>")]
5214 1.1.1.3 mrg SVE_COND_FP_BINARY_I1)
5215 1.1.1.3 mrg (match_operand:SVE_FULL_F 4 "aarch64_simd_reg_or_zero" "Dz, 0, w")]
5216 1.1.1.3 mrg UNSPEC_SEL))]
5217 1.1.1.3 mrg "TARGET_SVE && !rtx_equal_p (operands[2], operands[4])"
5218 1.1.1.3 mrg "@
5219 1.1.1.3 mrg movprfx\t%0.<Vetype>, %1/z, %2.<Vetype>\;<sve_fp_op>\t%0.<Vetype>, %1/m, %0.<Vetype>, #%3
5220 1.1.1.3 mrg movprfx\t%0.<Vetype>, %1/m, %2.<Vetype>\;<sve_fp_op>\t%0.<Vetype>, %1/m, %0.<Vetype>, #%3
5221 1.1.1.3 mrg #"
5222 1.1.1.3 mrg "&& 1"
5223 1.1.1.3 mrg {
5224 1.1.1.3 mrg if (reload_completed
5225 1.1.1.3 mrg && register_operand (operands[4], <MODE>mode)
5226 1.1.1.3 mrg && !rtx_equal_p (operands[0], operands[4]))
5227 1.1.1.3 mrg {
5228 1.1.1.3 mrg emit_insn (gen_vcond_mask_<mode><vpred> (operands[0], operands[2],
5229 1.1.1.3 mrg operands[4], operands[1]));
5230 1.1.1.3 mrg operands[4] = operands[2] = operands[0];
5231 1.1.1.3 mrg }
5232 1.1.1.3 mrg else if (!rtx_equal_p (operands[1], operands[5]))
5233 1.1.1.3 mrg operands[5] = copy_rtx (operands[1]);
5234 1.1.1.3 mrg else
5235 1.1.1.3 mrg FAIL;
5236 1.1.1.3 mrg }
5237 1.1.1.3 mrg [(set_attr "movprfx" "yes")]
5238 1.1.1.3 mrg )
5239 1.1.1.3 mrg
5240 1.1.1.3 mrg (define_insn_and_rewrite "*cond_<optab><mode>_any_const_strict"
5241 1.1.1.3 mrg [(set (match_operand:SVE_FULL_F 0 "register_operand" "=w, w, ?w")
5242 1.1.1.3 mrg (unspec:SVE_FULL_F
5243 1.1.1.3 mrg [(match_operand:<VPRED> 1 "register_operand" "Upl, Upl, Upl")
5244 1.1.1.3 mrg (unspec:SVE_FULL_F
5245 1.1.1.3 mrg [(match_dup 1)
5246 1.1.1.3 mrg (const_int SVE_STRICT_GP)
5247 1.1.1.3 mrg (match_operand:SVE_FULL_F 2 "register_operand" "w, w, w")
5248 1.1.1.3 mrg (match_operand:SVE_FULL_F 3 "<sve_pred_fp_rhs2_immediate>")]
5249 1.1.1.3 mrg SVE_COND_FP_BINARY_I1)
5250 1.1.1.3 mrg (match_operand:SVE_FULL_F 4 "aarch64_simd_reg_or_zero" "Dz, 0, w")]
5251 1.1.1.3 mrg UNSPEC_SEL))]
5252 1.1.1.3 mrg "TARGET_SVE && !rtx_equal_p (operands[2], operands[4])"
5253 1.1.1.3 mrg "@
5254 1.1.1.3 mrg movprfx\t%0.<Vetype>, %1/z, %2.<Vetype>\;<sve_fp_op>\t%0.<Vetype>, %1/m, %0.<Vetype>, #%3
5255 1.1.1.3 mrg movprfx\t%0.<Vetype>, %1/m, %2.<Vetype>\;<sve_fp_op>\t%0.<Vetype>, %1/m, %0.<Vetype>, #%3
5256 1.1.1.3 mrg #"
5257 1.1.1.3 mrg "&& reload_completed
5258 1.1.1.3 mrg && register_operand (operands[4], <MODE>mode)
5259 1.1.1.3 mrg && !rtx_equal_p (operands[0], operands[4])"
5260 1.1.1.3 mrg {
5261 1.1.1.3 mrg emit_insn (gen_vcond_mask_<mode><vpred> (operands[0], operands[2],
5262 1.1.1.3 mrg operands[4], operands[1]));
5263 1.1.1.3 mrg operands[4] = operands[2] = operands[0];
5264 1.1.1.3 mrg }
5265 1.1.1.3 mrg [(set_attr "movprfx" "yes")]
5266 1.1.1.3 mrg )
5267 1.1.1.3 mrg
5268 1.1.1.3 mrg ;; -------------------------------------------------------------------------
5269 1.1.1.3 mrg ;; ---- [FP] Addition
5270 1.1.1.3 mrg ;; -------------------------------------------------------------------------
5271 1.1.1.3 mrg ;; Includes:
5272 1.1.1.3 mrg ;; - FADD
5273 1.1.1.3 mrg ;; - FSUB
5274 1.1.1.3 mrg ;; -------------------------------------------------------------------------
5275 1.1.1.3 mrg
5276 1.1.1.3 mrg ;; Predicated floating-point addition.
5277 1.1.1.3 mrg (define_insn_and_split "@aarch64_pred_<optab><mode>"
5278 1.1.1.3 mrg [(set (match_operand:SVE_FULL_F 0 "register_operand" "=w, w, w, w, ?&w, ?&w, ?&w")
5279 1.1.1.3 mrg (unspec:SVE_FULL_F
5280 1.1.1.3 mrg [(match_operand:<VPRED> 1 "register_operand" "Upl, Upl, Upl, Upl, Upl, Upl, Upl")
5281 1.1.1.3 mrg (match_operand:SI 4 "aarch64_sve_gp_strictness" "i, i, Z, Ui1, i, i, Ui1")
5282 1.1.1.3 mrg (match_operand:SVE_FULL_F 2 "register_operand" "%0, 0, w, 0, w, w, w")
5283 1.1.1.3 mrg (match_operand:SVE_FULL_F 3 "aarch64_sve_float_arith_with_sub_operand" "vsA, vsN, w, w, vsA, vsN, w")]
5284 1.1.1.3 mrg SVE_COND_FP_ADD))]
5285 1.1.1.3 mrg "TARGET_SVE"
5286 1.1.1.3 mrg "@
5287 1.1.1.3 mrg fadd\t%0.<Vetype>, %1/m, %0.<Vetype>, #%3
5288 1.1.1.3 mrg fsub\t%0.<Vetype>, %1/m, %0.<Vetype>, #%N3
5289 1.1.1.3 mrg #
5290 1.1.1.3 mrg fadd\t%0.<Vetype>, %1/m, %0.<Vetype>, %3.<Vetype>
5291 1.1.1.3 mrg movprfx\t%0, %2\;fadd\t%0.<Vetype>, %1/m, %0.<Vetype>, #%3
5292 1.1.1.3 mrg movprfx\t%0, %2\;fsub\t%0.<Vetype>, %1/m, %0.<Vetype>, #%N3
5293 1.1.1.3 mrg movprfx\t%0, %2\;fadd\t%0.<Vetype>, %1/m, %0.<Vetype>, %3.<Vetype>"
5294 1.1.1.3 mrg ; Split the unpredicated form after reload, so that we don't have
5295 1.1.1.3 mrg ; the unnecessary PTRUE.
5296 1.1.1.3 mrg "&& reload_completed
5297 1.1.1.3 mrg && register_operand (operands[3], <MODE>mode)
5298 1.1.1.3 mrg && INTVAL (operands[4]) == SVE_RELAXED_GP"
5299 1.1.1.3 mrg [(set (match_dup 0) (plus:SVE_FULL_F (match_dup 2) (match_dup 3)))]
5300 1.1.1.3 mrg ""
5301 1.1.1.3 mrg [(set_attr "movprfx" "*,*,*,*,yes,yes,yes")]
5302 1.1.1.3 mrg )
5303 1.1.1.3 mrg
5304 1.1.1.3 mrg ;; Predicated floating-point addition of a constant, merging with the
5305 1.1.1.3 mrg ;; first input.
5306 1.1.1.3 mrg (define_insn_and_rewrite "*cond_add<mode>_2_const_relaxed"
5307 1.1.1.3 mrg [(set (match_operand:SVE_FULL_F 0 "register_operand" "=w, w, ?w, ?w")
5308 1.1.1.3 mrg (unspec:SVE_FULL_F
5309 1.1.1.3 mrg [(match_operand:<VPRED> 1 "register_operand" "Upl, Upl, Upl, Upl")
5310 1.1.1.3 mrg (unspec:SVE_FULL_F
5311 1.1.1.3 mrg [(match_operand 4)
5312 1.1.1.3 mrg (const_int SVE_RELAXED_GP)
5313 1.1.1.3 mrg (match_operand:SVE_FULL_F 2 "register_operand" "0, 0, w, w")
5314 1.1.1.3 mrg (match_operand:SVE_FULL_F 3 "aarch64_sve_float_arith_with_sub_immediate" "vsA, vsN, vsA, vsN")]
5315 1.1.1.3 mrg UNSPEC_COND_FADD)
5316 1.1.1.3 mrg (match_dup 2)]
5317 1.1.1.3 mrg UNSPEC_SEL))]
5318 1.1.1.3 mrg "TARGET_SVE"
5319 1.1.1.3 mrg "@
5320 1.1.1.3 mrg fadd\t%0.<Vetype>, %1/m, %0.<Vetype>, #%3
5321 1.1.1.3 mrg fsub\t%0.<Vetype>, %1/m, %0.<Vetype>, #%N3
5322 1.1.1.3 mrg movprfx\t%0, %2\;fadd\t%0.<Vetype>, %1/m, %0.<Vetype>, #%3
5323 1.1.1.3 mrg movprfx\t%0, %2\;fsub\t%0.<Vetype>, %1/m, %0.<Vetype>, #%N3"
5324 1.1.1.3 mrg "&& !rtx_equal_p (operands[1], operands[4])"
5325 1.1.1.3 mrg {
5326 1.1.1.3 mrg operands[4] = copy_rtx (operands[1]);
5327 1.1.1.3 mrg }
5328 1.1.1.3 mrg [(set_attr "movprfx" "*,*,yes,yes")]
5329 1.1.1.3 mrg )
5330 1.1.1.3 mrg
5331 1.1.1.3 mrg (define_insn "*cond_add<mode>_2_const_strict"
5332 1.1.1.3 mrg [(set (match_operand:SVE_FULL_F 0 "register_operand" "=w, w, ?w, ?w")
5333 1.1.1.3 mrg (unspec:SVE_FULL_F
5334 1.1.1.3 mrg [(match_operand:<VPRED> 1 "register_operand" "Upl, Upl, Upl, Upl")
5335 1.1.1.3 mrg (unspec:SVE_FULL_F
5336 1.1.1.3 mrg [(match_dup 1)
5337 1.1.1.3 mrg (const_int SVE_STRICT_GP)
5338 1.1.1.3 mrg (match_operand:SVE_FULL_F 2 "register_operand" "0, 0, w, w")
5339 1.1.1.3 mrg (match_operand:SVE_FULL_F 3 "aarch64_sve_float_arith_with_sub_immediate" "vsA, vsN, vsA, vsN")]
5340 1.1.1.3 mrg UNSPEC_COND_FADD)
5341 1.1.1.3 mrg (match_dup 2)]
5342 1.1.1.3 mrg UNSPEC_SEL))]
5343 1.1.1.3 mrg "TARGET_SVE"
5344 1.1.1.3 mrg "@
5345 1.1.1.3 mrg fadd\t%0.<Vetype>, %1/m, %0.<Vetype>, #%3
5346 1.1.1.3 mrg fsub\t%0.<Vetype>, %1/m, %0.<Vetype>, #%N3
5347 1.1.1.3 mrg movprfx\t%0, %2\;fadd\t%0.<Vetype>, %1/m, %0.<Vetype>, #%3
5348 1.1.1.3 mrg movprfx\t%0, %2\;fsub\t%0.<Vetype>, %1/m, %0.<Vetype>, #%N3"
5349 1.1.1.3 mrg [(set_attr "movprfx" "*,*,yes,yes")]
5350 1.1.1.3 mrg )
5351 1.1.1.3 mrg
5352 1.1.1.3 mrg ;; Predicated floating-point addition of a constant, merging with an
5353 1.1.1.3 mrg ;; independent value.
5354 1.1.1.3 mrg (define_insn_and_rewrite "*cond_add<mode>_any_const_relaxed"
5355 1.1.1.3 mrg [(set (match_operand:SVE_FULL_F 0 "register_operand" "=w, w, w, w, ?w, ?w")
5356 1.1.1.3 mrg (unspec:SVE_FULL_F
5357 1.1.1.3 mrg [(match_operand:<VPRED> 1 "register_operand" "Upl, Upl, Upl, Upl, Upl, Upl")
5358 1.1.1.3 mrg (unspec:SVE_FULL_F
5359 1.1.1.3 mrg [(match_operand 5)
5360 1.1.1.3 mrg (const_int SVE_RELAXED_GP)
5361 1.1.1.3 mrg (match_operand:SVE_FULL_F 2 "register_operand" "w, w, w, w, w, w")
5362 1.1.1.3 mrg (match_operand:SVE_FULL_F 3 "aarch64_sve_float_arith_with_sub_immediate" "vsA, vsN, vsA, vsN, vsA, vsN")]
5363 1.1.1.3 mrg UNSPEC_COND_FADD)
5364 1.1.1.3 mrg (match_operand:SVE_FULL_F 4 "aarch64_simd_reg_or_zero" "Dz, Dz, 0, 0, w, w")]
5365 1.1.1.3 mrg UNSPEC_SEL))]
5366 1.1.1.3 mrg "TARGET_SVE && !rtx_equal_p (operands[2], operands[4])"
5367 1.1.1.3 mrg "@
5368 1.1.1.3 mrg movprfx\t%0.<Vetype>, %1/z, %2.<Vetype>\;fadd\t%0.<Vetype>, %1/m, %0.<Vetype>, #%3
5369 1.1.1.3 mrg movprfx\t%0.<Vetype>, %1/z, %2.<Vetype>\;fsub\t%0.<Vetype>, %1/m, %0.<Vetype>, #%N3
5370 1.1.1.3 mrg movprfx\t%0.<Vetype>, %1/m, %2.<Vetype>\;fadd\t%0.<Vetype>, %1/m, %0.<Vetype>, #%3
5371 1.1.1.3 mrg movprfx\t%0.<Vetype>, %1/m, %2.<Vetype>\;fsub\t%0.<Vetype>, %1/m, %0.<Vetype>, #%N3
5372 1.1.1.3 mrg #
5373 1.1.1.3 mrg #"
5374 1.1.1.3 mrg "&& 1"
5375 1.1.1.3 mrg {
5376 1.1.1.3 mrg if (reload_completed
5377 1.1.1.3 mrg && register_operand (operands[4], <MODE>mode)
5378 1.1.1.3 mrg && !rtx_equal_p (operands[0], operands[4]))
5379 1.1.1.3 mrg {
5380 1.1.1.3 mrg emit_insn (gen_vcond_mask_<mode><vpred> (operands[0], operands[2],
5381 1.1.1.3 mrg operands[4], operands[1]));
5382 1.1.1.3 mrg operands[4] = operands[2] = operands[0];
5383 1.1.1.3 mrg }
5384 1.1.1.3 mrg else if (!rtx_equal_p (operands[1], operands[5]))
5385 1.1.1.3 mrg operands[5] = copy_rtx (operands[1]);
5386 1.1.1.3 mrg else
5387 1.1.1.3 mrg FAIL;
5388 1.1.1.3 mrg }
5389 1.1.1.3 mrg [(set_attr "movprfx" "yes")]
5390 1.1.1.3 mrg )
5391 1.1.1.3 mrg
5392 1.1.1.3 mrg (define_insn_and_rewrite "*cond_add<mode>_any_const_strict"
5393 1.1.1.3 mrg [(set (match_operand:SVE_FULL_F 0 "register_operand" "=w, w, w, w, ?w, ?w")
5394 1.1.1.3 mrg (unspec:SVE_FULL_F
5395 1.1.1.3 mrg [(match_operand:<VPRED> 1 "register_operand" "Upl, Upl, Upl, Upl, Upl, Upl")
5396 1.1.1.3 mrg (unspec:SVE_FULL_F
5397 1.1.1.3 mrg [(match_dup 1)
5398 1.1.1.3 mrg (const_int SVE_STRICT_GP)
5399 1.1.1.3 mrg (match_operand:SVE_FULL_F 2 "register_operand" "w, w, w, w, w, w")
5400 1.1.1.3 mrg (match_operand:SVE_FULL_F 3 "aarch64_sve_float_arith_with_sub_immediate" "vsA, vsN, vsA, vsN, vsA, vsN")]
5401 1.1.1.3 mrg UNSPEC_COND_FADD)
5402 1.1.1.3 mrg (match_operand:SVE_FULL_F 4 "aarch64_simd_reg_or_zero" "Dz, Dz, 0, 0, w, w")]
5403 1.1.1.3 mrg UNSPEC_SEL))]
5404 1.1.1.3 mrg "TARGET_SVE && !rtx_equal_p (operands[2], operands[4])"
5405 1.1.1.3 mrg "@
5406 1.1.1.3 mrg movprfx\t%0.<Vetype>, %1/z, %2.<Vetype>\;fadd\t%0.<Vetype>, %1/m, %0.<Vetype>, #%3
5407 1.1.1.3 mrg movprfx\t%0.<Vetype>, %1/z, %2.<Vetype>\;fsub\t%0.<Vetype>, %1/m, %0.<Vetype>, #%N3
5408 1.1.1.3 mrg movprfx\t%0.<Vetype>, %1/m, %2.<Vetype>\;fadd\t%0.<Vetype>, %1/m, %0.<Vetype>, #%3
5409 1.1.1.3 mrg movprfx\t%0.<Vetype>, %1/m, %2.<Vetype>\;fsub\t%0.<Vetype>, %1/m, %0.<Vetype>, #%N3
5410 1.1.1.3 mrg #
5411 1.1.1.3 mrg #"
5412 1.1.1.3 mrg "&& reload_completed
5413 1.1.1.3 mrg && register_operand (operands[4], <MODE>mode)
5414 1.1.1.3 mrg && !rtx_equal_p (operands[0], operands[4])"
5415 1.1.1.3 mrg {
5416 1.1.1.3 mrg emit_insn (gen_vcond_mask_<mode><vpred> (operands[0], operands[2],
5417 1.1.1.3 mrg operands[4], operands[1]));
5418 1.1.1.3 mrg operands[4] = operands[2] = operands[0];
5419 1.1.1.3 mrg }
5420 1.1.1.3 mrg [(set_attr "movprfx" "yes")]
5421 1.1.1.3 mrg )
5422 1.1.1.3 mrg
5423 1.1.1.3 mrg ;; Register merging forms are handled through SVE_COND_FP_BINARY.
5424 1.1.1.3 mrg
5425 1.1.1.3 mrg ;; -------------------------------------------------------------------------
5426 1.1.1.3 mrg ;; ---- [FP] Complex addition
5427 1.1.1.3 mrg ;; -------------------------------------------------------------------------
5428 1.1.1.3 mrg ;; Includes:
5429 1.1.1.3 mrg ;; - FCADD
5430 1.1.1.3 mrg ;; -------------------------------------------------------------------------
5431 1.1.1.3 mrg
5432 1.1.1.3 mrg ;; Predicated FCADD.
5433 1.1.1.3 mrg (define_insn "@aarch64_pred_<optab><mode>"
5434 1.1.1.3 mrg [(set (match_operand:SVE_FULL_F 0 "register_operand" "=w, ?&w")
5435 1.1.1.3 mrg (unspec:SVE_FULL_F
5436 1.1.1.3 mrg [(match_operand:<VPRED> 1 "register_operand" "Upl, Upl")
5437 1.1.1.3 mrg (match_operand:SI 4 "aarch64_sve_gp_strictness")
5438 1.1.1.3 mrg (match_operand:SVE_FULL_F 2 "register_operand" "0, w")
5439 1.1.1.3 mrg (match_operand:SVE_FULL_F 3 "register_operand" "w, w")]
5440 1.1.1.3 mrg SVE_COND_FCADD))]
5441 1.1.1.3 mrg "TARGET_SVE"
5442 1.1.1.3 mrg "@
5443 1.1.1.3 mrg fcadd\t%0.<Vetype>, %1/m, %0.<Vetype>, %3.<Vetype>, #<rot>
5444 1.1.1.3 mrg movprfx\t%0, %2\;fcadd\t%0.<Vetype>, %1/m, %0.<Vetype>, %3.<Vetype>, #<rot>"
5445 1.1.1.3 mrg [(set_attr "movprfx" "*,yes")]
5446 1.1.1.3 mrg )
5447 1.1.1.3 mrg
5448 1.1.1.3 mrg ;; Predicated FCADD with merging.
5449 1.1.1.3 mrg (define_expand "@cond_<optab><mode>"
5450 1.1.1.3 mrg [(set (match_operand:SVE_FULL_F 0 "register_operand")
5451 1.1.1.3 mrg (unspec:SVE_FULL_F
5452 1.1.1.3 mrg [(match_operand:<VPRED> 1 "register_operand")
5453 1.1.1.3 mrg (unspec:SVE_FULL_F
5454 1.1.1.3 mrg [(match_dup 1)
5455 1.1.1.3 mrg (const_int SVE_STRICT_GP)
5456 1.1.1.3 mrg (match_operand:SVE_FULL_F 2 "register_operand")
5457 1.1.1.3 mrg (match_operand:SVE_FULL_F 3 "register_operand")]
5458 1.1.1.3 mrg SVE_COND_FCADD)
5459 1.1.1.3 mrg (match_operand:SVE_FULL_F 4 "aarch64_simd_reg_or_zero")]
5460 1.1.1.3 mrg UNSPEC_SEL))]
5461 1.1.1.3 mrg "TARGET_SVE"
5462 1.1.1.3 mrg )
5463 1.1.1.3 mrg
5464 1.1.1.3 mrg ;; Predicated FCADD, merging with the first input.
5465 1.1.1.3 mrg (define_insn_and_rewrite "*cond_<optab><mode>_2_relaxed"
5466 1.1.1.3 mrg [(set (match_operand:SVE_FULL_F 0 "register_operand" "=w, ?&w")
5467 1.1.1.3 mrg (unspec:SVE_FULL_F
5468 1.1.1.3 mrg [(match_operand:<VPRED> 1 "register_operand" "Upl, Upl")
5469 1.1.1.3 mrg (unspec:SVE_FULL_F
5470 1.1.1.3 mrg [(match_operand 4)
5471 1.1.1.3 mrg (const_int SVE_RELAXED_GP)
5472 1.1.1.3 mrg (match_operand:SVE_FULL_F 2 "register_operand" "0, w")
5473 1.1.1.3 mrg (match_operand:SVE_FULL_F 3 "register_operand" "w, w")]
5474 1.1.1.3 mrg SVE_COND_FCADD)
5475 1.1.1.3 mrg (match_dup 2)]
5476 1.1.1.3 mrg UNSPEC_SEL))]
5477 1.1.1.3 mrg "TARGET_SVE"
5478 1.1.1.3 mrg "@
5479 1.1.1.3 mrg fcadd\t%0.<Vetype>, %1/m, %0.<Vetype>, %3.<Vetype>, #<rot>
5480 1.1.1.3 mrg movprfx\t%0, %2\;fcadd\t%0.<Vetype>, %1/m, %0.<Vetype>, %3.<Vetype>, #<rot>"
5481 1.1.1.3 mrg "&& !rtx_equal_p (operands[1], operands[4])"
5482 1.1.1.3 mrg {
5483 1.1.1.3 mrg operands[4] = copy_rtx (operands[1]);
5484 1.1.1.3 mrg }
5485 1.1.1.3 mrg [(set_attr "movprfx" "*,yes")]
5486 1.1.1.3 mrg )
5487 1.1.1.3 mrg
5488 1.1.1.3 mrg (define_insn "*cond_<optab><mode>_2_strict"
5489 1.1.1.3 mrg [(set (match_operand:SVE_FULL_F 0 "register_operand" "=w, ?&w")
5490 1.1.1.3 mrg (unspec:SVE_FULL_F
5491 1.1.1.3 mrg [(match_operand:<VPRED> 1 "register_operand" "Upl, Upl")
5492 1.1.1.3 mrg (unspec:SVE_FULL_F
5493 1.1.1.3 mrg [(match_dup 1)
5494 1.1.1.3 mrg (const_int SVE_STRICT_GP)
5495 1.1.1.3 mrg (match_operand:SVE_FULL_F 2 "register_operand" "0, w")
5496 1.1.1.3 mrg (match_operand:SVE_FULL_F 3 "register_operand" "w, w")]
5497 1.1.1.3 mrg SVE_COND_FCADD)
5498 1.1.1.3 mrg (match_dup 2)]
5499 1.1.1.3 mrg UNSPEC_SEL))]
5500 1.1.1.3 mrg "TARGET_SVE"
5501 1.1.1.3 mrg "@
5502 1.1.1.3 mrg fcadd\t%0.<Vetype>, %1/m, %0.<Vetype>, %3.<Vetype>, #<rot>
5503 1.1.1.3 mrg movprfx\t%0, %2\;fcadd\t%0.<Vetype>, %1/m, %0.<Vetype>, %3.<Vetype>, #<rot>"
5504 1.1.1.3 mrg [(set_attr "movprfx" "*,yes")]
5505 1.1.1.3 mrg )
5506 1.1.1.3 mrg
5507 1.1.1.3 mrg ;; Predicated FCADD, merging with an independent value.
5508 1.1.1.3 mrg (define_insn_and_rewrite "*cond_<optab><mode>_any_relaxed"
5509 1.1.1.3 mrg [(set (match_operand:SVE_FULL_F 0 "register_operand" "=&w, &w, &w, ?&w")
5510 1.1.1.3 mrg (unspec:SVE_FULL_F
5511 1.1.1.3 mrg [(match_operand:<VPRED> 1 "register_operand" "Upl, Upl, Upl, Upl")
5512 1.1.1.3 mrg (unspec:SVE_FULL_F
5513 1.1.1.3 mrg [(match_operand 5)
5514 1.1.1.3 mrg (const_int SVE_RELAXED_GP)
5515 1.1.1.3 mrg (match_operand:SVE_FULL_F 2 "register_operand" "w, 0, w, w")
5516 1.1.1.3 mrg (match_operand:SVE_FULL_F 3 "register_operand" "w, w, w, w")]
5517 1.1.1.3 mrg SVE_COND_FCADD)
5518 1.1.1.3 mrg (match_operand:SVE_FULL_F 4 "aarch64_simd_reg_or_zero" "Dz, Dz, 0, w")]
5519 1.1.1.3 mrg UNSPEC_SEL))]
5520 1.1.1.3 mrg "TARGET_SVE && !rtx_equal_p (operands[2], operands[4])"
5521 1.1.1.3 mrg "@
5522 1.1.1.3 mrg movprfx\t%0.<Vetype>, %1/z, %2.<Vetype>\;fcadd\t%0.<Vetype>, %1/m, %0.<Vetype>, %3.<Vetype>, #<rot>
5523 1.1.1.3 mrg movprfx\t%0.<Vetype>, %1/z, %0.<Vetype>\;fcadd\t%0.<Vetype>, %1/m, %0.<Vetype>, %3.<Vetype>, #<rot>
5524 1.1.1.3 mrg movprfx\t%0.<Vetype>, %1/m, %2.<Vetype>\;fcadd\t%0.<Vetype>, %1/m, %0.<Vetype>, %3.<Vetype>, #<rot>
5525 1.1.1.3 mrg #"
5526 1.1.1.3 mrg "&& 1"
5527 1.1.1.3 mrg {
5528 1.1.1.3 mrg if (reload_completed
5529 1.1.1.3 mrg && register_operand (operands[4], <MODE>mode)
5530 1.1.1.3 mrg && !rtx_equal_p (operands[0], operands[4]))
5531 1.1.1.3 mrg {
5532 1.1.1.3 mrg emit_insn (gen_vcond_mask_<mode><vpred> (operands[0], operands[2],
5533 1.1.1.3 mrg operands[4], operands[1]));
5534 1.1.1.3 mrg operands[4] = operands[2] = operands[0];
5535 1.1.1.3 mrg }
5536 1.1.1.3 mrg else if (!rtx_equal_p (operands[1], operands[5]))
5537 1.1.1.3 mrg operands[5] = copy_rtx (operands[1]);
5538 1.1.1.3 mrg else
5539 1.1.1.3 mrg FAIL;
5540 1.1.1.3 mrg }
5541 1.1.1.3 mrg [(set_attr "movprfx" "yes")]
5542 1.1.1.3 mrg )
5543 1.1.1.3 mrg
5544 1.1.1.3 mrg (define_insn_and_rewrite "*cond_<optab><mode>_any_strict"
5545 1.1.1.3 mrg [(set (match_operand:SVE_FULL_F 0 "register_operand" "=&w, &w, &w, ?&w")
5546 1.1.1.3 mrg (unspec:SVE_FULL_F
5547 1.1.1.3 mrg [(match_operand:<VPRED> 1 "register_operand" "Upl, Upl, Upl, Upl")
5548 1.1.1.3 mrg (unspec:SVE_FULL_F
5549 1.1.1.3 mrg [(match_dup 1)
5550 1.1.1.3 mrg (const_int SVE_STRICT_GP)
5551 1.1.1.3 mrg (match_operand:SVE_FULL_F 2 "register_operand" "w, 0, w, w")
5552 1.1.1.3 mrg (match_operand:SVE_FULL_F 3 "register_operand" "w, w, w, w")]
5553 1.1.1.3 mrg SVE_COND_FCADD)
5554 1.1.1.3 mrg (match_operand:SVE_FULL_F 4 "aarch64_simd_reg_or_zero" "Dz, Dz, 0, w")]
5555 1.1.1.3 mrg UNSPEC_SEL))]
5556 1.1.1.3 mrg "TARGET_SVE && !rtx_equal_p (operands[2], operands[4])"
5557 1.1.1.3 mrg "@
5558 1.1.1.3 mrg movprfx\t%0.<Vetype>, %1/z, %2.<Vetype>\;fcadd\t%0.<Vetype>, %1/m, %0.<Vetype>, %3.<Vetype>, #<rot>
5559 1.1.1.3 mrg movprfx\t%0.<Vetype>, %1/z, %0.<Vetype>\;fcadd\t%0.<Vetype>, %1/m, %0.<Vetype>, %3.<Vetype>, #<rot>
5560 1.1.1.3 mrg movprfx\t%0.<Vetype>, %1/m, %2.<Vetype>\;fcadd\t%0.<Vetype>, %1/m, %0.<Vetype>, %3.<Vetype>, #<rot>
5561 1.1.1.3 mrg #"
5562 1.1.1.3 mrg "&& reload_completed
5563 1.1.1.3 mrg && register_operand (operands[4], <MODE>mode)
5564 1.1.1.3 mrg && !rtx_equal_p (operands[0], operands[4])"
5565 1.1.1.3 mrg {
5566 1.1.1.3 mrg emit_insn (gen_vcond_mask_<mode><vpred> (operands[0], operands[2],
5567 1.1.1.3 mrg operands[4], operands[1]));
5568 1.1.1.3 mrg operands[4] = operands[2] = operands[0];
5569 1.1.1.3 mrg }
5570 1.1.1.3 mrg [(set_attr "movprfx" "yes")]
5571 1.1.1.3 mrg )
5572 1.1.1.3 mrg
5573 1.1.1.3 mrg ;; -------------------------------------------------------------------------
5574 1.1.1.3 mrg ;; ---- [FP] Subtraction
5575 1.1.1.3 mrg ;; -------------------------------------------------------------------------
5576 1.1.1.3 mrg ;; Includes:
5577 1.1.1.3 mrg ;; - FSUB
5578 1.1.1.3 mrg ;; - FSUBR
5579 1.1.1.3 mrg ;; -------------------------------------------------------------------------
5580 1.1.1.3 mrg
5581 1.1.1.3 mrg ;; Predicated floating-point subtraction.
5582 1.1.1.3 mrg (define_insn_and_split "@aarch64_pred_<optab><mode>"
5583 1.1.1.3 mrg [(set (match_operand:SVE_FULL_F 0 "register_operand" "=w, w, w, w, ?&w, ?&w")
5584 1.1.1.3 mrg (unspec:SVE_FULL_F
5585 1.1.1.3 mrg [(match_operand:<VPRED> 1 "register_operand" "Upl, Upl, Upl, Upl, Upl, Upl")
5586 1.1.1.3 mrg (match_operand:SI 4 "aarch64_sve_gp_strictness" "i, Z, Ui1, Ui1, i, Ui1")
5587 1.1.1.3 mrg (match_operand:SVE_FULL_F 2 "aarch64_sve_float_arith_operand" "vsA, w, 0, w, vsA, w")
5588 1.1.1.3 mrg (match_operand:SVE_FULL_F 3 "register_operand" "0, w, w, 0, w, w")]
5589 1.1.1.3 mrg SVE_COND_FP_SUB))]
5590 1.1.1.3 mrg "TARGET_SVE"
5591 1.1.1.3 mrg "@
5592 1.1.1.3 mrg fsubr\t%0.<Vetype>, %1/m, %0.<Vetype>, #%2
5593 1.1.1.3 mrg #
5594 1.1.1.3 mrg fsub\t%0.<Vetype>, %1/m, %0.<Vetype>, %3.<Vetype>
5595 1.1.1.3 mrg fsubr\t%0.<Vetype>, %1/m, %0.<Vetype>, %2.<Vetype>
5596 1.1.1.3 mrg movprfx\t%0, %3\;fsubr\t%0.<Vetype>, %1/m, %0.<Vetype>, #%2
5597 1.1.1.3 mrg movprfx\t%0, %2\;fsub\t%0.<Vetype>, %1/m, %0.<Vetype>, %3.<Vetype>"
5598 1.1.1.3 mrg ; Split the unpredicated form after reload, so that we don't have
5599 1.1.1.3 mrg ; the unnecessary PTRUE.
5600 1.1.1.3 mrg "&& reload_completed
5601 1.1.1.3 mrg && register_operand (operands[2], <MODE>mode)
5602 1.1.1.3 mrg && INTVAL (operands[4]) == SVE_RELAXED_GP"
5603 1.1.1.3 mrg [(set (match_dup 0) (minus:SVE_FULL_F (match_dup 2) (match_dup 3)))]
5604 1.1.1.3 mrg ""
5605 1.1.1.3 mrg [(set_attr "movprfx" "*,*,*,*,yes,yes")]
5606 1.1.1.3 mrg )
5607 1.1.1.3 mrg
5608 1.1.1.3 mrg ;; Predicated floating-point subtraction from a constant, merging with the
5609 1.1.1.3 mrg ;; second input.
5610 1.1.1.3 mrg (define_insn_and_rewrite "*cond_sub<mode>_3_const_relaxed"
5611 1.1.1.3 mrg [(set (match_operand:SVE_FULL_F 0 "register_operand" "=w, ?w")
5612 1.1.1.3 mrg (unspec:SVE_FULL_F
5613 1.1.1.3 mrg [(match_operand:<VPRED> 1 "register_operand" "Upl, Upl")
5614 1.1.1.3 mrg (unspec:SVE_FULL_F
5615 1.1.1.3 mrg [(match_operand 4)
5616 1.1.1.3 mrg (const_int SVE_RELAXED_GP)
5617 1.1.1.3 mrg (match_operand:SVE_FULL_F 2 "aarch64_sve_float_arith_immediate")
5618 1.1.1.3 mrg (match_operand:SVE_FULL_F 3 "register_operand" "0, w")]
5619 1.1.1.3 mrg UNSPEC_COND_FSUB)
5620 1.1.1.3 mrg (match_dup 3)]
5621 1.1.1.3 mrg UNSPEC_SEL))]
5622 1.1.1.3 mrg "TARGET_SVE"
5623 1.1.1.3 mrg "@
5624 1.1.1.3 mrg fsubr\t%0.<Vetype>, %1/m, %0.<Vetype>, #%2
5625 1.1.1.3 mrg movprfx\t%0, %3\;fsubr\t%0.<Vetype>, %1/m, %0.<Vetype>, #%2"
5626 1.1.1.3 mrg "&& !rtx_equal_p (operands[1], operands[4])"
5627 1.1.1.3 mrg {
5628 1.1.1.3 mrg operands[4] = copy_rtx (operands[1]);
5629 1.1.1.3 mrg }
5630 1.1.1.3 mrg [(set_attr "movprfx" "*,yes")]
5631 1.1.1.3 mrg )
5632 1.1.1.3 mrg
5633 1.1.1.3 mrg (define_insn "*cond_sub<mode>_3_const_strict"
5634 1.1.1.3 mrg [(set (match_operand:SVE_FULL_F 0 "register_operand" "=w, ?w")
5635 1.1.1.3 mrg (unspec:SVE_FULL_F
5636 1.1.1.3 mrg [(match_operand:<VPRED> 1 "register_operand" "Upl, Upl")
5637 1.1.1.3 mrg (unspec:SVE_FULL_F
5638 1.1.1.3 mrg [(match_dup 1)
5639 1.1.1.3 mrg (const_int SVE_STRICT_GP)
5640 1.1.1.3 mrg (match_operand:SVE_FULL_F 2 "aarch64_sve_float_arith_immediate")
5641 1.1.1.3 mrg (match_operand:SVE_FULL_F 3 "register_operand" "0, w")]
5642 1.1.1.3 mrg UNSPEC_COND_FSUB)
5643 1.1.1.3 mrg (match_dup 3)]
5644 1.1.1.3 mrg UNSPEC_SEL))]
5645 1.1.1.3 mrg "TARGET_SVE"
5646 1.1.1.3 mrg "@
5647 1.1.1.3 mrg fsubr\t%0.<Vetype>, %1/m, %0.<Vetype>, #%2
5648 1.1.1.3 mrg movprfx\t%0, %3\;fsubr\t%0.<Vetype>, %1/m, %0.<Vetype>, #%2"
5649 1.1.1.3 mrg [(set_attr "movprfx" "*,yes")]
5650 1.1.1.3 mrg )
5651 1.1.1.3 mrg
5652 1.1.1.3 mrg ;; Predicated floating-point subtraction from a constant, merging with an
5653 1.1.1.3 mrg ;; independent value.
5654 1.1.1.3 mrg (define_insn_and_rewrite "*cond_sub<mode>_const_relaxed"
5655 1.1.1.3 mrg [(set (match_operand:SVE_FULL_F 0 "register_operand" "=w, w, ?w")
5656 1.1.1.3 mrg (unspec:SVE_FULL_F
5657 1.1.1.3 mrg [(match_operand:<VPRED> 1 "register_operand" "Upl, Upl, Upl")
5658 1.1.1.3 mrg (unspec:SVE_FULL_F
5659 1.1.1.3 mrg [(match_operand 5)
5660 1.1.1.3 mrg (const_int SVE_RELAXED_GP)
5661 1.1.1.3 mrg (match_operand:SVE_FULL_F 2 "aarch64_sve_float_arith_immediate")
5662 1.1.1.3 mrg (match_operand:SVE_FULL_F 3 "register_operand" "w, w, w")]
5663 1.1.1.3 mrg UNSPEC_COND_FSUB)
5664 1.1.1.3 mrg (match_operand:SVE_FULL_F 4 "aarch64_simd_reg_or_zero" "Dz, 0, w")]
5665 1.1.1.3 mrg UNSPEC_SEL))]
5666 1.1.1.3 mrg "TARGET_SVE && !rtx_equal_p (operands[3], operands[4])"
5667 1.1.1.3 mrg "@
5668 1.1.1.3 mrg movprfx\t%0.<Vetype>, %1/z, %3.<Vetype>\;fsubr\t%0.<Vetype>, %1/m, %0.<Vetype>, #%2
5669 1.1.1.3 mrg movprfx\t%0.<Vetype>, %1/m, %3.<Vetype>\;fsubr\t%0.<Vetype>, %1/m, %0.<Vetype>, #%2
5670 1.1.1.3 mrg #"
5671 1.1.1.3 mrg "&& 1"
5672 1.1.1.3 mrg {
5673 1.1.1.3 mrg if (reload_completed
5674 1.1.1.3 mrg && register_operand (operands[4], <MODE>mode)
5675 1.1.1.3 mrg && !rtx_equal_p (operands[0], operands[4]))
5676 1.1.1.3 mrg {
5677 1.1.1.3 mrg emit_insn (gen_vcond_mask_<mode><vpred> (operands[0], operands[3],
5678 1.1.1.3 mrg operands[4], operands[1]));
5679 1.1.1.3 mrg operands[4] = operands[3] = operands[0];
5680 1.1.1.3 mrg }
5681 1.1.1.3 mrg else if (!rtx_equal_p (operands[1], operands[5]))
5682 1.1.1.3 mrg operands[5] = copy_rtx (operands[1]);
5683 1.1.1.3 mrg else
5684 1.1.1.3 mrg FAIL;
5685 1.1.1.3 mrg }
5686 1.1.1.3 mrg [(set_attr "movprfx" "yes")]
5687 1.1.1.3 mrg )
5688 1.1.1.3 mrg
5689 1.1.1.3 mrg (define_insn_and_rewrite "*cond_sub<mode>_const_strict"
5690 1.1.1.3 mrg [(set (match_operand:SVE_FULL_F 0 "register_operand" "=w, w, ?w")
5691 1.1.1.3 mrg (unspec:SVE_FULL_F
5692 1.1.1.3 mrg [(match_operand:<VPRED> 1 "register_operand" "Upl, Upl, Upl")
5693 1.1.1.3 mrg (unspec:SVE_FULL_F
5694 1.1.1.3 mrg [(match_dup 1)
5695 1.1.1.3 mrg (const_int SVE_STRICT_GP)
5696 1.1.1.3 mrg (match_operand:SVE_FULL_F 2 "aarch64_sve_float_arith_immediate")
5697 1.1.1.3 mrg (match_operand:SVE_FULL_F 3 "register_operand" "w, w, w")]
5698 1.1.1.3 mrg UNSPEC_COND_FSUB)
5699 1.1.1.3 mrg (match_operand:SVE_FULL_F 4 "aarch64_simd_reg_or_zero" "Dz, 0, w")]
5700 1.1.1.3 mrg UNSPEC_SEL))]
5701 1.1.1.3 mrg "TARGET_SVE && !rtx_equal_p (operands[3], operands[4])"
5702 1.1.1.3 mrg "@
5703 1.1.1.3 mrg movprfx\t%0.<Vetype>, %1/z, %3.<Vetype>\;fsubr\t%0.<Vetype>, %1/m, %0.<Vetype>, #%2
5704 1.1.1.3 mrg movprfx\t%0.<Vetype>, %1/m, %3.<Vetype>\;fsubr\t%0.<Vetype>, %1/m, %0.<Vetype>, #%2
5705 1.1.1.3 mrg #"
5706 1.1.1.3 mrg "&& reload_completed
5707 1.1.1.3 mrg && register_operand (operands[4], <MODE>mode)
5708 1.1.1.3 mrg && !rtx_equal_p (operands[0], operands[4])"
5709 1.1.1.3 mrg {
5710 1.1.1.3 mrg emit_insn (gen_vcond_mask_<mode><vpred> (operands[0], operands[3],
5711 1.1.1.3 mrg operands[4], operands[1]));
5712 1.1.1.3 mrg operands[4] = operands[3] = operands[0];
5713 1.1.1.3 mrg }
5714 1.1.1.3 mrg [(set_attr "movprfx" "yes")]
5715 1.1.1.3 mrg )
5716 1.1.1.3 mrg ;; Register merging forms are handled through SVE_COND_FP_BINARY.
5717 1.1.1.3 mrg
5718 1.1.1.3 mrg ;; -------------------------------------------------------------------------
5719 1.1.1.3 mrg ;; ---- [FP] Absolute difference
5720 1.1.1.3 mrg ;; -------------------------------------------------------------------------
5721 1.1.1.3 mrg ;; Includes:
5722 1.1.1.3 mrg ;; - FABD
5723 1.1.1.3 mrg ;; -------------------------------------------------------------------------
5724 1.1.1.3 mrg
5725 1.1.1.3 mrg ;; Predicated floating-point absolute difference.
5726 1.1.1.3 mrg (define_expand "@aarch64_pred_abd<mode>"
5727 1.1.1.3 mrg [(set (match_operand:SVE_FULL_F 0 "register_operand")
5728 1.1.1.3 mrg (unspec:SVE_FULL_F
5729 1.1.1.3 mrg [(match_operand:<VPRED> 1 "register_operand")
5730 1.1.1.3 mrg (match_operand:SI 4 "aarch64_sve_gp_strictness")
5731 1.1.1.3 mrg (unspec:SVE_FULL_F
5732 1.1.1.3 mrg [(match_dup 1)
5733 1.1.1.3 mrg (match_dup 4)
5734 1.1.1.3 mrg (match_operand:SVE_FULL_F 2 "register_operand")
5735 1.1.1.3 mrg (match_operand:SVE_FULL_F 3 "register_operand")]
5736 1.1.1.3 mrg UNSPEC_COND_FSUB)]
5737 1.1.1.3 mrg UNSPEC_COND_FABS))]
5738 1.1.1.3 mrg "TARGET_SVE"
5739 1.1.1.3 mrg )
5740 1.1.1.3 mrg
5741 1.1.1.3 mrg ;; Predicated floating-point absolute difference.
5742 1.1.1.3 mrg (define_insn_and_rewrite "*aarch64_pred_abd<mode>_relaxed"
5743 1.1.1.3 mrg [(set (match_operand:SVE_FULL_F 0 "register_operand" "=w, ?&w")
5744 1.1.1.3 mrg (unspec:SVE_FULL_F
5745 1.1.1.3 mrg [(match_operand:<VPRED> 1 "register_operand" "Upl, Upl")
5746 1.1.1.3 mrg (match_operand:SI 4 "aarch64_sve_gp_strictness")
5747 1.1.1.3 mrg (unspec:SVE_FULL_F
5748 1.1.1.3 mrg [(match_operand 5)
5749 1.1.1.3 mrg (const_int SVE_RELAXED_GP)
5750 1.1.1.3 mrg (match_operand:SVE_FULL_F 2 "register_operand" "%0, w")
5751 1.1.1.3 mrg (match_operand:SVE_FULL_F 3 "register_operand" "w, w")]
5752 1.1.1.3 mrg UNSPEC_COND_FSUB)]
5753 1.1.1.3 mrg UNSPEC_COND_FABS))]
5754 1.1.1.3 mrg "TARGET_SVE"
5755 1.1.1.3 mrg "@
5756 1.1.1.3 mrg fabd\t%0.<Vetype>, %1/m, %0.<Vetype>, %3.<Vetype>
5757 1.1.1.3 mrg movprfx\t%0, %2\;fabd\t%0.<Vetype>, %1/m, %0.<Vetype>, %3.<Vetype>"
5758 1.1.1.3 mrg "&& !rtx_equal_p (operands[1], operands[5])"
5759 1.1.1.3 mrg {
5760 1.1.1.3 mrg operands[5] = copy_rtx (operands[1]);
5761 1.1.1.3 mrg }
5762 1.1.1.3 mrg [(set_attr "movprfx" "*,yes")]
5763 1.1.1.3 mrg )
5764 1.1.1.3 mrg
5765 1.1.1.3 mrg (define_insn "*aarch64_pred_abd<mode>_strict"
5766 1.1.1.3 mrg [(set (match_operand:SVE_FULL_F 0 "register_operand" "=w, ?&w")
5767 1.1.1.3 mrg (unspec:SVE_FULL_F
5768 1.1.1.3 mrg [(match_operand:<VPRED> 1 "register_operand" "Upl, Upl")
5769 1.1.1.3 mrg (match_operand:SI 4 "aarch64_sve_gp_strictness")
5770 1.1.1.3 mrg (unspec:SVE_FULL_F
5771 1.1.1.3 mrg [(match_dup 1)
5772 1.1.1.3 mrg (const_int SVE_STRICT_GP)
5773 1.1.1.3 mrg (match_operand:SVE_FULL_F 2 "register_operand" "%0, w")
5774 1.1.1.3 mrg (match_operand:SVE_FULL_F 3 "register_operand" "w, w")]
5775 1.1.1.3 mrg UNSPEC_COND_FSUB)]
5776 1.1.1.3 mrg UNSPEC_COND_FABS))]
5777 1.1.1.3 mrg "TARGET_SVE"
5778 1.1.1.3 mrg "@
5779 1.1.1.3 mrg fabd\t%0.<Vetype>, %1/m, %0.<Vetype>, %3.<Vetype>
5780 1.1.1.3 mrg movprfx\t%0, %2\;fabd\t%0.<Vetype>, %1/m, %0.<Vetype>, %3.<Vetype>"
5781 1.1.1.3 mrg [(set_attr "movprfx" "*,yes")]
5782 1.1.1.3 mrg )
5783 1.1.1.3 mrg
5784 1.1.1.3 mrg (define_expand "@aarch64_cond_abd<mode>"
5785 1.1.1.3 mrg [(set (match_operand:SVE_FULL_F 0 "register_operand")
5786 1.1.1.3 mrg (unspec:SVE_FULL_F
5787 1.1.1.3 mrg [(match_operand:<VPRED> 1 "register_operand")
5788 1.1.1.3 mrg (unspec:SVE_FULL_F
5789 1.1.1.3 mrg [(match_dup 1)
5790 1.1.1.3 mrg (const_int SVE_STRICT_GP)
5791 1.1.1.3 mrg (unspec:SVE_FULL_F
5792 1.1.1.3 mrg [(match_dup 1)
5793 1.1.1.3 mrg (const_int SVE_STRICT_GP)
5794 1.1.1.3 mrg (match_operand:SVE_FULL_F 2 "register_operand")
5795 1.1.1.3 mrg (match_operand:SVE_FULL_F 3 "register_operand")]
5796 1.1.1.3 mrg UNSPEC_COND_FSUB)]
5797 1.1.1.3 mrg UNSPEC_COND_FABS)
5798 1.1.1.3 mrg (match_operand:SVE_FULL_F 4 "aarch64_simd_reg_or_zero")]
5799 1.1.1.3 mrg UNSPEC_SEL))]
5800 1.1.1.3 mrg "TARGET_SVE"
5801 1.1.1.3 mrg {
5802 1.1.1.3 mrg if (rtx_equal_p (operands[3], operands[4]))
5803 1.1.1.3 mrg std::swap (operands[2], operands[3]);
5804 1.1.1.3 mrg })
5805 1.1.1.3 mrg
5806 1.1.1.3 mrg ;; Predicated floating-point absolute difference, merging with the first
5807 1.1.1.3 mrg ;; input.
5808 1.1.1.3 mrg (define_insn_and_rewrite "*aarch64_cond_abd<mode>_2_relaxed"
5809 1.1.1.3 mrg [(set (match_operand:SVE_FULL_F 0 "register_operand" "=w, ?&w")
5810 1.1.1.3 mrg (unspec:SVE_FULL_F
5811 1.1.1.3 mrg [(match_operand:<VPRED> 1 "register_operand" "Upl, Upl")
5812 1.1.1.3 mrg (unspec:SVE_FULL_F
5813 1.1.1.3 mrg [(match_operand 4)
5814 1.1.1.3 mrg (const_int SVE_RELAXED_GP)
5815 1.1.1.3 mrg (unspec:SVE_FULL_F
5816 1.1.1.3 mrg [(match_operand 5)
5817 1.1.1.3 mrg (const_int SVE_RELAXED_GP)
5818 1.1.1.3 mrg (match_operand:SVE_FULL_F 2 "register_operand" "0, w")
5819 1.1.1.3 mrg (match_operand:SVE_FULL_F 3 "register_operand" "w, w")]
5820 1.1.1.3 mrg UNSPEC_COND_FSUB)]
5821 1.1.1.3 mrg UNSPEC_COND_FABS)
5822 1.1.1.3 mrg (match_dup 2)]
5823 1.1.1.3 mrg UNSPEC_SEL))]
5824 1.1.1.3 mrg "TARGET_SVE"
5825 1.1.1.3 mrg "@
5826 1.1.1.3 mrg fabd\t%0.<Vetype>, %1/m, %0.<Vetype>, %3.<Vetype>
5827 1.1.1.3 mrg movprfx\t%0, %2\;fabd\t%0.<Vetype>, %1/m, %0.<Vetype>, %3.<Vetype>"
5828 1.1.1.3 mrg "&& (!rtx_equal_p (operands[1], operands[4])
5829 1.1.1.3 mrg || !rtx_equal_p (operands[1], operands[5]))"
5830 1.1.1.3 mrg {
5831 1.1.1.3 mrg operands[4] = copy_rtx (operands[1]);
5832 1.1.1.3 mrg operands[5] = copy_rtx (operands[1]);
5833 1.1.1.3 mrg }
5834 1.1.1.3 mrg [(set_attr "movprfx" "*,yes")]
5835 1.1.1.3 mrg )
5836 1.1.1.3 mrg
5837 1.1.1.3 mrg (define_insn "*aarch64_cond_abd<mode>_2_strict"
5838 1.1.1.3 mrg [(set (match_operand:SVE_FULL_F 0 "register_operand" "=w, ?&w")
5839 1.1.1.3 mrg (unspec:SVE_FULL_F
5840 1.1.1.3 mrg [(match_operand:<VPRED> 1 "register_operand" "Upl, Upl")
5841 1.1.1.3 mrg (unspec:SVE_FULL_F
5842 1.1.1.3 mrg [(match_dup 1)
5843 1.1.1.3 mrg (match_operand:SI 4 "aarch64_sve_gp_strictness")
5844 1.1.1.3 mrg (unspec:SVE_FULL_F
5845 1.1.1.3 mrg [(match_dup 1)
5846 1.1.1.3 mrg (match_operand:SI 5 "aarch64_sve_gp_strictness")
5847 1.1.1.3 mrg (match_operand:SVE_FULL_F 2 "register_operand" "0, w")
5848 1.1.1.3 mrg (match_operand:SVE_FULL_F 3 "register_operand" "w, w")]
5849 1.1.1.3 mrg UNSPEC_COND_FSUB)]
5850 1.1.1.3 mrg UNSPEC_COND_FABS)
5851 1.1.1.3 mrg (match_dup 2)]
5852 1.1.1.3 mrg UNSPEC_SEL))]
5853 1.1.1.3 mrg "TARGET_SVE"
5854 1.1.1.3 mrg "@
5855 1.1.1.3 mrg fabd\t%0.<Vetype>, %1/m, %0.<Vetype>, %3.<Vetype>
5856 1.1.1.3 mrg movprfx\t%0, %2\;fabd\t%0.<Vetype>, %1/m, %0.<Vetype>, %3.<Vetype>"
5857 1.1.1.3 mrg [(set_attr "movprfx" "*,yes")]
5858 1.1.1.3 mrg )
5859 1.1.1.3 mrg
5860 1.1.1.3 mrg ;; Predicated floating-point absolute difference, merging with the second
5861 1.1.1.3 mrg ;; input.
5862 1.1.1.3 mrg (define_insn_and_rewrite "*aarch64_cond_abd<mode>_3_relaxed"
5863 1.1.1.3 mrg [(set (match_operand:SVE_FULL_F 0 "register_operand" "=w, ?&w")
5864 1.1.1.3 mrg (unspec:SVE_FULL_F
5865 1.1.1.3 mrg [(match_operand:<VPRED> 1 "register_operand" "Upl, Upl")
5866 1.1.1.3 mrg (unspec:SVE_FULL_F
5867 1.1.1.3 mrg [(match_operand 4)
5868 1.1.1.3 mrg (const_int SVE_RELAXED_GP)
5869 1.1.1.3 mrg (unspec:SVE_FULL_F
5870 1.1.1.3 mrg [(match_operand 5)
5871 1.1.1.3 mrg (const_int SVE_RELAXED_GP)
5872 1.1.1.3 mrg (match_operand:SVE_FULL_F 2 "register_operand" "w, w")
5873 1.1.1.3 mrg (match_operand:SVE_FULL_F 3 "register_operand" "0, w")]
5874 1.1.1.3 mrg UNSPEC_COND_FSUB)]
5875 1.1.1.3 mrg UNSPEC_COND_FABS)
5876 1.1.1.3 mrg (match_dup 3)]
5877 1.1.1.3 mrg UNSPEC_SEL))]
5878 1.1.1.3 mrg "TARGET_SVE"
5879 1.1.1.3 mrg "@
5880 1.1.1.3 mrg fabd\t%0.<Vetype>, %1/m, %0.<Vetype>, %2.<Vetype>
5881 1.1.1.3 mrg movprfx\t%0, %3\;fabd\t%0.<Vetype>, %1/m, %0.<Vetype>, %2.<Vetype>"
5882 1.1.1.3 mrg "&& (!rtx_equal_p (operands[1], operands[4])
5883 1.1.1.3 mrg || !rtx_equal_p (operands[1], operands[5]))"
5884 1.1.1.3 mrg {
5885 1.1.1.3 mrg operands[4] = copy_rtx (operands[1]);
5886 1.1.1.3 mrg operands[5] = copy_rtx (operands[1]);
5887 1.1.1.3 mrg }
5888 1.1.1.3 mrg [(set_attr "movprfx" "*,yes")]
5889 1.1.1.3 mrg )
5890 1.1.1.3 mrg
5891 1.1.1.3 mrg (define_insn "*aarch64_cond_abd<mode>_3_strict"
5892 1.1.1.3 mrg [(set (match_operand:SVE_FULL_F 0 "register_operand" "=w, ?&w")
5893 1.1.1.3 mrg (unspec:SVE_FULL_F
5894 1.1.1.3 mrg [(match_operand:<VPRED> 1 "register_operand" "Upl, Upl")
5895 1.1.1.3 mrg (unspec:SVE_FULL_F
5896 1.1.1.3 mrg [(match_dup 1)
5897 1.1.1.3 mrg (match_operand:SI 4 "aarch64_sve_gp_strictness")
5898 1.1.1.3 mrg (unspec:SVE_FULL_F
5899 1.1.1.3 mrg [(match_dup 1)
5900 1.1.1.3 mrg (match_operand:SI 5 "aarch64_sve_gp_strictness")
5901 1.1.1.3 mrg (match_operand:SVE_FULL_F 2 "register_operand" "w, w")
5902 1.1.1.3 mrg (match_operand:SVE_FULL_F 3 "register_operand" "0, w")]
5903 1.1.1.3 mrg UNSPEC_COND_FSUB)]
5904 1.1.1.3 mrg UNSPEC_COND_FABS)
5905 1.1.1.3 mrg (match_dup 3)]
5906 1.1.1.3 mrg UNSPEC_SEL))]
5907 1.1.1.3 mrg "TARGET_SVE"
5908 1.1.1.3 mrg "@
5909 1.1.1.3 mrg fabd\t%0.<Vetype>, %1/m, %0.<Vetype>, %2.<Vetype>
5910 1.1.1.3 mrg movprfx\t%0, %3\;fabd\t%0.<Vetype>, %1/m, %0.<Vetype>, %2.<Vetype>"
5911 1.1.1.3 mrg [(set_attr "movprfx" "*,yes")]
5912 1.1.1.3 mrg )
5913 1.1.1.3 mrg
5914 1.1.1.3 mrg ;; Predicated floating-point absolute difference, merging with an
5915 1.1.1.3 mrg ;; independent value.
5916 1.1.1.3 mrg (define_insn_and_rewrite "*aarch64_cond_abd<mode>_any_relaxed"
5917 1.1.1.3 mrg [(set (match_operand:SVE_FULL_F 0 "register_operand" "=&w, &w, &w, &w, ?&w")
5918 1.1.1.3 mrg (unspec:SVE_FULL_F
5919 1.1.1.3 mrg [(match_operand:<VPRED> 1 "register_operand" "Upl, Upl, Upl, Upl, Upl")
5920 1.1.1.3 mrg (unspec:SVE_FULL_F
5921 1.1.1.3 mrg [(match_operand 5)
5922 1.1.1.3 mrg (const_int SVE_RELAXED_GP)
5923 1.1.1.3 mrg (unspec:SVE_FULL_F
5924 1.1.1.3 mrg [(match_operand 6)
5925 1.1.1.3 mrg (const_int SVE_RELAXED_GP)
5926 1.1.1.3 mrg (match_operand:SVE_FULL_F 2 "register_operand" "0, w, w, w, w")
5927 1.1.1.3 mrg (match_operand:SVE_FULL_F 3 "register_operand" "w, 0, w, w, w")]
5928 1.1.1.3 mrg UNSPEC_COND_FSUB)]
5929 1.1.1.3 mrg UNSPEC_COND_FABS)
5930 1.1.1.3 mrg (match_operand:SVE_FULL_F 4 "aarch64_simd_reg_or_zero" "Dz, Dz, Dz, 0, w")]
5931 1.1.1.3 mrg UNSPEC_SEL))]
5932 1.1.1.3 mrg "TARGET_SVE
5933 1.1.1.3 mrg && !rtx_equal_p (operands[2], operands[4])
5934 1.1.1.3 mrg && !rtx_equal_p (operands[3], operands[4])"
5935 1.1.1.3 mrg "@
5936 1.1.1.3 mrg movprfx\t%0.<Vetype>, %1/z, %0.<Vetype>\;fabd\t%0.<Vetype>, %1/m, %0.<Vetype>, %3.<Vetype>
5937 1.1.1.3 mrg movprfx\t%0.<Vetype>, %1/z, %0.<Vetype>\;fabd\t%0.<Vetype>, %1/m, %0.<Vetype>, %2.<Vetype>
5938 1.1.1.3 mrg movprfx\t%0.<Vetype>, %1/z, %2.<Vetype>\;fabd\t%0.<Vetype>, %1/m, %0.<Vetype>, %3.<Vetype>
5939 1.1.1.3 mrg movprfx\t%0.<Vetype>, %1/m, %2.<Vetype>\;fabd\t%0.<Vetype>, %1/m, %0.<Vetype>, %3.<Vetype>
5940 1.1.1.3 mrg #"
5941 1.1.1.3 mrg "&& 1"
5942 1.1.1.3 mrg {
5943 1.1.1.3 mrg if (reload_completed
5944 1.1.1.3 mrg && register_operand (operands[4], <MODE>mode)
5945 1.1.1.3 mrg && !rtx_equal_p (operands[0], operands[4]))
5946 1.1.1.3 mrg {
5947 1.1.1.3 mrg emit_insn (gen_vcond_mask_<mode><vpred> (operands[0], operands[3],
5948 1.1.1.3 mrg operands[4], operands[1]));
5949 1.1.1.3 mrg operands[4] = operands[3] = operands[0];
5950 1.1.1.3 mrg }
5951 1.1.1.3 mrg else if (!rtx_equal_p (operands[1], operands[5])
5952 1.1.1.3 mrg || !rtx_equal_p (operands[1], operands[6]))
5953 1.1.1.3 mrg {
5954 1.1.1.3 mrg operands[5] = copy_rtx (operands[1]);
5955 1.1.1.3 mrg operands[6] = copy_rtx (operands[1]);
5956 1.1.1.3 mrg }
5957 1.1.1.3 mrg else
5958 1.1.1.3 mrg FAIL;
5959 1.1.1.3 mrg }
5960 1.1.1.3 mrg [(set_attr "movprfx" "yes")]
5961 1.1.1.3 mrg )
5962 1.1.1.3 mrg
5963 1.1.1.3 mrg (define_insn_and_rewrite "*aarch64_cond_abd<mode>_any_strict"
5964 1.1.1.3 mrg [(set (match_operand:SVE_FULL_F 0 "register_operand" "=&w, &w, &w, &w, ?&w")
5965 1.1.1.3 mrg (unspec:SVE_FULL_F
5966 1.1.1.3 mrg [(match_operand:<VPRED> 1 "register_operand" "Upl, Upl, Upl, Upl, Upl")
5967 1.1.1.3 mrg (unspec:SVE_FULL_F
5968 1.1.1.3 mrg [(match_dup 1)
5969 1.1.1.3 mrg (match_operand:SI 5 "aarch64_sve_gp_strictness")
5970 1.1.1.3 mrg (unspec:SVE_FULL_F
5971 1.1.1.3 mrg [(match_dup 1)
5972 1.1.1.3 mrg (match_operand:SI 6 "aarch64_sve_gp_strictness")
5973 1.1.1.3 mrg (match_operand:SVE_FULL_F 2 "register_operand" "0, w, w, w, w")
5974 1.1.1.3 mrg (match_operand:SVE_FULL_F 3 "register_operand" "w, 0, w, w, w")]
5975 1.1.1.3 mrg UNSPEC_COND_FSUB)]
5976 1.1.1.3 mrg UNSPEC_COND_FABS)
5977 1.1.1.3 mrg (match_operand:SVE_FULL_F 4 "aarch64_simd_reg_or_zero" "Dz, Dz, Dz, 0, w")]
5978 1.1.1.3 mrg UNSPEC_SEL))]
5979 1.1.1.3 mrg "TARGET_SVE
5980 1.1.1.3 mrg && !rtx_equal_p (operands[2], operands[4])
5981 1.1.1.3 mrg && !rtx_equal_p (operands[3], operands[4])"
5982 1.1.1.3 mrg "@
5983 1.1.1.3 mrg movprfx\t%0.<Vetype>, %1/z, %0.<Vetype>\;fabd\t%0.<Vetype>, %1/m, %0.<Vetype>, %3.<Vetype>
5984 1.1.1.3 mrg movprfx\t%0.<Vetype>, %1/z, %0.<Vetype>\;fabd\t%0.<Vetype>, %1/m, %0.<Vetype>, %2.<Vetype>
5985 1.1.1.3 mrg movprfx\t%0.<Vetype>, %1/z, %2.<Vetype>\;fabd\t%0.<Vetype>, %1/m, %0.<Vetype>, %3.<Vetype>
5986 1.1.1.3 mrg movprfx\t%0.<Vetype>, %1/m, %2.<Vetype>\;fabd\t%0.<Vetype>, %1/m, %0.<Vetype>, %3.<Vetype>
5987 1.1.1.3 mrg #"
5988 1.1.1.3 mrg "&& reload_completed
5989 1.1.1.3 mrg && register_operand (operands[4], <MODE>mode)
5990 1.1.1.3 mrg && !rtx_equal_p (operands[0], operands[4])"
5991 1.1.1.3 mrg {
5992 1.1.1.3 mrg emit_insn (gen_vcond_mask_<mode><vpred> (operands[0], operands[3],
5993 1.1.1.3 mrg operands[4], operands[1]));
5994 1.1.1.3 mrg operands[4] = operands[3] = operands[0];
5995 1.1.1.3 mrg }
5996 1.1.1.3 mrg [(set_attr "movprfx" "yes")]
5997 1.1.1.3 mrg )
5998 1.1.1.3 mrg
5999 1.1.1.3 mrg ;; -------------------------------------------------------------------------
6000 1.1.1.3 mrg ;; ---- [FP] Multiplication
6001 1.1.1.3 mrg ;; -------------------------------------------------------------------------
6002 1.1.1.3 mrg ;; Includes:
6003 1.1.1.3 mrg ;; - FMUL
6004 1.1.1.3 mrg ;; -------------------------------------------------------------------------
6005 1.1.1.3 mrg
6006 1.1.1.3 mrg ;; Predicated floating-point multiplication.
6007 1.1.1.3 mrg (define_insn_and_split "@aarch64_pred_<optab><mode>"
6008 1.1.1.3 mrg [(set (match_operand:SVE_FULL_F 0 "register_operand" "=w, w, w, ?&w, ?&w")
6009 1.1.1.3 mrg (unspec:SVE_FULL_F
6010 1.1.1.3 mrg [(match_operand:<VPRED> 1 "register_operand" "Upl, Upl, Upl, Upl, Upl")
6011 1.1.1.3 mrg (match_operand:SI 4 "aarch64_sve_gp_strictness" "i, Z, Ui1, i, Ui1")
6012 1.1.1.3 mrg (match_operand:SVE_FULL_F 2 "register_operand" "%0, w, 0, w, w")
6013 1.1.1.3 mrg (match_operand:SVE_FULL_F 3 "aarch64_sve_float_mul_operand" "vsM, w, w, vsM, w")]
6014 1.1.1.3 mrg SVE_COND_FP_MUL))]
6015 1.1.1.3 mrg "TARGET_SVE"
6016 1.1.1.3 mrg "@
6017 1.1.1.3 mrg fmul\t%0.<Vetype>, %1/m, %0.<Vetype>, #%3
6018 1.1.1.3 mrg #
6019 1.1.1.3 mrg fmul\t%0.<Vetype>, %1/m, %0.<Vetype>, %3.<Vetype>
6020 1.1.1.3 mrg movprfx\t%0, %2\;fmul\t%0.<Vetype>, %1/m, %0.<Vetype>, #%3
6021 1.1.1.3 mrg movprfx\t%0, %2\;fmul\t%0.<Vetype>, %1/m, %0.<Vetype>, %3.<Vetype>"
6022 1.1.1.3 mrg ; Split the unpredicated form after reload, so that we don't have
6023 1.1.1.3 mrg ; the unnecessary PTRUE.
6024 1.1.1.3 mrg "&& reload_completed
6025 1.1.1.3 mrg && register_operand (operands[3], <MODE>mode)
6026 1.1.1.3 mrg && INTVAL (operands[4]) == SVE_RELAXED_GP"
6027 1.1.1.3 mrg [(set (match_dup 0) (mult:SVE_FULL_F (match_dup 2) (match_dup 3)))]
6028 1.1.1.3 mrg ""
6029 1.1.1.3 mrg [(set_attr "movprfx" "*,*,*,yes,yes")]
6030 1.1.1.3 mrg )
6031 1.1.1.3 mrg
6032 1.1.1.3 mrg ;; Merging forms are handled through SVE_COND_FP_BINARY and
6033 1.1.1.3 mrg ;; SVE_COND_FP_BINARY_I1.
6034 1.1.1.3 mrg
6035 1.1.1.3 mrg ;; Unpredicated multiplication by selected lanes.
6036 1.1.1.3 mrg (define_insn "@aarch64_mul_lane_<mode>"
6037 1.1.1.3 mrg [(set (match_operand:SVE_FULL_F 0 "register_operand" "=w")
6038 1.1.1.3 mrg (mult:SVE_FULL_F
6039 1.1.1.3 mrg (unspec:SVE_FULL_F
6040 1.1.1.3 mrg [(match_operand:SVE_FULL_F 2 "register_operand" "<sve_lane_con>")
6041 1.1.1.3 mrg (match_operand:SI 3 "const_int_operand")]
6042 1.1.1.3 mrg UNSPEC_SVE_LANE_SELECT)
6043 1.1.1.3 mrg (match_operand:SVE_FULL_F 1 "register_operand" "w")))]
6044 1.1.1.3 mrg "TARGET_SVE"
6045 1.1.1.3 mrg "fmul\t%0.<Vetype>, %1.<Vetype>, %2.<Vetype>[%3]"
6046 1.1.1.3 mrg )
6047 1.1.1.3 mrg
6048 1.1.1.3 mrg ;; -------------------------------------------------------------------------
6049 1.1.1.3 mrg ;; ---- [FP] Division
6050 1.1.1.3 mrg ;; -------------------------------------------------------------------------
6051 1.1.1.3 mrg ;; The patterns in this section are synthetic.
6052 1.1.1.3 mrg ;; -------------------------------------------------------------------------
6053 1.1.1.3 mrg
6054 1.1.1.3 mrg (define_expand "div<mode>3"
6055 1.1.1.3 mrg [(set (match_operand:SVE_FULL_F 0 "register_operand")
6056 1.1.1.3 mrg (unspec:SVE_FULL_F
6057 1.1.1.3 mrg [(match_dup 3)
6058 1.1.1.3 mrg (const_int SVE_RELAXED_GP)
6059 1.1.1.3 mrg (match_operand:SVE_FULL_F 1 "nonmemory_operand")
6060 1.1.1.3 mrg (match_operand:SVE_FULL_F 2 "register_operand")]
6061 1.1.1.3 mrg UNSPEC_COND_FDIV))]
6062 1.1.1.3 mrg "TARGET_SVE"
6063 1.1.1.3 mrg {
6064 1.1.1.3 mrg if (aarch64_emit_approx_div (operands[0], operands[1], operands[2]))
6065 1.1.1.3 mrg DONE;
6066 1.1.1.3 mrg
6067 1.1.1.3 mrg operands[1] = force_reg (<MODE>mode, operands[1]);
6068 1.1.1.3 mrg operands[3] = aarch64_ptrue_reg (<VPRED>mode);
6069 1.1.1.3 mrg }
6070 1.1.1.3 mrg )
6071 1.1.1.3 mrg
6072 1.1.1.3 mrg (define_expand "@aarch64_frecpe<mode>"
6073 1.1.1.3 mrg [(set (match_operand:SVE_FULL_F 0 "register_operand")
6074 1.1.1.3 mrg (unspec:SVE_FULL_F
6075 1.1.1.3 mrg [(match_operand:SVE_FULL_F 1 "register_operand")]
6076 1.1.1.3 mrg UNSPEC_FRECPE))]
6077 1.1.1.3 mrg "TARGET_SVE"
6078 1.1.1.3 mrg )
6079 1.1.1.3 mrg
6080 1.1.1.3 mrg (define_expand "@aarch64_frecps<mode>"
6081 1.1.1.3 mrg [(set (match_operand:SVE_FULL_F 0 "register_operand")
6082 1.1.1.3 mrg (unspec:SVE_FULL_F
6083 1.1.1.3 mrg [(match_operand:SVE_FULL_F 1 "register_operand")
6084 1.1.1.3 mrg (match_operand:SVE_FULL_F 2 "register_operand")]
6085 1.1.1.3 mrg UNSPEC_FRECPS))]
6086 1.1.1.3 mrg "TARGET_SVE"
6087 1.1.1.3 mrg )
6088 1.1.1.3 mrg
6089 1.1.1.3 mrg ;; -------------------------------------------------------------------------
6090 1.1.1.3 mrg ;; ---- [FP] Binary logical operations
6091 1.1.1.3 mrg ;; -------------------------------------------------------------------------
6092 1.1.1.3 mrg ;; Includes
6093 1.1.1.3 mrg ;; - AND
6094 1.1.1.3 mrg ;; - EOR
6095 1.1.1.3 mrg ;; - ORR
6096 1.1.1.3 mrg ;; -------------------------------------------------------------------------
6097 1.1.1.3 mrg
6098 1.1.1.3 mrg ;; Binary logical operations on floating-point modes. We avoid subregs
6099 1.1.1.3 mrg ;; by providing this, but we need to use UNSPECs since rtx logical ops
6100 1.1.1.3 mrg ;; aren't defined for floating-point modes.
6101 1.1.1.3 mrg (define_insn "*<optab><mode>3"
6102 1.1.1.3 mrg [(set (match_operand:SVE_FULL_F 0 "register_operand" "=w")
6103 1.1.1.3 mrg (unspec:SVE_FULL_F
6104 1.1.1.3 mrg [(match_operand:SVE_FULL_F 1 "register_operand" "w")
6105 1.1.1.3 mrg (match_operand:SVE_FULL_F 2 "register_operand" "w")]
6106 1.1.1.3 mrg LOGICALF))]
6107 1.1.1.3 mrg "TARGET_SVE"
6108 1.1.1.3 mrg "<logicalf_op>\t%0.d, %1.d, %2.d"
6109 1.1.1.3 mrg )
6110 1.1.1.3 mrg
6111 1.1.1.3 mrg ;; -------------------------------------------------------------------------
6112 1.1.1.3 mrg ;; ---- [FP] Sign copying
6113 1.1.1.3 mrg ;; -------------------------------------------------------------------------
6114 1.1.1.3 mrg ;; The patterns in this section are synthetic.
6115 1.1.1.3 mrg ;; -------------------------------------------------------------------------
6116 1.1.1.3 mrg
6117 1.1.1.3 mrg (define_expand "copysign<mode>3"
6118 1.1.1.3 mrg [(match_operand:SVE_FULL_F 0 "register_operand")
6119 1.1.1.3 mrg (match_operand:SVE_FULL_F 1 "register_operand")
6120 1.1.1.3 mrg (match_operand:SVE_FULL_F 2 "register_operand")]
6121 1.1.1.3 mrg "TARGET_SVE"
6122 1.1.1.3 mrg {
6123 1.1.1.3 mrg rtx sign = gen_reg_rtx (<V_INT_EQUIV>mode);
6124 1.1.1.3 mrg rtx mant = gen_reg_rtx (<V_INT_EQUIV>mode);
6125 1.1.1.3 mrg rtx int_res = gen_reg_rtx (<V_INT_EQUIV>mode);
6126 1.1.1.3 mrg int bits = GET_MODE_UNIT_BITSIZE (<MODE>mode) - 1;
6127 1.1.1.3 mrg
6128 1.1.1.3 mrg rtx arg1 = lowpart_subreg (<V_INT_EQUIV>mode, operands[1], <MODE>mode);
6129 1.1.1.3 mrg rtx arg2 = lowpart_subreg (<V_INT_EQUIV>mode, operands[2], <MODE>mode);
6130 1.1.1.3 mrg
6131 1.1.1.3 mrg emit_insn (gen_and<v_int_equiv>3
6132 1.1.1.3 mrg (sign, arg2,
6133 1.1.1.3 mrg aarch64_simd_gen_const_vector_dup (<V_INT_EQUIV>mode,
6134 1.1.1.3 mrg HOST_WIDE_INT_M1U
6135 1.1.1.3 mrg << bits)));
6136 1.1.1.3 mrg emit_insn (gen_and<v_int_equiv>3
6137 1.1.1.3 mrg (mant, arg1,
6138 1.1.1.3 mrg aarch64_simd_gen_const_vector_dup (<V_INT_EQUIV>mode,
6139 1.1.1.3 mrg ~(HOST_WIDE_INT_M1U
6140 1.1.1.3 mrg << bits))));
6141 1.1.1.3 mrg emit_insn (gen_ior<v_int_equiv>3 (int_res, sign, mant));
6142 1.1.1.3 mrg emit_move_insn (operands[0], gen_lowpart (<MODE>mode, int_res));
6143 1.1.1.3 mrg DONE;
6144 1.1.1.3 mrg }
6145 1.1.1.3 mrg )
6146 1.1.1.3 mrg
6147 1.1.1.3 mrg (define_expand "xorsign<mode>3"
6148 1.1.1.3 mrg [(match_operand:SVE_FULL_F 0 "register_operand")
6149 1.1.1.3 mrg (match_operand:SVE_FULL_F 1 "register_operand")
6150 1.1.1.3 mrg (match_operand:SVE_FULL_F 2 "register_operand")]
6151 1.1.1.3 mrg "TARGET_SVE"
6152 1.1.1.3 mrg {
6153 1.1.1.3 mrg rtx sign = gen_reg_rtx (<V_INT_EQUIV>mode);
6154 1.1.1.3 mrg rtx int_res = gen_reg_rtx (<V_INT_EQUIV>mode);
6155 1.1.1.3 mrg int bits = GET_MODE_UNIT_BITSIZE (<MODE>mode) - 1;
6156 1.1.1.3 mrg
6157 1.1.1.3 mrg rtx arg1 = lowpart_subreg (<V_INT_EQUIV>mode, operands[1], <MODE>mode);
6158 1.1.1.3 mrg rtx arg2 = lowpart_subreg (<V_INT_EQUIV>mode, operands[2], <MODE>mode);
6159 1.1.1.3 mrg
6160 1.1.1.3 mrg emit_insn (gen_and<v_int_equiv>3
6161 1.1.1.3 mrg (sign, arg2,
6162 1.1.1.3 mrg aarch64_simd_gen_const_vector_dup (<V_INT_EQUIV>mode,
6163 1.1.1.3 mrg HOST_WIDE_INT_M1U
6164 1.1.1.3 mrg << bits)));
6165 1.1.1.3 mrg emit_insn (gen_xor<v_int_equiv>3 (int_res, arg1, sign));
6166 1.1.1.3 mrg emit_move_insn (operands[0], gen_lowpart (<MODE>mode, int_res));
6167 1.1.1.3 mrg DONE;
6168 1.1.1.3 mrg }
6169 1.1.1.3 mrg )
6170 1.1.1.3 mrg
6171 1.1.1.3 mrg ;; -------------------------------------------------------------------------
6172 1.1.1.3 mrg ;; ---- [FP] Maximum and minimum
6173 1.1.1.3 mrg ;; -------------------------------------------------------------------------
6174 1.1.1.3 mrg ;; Includes:
6175 1.1.1.3 mrg ;; - FMAX
6176 1.1.1.3 mrg ;; - FMAXNM
6177 1.1.1.3 mrg ;; - FMIN
6178 1.1.1.3 mrg ;; - FMINNM
6179 1.1.1.3 mrg ;; -------------------------------------------------------------------------
6180 1.1.1.3 mrg
6181 1.1.1.3 mrg ;; Unpredicated fmax/fmin (the libm functions). The optabs for the
6182 1.1.1.3 mrg ;; smin/smax rtx codes are handled in the generic section above.
6183 1.1.1.3 mrg (define_expand "<maxmin_uns><mode>3"
6184 1.1.1.3 mrg [(set (match_operand:SVE_FULL_F 0 "register_operand")
6185 1.1.1.3 mrg (unspec:SVE_FULL_F
6186 1.1.1.3 mrg [(match_dup 3)
6187 1.1.1.3 mrg (const_int SVE_RELAXED_GP)
6188 1.1.1.3 mrg (match_operand:SVE_FULL_F 1 "register_operand")
6189 1.1.1.3 mrg (match_operand:SVE_FULL_F 2 "aarch64_sve_float_maxmin_operand")]
6190 1.1.1.3 mrg SVE_COND_FP_MAXMIN_PUBLIC))]
6191 1.1.1.3 mrg "TARGET_SVE"
6192 1.1.1.3 mrg {
6193 1.1.1.3 mrg operands[3] = aarch64_ptrue_reg (<VPRED>mode);
6194 1.1.1.3 mrg }
6195 1.1.1.3 mrg )
6196 1.1.1.3 mrg
6197 1.1.1.3 mrg ;; Predicated floating-point maximum/minimum.
6198 1.1.1.3 mrg (define_insn "@aarch64_pred_<optab><mode>"
6199 1.1.1.3 mrg [(set (match_operand:SVE_FULL_F 0 "register_operand" "=w, w, ?&w, ?&w")
6200 1.1.1.3 mrg (unspec:SVE_FULL_F
6201 1.1.1.3 mrg [(match_operand:<VPRED> 1 "register_operand" "Upl, Upl, Upl, Upl")
6202 1.1.1.3 mrg (match_operand:SI 4 "aarch64_sve_gp_strictness")
6203 1.1.1.3 mrg (match_operand:SVE_FULL_F 2 "register_operand" "%0, 0, w, w")
6204 1.1.1.3 mrg (match_operand:SVE_FULL_F 3 "aarch64_sve_float_maxmin_operand" "vsB, w, vsB, w")]
6205 1.1.1.3 mrg SVE_COND_FP_MAXMIN))]
6206 1.1.1.3 mrg "TARGET_SVE"
6207 1.1.1.3 mrg "@
6208 1.1.1.3 mrg <sve_fp_op>\t%0.<Vetype>, %1/m, %0.<Vetype>, #%3
6209 1.1.1.3 mrg <sve_fp_op>\t%0.<Vetype>, %1/m, %0.<Vetype>, %3.<Vetype>
6210 1.1.1.3 mrg movprfx\t%0, %2\;<sve_fp_op>\t%0.<Vetype>, %1/m, %0.<Vetype>, #%3
6211 1.1.1.3 mrg movprfx\t%0, %2\;<sve_fp_op>\t%0.<Vetype>, %1/m, %0.<Vetype>, %3.<Vetype>"
6212 1.1.1.3 mrg [(set_attr "movprfx" "*,*,yes,yes")]
6213 1.1.1.3 mrg )
6214 1.1.1.3 mrg
6215 1.1.1.3 mrg ;; Merging forms are handled through SVE_COND_FP_BINARY and
6216 1.1.1.3 mrg ;; SVE_COND_FP_BINARY_I1.
6217 1.1.1.3 mrg
6218 1.1.1.3 mrg ;; -------------------------------------------------------------------------
6219 1.1.1.3 mrg ;; ---- [PRED] Binary logical operations
6220 1.1.1.3 mrg ;; -------------------------------------------------------------------------
6221 1.1.1.3 mrg ;; Includes:
6222 1.1.1.3 mrg ;; - AND
6223 1.1.1.3 mrg ;; - ANDS
6224 1.1.1.3 mrg ;; - EOR
6225 1.1.1.3 mrg ;; - EORS
6226 1.1.1.3 mrg ;; - ORR
6227 1.1.1.3 mrg ;; - ORRS
6228 1.1.1.3 mrg ;; -------------------------------------------------------------------------
6229 1.1.1.3 mrg
6230 1.1.1.3 mrg ;; Predicate AND. We can reuse one of the inputs as the GP.
6231 1.1.1.3 mrg ;; Doubling the second operand is the preferred implementation
6232 1.1.1.3 mrg ;; of the MOV alias, so we use that instead of %1/z, %1, %2.
6233 1.1.1.3 mrg (define_insn "and<mode>3"
6234 1.1.1.3 mrg [(set (match_operand:PRED_ALL 0 "register_operand" "=Upa")
6235 1.1.1.3 mrg (and:PRED_ALL (match_operand:PRED_ALL 1 "register_operand" "Upa")
6236 1.1.1.3 mrg (match_operand:PRED_ALL 2 "register_operand" "Upa")))]
6237 1.1.1.3 mrg "TARGET_SVE"
6238 1.1.1.3 mrg "and\t%0.b, %1/z, %2.b, %2.b"
6239 1.1.1.3 mrg )
6240 1.1.1.3 mrg
6241 1.1.1.3 mrg ;; Unpredicated predicate EOR and ORR.
6242 1.1.1.3 mrg (define_expand "<optab><mode>3"
6243 1.1.1.3 mrg [(set (match_operand:PRED_ALL 0 "register_operand")
6244 1.1.1.3 mrg (and:PRED_ALL
6245 1.1.1.3 mrg (LOGICAL_OR:PRED_ALL
6246 1.1.1.3 mrg (match_operand:PRED_ALL 1 "register_operand")
6247 1.1.1.3 mrg (match_operand:PRED_ALL 2 "register_operand"))
6248 1.1.1.3 mrg (match_dup 3)))]
6249 1.1.1.3 mrg "TARGET_SVE"
6250 1.1.1.3 mrg {
6251 1.1.1.3 mrg operands[3] = aarch64_ptrue_reg (<MODE>mode);
6252 1.1.1.3 mrg }
6253 1.1.1.3 mrg )
6254 1.1.1.3 mrg
6255 1.1.1.3 mrg ;; Predicated predicate AND, EOR and ORR.
6256 1.1.1.3 mrg (define_insn "@aarch64_pred_<optab><mode>_z"
6257 1.1.1.3 mrg [(set (match_operand:PRED_ALL 0 "register_operand" "=Upa")
6258 1.1.1.3 mrg (and:PRED_ALL
6259 1.1.1.3 mrg (LOGICAL:PRED_ALL
6260 1.1.1.3 mrg (match_operand:PRED_ALL 2 "register_operand" "Upa")
6261 1.1.1.3 mrg (match_operand:PRED_ALL 3 "register_operand" "Upa"))
6262 1.1.1.3 mrg (match_operand:PRED_ALL 1 "register_operand" "Upa")))]
6263 1.1.1.3 mrg "TARGET_SVE"
6264 1.1.1.3 mrg "<logical>\t%0.b, %1/z, %2.b, %3.b"
6265 1.1.1.3 mrg )
6266 1.1.1.3 mrg
6267 1.1.1.3 mrg ;; Perform a logical operation on operands 2 and 3, using operand 1 as
6268 1.1.1.3 mrg ;; the GP. Store the result in operand 0 and set the flags in the same
6269 1.1.1.3 mrg ;; way as for PTEST.
6270 1.1.1.3 mrg (define_insn "*<optab><mode>3_cc"
6271 1.1.1.3 mrg [(set (reg:CC_NZC CC_REGNUM)
6272 1.1.1.3 mrg (unspec:CC_NZC
6273 1.1.1.3 mrg [(match_operand:VNx16BI 1 "register_operand" "Upa")
6274 1.1.1.3 mrg (match_operand 4)
6275 1.1.1.3 mrg (match_operand:SI 5 "aarch64_sve_ptrue_flag")
6276 1.1.1.3 mrg (and:PRED_ALL
6277 1.1.1.3 mrg (LOGICAL:PRED_ALL
6278 1.1.1.3 mrg (match_operand:PRED_ALL 2 "register_operand" "Upa")
6279 1.1.1.3 mrg (match_operand:PRED_ALL 3 "register_operand" "Upa"))
6280 1.1.1.3 mrg (match_dup 4))]
6281 1.1.1.3 mrg UNSPEC_PTEST))
6282 1.1.1.3 mrg (set (match_operand:PRED_ALL 0 "register_operand" "=Upa")
6283 1.1.1.3 mrg (and:PRED_ALL (LOGICAL:PRED_ALL (match_dup 2) (match_dup 3))
6284 1.1.1.3 mrg (match_dup 4)))]
6285 1.1.1.3 mrg "TARGET_SVE"
6286 1.1.1.3 mrg "<logical>s\t%0.b, %1/z, %2.b, %3.b"
6287 1.1.1.3 mrg )
6288 1.1.1.3 mrg
6289 1.1.1.3 mrg ;; Same with just the flags result.
6290 1.1.1.3 mrg (define_insn "*<optab><mode>3_ptest"
6291 1.1.1.3 mrg [(set (reg:CC_NZC CC_REGNUM)
6292 1.1.1.3 mrg (unspec:CC_NZC
6293 1.1.1.3 mrg [(match_operand:VNx16BI 1 "register_operand" "Upa")
6294 1.1.1.3 mrg (match_operand 4)
6295 1.1.1.3 mrg (match_operand:SI 5 "aarch64_sve_ptrue_flag")
6296 1.1.1.3 mrg (and:PRED_ALL
6297 1.1.1.3 mrg (LOGICAL:PRED_ALL
6298 1.1.1.3 mrg (match_operand:PRED_ALL 2 "register_operand" "Upa")
6299 1.1.1.3 mrg (match_operand:PRED_ALL 3 "register_operand" "Upa"))
6300 1.1.1.3 mrg (match_dup 4))]
6301 1.1.1.3 mrg UNSPEC_PTEST))
6302 1.1.1.3 mrg (clobber (match_scratch:VNx16BI 0 "=Upa"))]
6303 1.1.1.3 mrg "TARGET_SVE"
6304 1.1.1.3 mrg "<logical>s\t%0.b, %1/z, %2.b, %3.b"
6305 1.1.1.3 mrg )
6306 1.1.1.3 mrg
6307 1.1.1.3 mrg ;; -------------------------------------------------------------------------
6308 1.1.1.3 mrg ;; ---- [PRED] Binary logical operations (inverted second input)
6309 1.1.1.3 mrg ;; -------------------------------------------------------------------------
6310 1.1.1.3 mrg ;; Includes:
6311 1.1.1.3 mrg ;; - BIC
6312 1.1.1.3 mrg ;; - ORN
6313 1.1.1.3 mrg ;; -------------------------------------------------------------------------
6314 1.1.1.3 mrg
6315 1.1.1.3 mrg ;; Predicated predicate BIC and ORN.
6316 1.1.1.3 mrg (define_insn "aarch64_pred_<nlogical><mode>_z"
6317 1.1.1.3 mrg [(set (match_operand:PRED_ALL 0 "register_operand" "=Upa")
6318 1.1.1.3 mrg (and:PRED_ALL
6319 1.1.1.3 mrg (NLOGICAL:PRED_ALL
6320 1.1.1.3 mrg (not:PRED_ALL (match_operand:PRED_ALL 3 "register_operand" "Upa"))
6321 1.1.1.3 mrg (match_operand:PRED_ALL 2 "register_operand" "Upa"))
6322 1.1.1.3 mrg (match_operand:PRED_ALL 1 "register_operand" "Upa")))]
6323 1.1.1.3 mrg "TARGET_SVE"
6324 1.1.1.3 mrg "<nlogical>\t%0.b, %1/z, %2.b, %3.b"
6325 1.1.1.3 mrg )
6326 1.1.1.3 mrg
6327 1.1.1.3 mrg ;; Same, but set the flags as a side-effect.
6328 1.1.1.3 mrg (define_insn "*<nlogical><mode>3_cc"
6329 1.1.1.3 mrg [(set (reg:CC_NZC CC_REGNUM)
6330 1.1.1.3 mrg (unspec:CC_NZC
6331 1.1.1.3 mrg [(match_operand:VNx16BI 1 "register_operand" "Upa")
6332 1.1.1.3 mrg (match_operand 4)
6333 1.1.1.3 mrg (match_operand:SI 5 "aarch64_sve_ptrue_flag")
6334 1.1.1.3 mrg (and:PRED_ALL
6335 1.1.1.3 mrg (NLOGICAL:PRED_ALL
6336 1.1.1.3 mrg (not:PRED_ALL
6337 1.1.1.3 mrg (match_operand:PRED_ALL 3 "register_operand" "Upa"))
6338 1.1.1.3 mrg (match_operand:PRED_ALL 2 "register_operand" "Upa"))
6339 1.1.1.3 mrg (match_dup 4))]
6340 1.1.1.3 mrg UNSPEC_PTEST))
6341 1.1.1.3 mrg (set (match_operand:PRED_ALL 0 "register_operand" "=Upa")
6342 1.1.1.3 mrg (and:PRED_ALL (NLOGICAL:PRED_ALL
6343 1.1.1.3 mrg (not:PRED_ALL (match_dup 3))
6344 1.1.1.3 mrg (match_dup 2))
6345 1.1.1.3 mrg (match_dup 4)))]
6346 1.1.1.3 mrg "TARGET_SVE"
6347 1.1.1.3 mrg "<nlogical>s\t%0.b, %1/z, %2.b, %3.b"
6348 1.1.1.3 mrg )
6349 1.1.1.3 mrg
6350 1.1.1.3 mrg ;; Same with just the flags result.
6351 1.1.1.3 mrg (define_insn "*<nlogical><mode>3_ptest"
6352 1.1.1.3 mrg [(set (reg:CC_NZC CC_REGNUM)
6353 1.1.1.3 mrg (unspec:CC_NZC
6354 1.1.1.3 mrg [(match_operand:VNx16BI 1 "register_operand" "Upa")
6355 1.1.1.3 mrg (match_operand 4)
6356 1.1.1.3 mrg (match_operand:SI 5 "aarch64_sve_ptrue_flag")
6357 1.1.1.3 mrg (and:PRED_ALL
6358 1.1.1.3 mrg (NLOGICAL:PRED_ALL
6359 1.1.1.3 mrg (not:PRED_ALL
6360 1.1.1.3 mrg (match_operand:PRED_ALL 3 "register_operand" "Upa"))
6361 1.1.1.3 mrg (match_operand:PRED_ALL 2 "register_operand" "Upa"))
6362 1.1.1.3 mrg (match_dup 4))]
6363 1.1.1.3 mrg UNSPEC_PTEST))
6364 1.1.1.3 mrg (clobber (match_scratch:VNx16BI 0 "=Upa"))]
6365 1.1.1.3 mrg "TARGET_SVE"
6366 1.1.1.3 mrg "<nlogical>s\t%0.b, %1/z, %2.b, %3.b"
6367 1.1.1.3 mrg )
6368 1.1.1.3 mrg
6369 1.1.1.3 mrg ;; -------------------------------------------------------------------------
6370 1.1.1.3 mrg ;; ---- [PRED] Binary logical operations (inverted result)
6371 1.1.1.3 mrg ;; -------------------------------------------------------------------------
6372 1.1.1.3 mrg ;; Includes:
6373 1.1.1.3 mrg ;; - NAND
6374 1.1.1.3 mrg ;; - NOR
6375 1.1.1.3 mrg ;; -------------------------------------------------------------------------
6376 1.1.1.3 mrg
6377 1.1.1.3 mrg ;; Predicated predicate NAND and NOR.
6378 1.1.1.3 mrg (define_insn "aarch64_pred_<logical_nn><mode>_z"
6379 1.1.1.3 mrg [(set (match_operand:PRED_ALL 0 "register_operand" "=Upa")
6380 1.1.1.3 mrg (and:PRED_ALL
6381 1.1.1.3 mrg (NLOGICAL:PRED_ALL
6382 1.1.1.3 mrg (not:PRED_ALL (match_operand:PRED_ALL 2 "register_operand" "Upa"))
6383 1.1.1.3 mrg (not:PRED_ALL (match_operand:PRED_ALL 3 "register_operand" "Upa")))
6384 1.1.1.3 mrg (match_operand:PRED_ALL 1 "register_operand" "Upa")))]
6385 1.1.1.3 mrg "TARGET_SVE"
6386 1.1.1.3 mrg "<logical_nn>\t%0.b, %1/z, %2.b, %3.b"
6387 1.1.1.3 mrg )
6388 1.1.1.3 mrg
6389 1.1.1.3 mrg ;; Same, but set the flags as a side-effect.
6390 1.1.1.3 mrg (define_insn "*<logical_nn><mode>3_cc"
6391 1.1.1.3 mrg [(set (reg:CC_NZC CC_REGNUM)
6392 1.1.1.3 mrg (unspec:CC_NZC
6393 1.1.1.3 mrg [(match_operand:VNx16BI 1 "register_operand" "Upa")
6394 1.1.1.3 mrg (match_operand 4)
6395 1.1.1.3 mrg (match_operand:SI 5 "aarch64_sve_ptrue_flag")
6396 1.1.1.3 mrg (and:PRED_ALL
6397 1.1.1.3 mrg (NLOGICAL:PRED_ALL
6398 1.1.1.3 mrg (not:PRED_ALL
6399 1.1.1.3 mrg (match_operand:PRED_ALL 2 "register_operand" "Upa"))
6400 1.1.1.3 mrg (not:PRED_ALL
6401 1.1.1.3 mrg (match_operand:PRED_ALL 3 "register_operand" "Upa")))
6402 1.1.1.3 mrg (match_dup 4))]
6403 1.1.1.3 mrg UNSPEC_PTEST))
6404 1.1.1.3 mrg (set (match_operand:PRED_ALL 0 "register_operand" "=Upa")
6405 1.1.1.3 mrg (and:PRED_ALL (NLOGICAL:PRED_ALL
6406 1.1.1.3 mrg (not:PRED_ALL (match_dup 2))
6407 1.1.1.3 mrg (not:PRED_ALL (match_dup 3)))
6408 1.1.1.3 mrg (match_dup 4)))]
6409 1.1.1.3 mrg "TARGET_SVE"
6410 1.1.1.3 mrg "<logical_nn>s\t%0.b, %1/z, %2.b, %3.b"
6411 1.1.1.3 mrg )
6412 1.1.1.3 mrg
6413 1.1.1.3 mrg ;; Same with just the flags result.
6414 1.1.1.3 mrg (define_insn "*<logical_nn><mode>3_ptest"
6415 1.1.1.3 mrg [(set (reg:CC_NZC CC_REGNUM)
6416 1.1.1.3 mrg (unspec:CC_NZC
6417 1.1.1.3 mrg [(match_operand:VNx16BI 1 "register_operand" "Upa")
6418 1.1.1.3 mrg (match_operand 4)
6419 1.1.1.3 mrg (match_operand:SI 5 "aarch64_sve_ptrue_flag")
6420 1.1.1.3 mrg (and:PRED_ALL
6421 1.1.1.3 mrg (NLOGICAL:PRED_ALL
6422 1.1.1.3 mrg (not:PRED_ALL
6423 1.1.1.3 mrg (match_operand:PRED_ALL 2 "register_operand" "Upa"))
6424 1.1.1.3 mrg (not:PRED_ALL
6425 1.1.1.3 mrg (match_operand:PRED_ALL 3 "register_operand" "Upa")))
6426 1.1.1.3 mrg (match_dup 4))]
6427 1.1.1.3 mrg UNSPEC_PTEST))
6428 1.1.1.3 mrg (clobber (match_scratch:VNx16BI 0 "=Upa"))]
6429 1.1.1.3 mrg "TARGET_SVE"
6430 1.1.1.3 mrg "<logical_nn>s\t%0.b, %1/z, %2.b, %3.b"
6431 1.1.1.3 mrg )
6432 1.1.1.3 mrg
6433 1.1.1.3 mrg ;; =========================================================================
6434 1.1.1.3 mrg ;; == Ternary arithmetic
6435 1.1.1.3 mrg ;; =========================================================================
6436 1.1.1.3 mrg
6437 1.1.1.3 mrg ;; -------------------------------------------------------------------------
6438 1.1.1.3 mrg ;; ---- [INT] MLA and MAD
6439 1.1.1.3 mrg ;; -------------------------------------------------------------------------
6440 1.1.1.3 mrg ;; Includes:
6441 1.1.1.3 mrg ;; - MAD
6442 1.1.1.3 mrg ;; - MLA
6443 1.1.1.3 mrg ;; -------------------------------------------------------------------------
6444 1.1.1.3 mrg
6445 1.1.1.3 mrg ;; Unpredicated integer addition of product.
6446 1.1.1.3 mrg (define_expand "fma<mode>4"
6447 1.1.1.3 mrg [(set (match_operand:SVE_FULL_I 0 "register_operand")
6448 1.1.1.3 mrg (plus:SVE_FULL_I
6449 1.1.1.3 mrg (unspec:SVE_FULL_I
6450 1.1.1.3 mrg [(match_dup 4)
6451 1.1.1.3 mrg (mult:SVE_FULL_I
6452 1.1.1.3 mrg (match_operand:SVE_FULL_I 1 "register_operand")
6453 1.1.1.3 mrg (match_operand:SVE_FULL_I 2 "nonmemory_operand"))]
6454 1.1.1.3 mrg UNSPEC_PRED_X)
6455 1.1.1.3 mrg (match_operand:SVE_FULL_I 3 "register_operand")))]
6456 1.1.1.3 mrg "TARGET_SVE"
6457 1.1.1.3 mrg {
6458 1.1.1.3 mrg if (aarch64_prepare_sve_int_fma (operands, PLUS))
6459 1.1.1.3 mrg DONE;
6460 1.1.1.3 mrg operands[4] = aarch64_ptrue_reg (<VPRED>mode);
6461 1.1.1.3 mrg }
6462 1.1.1.3 mrg )
6463 1.1.1.3 mrg
6464 1.1.1.3 mrg ;; Predicated integer addition of product.
6465 1.1.1.3 mrg (define_insn "@aarch64_pred_fma<mode>"
6466 1.1.1.3 mrg [(set (match_operand:SVE_FULL_I 0 "register_operand" "=w, w, ?&w")
6467 1.1.1.3 mrg (plus:SVE_FULL_I
6468 1.1.1.3 mrg (unspec:SVE_FULL_I
6469 1.1.1.3 mrg [(match_operand:<VPRED> 1 "register_operand" "Upl, Upl, Upl")
6470 1.1.1.3 mrg (mult:SVE_FULL_I
6471 1.1.1.3 mrg (match_operand:SVE_FULL_I 2 "register_operand" "%0, w, w")
6472 1.1.1.3 mrg (match_operand:SVE_FULL_I 3 "register_operand" "w, w, w"))]
6473 1.1.1.3 mrg UNSPEC_PRED_X)
6474 1.1.1.3 mrg (match_operand:SVE_FULL_I 4 "register_operand" "w, 0, w")))]
6475 1.1.1.3 mrg "TARGET_SVE"
6476 1.1.1.3 mrg "@
6477 1.1.1.3 mrg mad\t%0.<Vetype>, %1/m, %3.<Vetype>, %4.<Vetype>
6478 1.1.1.3 mrg mla\t%0.<Vetype>, %1/m, %2.<Vetype>, %3.<Vetype>
6479 1.1.1.3 mrg movprfx\t%0, %4\;mla\t%0.<Vetype>, %1/m, %2.<Vetype>, %3.<Vetype>"
6480 1.1.1.3 mrg [(set_attr "movprfx" "*,*,yes")]
6481 1.1.1.3 mrg )
6482 1.1.1.3 mrg
6483 1.1.1.3 mrg ;; Predicated integer addition of product with merging.
6484 1.1.1.3 mrg (define_expand "cond_fma<mode>"
6485 1.1.1.3 mrg [(set (match_operand:SVE_FULL_I 0 "register_operand")
6486 1.1.1.3 mrg (unspec:SVE_FULL_I
6487 1.1.1.3 mrg [(match_operand:<VPRED> 1 "register_operand")
6488 1.1.1.3 mrg (plus:SVE_FULL_I
6489 1.1.1.3 mrg (mult:SVE_FULL_I
6490 1.1.1.3 mrg (match_operand:SVE_FULL_I 2 "register_operand")
6491 1.1.1.3 mrg (match_operand:SVE_FULL_I 3 "general_operand"))
6492 1.1.1.3 mrg (match_operand:SVE_FULL_I 4 "register_operand"))
6493 1.1.1.3 mrg (match_operand:SVE_FULL_I 5 "aarch64_simd_reg_or_zero")]
6494 1.1.1.3 mrg UNSPEC_SEL))]
6495 1.1 mrg "TARGET_SVE"
6496 1.1 mrg {
6497 1.1.1.3 mrg if (aarch64_prepare_sve_cond_int_fma (operands, PLUS))
6498 1.1.1.3 mrg DONE;
6499 1.1.1.3 mrg /* Swap the multiplication operands if the fallback value is the
6500 1.1.1.3 mrg second of the two. */
6501 1.1.1.3 mrg if (rtx_equal_p (operands[3], operands[5]))
6502 1.1.1.3 mrg std::swap (operands[2], operands[3]);
6503 1.1 mrg }
6504 1.1 mrg )
6505 1.1 mrg
6506 1.1.1.3 mrg ;; Predicated integer addition of product, merging with the first input.
6507 1.1.1.3 mrg (define_insn "*cond_fma<mode>_2"
6508 1.1.1.3 mrg [(set (match_operand:SVE_FULL_I 0 "register_operand" "=w, ?&w")
6509 1.1.1.3 mrg (unspec:SVE_FULL_I
6510 1.1.1.3 mrg [(match_operand:<VPRED> 1 "register_operand" "Upl, Upl")
6511 1.1.1.3 mrg (plus:SVE_FULL_I
6512 1.1.1.3 mrg (mult:SVE_FULL_I
6513 1.1.1.3 mrg (match_operand:SVE_FULL_I 2 "register_operand" "0, w")
6514 1.1.1.3 mrg (match_operand:SVE_FULL_I 3 "register_operand" "w, w"))
6515 1.1.1.3 mrg (match_operand:SVE_FULL_I 4 "register_operand" "w, w"))
6516 1.1.1.3 mrg (match_dup 2)]
6517 1.1.1.3 mrg UNSPEC_SEL))]
6518 1.1 mrg "TARGET_SVE"
6519 1.1 mrg "@
6520 1.1.1.3 mrg mad\t%0.<Vetype>, %1/m, %3.<Vetype>, %4.<Vetype>
6521 1.1.1.3 mrg movprfx\t%0, %2\;mad\t%0.<Vetype>, %1/m, %3.<Vetype>, %4.<Vetype>"
6522 1.1.1.3 mrg [(set_attr "movprfx" "*,yes")]
6523 1.1.1.3 mrg )
6524 1.1.1.3 mrg
6525 1.1.1.3 mrg ;; Predicated integer addition of product, merging with the third input.
6526 1.1.1.3 mrg (define_insn "*cond_fma<mode>_4"
6527 1.1.1.3 mrg [(set (match_operand:SVE_FULL_I 0 "register_operand" "=w, ?&w")
6528 1.1.1.3 mrg (unspec:SVE_FULL_I
6529 1.1.1.3 mrg [(match_operand:<VPRED> 1 "register_operand" "Upl, Upl")
6530 1.1.1.3 mrg (plus:SVE_FULL_I
6531 1.1.1.3 mrg (mult:SVE_FULL_I
6532 1.1.1.3 mrg (match_operand:SVE_FULL_I 2 "register_operand" "w, w")
6533 1.1.1.3 mrg (match_operand:SVE_FULL_I 3 "register_operand" "w, w"))
6534 1.1.1.3 mrg (match_operand:SVE_FULL_I 4 "register_operand" "0, w"))
6535 1.1.1.3 mrg (match_dup 4)]
6536 1.1.1.3 mrg UNSPEC_SEL))]
6537 1.1.1.3 mrg "TARGET_SVE"
6538 1.1.1.3 mrg "@
6539 1.1.1.3 mrg mla\t%0.<Vetype>, %1/m, %2.<Vetype>, %3.<Vetype>
6540 1.1.1.3 mrg movprfx\t%0, %4\;mla\t%0.<Vetype>, %1/m, %2.<Vetype>, %3.<Vetype>"
6541 1.1.1.3 mrg [(set_attr "movprfx" "*,yes")]
6542 1.1.1.3 mrg )
6543 1.1.1.3 mrg
6544 1.1.1.3 mrg ;; Predicated integer addition of product, merging with an independent value.
6545 1.1.1.3 mrg (define_insn_and_rewrite "*cond_fma<mode>_any"
6546 1.1.1.3 mrg [(set (match_operand:SVE_FULL_I 0 "register_operand" "=&w, &w, &w, &w, &w, ?&w")
6547 1.1.1.3 mrg (unspec:SVE_FULL_I
6548 1.1.1.3 mrg [(match_operand:<VPRED> 1 "register_operand" "Upl, Upl, Upl, Upl, Upl, Upl")
6549 1.1.1.3 mrg (plus:SVE_FULL_I
6550 1.1.1.3 mrg (mult:SVE_FULL_I
6551 1.1.1.3 mrg (match_operand:SVE_FULL_I 2 "register_operand" "w, w, 0, w, w, w")
6552 1.1.1.3 mrg (match_operand:SVE_FULL_I 3 "register_operand" "w, w, w, 0, w, w"))
6553 1.1.1.3 mrg (match_operand:SVE_FULL_I 4 "register_operand" "w, 0, w, w, w, w"))
6554 1.1.1.3 mrg (match_operand:SVE_FULL_I 5 "aarch64_simd_reg_or_zero" "Dz, Dz, Dz, Dz, 0, w")]
6555 1.1.1.3 mrg UNSPEC_SEL))]
6556 1.1.1.3 mrg "TARGET_SVE
6557 1.1.1.3 mrg && !rtx_equal_p (operands[2], operands[5])
6558 1.1.1.3 mrg && !rtx_equal_p (operands[3], operands[5])
6559 1.1.1.3 mrg && !rtx_equal_p (operands[4], operands[5])"
6560 1.1.1.3 mrg "@
6561 1.1.1.3 mrg movprfx\t%0.<Vetype>, %1/z, %4.<Vetype>\;mla\t%0.<Vetype>, %1/m, %2.<Vetype>, %3.<Vetype>
6562 1.1.1.3 mrg movprfx\t%0.<Vetype>, %1/z, %0.<Vetype>\;mla\t%0.<Vetype>, %1/m, %2.<Vetype>, %3.<Vetype>
6563 1.1.1.3 mrg movprfx\t%0.<Vetype>, %1/z, %0.<Vetype>\;mad\t%0.<Vetype>, %1/m, %3.<Vetype>, %4.<Vetype>
6564 1.1.1.3 mrg movprfx\t%0.<Vetype>, %1/z, %0.<Vetype>\;mad\t%0.<Vetype>, %1/m, %2.<Vetype>, %4.<Vetype>
6565 1.1.1.3 mrg movprfx\t%0.<Vetype>, %1/m, %4.<Vetype>\;mla\t%0.<Vetype>, %1/m, %2.<Vetype>, %3.<Vetype>
6566 1.1.1.3 mrg #"
6567 1.1.1.2 mrg "&& reload_completed
6568 1.1.1.3 mrg && register_operand (operands[5], <MODE>mode)
6569 1.1.1.3 mrg && !rtx_equal_p (operands[0], operands[5])"
6570 1.1.1.3 mrg {
6571 1.1.1.3 mrg emit_insn (gen_vcond_mask_<mode><vpred> (operands[0], operands[4],
6572 1.1.1.3 mrg operands[5], operands[1]));
6573 1.1.1.3 mrg operands[5] = operands[4] = operands[0];
6574 1.1.1.3 mrg }
6575 1.1.1.3 mrg [(set_attr "movprfx" "yes")]
6576 1.1.1.3 mrg )
6577 1.1.1.3 mrg
6578 1.1.1.3 mrg ;; -------------------------------------------------------------------------
6579 1.1.1.3 mrg ;; ---- [INT] MLS and MSB
6580 1.1.1.3 mrg ;; -------------------------------------------------------------------------
6581 1.1.1.3 mrg ;; Includes:
6582 1.1.1.3 mrg ;; - MLS
6583 1.1.1.3 mrg ;; - MSB
6584 1.1.1.3 mrg ;; -------------------------------------------------------------------------
6585 1.1.1.3 mrg
6586 1.1.1.3 mrg ;; Unpredicated integer subtraction of product.
6587 1.1.1.3 mrg (define_expand "fnma<mode>4"
6588 1.1.1.3 mrg [(set (match_operand:SVE_FULL_I 0 "register_operand")
6589 1.1.1.3 mrg (minus:SVE_FULL_I
6590 1.1.1.3 mrg (match_operand:SVE_FULL_I 3 "register_operand")
6591 1.1.1.3 mrg (unspec:SVE_FULL_I
6592 1.1.1.3 mrg [(match_dup 4)
6593 1.1.1.3 mrg (mult:SVE_FULL_I
6594 1.1.1.3 mrg (match_operand:SVE_FULL_I 1 "register_operand")
6595 1.1.1.3 mrg (match_operand:SVE_FULL_I 2 "general_operand"))]
6596 1.1.1.3 mrg UNSPEC_PRED_X)))]
6597 1.1.1.3 mrg "TARGET_SVE"
6598 1.1.1.3 mrg {
6599 1.1.1.3 mrg if (aarch64_prepare_sve_int_fma (operands, MINUS))
6600 1.1.1.3 mrg DONE;
6601 1.1.1.3 mrg operands[4] = aarch64_ptrue_reg (<VPRED>mode);
6602 1.1.1.3 mrg }
6603 1.1.1.3 mrg )
6604 1.1.1.3 mrg
6605 1.1.1.3 mrg ;; Predicated integer subtraction of product.
6606 1.1.1.3 mrg (define_insn "@aarch64_pred_fnma<mode>"
6607 1.1.1.3 mrg [(set (match_operand:SVE_FULL_I 0 "register_operand" "=w, w, ?&w")
6608 1.1.1.3 mrg (minus:SVE_FULL_I
6609 1.1.1.3 mrg (match_operand:SVE_FULL_I 4 "register_operand" "w, 0, w")
6610 1.1.1.3 mrg (unspec:SVE_FULL_I
6611 1.1.1.3 mrg [(match_operand:<VPRED> 1 "register_operand" "Upl, Upl, Upl")
6612 1.1.1.3 mrg (mult:SVE_FULL_I
6613 1.1.1.3 mrg (match_operand:SVE_FULL_I 2 "register_operand" "%0, w, w")
6614 1.1.1.3 mrg (match_operand:SVE_FULL_I 3 "register_operand" "w, w, w"))]
6615 1.1.1.3 mrg UNSPEC_PRED_X)))]
6616 1.1.1.3 mrg "TARGET_SVE"
6617 1.1.1.3 mrg "@
6618 1.1.1.3 mrg msb\t%0.<Vetype>, %1/m, %3.<Vetype>, %4.<Vetype>
6619 1.1.1.3 mrg mls\t%0.<Vetype>, %1/m, %2.<Vetype>, %3.<Vetype>
6620 1.1.1.3 mrg movprfx\t%0, %4\;mls\t%0.<Vetype>, %1/m, %2.<Vetype>, %3.<Vetype>"
6621 1.1.1.2 mrg [(set_attr "movprfx" "*,*,yes")]
6622 1.1.1.2 mrg )
6623 1.1.1.2 mrg
6624 1.1.1.3 mrg ;; Predicated integer subtraction of product with merging.
6625 1.1.1.3 mrg (define_expand "cond_fnma<mode>"
6626 1.1.1.3 mrg [(set (match_operand:SVE_FULL_I 0 "register_operand")
6627 1.1.1.3 mrg (unspec:SVE_FULL_I
6628 1.1.1.3 mrg [(match_operand:<VPRED> 1 "register_operand")
6629 1.1.1.3 mrg (minus:SVE_FULL_I
6630 1.1.1.3 mrg (match_operand:SVE_FULL_I 4 "register_operand")
6631 1.1.1.3 mrg (mult:SVE_FULL_I
6632 1.1.1.3 mrg (match_operand:SVE_FULL_I 2 "register_operand")
6633 1.1.1.3 mrg (match_operand:SVE_FULL_I 3 "general_operand")))
6634 1.1.1.3 mrg (match_operand:SVE_FULL_I 5 "aarch64_simd_reg_or_zero")]
6635 1.1.1.3 mrg UNSPEC_SEL))]
6636 1.1.1.3 mrg "TARGET_SVE"
6637 1.1.1.3 mrg {
6638 1.1.1.3 mrg if (aarch64_prepare_sve_cond_int_fma (operands, MINUS))
6639 1.1.1.3 mrg DONE;
6640 1.1.1.3 mrg /* Swap the multiplication operands if the fallback value is the
6641 1.1.1.3 mrg second of the two. */
6642 1.1.1.3 mrg if (rtx_equal_p (operands[3], operands[5]))
6643 1.1.1.3 mrg std::swap (operands[2], operands[3]);
6644 1.1.1.3 mrg }
6645 1.1 mrg )
6646 1.1 mrg
6647 1.1.1.3 mrg ;; Predicated integer subtraction of product, merging with the first input.
6648 1.1.1.3 mrg (define_insn "*cond_fnma<mode>_2"
6649 1.1.1.3 mrg [(set (match_operand:SVE_FULL_I 0 "register_operand" "=w, ?&w")
6650 1.1.1.3 mrg (unspec:SVE_FULL_I
6651 1.1.1.3 mrg [(match_operand:<VPRED> 1 "register_operand" "Upl, Upl")
6652 1.1.1.3 mrg (minus:SVE_FULL_I
6653 1.1.1.3 mrg (match_operand:SVE_FULL_I 4 "register_operand" "w, w")
6654 1.1.1.3 mrg (mult:SVE_FULL_I
6655 1.1.1.3 mrg (match_operand:SVE_FULL_I 2 "register_operand" "0, w")
6656 1.1.1.3 mrg (match_operand:SVE_FULL_I 3 "register_operand" "w, w")))
6657 1.1.1.3 mrg (match_dup 2)]
6658 1.1.1.3 mrg UNSPEC_SEL))]
6659 1.1.1.3 mrg "TARGET_SVE"
6660 1.1.1.3 mrg "@
6661 1.1.1.3 mrg msb\t%0.<Vetype>, %1/m, %3.<Vetype>, %4.<Vetype>
6662 1.1.1.3 mrg movprfx\t%0, %2\;msb\t%0.<Vetype>, %1/m, %3.<Vetype>, %4.<Vetype>"
6663 1.1.1.3 mrg [(set_attr "movprfx" "*,yes")]
6664 1.1.1.3 mrg )
6665 1.1.1.3 mrg
6666 1.1.1.3 mrg ;; Predicated integer subtraction of product, merging with the third input.
6667 1.1.1.3 mrg (define_insn "*cond_fnma<mode>_4"
6668 1.1.1.3 mrg [(set (match_operand:SVE_FULL_I 0 "register_operand" "=w, ?&w")
6669 1.1.1.3 mrg (unspec:SVE_FULL_I
6670 1.1.1.3 mrg [(match_operand:<VPRED> 1 "register_operand" "Upl, Upl")
6671 1.1.1.3 mrg (minus:SVE_FULL_I
6672 1.1.1.3 mrg (match_operand:SVE_FULL_I 4 "register_operand" "0, w")
6673 1.1.1.3 mrg (mult:SVE_FULL_I
6674 1.1.1.3 mrg (match_operand:SVE_FULL_I 2 "register_operand" "w, w")
6675 1.1.1.3 mrg (match_operand:SVE_FULL_I 3 "register_operand" "w, w")))
6676 1.1.1.3 mrg (match_dup 4)]
6677 1.1.1.3 mrg UNSPEC_SEL))]
6678 1.1 mrg "TARGET_SVE"
6679 1.1.1.3 mrg "@
6680 1.1.1.3 mrg mls\t%0.<Vetype>, %1/m, %2.<Vetype>, %3.<Vetype>
6681 1.1.1.3 mrg movprfx\t%0, %4\;mls\t%0.<Vetype>, %1/m, %2.<Vetype>, %3.<Vetype>"
6682 1.1.1.3 mrg [(set_attr "movprfx" "*,yes")]
6683 1.1.1.3 mrg )
6684 1.1.1.3 mrg
6685 1.1.1.3 mrg ;; Predicated integer subtraction of product, merging with an
6686 1.1.1.3 mrg ;; independent value.
6687 1.1.1.3 mrg (define_insn_and_rewrite "*cond_fnma<mode>_any"
6688 1.1.1.3 mrg [(set (match_operand:SVE_FULL_I 0 "register_operand" "=&w, &w, &w, &w, &w, ?&w")
6689 1.1.1.3 mrg (unspec:SVE_FULL_I
6690 1.1.1.3 mrg [(match_operand:<VPRED> 1 "register_operand" "Upl, Upl, Upl, Upl, Upl, Upl")
6691 1.1.1.3 mrg (minus:SVE_FULL_I
6692 1.1.1.3 mrg (match_operand:SVE_FULL_I 4 "register_operand" "w, 0, w, w, w, w")
6693 1.1.1.3 mrg (mult:SVE_FULL_I
6694 1.1.1.3 mrg (match_operand:SVE_FULL_I 2 "register_operand" "w, w, 0, w, w, w")
6695 1.1.1.3 mrg (match_operand:SVE_FULL_I 3 "register_operand" "w, w, w, 0, w, w")))
6696 1.1.1.3 mrg (match_operand:SVE_FULL_I 5 "aarch64_simd_reg_or_zero" "Dz, Dz, Dz, Dz, 0, w")]
6697 1.1.1.3 mrg UNSPEC_SEL))]
6698 1.1.1.3 mrg "TARGET_SVE
6699 1.1.1.3 mrg && !rtx_equal_p (operands[2], operands[5])
6700 1.1.1.3 mrg && !rtx_equal_p (operands[3], operands[5])
6701 1.1.1.3 mrg && !rtx_equal_p (operands[4], operands[5])"
6702 1.1.1.3 mrg "@
6703 1.1.1.3 mrg movprfx\t%0.<Vetype>, %1/z, %4.<Vetype>\;mls\t%0.<Vetype>, %1/m, %2.<Vetype>, %3.<Vetype>
6704 1.1.1.3 mrg movprfx\t%0.<Vetype>, %1/z, %0.<Vetype>\;mls\t%0.<Vetype>, %1/m, %2.<Vetype>, %3.<Vetype>
6705 1.1.1.3 mrg movprfx\t%0.<Vetype>, %1/z, %0.<Vetype>\;msb\t%0.<Vetype>, %1/m, %3.<Vetype>, %4.<Vetype>
6706 1.1.1.3 mrg movprfx\t%0.<Vetype>, %1/z, %0.<Vetype>\;msb\t%0.<Vetype>, %1/m, %2.<Vetype>, %4.<Vetype>
6707 1.1.1.3 mrg movprfx\t%0.<Vetype>, %1/m, %4.<Vetype>\;mls\t%0.<Vetype>, %1/m, %2.<Vetype>, %3.<Vetype>
6708 1.1.1.3 mrg #"
6709 1.1.1.3 mrg "&& reload_completed
6710 1.1.1.3 mrg && register_operand (operands[5], <MODE>mode)
6711 1.1.1.3 mrg && !rtx_equal_p (operands[0], operands[5])"
6712 1.1 mrg {
6713 1.1.1.3 mrg emit_insn (gen_vcond_mask_<mode><vpred> (operands[0], operands[4],
6714 1.1.1.3 mrg operands[5], operands[1]));
6715 1.1.1.3 mrg operands[5] = operands[4] = operands[0];
6716 1.1.1.3 mrg }
6717 1.1.1.3 mrg [(set_attr "movprfx" "yes")]
6718 1.1.1.3 mrg )
6719 1.1.1.3 mrg
6720 1.1.1.3 mrg ;; -------------------------------------------------------------------------
6721 1.1.1.3 mrg ;; ---- [INT] Dot product
6722 1.1.1.3 mrg ;; -------------------------------------------------------------------------
6723 1.1.1.3 mrg ;; Includes:
6724 1.1.1.3 mrg ;; - SDOT
6725 1.1.1.3 mrg ;; - SUDOT (I8MM)
6726 1.1.1.3 mrg ;; - UDOT
6727 1.1.1.3 mrg ;; - USDOT (I8MM)
6728 1.1.1.3 mrg ;; -------------------------------------------------------------------------
6729 1.1.1.3 mrg
6730 1.1.1.3 mrg ;; Four-element integer dot-product with accumulation.
6731 1.1.1.3 mrg (define_insn "<sur>dot_prod<vsi2qi>"
6732 1.1.1.3 mrg [(set (match_operand:SVE_FULL_SDI 0 "register_operand" "=w, ?&w")
6733 1.1.1.3 mrg (plus:SVE_FULL_SDI
6734 1.1.1.3 mrg (unspec:SVE_FULL_SDI
6735 1.1.1.3 mrg [(match_operand:<VSI2QI> 1 "register_operand" "w, w")
6736 1.1.1.3 mrg (match_operand:<VSI2QI> 2 "register_operand" "w, w")]
6737 1.1.1.3 mrg DOTPROD)
6738 1.1.1.3 mrg (match_operand:SVE_FULL_SDI 3 "register_operand" "0, w")))]
6739 1.1.1.3 mrg "TARGET_SVE"
6740 1.1.1.3 mrg "@
6741 1.1.1.3 mrg <sur>dot\\t%0.<Vetype>, %1.<Vetype_fourth>, %2.<Vetype_fourth>
6742 1.1.1.3 mrg movprfx\t%0, %3\;<sur>dot\\t%0.<Vetype>, %1.<Vetype_fourth>, %2.<Vetype_fourth>"
6743 1.1.1.3 mrg [(set_attr "movprfx" "*,yes")]
6744 1.1.1.3 mrg )
6745 1.1.1.3 mrg
6746 1.1.1.3 mrg ;; Four-element integer dot-product by selected lanes with accumulation.
6747 1.1.1.3 mrg (define_insn "@aarch64_<sur>dot_prod_lane<vsi2qi>"
6748 1.1.1.3 mrg [(set (match_operand:SVE_FULL_SDI 0 "register_operand" "=w, ?&w")
6749 1.1.1.3 mrg (plus:SVE_FULL_SDI
6750 1.1.1.3 mrg (unspec:SVE_FULL_SDI
6751 1.1.1.3 mrg [(match_operand:<VSI2QI> 1 "register_operand" "w, w")
6752 1.1.1.3 mrg (unspec:<VSI2QI>
6753 1.1.1.3 mrg [(match_operand:<VSI2QI> 2 "register_operand" "<sve_lane_con>, <sve_lane_con>")
6754 1.1.1.3 mrg (match_operand:SI 3 "const_int_operand")]
6755 1.1.1.3 mrg UNSPEC_SVE_LANE_SELECT)]
6756 1.1.1.3 mrg DOTPROD)
6757 1.1.1.3 mrg (match_operand:SVE_FULL_SDI 4 "register_operand" "0, w")))]
6758 1.1.1.3 mrg "TARGET_SVE"
6759 1.1.1.3 mrg "@
6760 1.1.1.3 mrg <sur>dot\\t%0.<Vetype>, %1.<Vetype_fourth>, %2.<Vetype_fourth>[%3]
6761 1.1.1.3 mrg movprfx\t%0, %4\;<sur>dot\\t%0.<Vetype>, %1.<Vetype_fourth>, %2.<Vetype_fourth>[%3]"
6762 1.1.1.3 mrg [(set_attr "movprfx" "*,yes")]
6763 1.1.1.3 mrg )
6764 1.1.1.3 mrg
6765 1.1.1.3 mrg (define_insn "@aarch64_<sur>dot_prod<vsi2qi>"
6766 1.1.1.3 mrg [(set (match_operand:VNx4SI_ONLY 0 "register_operand" "=w, ?&w")
6767 1.1.1.3 mrg (plus:VNx4SI_ONLY
6768 1.1.1.3 mrg (unspec:VNx4SI_ONLY
6769 1.1.1.3 mrg [(match_operand:<VSI2QI> 1 "register_operand" "w, w")
6770 1.1.1.3 mrg (match_operand:<VSI2QI> 2 "register_operand" "w, w")]
6771 1.1.1.3 mrg DOTPROD_US_ONLY)
6772 1.1.1.3 mrg (match_operand:VNx4SI_ONLY 3 "register_operand" "0, w")))]
6773 1.1.1.3 mrg "TARGET_SVE_I8MM"
6774 1.1.1.3 mrg "@
6775 1.1.1.3 mrg <sur>dot\\t%0.s, %1.b, %2.b
6776 1.1.1.3 mrg movprfx\t%0, %3\;<sur>dot\\t%0.s, %1.b, %2.b"
6777 1.1.1.3 mrg [(set_attr "movprfx" "*,yes")]
6778 1.1.1.3 mrg )
6779 1.1.1.3 mrg
6780 1.1.1.3 mrg (define_insn "@aarch64_<sur>dot_prod_lane<vsi2qi>"
6781 1.1.1.3 mrg [(set (match_operand:VNx4SI_ONLY 0 "register_operand" "=w, ?&w")
6782 1.1.1.3 mrg (plus:VNx4SI_ONLY
6783 1.1.1.3 mrg (unspec:VNx4SI_ONLY
6784 1.1.1.3 mrg [(match_operand:<VSI2QI> 1 "register_operand" "w, w")
6785 1.1.1.3 mrg (unspec:<VSI2QI>
6786 1.1.1.3 mrg [(match_operand:<VSI2QI> 2 "register_operand" "y, y")
6787 1.1.1.3 mrg (match_operand:SI 3 "const_int_operand")]
6788 1.1.1.3 mrg UNSPEC_SVE_LANE_SELECT)]
6789 1.1.1.3 mrg DOTPROD_I8MM)
6790 1.1.1.3 mrg (match_operand:VNx4SI_ONLY 4 "register_operand" "0, w")))]
6791 1.1.1.3 mrg "TARGET_SVE_I8MM"
6792 1.1.1.3 mrg "@
6793 1.1.1.3 mrg <sur>dot\\t%0.s, %1.b, %2.b[%3]
6794 1.1.1.3 mrg movprfx\t%0, %4\;<sur>dot\\t%0.s, %1.b, %2.b[%3]"
6795 1.1.1.3 mrg [(set_attr "movprfx" "*,yes")]
6796 1.1.1.3 mrg )
6797 1.1.1.3 mrg
6798 1.1.1.3 mrg ;; -------------------------------------------------------------------------
6799 1.1.1.3 mrg ;; ---- [INT] Sum of absolute differences
6800 1.1.1.3 mrg ;; -------------------------------------------------------------------------
6801 1.1.1.3 mrg ;; The patterns in this section are synthetic.
6802 1.1.1.3 mrg ;; -------------------------------------------------------------------------
6803 1.1.1.3 mrg
6804 1.1.1.3 mrg ;; Emit a sequence to produce a sum-of-absolute-differences of the inputs in
6805 1.1.1.3 mrg ;; operands 1 and 2. The sequence also has to perform a widening reduction of
6806 1.1.1.3 mrg ;; the difference into a vector and accumulate that into operand 3 before
6807 1.1.1.3 mrg ;; copying that into the result operand 0.
6808 1.1.1.3 mrg ;; Perform that with a sequence of:
6809 1.1.1.3 mrg ;; MOV ones.b, #1
6810 1.1.1.3 mrg ;; [SU]ABD diff.b, p0/m, op1.b, op2.b
6811 1.1.1.3 mrg ;; MOVPRFX op0, op3 // If necessary
6812 1.1.1.3 mrg ;; UDOT op0.s, diff.b, ones.b
6813 1.1.1.3 mrg (define_expand "<sur>sad<vsi2qi>"
6814 1.1.1.3 mrg [(use (match_operand:SVE_FULL_SDI 0 "register_operand"))
6815 1.1.1.3 mrg (unspec:<VSI2QI> [(use (match_operand:<VSI2QI> 1 "register_operand"))
6816 1.1.1.3 mrg (use (match_operand:<VSI2QI> 2 "register_operand"))] ABAL)
6817 1.1.1.3 mrg (use (match_operand:SVE_FULL_SDI 3 "register_operand"))]
6818 1.1.1.3 mrg "TARGET_SVE"
6819 1.1.1.3 mrg {
6820 1.1.1.3 mrg rtx ones = force_reg (<VSI2QI>mode, CONST1_RTX (<VSI2QI>mode));
6821 1.1.1.3 mrg rtx diff = gen_reg_rtx (<VSI2QI>mode);
6822 1.1.1.3 mrg emit_insn (gen_<sur>abd<vsi2qi>_3 (diff, operands[1], operands[2]));
6823 1.1.1.3 mrg emit_insn (gen_udot_prod<vsi2qi> (operands[0], diff, ones, operands[3]));
6824 1.1 mrg DONE;
6825 1.1 mrg }
6826 1.1 mrg )
6827 1.1 mrg
6828 1.1.1.3 mrg ;; -------------------------------------------------------------------------
6829 1.1.1.3 mrg ;; ---- [INT] Matrix multiply-accumulate
6830 1.1.1.3 mrg ;; -------------------------------------------------------------------------
6831 1.1.1.3 mrg ;; Includes:
6832 1.1.1.3 mrg ;; - SMMLA (I8MM)
6833 1.1.1.3 mrg ;; - UMMLA (I8MM)
6834 1.1.1.3 mrg ;; - USMMLA (I8MM)
6835 1.1.1.3 mrg ;; -------------------------------------------------------------------------
6836 1.1.1.3 mrg
6837 1.1.1.3 mrg (define_insn "@aarch64_sve_add_<optab><vsi2qi>"
6838 1.1.1.3 mrg [(set (match_operand:VNx4SI_ONLY 0 "register_operand" "=w, ?&w")
6839 1.1.1.3 mrg (plus:VNx4SI_ONLY
6840 1.1.1.3 mrg (unspec:VNx4SI_ONLY
6841 1.1.1.3 mrg [(match_operand:<VSI2QI> 2 "register_operand" "w, w")
6842 1.1.1.3 mrg (match_operand:<VSI2QI> 3 "register_operand" "w, w")]
6843 1.1.1.3 mrg MATMUL)
6844 1.1.1.3 mrg (match_operand:VNx4SI_ONLY 1 "register_operand" "0, w")))]
6845 1.1.1.3 mrg "TARGET_SVE_I8MM"
6846 1.1.1.3 mrg "@
6847 1.1.1.3 mrg <sur>mmla\\t%0.s, %2.b, %3.b
6848 1.1.1.3 mrg movprfx\t%0, %1\;<sur>mmla\\t%0.s, %2.b, %3.b"
6849 1.1.1.3 mrg [(set_attr "movprfx" "*,yes")]
6850 1.1.1.3 mrg )
6851 1.1.1.3 mrg
6852 1.1.1.3 mrg ;; -------------------------------------------------------------------------
6853 1.1.1.3 mrg ;; ---- [FP] General ternary arithmetic corresponding to unspecs
6854 1.1.1.3 mrg ;; -------------------------------------------------------------------------
6855 1.1.1.3 mrg ;; Includes merging patterns for:
6856 1.1.1.3 mrg ;; - FMAD
6857 1.1.1.3 mrg ;; - FMLA
6858 1.1.1.3 mrg ;; - FMLS
6859 1.1.1.3 mrg ;; - FMSB
6860 1.1.1.3 mrg ;; - FNMAD
6861 1.1.1.3 mrg ;; - FNMLA
6862 1.1.1.3 mrg ;; - FNMLS
6863 1.1.1.3 mrg ;; - FNMSB
6864 1.1.1.3 mrg ;; -------------------------------------------------------------------------
6865 1.1.1.3 mrg
6866 1.1.1.3 mrg ;; Unpredicated floating-point ternary operations.
6867 1.1.1.3 mrg (define_expand "<optab><mode>4"
6868 1.1.1.3 mrg [(set (match_operand:SVE_FULL_F 0 "register_operand")
6869 1.1.1.3 mrg (unspec:SVE_FULL_F
6870 1.1.1.3 mrg [(match_dup 4)
6871 1.1.1.3 mrg (const_int SVE_RELAXED_GP)
6872 1.1.1.3 mrg (match_operand:SVE_FULL_F 1 "register_operand")
6873 1.1.1.3 mrg (match_operand:SVE_FULL_F 2 "register_operand")
6874 1.1.1.3 mrg (match_operand:SVE_FULL_F 3 "register_operand")]
6875 1.1.1.3 mrg SVE_COND_FP_TERNARY))]
6876 1.1 mrg "TARGET_SVE"
6877 1.1.1.3 mrg {
6878 1.1.1.3 mrg operands[4] = aarch64_ptrue_reg (<VPRED>mode);
6879 1.1.1.3 mrg }
6880 1.1 mrg )
6881 1.1 mrg
6882 1.1.1.3 mrg ;; Predicated floating-point ternary operations.
6883 1.1.1.3 mrg (define_insn "@aarch64_pred_<optab><mode>"
6884 1.1.1.3 mrg [(set (match_operand:SVE_FULL_F 0 "register_operand" "=w, w, ?&w")
6885 1.1.1.3 mrg (unspec:SVE_FULL_F
6886 1.1.1.3 mrg [(match_operand:<VPRED> 1 "register_operand" "Upl, Upl, Upl")
6887 1.1.1.3 mrg (match_operand:SI 5 "aarch64_sve_gp_strictness")
6888 1.1.1.3 mrg (match_operand:SVE_FULL_F 2 "register_operand" "%w, 0, w")
6889 1.1.1.3 mrg (match_operand:SVE_FULL_F 3 "register_operand" "w, w, w")
6890 1.1.1.3 mrg (match_operand:SVE_FULL_F 4 "register_operand" "0, w, w")]
6891 1.1.1.3 mrg SVE_COND_FP_TERNARY))]
6892 1.1 mrg "TARGET_SVE"
6893 1.1.1.3 mrg "@
6894 1.1.1.3 mrg <sve_fmla_op>\t%0.<Vetype>, %1/m, %2.<Vetype>, %3.<Vetype>
6895 1.1.1.3 mrg <sve_fmad_op>\t%0.<Vetype>, %1/m, %3.<Vetype>, %4.<Vetype>
6896 1.1.1.3 mrg movprfx\t%0, %4\;<sve_fmla_op>\t%0.<Vetype>, %1/m, %2.<Vetype>, %3.<Vetype>"
6897 1.1.1.3 mrg [(set_attr "movprfx" "*,*,yes")]
6898 1.1.1.3 mrg )
6899 1.1.1.3 mrg
6900 1.1.1.3 mrg ;; Predicated floating-point ternary operations with merging.
6901 1.1.1.3 mrg (define_expand "@cond_<optab><mode>"
6902 1.1.1.3 mrg [(set (match_operand:SVE_FULL_F 0 "register_operand")
6903 1.1.1.3 mrg (unspec:SVE_FULL_F
6904 1.1.1.3 mrg [(match_operand:<VPRED> 1 "register_operand")
6905 1.1.1.3 mrg (unspec:SVE_FULL_F
6906 1.1.1.3 mrg [(match_dup 1)
6907 1.1.1.3 mrg (const_int SVE_STRICT_GP)
6908 1.1.1.3 mrg (match_operand:SVE_FULL_F 2 "register_operand")
6909 1.1.1.3 mrg (match_operand:SVE_FULL_F 3 "register_operand")
6910 1.1.1.3 mrg (match_operand:SVE_FULL_F 4 "register_operand")]
6911 1.1.1.3 mrg SVE_COND_FP_TERNARY)
6912 1.1.1.3 mrg (match_operand:SVE_FULL_F 5 "aarch64_simd_reg_or_zero")]
6913 1.1.1.3 mrg UNSPEC_SEL))]
6914 1.1.1.3 mrg "TARGET_SVE"
6915 1.1.1.3 mrg {
6916 1.1.1.3 mrg /* Swap the multiplication operands if the fallback value is the
6917 1.1.1.3 mrg second of the two. */
6918 1.1.1.3 mrg if (rtx_equal_p (operands[3], operands[5]))
6919 1.1.1.3 mrg std::swap (operands[2], operands[3]);
6920 1.1.1.3 mrg })
6921 1.1.1.3 mrg
6922 1.1.1.3 mrg ;; Predicated floating-point ternary operations, merging with the
6923 1.1.1.3 mrg ;; first input.
6924 1.1.1.3 mrg (define_insn_and_rewrite "*cond_<optab><mode>_2_relaxed"
6925 1.1.1.3 mrg [(set (match_operand:SVE_FULL_F 0 "register_operand" "=w, ?&w")
6926 1.1.1.3 mrg (unspec:SVE_FULL_F
6927 1.1.1.3 mrg [(match_operand:<VPRED> 1 "register_operand" "Upl, Upl")
6928 1.1.1.3 mrg (unspec:SVE_FULL_F
6929 1.1.1.3 mrg [(match_operand 5)
6930 1.1.1.3 mrg (const_int SVE_RELAXED_GP)
6931 1.1.1.3 mrg (match_operand:SVE_FULL_F 2 "register_operand" "0, w")
6932 1.1.1.3 mrg (match_operand:SVE_FULL_F 3 "register_operand" "w, w")
6933 1.1.1.3 mrg (match_operand:SVE_FULL_F 4 "register_operand" "w, w")]
6934 1.1.1.3 mrg SVE_COND_FP_TERNARY)
6935 1.1.1.3 mrg (match_dup 2)]
6936 1.1.1.3 mrg UNSPEC_SEL))]
6937 1.1.1.3 mrg "TARGET_SVE"
6938 1.1.1.3 mrg "@
6939 1.1.1.3 mrg <sve_fmad_op>\t%0.<Vetype>, %1/m, %3.<Vetype>, %4.<Vetype>
6940 1.1.1.3 mrg movprfx\t%0, %2\;<sve_fmad_op>\t%0.<Vetype>, %1/m, %3.<Vetype>, %4.<Vetype>"
6941 1.1.1.3 mrg "&& !rtx_equal_p (operands[1], operands[5])"
6942 1.1 mrg {
6943 1.1.1.3 mrg operands[5] = copy_rtx (operands[1]);
6944 1.1 mrg }
6945 1.1.1.3 mrg [(set_attr "movprfx" "*,yes")]
6946 1.1 mrg )
6947 1.1 mrg
6948 1.1.1.3 mrg (define_insn "*cond_<optab><mode>_2_strict"
6949 1.1.1.3 mrg [(set (match_operand:SVE_FULL_F 0 "register_operand" "=w, ?&w")
6950 1.1.1.3 mrg (unspec:SVE_FULL_F
6951 1.1 mrg [(match_operand:<VPRED> 1 "register_operand" "Upl, Upl")
6952 1.1.1.3 mrg (unspec:SVE_FULL_F
6953 1.1.1.3 mrg [(match_dup 1)
6954 1.1.1.3 mrg (const_int SVE_STRICT_GP)
6955 1.1.1.3 mrg (match_operand:SVE_FULL_F 2 "register_operand" "0, w")
6956 1.1.1.3 mrg (match_operand:SVE_FULL_F 3 "register_operand" "w, w")
6957 1.1.1.3 mrg (match_operand:SVE_FULL_F 4 "register_operand" "w, w")]
6958 1.1.1.3 mrg SVE_COND_FP_TERNARY)
6959 1.1.1.3 mrg (match_dup 2)]
6960 1.1.1.3 mrg UNSPEC_SEL))]
6961 1.1 mrg "TARGET_SVE"
6962 1.1 mrg "@
6963 1.1.1.3 mrg <sve_fmad_op>\t%0.<Vetype>, %1/m, %3.<Vetype>, %4.<Vetype>
6964 1.1.1.3 mrg movprfx\t%0, %2\;<sve_fmad_op>\t%0.<Vetype>, %1/m, %3.<Vetype>, %4.<Vetype>"
6965 1.1.1.3 mrg [(set_attr "movprfx" "*,yes")]
6966 1.1 mrg )
6967 1.1 mrg
6968 1.1.1.3 mrg ;; Predicated floating-point ternary operations, merging with the
6969 1.1.1.3 mrg ;; third input.
6970 1.1.1.3 mrg (define_insn_and_rewrite "*cond_<optab><mode>_4_relaxed"
6971 1.1.1.3 mrg [(set (match_operand:SVE_FULL_F 0 "register_operand" "=w, ?&w")
6972 1.1.1.3 mrg (unspec:SVE_FULL_F
6973 1.1.1.3 mrg [(match_operand:<VPRED> 1 "register_operand" "Upl, Upl")
6974 1.1.1.3 mrg (unspec:SVE_FULL_F
6975 1.1.1.3 mrg [(match_operand 5)
6976 1.1.1.3 mrg (const_int SVE_RELAXED_GP)
6977 1.1.1.3 mrg (match_operand:SVE_FULL_F 2 "register_operand" "w, w")
6978 1.1.1.3 mrg (match_operand:SVE_FULL_F 3 "register_operand" "w, w")
6979 1.1.1.3 mrg (match_operand:SVE_FULL_F 4 "register_operand" "0, w")]
6980 1.1.1.3 mrg SVE_COND_FP_TERNARY)
6981 1.1.1.3 mrg (match_dup 4)]
6982 1.1.1.3 mrg UNSPEC_SEL))]
6983 1.1 mrg "TARGET_SVE"
6984 1.1 mrg "@
6985 1.1.1.3 mrg <sve_fmla_op>\t%0.<Vetype>, %1/m, %2.<Vetype>, %3.<Vetype>
6986 1.1.1.3 mrg movprfx\t%0, %4\;<sve_fmla_op>\t%0.<Vetype>, %1/m, %2.<Vetype>, %3.<Vetype>"
6987 1.1.1.3 mrg "&& !rtx_equal_p (operands[1], operands[5])"
6988 1.1.1.3 mrg {
6989 1.1.1.3 mrg operands[5] = copy_rtx (operands[1]);
6990 1.1.1.3 mrg }
6991 1.1.1.3 mrg [(set_attr "movprfx" "*,yes")]
6992 1.1.1.3 mrg )
6993 1.1.1.3 mrg
6994 1.1.1.3 mrg (define_insn "*cond_<optab><mode>_4_strict"
6995 1.1.1.3 mrg [(set (match_operand:SVE_FULL_F 0 "register_operand" "=w, ?&w")
6996 1.1.1.3 mrg (unspec:SVE_FULL_F
6997 1.1.1.3 mrg [(match_operand:<VPRED> 1 "register_operand" "Upl, Upl")
6998 1.1.1.3 mrg (unspec:SVE_FULL_F
6999 1.1.1.3 mrg [(match_dup 1)
7000 1.1.1.3 mrg (const_int SVE_STRICT_GP)
7001 1.1.1.3 mrg (match_operand:SVE_FULL_F 2 "register_operand" "w, w")
7002 1.1.1.3 mrg (match_operand:SVE_FULL_F 3 "register_operand" "w, w")
7003 1.1.1.3 mrg (match_operand:SVE_FULL_F 4 "register_operand" "0, w")]
7004 1.1.1.3 mrg SVE_COND_FP_TERNARY)
7005 1.1.1.3 mrg (match_dup 4)]
7006 1.1.1.3 mrg UNSPEC_SEL))]
7007 1.1.1.3 mrg "TARGET_SVE"
7008 1.1.1.3 mrg "@
7009 1.1.1.3 mrg <sve_fmla_op>\t%0.<Vetype>, %1/m, %2.<Vetype>, %3.<Vetype>
7010 1.1.1.3 mrg movprfx\t%0, %4\;<sve_fmla_op>\t%0.<Vetype>, %1/m, %2.<Vetype>, %3.<Vetype>"
7011 1.1.1.3 mrg [(set_attr "movprfx" "*,yes")]
7012 1.1.1.3 mrg )
7013 1.1.1.3 mrg
7014 1.1.1.3 mrg ;; Predicated floating-point ternary operations, merging with an
7015 1.1.1.3 mrg ;; independent value.
7016 1.1.1.3 mrg (define_insn_and_rewrite "*cond_<optab><mode>_any_relaxed"
7017 1.1.1.3 mrg [(set (match_operand:SVE_FULL_F 0 "register_operand" "=&w, &w, &w, &w, &w, ?&w")
7018 1.1.1.3 mrg (unspec:SVE_FULL_F
7019 1.1.1.3 mrg [(match_operand:<VPRED> 1 "register_operand" "Upl, Upl, Upl, Upl, Upl, Upl")
7020 1.1.1.3 mrg (unspec:SVE_FULL_F
7021 1.1.1.3 mrg [(match_operand 6)
7022 1.1.1.3 mrg (const_int SVE_RELAXED_GP)
7023 1.1.1.3 mrg (match_operand:SVE_FULL_F 2 "register_operand" "w, w, 0, w, w, w")
7024 1.1.1.3 mrg (match_operand:SVE_FULL_F 3 "register_operand" "w, w, w, 0, w, w")
7025 1.1.1.3 mrg (match_operand:SVE_FULL_F 4 "register_operand" "w, 0, w, w, w, w")]
7026 1.1.1.3 mrg SVE_COND_FP_TERNARY)
7027 1.1.1.3 mrg (match_operand:SVE_FULL_F 5 "aarch64_simd_reg_or_zero" "Dz, Dz, Dz, Dz, 0, w")]
7028 1.1.1.3 mrg UNSPEC_SEL))]
7029 1.1.1.3 mrg "TARGET_SVE
7030 1.1.1.3 mrg && !rtx_equal_p (operands[2], operands[5])
7031 1.1.1.3 mrg && !rtx_equal_p (operands[3], operands[5])
7032 1.1.1.3 mrg && !rtx_equal_p (operands[4], operands[5])"
7033 1.1.1.3 mrg "@
7034 1.1.1.3 mrg movprfx\t%0.<Vetype>, %1/z, %4.<Vetype>\;<sve_fmla_op>\t%0.<Vetype>, %1/m, %2.<Vetype>, %3.<Vetype>
7035 1.1.1.3 mrg movprfx\t%0.<Vetype>, %1/z, %0.<Vetype>\;<sve_fmla_op>\t%0.<Vetype>, %1/m, %2.<Vetype>, %3.<Vetype>
7036 1.1.1.3 mrg movprfx\t%0.<Vetype>, %1/z, %0.<Vetype>\;<sve_fmad_op>\t%0.<Vetype>, %1/m, %3.<Vetype>, %4.<Vetype>
7037 1.1.1.3 mrg movprfx\t%0.<Vetype>, %1/z, %0.<Vetype>\;<sve_fmad_op>\t%0.<Vetype>, %1/m, %2.<Vetype>, %4.<Vetype>
7038 1.1.1.3 mrg movprfx\t%0.<Vetype>, %1/m, %4.<Vetype>\;<sve_fmla_op>\t%0.<Vetype>, %1/m, %2.<Vetype>, %3.<Vetype>
7039 1.1.1.3 mrg #"
7040 1.1.1.3 mrg "&& 1"
7041 1.1.1.3 mrg {
7042 1.1.1.3 mrg if (reload_completed
7043 1.1.1.3 mrg && register_operand (operands[5], <MODE>mode)
7044 1.1.1.3 mrg && !rtx_equal_p (operands[0], operands[5]))
7045 1.1.1.3 mrg {
7046 1.1.1.3 mrg emit_insn (gen_vcond_mask_<mode><vpred> (operands[0], operands[4],
7047 1.1.1.3 mrg operands[5], operands[1]));
7048 1.1.1.3 mrg operands[5] = operands[4] = operands[0];
7049 1.1.1.3 mrg }
7050 1.1.1.3 mrg else if (!rtx_equal_p (operands[1], operands[6]))
7051 1.1.1.3 mrg operands[6] = copy_rtx (operands[1]);
7052 1.1.1.3 mrg else
7053 1.1.1.3 mrg FAIL;
7054 1.1.1.3 mrg }
7055 1.1.1.3 mrg [(set_attr "movprfx" "yes")]
7056 1.1.1.3 mrg )
7057 1.1.1.3 mrg
7058 1.1.1.3 mrg (define_insn_and_rewrite "*cond_<optab><mode>_any_strict"
7059 1.1.1.3 mrg [(set (match_operand:SVE_FULL_F 0 "register_operand" "=&w, &w, &w, &w, &w, ?&w")
7060 1.1.1.3 mrg (unspec:SVE_FULL_F
7061 1.1.1.3 mrg [(match_operand:<VPRED> 1 "register_operand" "Upl, Upl, Upl, Upl, Upl, Upl")
7062 1.1.1.3 mrg (unspec:SVE_FULL_F
7063 1.1.1.3 mrg [(match_dup 1)
7064 1.1.1.3 mrg (const_int SVE_STRICT_GP)
7065 1.1.1.3 mrg (match_operand:SVE_FULL_F 2 "register_operand" "w, w, 0, w, w, w")
7066 1.1.1.3 mrg (match_operand:SVE_FULL_F 3 "register_operand" "w, w, w, 0, w, w")
7067 1.1.1.3 mrg (match_operand:SVE_FULL_F 4 "register_operand" "w, 0, w, w, w, w")]
7068 1.1.1.3 mrg SVE_COND_FP_TERNARY)
7069 1.1.1.3 mrg (match_operand:SVE_FULL_F 5 "aarch64_simd_reg_or_zero" "Dz, Dz, Dz, Dz, 0, w")]
7070 1.1.1.3 mrg UNSPEC_SEL))]
7071 1.1.1.3 mrg "TARGET_SVE
7072 1.1.1.3 mrg && !rtx_equal_p (operands[2], operands[5])
7073 1.1.1.3 mrg && !rtx_equal_p (operands[3], operands[5])
7074 1.1.1.3 mrg && !rtx_equal_p (operands[4], operands[5])"
7075 1.1.1.3 mrg "@
7076 1.1.1.3 mrg movprfx\t%0.<Vetype>, %1/z, %4.<Vetype>\;<sve_fmla_op>\t%0.<Vetype>, %1/m, %2.<Vetype>, %3.<Vetype>
7077 1.1.1.3 mrg movprfx\t%0.<Vetype>, %1/z, %0.<Vetype>\;<sve_fmla_op>\t%0.<Vetype>, %1/m, %2.<Vetype>, %3.<Vetype>
7078 1.1.1.3 mrg movprfx\t%0.<Vetype>, %1/z, %0.<Vetype>\;<sve_fmad_op>\t%0.<Vetype>, %1/m, %3.<Vetype>, %4.<Vetype>
7079 1.1.1.3 mrg movprfx\t%0.<Vetype>, %1/z, %0.<Vetype>\;<sve_fmad_op>\t%0.<Vetype>, %1/m, %2.<Vetype>, %4.<Vetype>
7080 1.1.1.3 mrg movprfx\t%0.<Vetype>, %1/m, %4.<Vetype>\;<sve_fmla_op>\t%0.<Vetype>, %1/m, %2.<Vetype>, %3.<Vetype>
7081 1.1.1.3 mrg #"
7082 1.1.1.3 mrg "&& reload_completed
7083 1.1.1.3 mrg && register_operand (operands[5], <MODE>mode)
7084 1.1.1.3 mrg && !rtx_equal_p (operands[0], operands[5])"
7085 1.1.1.3 mrg {
7086 1.1.1.3 mrg emit_insn (gen_vcond_mask_<mode><vpred> (operands[0], operands[4],
7087 1.1.1.3 mrg operands[5], operands[1]));
7088 1.1.1.3 mrg operands[5] = operands[4] = operands[0];
7089 1.1.1.3 mrg }
7090 1.1.1.3 mrg [(set_attr "movprfx" "yes")]
7091 1.1.1.3 mrg )
7092 1.1.1.3 mrg
7093 1.1.1.3 mrg ;; Unpredicated FMLA and FMLS by selected lanes. It doesn't seem worth using
7094 1.1.1.3 mrg ;; (fma ...) since target-independent code won't understand the indexing.
7095 1.1.1.3 mrg (define_insn "@aarch64_<optab>_lane_<mode>"
7096 1.1.1.3 mrg [(set (match_operand:SVE_FULL_F 0 "register_operand" "=w, ?&w")
7097 1.1.1.3 mrg (unspec:SVE_FULL_F
7098 1.1.1.3 mrg [(match_operand:SVE_FULL_F 1 "register_operand" "w, w")
7099 1.1.1.3 mrg (unspec:SVE_FULL_F
7100 1.1.1.3 mrg [(match_operand:SVE_FULL_F 2 "register_operand" "<sve_lane_con>, <sve_lane_con>")
7101 1.1.1.3 mrg (match_operand:SI 3 "const_int_operand")]
7102 1.1.1.3 mrg UNSPEC_SVE_LANE_SELECT)
7103 1.1.1.3 mrg (match_operand:SVE_FULL_F 4 "register_operand" "0, w")]
7104 1.1.1.3 mrg SVE_FP_TERNARY_LANE))]
7105 1.1.1.3 mrg "TARGET_SVE"
7106 1.1.1.3 mrg "@
7107 1.1.1.3 mrg <sve_fp_op>\t%0.<Vetype>, %1.<Vetype>, %2.<Vetype>[%3]
7108 1.1.1.3 mrg movprfx\t%0, %4\;<sve_fp_op>\t%0.<Vetype>, %1.<Vetype>, %2.<Vetype>[%3]"
7109 1.1.1.3 mrg [(set_attr "movprfx" "*,yes")]
7110 1.1 mrg )
7111 1.1 mrg
7112 1.1.1.3 mrg ;; -------------------------------------------------------------------------
7113 1.1.1.3 mrg ;; ---- [FP] Complex multiply-add
7114 1.1.1.3 mrg ;; -------------------------------------------------------------------------
7115 1.1.1.3 mrg ;; Includes merging patterns for:
7116 1.1.1.3 mrg ;; - FCMLA
7117 1.1.1.3 mrg ;; -------------------------------------------------------------------------
7118 1.1.1.3 mrg
7119 1.1.1.3 mrg ;; Predicated FCMLA.
7120 1.1.1.3 mrg (define_insn "@aarch64_pred_<optab><mode>"
7121 1.1.1.3 mrg [(set (match_operand:SVE_FULL_F 0 "register_operand" "=w, ?&w")
7122 1.1.1.3 mrg (unspec:SVE_FULL_F
7123 1.1.1.3 mrg [(match_operand:<VPRED> 1 "register_operand" "Upl, Upl")
7124 1.1.1.3 mrg (match_operand:SI 5 "aarch64_sve_gp_strictness")
7125 1.1.1.3 mrg (match_operand:SVE_FULL_F 2 "register_operand" "w, w")
7126 1.1.1.3 mrg (match_operand:SVE_FULL_F 3 "register_operand" "w, w")
7127 1.1.1.3 mrg (match_operand:SVE_FULL_F 4 "register_operand" "0, w")]
7128 1.1.1.3 mrg SVE_COND_FCMLA))]
7129 1.1 mrg "TARGET_SVE"
7130 1.1 mrg "@
7131 1.1.1.3 mrg fcmla\t%0.<Vetype>, %1/m, %2.<Vetype>, %3.<Vetype>, #<rot>
7132 1.1.1.3 mrg movprfx\t%0, %4\;fcmla\t%0.<Vetype>, %1/m, %2.<Vetype>, %3.<Vetype>, #<rot>"
7133 1.1.1.3 mrg [(set_attr "movprfx" "*,yes")]
7134 1.1 mrg )
7135 1.1 mrg
7136 1.1.1.3 mrg ;; Predicated FCMLA with merging.
7137 1.1.1.3 mrg (define_expand "@cond_<optab><mode>"
7138 1.1.1.3 mrg [(set (match_operand:SVE_FULL_F 0 "register_operand")
7139 1.1.1.3 mrg (unspec:SVE_FULL_F
7140 1.1.1.3 mrg [(match_operand:<VPRED> 1 "register_operand")
7141 1.1.1.3 mrg (unspec:SVE_FULL_F
7142 1.1.1.3 mrg [(match_dup 1)
7143 1.1.1.3 mrg (const_int SVE_STRICT_GP)
7144 1.1.1.3 mrg (match_operand:SVE_FULL_F 2 "register_operand")
7145 1.1.1.3 mrg (match_operand:SVE_FULL_F 3 "register_operand")
7146 1.1.1.3 mrg (match_operand:SVE_FULL_F 4 "register_operand")]
7147 1.1.1.3 mrg SVE_COND_FCMLA)
7148 1.1.1.3 mrg (match_operand:SVE_FULL_F 5 "aarch64_simd_reg_or_zero")]
7149 1.1.1.3 mrg UNSPEC_SEL))]
7150 1.1.1.2 mrg "TARGET_SVE"
7151 1.1.1.2 mrg )
7152 1.1.1.2 mrg
7153 1.1.1.3 mrg ;; Predicated FCMLA, merging with the third input.
7154 1.1.1.3 mrg (define_insn_and_rewrite "*cond_<optab><mode>_4_relaxed"
7155 1.1.1.3 mrg [(set (match_operand:SVE_FULL_F 0 "register_operand" "=w, ?&w")
7156 1.1.1.3 mrg (unspec:SVE_FULL_F
7157 1.1.1.3 mrg [(match_operand:<VPRED> 1 "register_operand" "Upl, Upl")
7158 1.1.1.3 mrg (unspec:SVE_FULL_F
7159 1.1.1.3 mrg [(match_operand 5)
7160 1.1.1.3 mrg (const_int SVE_RELAXED_GP)
7161 1.1.1.3 mrg (match_operand:SVE_FULL_F 2 "register_operand" "w, w")
7162 1.1.1.3 mrg (match_operand:SVE_FULL_F 3 "register_operand" "w, w")
7163 1.1.1.3 mrg (match_operand:SVE_FULL_F 4 "register_operand" "0, w")]
7164 1.1.1.3 mrg SVE_COND_FCMLA)
7165 1.1.1.3 mrg (match_dup 4)]
7166 1.1.1.3 mrg UNSPEC_SEL))]
7167 1.1.1.2 mrg "TARGET_SVE"
7168 1.1.1.2 mrg "@
7169 1.1.1.3 mrg fcmla\t%0.<Vetype>, %1/m, %2.<Vetype>, %3.<Vetype>, #<rot>
7170 1.1.1.3 mrg movprfx\t%0, %4\;fcmla\t%0.<Vetype>, %1/m, %2.<Vetype>, %3.<Vetype>, #<rot>"
7171 1.1.1.3 mrg "&& !rtx_equal_p (operands[1], operands[5])"
7172 1.1.1.3 mrg {
7173 1.1.1.3 mrg operands[5] = copy_rtx (operands[1]);
7174 1.1.1.3 mrg }
7175 1.1.1.3 mrg [(set_attr "movprfx" "*,yes")]
7176 1.1.1.2 mrg )
7177 1.1.1.2 mrg
7178 1.1.1.3 mrg (define_insn "*cond_<optab><mode>_4_strict"
7179 1.1.1.3 mrg [(set (match_operand:SVE_FULL_F 0 "register_operand" "=w, ?&w")
7180 1.1.1.3 mrg (unspec:SVE_FULL_F
7181 1.1 mrg [(match_operand:<VPRED> 1 "register_operand" "Upl, Upl")
7182 1.1.1.3 mrg (unspec:SVE_FULL_F
7183 1.1.1.3 mrg [(match_dup 1)
7184 1.1.1.3 mrg (const_int SVE_STRICT_GP)
7185 1.1.1.3 mrg (match_operand:SVE_FULL_F 2 "register_operand" "w, w")
7186 1.1.1.3 mrg (match_operand:SVE_FULL_F 3 "register_operand" "w, w")
7187 1.1.1.3 mrg (match_operand:SVE_FULL_F 4 "register_operand" "0, w")]
7188 1.1.1.3 mrg SVE_COND_FCMLA)
7189 1.1.1.3 mrg (match_dup 4)]
7190 1.1.1.3 mrg UNSPEC_SEL))]
7191 1.1 mrg "TARGET_SVE"
7192 1.1 mrg "@
7193 1.1.1.3 mrg fcmla\t%0.<Vetype>, %1/m, %2.<Vetype>, %3.<Vetype>, #<rot>
7194 1.1.1.3 mrg movprfx\t%0, %4\;fcmla\t%0.<Vetype>, %1/m, %2.<Vetype>, %3.<Vetype>, #<rot>"
7195 1.1.1.3 mrg [(set_attr "movprfx" "*,yes")]
7196 1.1 mrg )
7197 1.1 mrg
7198 1.1.1.3 mrg ;; Predicated FCMLA, merging with an independent value.
7199 1.1.1.3 mrg (define_insn_and_rewrite "*cond_<optab><mode>_any_relaxed"
7200 1.1.1.3 mrg [(set (match_operand:SVE_FULL_F 0 "register_operand" "=&w, &w, &w, ?&w")
7201 1.1.1.3 mrg (unspec:SVE_FULL_F
7202 1.1.1.3 mrg [(match_operand:<VPRED> 1 "register_operand" "Upl, Upl, Upl, Upl")
7203 1.1.1.3 mrg (unspec:SVE_FULL_F
7204 1.1.1.3 mrg [(match_operand 6)
7205 1.1.1.3 mrg (const_int SVE_RELAXED_GP)
7206 1.1.1.3 mrg (match_operand:SVE_FULL_F 2 "register_operand" "w, w, w, w")
7207 1.1.1.3 mrg (match_operand:SVE_FULL_F 3 "register_operand" "w, w, w, w")
7208 1.1.1.3 mrg (match_operand:SVE_FULL_F 4 "register_operand" "w, 0, w, w")]
7209 1.1.1.3 mrg SVE_COND_FCMLA)
7210 1.1.1.3 mrg (match_operand:SVE_FULL_F 5 "aarch64_simd_reg_or_zero" "Dz, Dz, 0, w")]
7211 1.1.1.3 mrg UNSPEC_SEL))]
7212 1.1.1.3 mrg "TARGET_SVE && !rtx_equal_p (operands[4], operands[5])"
7213 1.1.1.3 mrg "@
7214 1.1.1.3 mrg movprfx\t%0.<Vetype>, %1/z, %4.<Vetype>\;fcmla\t%0.<Vetype>, %1/m, %2.<Vetype>, %3.<Vetype>, #<rot>
7215 1.1.1.3 mrg movprfx\t%0.<Vetype>, %1/z, %0.<Vetype>\;fcmla\t%0.<Vetype>, %1/m, %2.<Vetype>, %3.<Vetype>, #<rot>
7216 1.1.1.3 mrg movprfx\t%0.<Vetype>, %1/m, %4.<Vetype>\;fcmla\t%0.<Vetype>, %1/m, %2.<Vetype>, %3.<Vetype>, #<rot>
7217 1.1.1.3 mrg #"
7218 1.1.1.3 mrg "&& 1"
7219 1.1.1.3 mrg {
7220 1.1.1.3 mrg if (reload_completed
7221 1.1.1.3 mrg && register_operand (operands[5], <MODE>mode)
7222 1.1.1.3 mrg && !rtx_equal_p (operands[0], operands[5]))
7223 1.1.1.3 mrg {
7224 1.1.1.3 mrg emit_insn (gen_vcond_mask_<mode><vpred> (operands[0], operands[4],
7225 1.1.1.3 mrg operands[5], operands[1]));
7226 1.1.1.3 mrg operands[5] = operands[4] = operands[0];
7227 1.1.1.3 mrg }
7228 1.1.1.3 mrg else if (!rtx_equal_p (operands[1], operands[6]))
7229 1.1.1.3 mrg operands[6] = copy_rtx (operands[1]);
7230 1.1.1.3 mrg else
7231 1.1.1.3 mrg FAIL;
7232 1.1.1.3 mrg }
7233 1.1.1.3 mrg [(set_attr "movprfx" "yes")]
7234 1.1 mrg )
7235 1.1 mrg
7236 1.1.1.3 mrg (define_insn_and_rewrite "*cond_<optab><mode>_any_strict"
7237 1.1.1.3 mrg [(set (match_operand:SVE_FULL_F 0 "register_operand" "=&w, &w, &w, ?&w")
7238 1.1.1.3 mrg (unspec:SVE_FULL_F
7239 1.1.1.3 mrg [(match_operand:<VPRED> 1 "register_operand" "Upl, Upl, Upl, Upl")
7240 1.1.1.3 mrg (unspec:SVE_FULL_F
7241 1.1.1.3 mrg [(match_dup 1)
7242 1.1.1.3 mrg (const_int SVE_STRICT_GP)
7243 1.1.1.3 mrg (match_operand:SVE_FULL_F 2 "register_operand" "w, w, w, w")
7244 1.1.1.3 mrg (match_operand:SVE_FULL_F 3 "register_operand" "w, w, w, w")
7245 1.1.1.3 mrg (match_operand:SVE_FULL_F 4 "register_operand" "w, 0, w, w")]
7246 1.1.1.3 mrg SVE_COND_FCMLA)
7247 1.1.1.3 mrg (match_operand:SVE_FULL_F 5 "aarch64_simd_reg_or_zero" "Dz, Dz, 0, w")]
7248 1.1.1.3 mrg UNSPEC_SEL))]
7249 1.1.1.3 mrg "TARGET_SVE && !rtx_equal_p (operands[4], operands[5])"
7250 1.1.1.3 mrg "@
7251 1.1.1.3 mrg movprfx\t%0.<Vetype>, %1/z, %4.<Vetype>\;fcmla\t%0.<Vetype>, %1/m, %2.<Vetype>, %3.<Vetype>, #<rot>
7252 1.1.1.3 mrg movprfx\t%0.<Vetype>, %1/z, %0.<Vetype>\;fcmla\t%0.<Vetype>, %1/m, %2.<Vetype>, %3.<Vetype>, #<rot>
7253 1.1.1.3 mrg movprfx\t%0.<Vetype>, %1/m, %4.<Vetype>\;fcmla\t%0.<Vetype>, %1/m, %2.<Vetype>, %3.<Vetype>, #<rot>
7254 1.1.1.3 mrg #"
7255 1.1.1.3 mrg "&& reload_completed
7256 1.1.1.3 mrg && register_operand (operands[5], <MODE>mode)
7257 1.1.1.3 mrg && !rtx_equal_p (operands[0], operands[5])"
7258 1.1.1.3 mrg {
7259 1.1.1.3 mrg emit_insn (gen_vcond_mask_<mode><vpred> (operands[0], operands[4],
7260 1.1.1.3 mrg operands[5], operands[1]));
7261 1.1.1.3 mrg operands[5] = operands[4] = operands[0];
7262 1.1.1.3 mrg }
7263 1.1.1.3 mrg [(set_attr "movprfx" "yes")]
7264 1.1.1.2 mrg )
7265 1.1.1.2 mrg
7266 1.1.1.3 mrg ;; Unpredicated FCMLA with indexing.
7267 1.1.1.3 mrg (define_insn "@aarch64_<optab>_lane_<mode>"
7268 1.1.1.3 mrg [(set (match_operand:SVE_FULL_HSF 0 "register_operand" "=w, ?&w")
7269 1.1.1.3 mrg (unspec:SVE_FULL_HSF
7270 1.1.1.3 mrg [(match_operand:SVE_FULL_HSF 1 "register_operand" "w, w")
7271 1.1.1.3 mrg (unspec:SVE_FULL_HSF
7272 1.1.1.3 mrg [(match_operand:SVE_FULL_HSF 2 "register_operand" "<sve_lane_pair_con>, <sve_lane_pair_con>")
7273 1.1.1.3 mrg (match_operand:SI 3 "const_int_operand")]
7274 1.1.1.3 mrg UNSPEC_SVE_LANE_SELECT)
7275 1.1.1.3 mrg (match_operand:SVE_FULL_HSF 4 "register_operand" "0, w")]
7276 1.1.1.3 mrg FCMLA))]
7277 1.1.1.2 mrg "TARGET_SVE"
7278 1.1.1.3 mrg "@
7279 1.1.1.3 mrg fcmla\t%0.<Vetype>, %1.<Vetype>, %2.<Vetype>[%3], #<rot>
7280 1.1.1.3 mrg movprfx\t%0, %4\;fcmla\t%0.<Vetype>, %1.<Vetype>, %2.<Vetype>[%3], #<rot>"
7281 1.1.1.3 mrg [(set_attr "movprfx" "*,yes")]
7282 1.1.1.2 mrg )
7283 1.1.1.2 mrg
7284 1.1.1.3 mrg ;; -------------------------------------------------------------------------
7285 1.1.1.3 mrg ;; ---- [FP] Trigonometric multiply-add
7286 1.1.1.3 mrg ;; -------------------------------------------------------------------------
7287 1.1.1.3 mrg ;; Includes:
7288 1.1.1.3 mrg ;; - FTMAD
7289 1.1.1.3 mrg ;; -------------------------------------------------------------------------
7290 1.1.1.3 mrg
7291 1.1.1.3 mrg (define_insn "@aarch64_sve_tmad<mode>"
7292 1.1.1.3 mrg [(set (match_operand:SVE_FULL_F 0 "register_operand" "=w, ?&w")
7293 1.1.1.3 mrg (unspec:SVE_FULL_F
7294 1.1.1.3 mrg [(match_operand:SVE_FULL_F 1 "register_operand" "0, w")
7295 1.1.1.3 mrg (match_operand:SVE_FULL_F 2 "register_operand" "w, w")
7296 1.1.1.3 mrg (match_operand:DI 3 "const_int_operand")]
7297 1.1.1.3 mrg UNSPEC_FTMAD))]
7298 1.1.1.2 mrg "TARGET_SVE"
7299 1.1.1.2 mrg "@
7300 1.1.1.3 mrg ftmad\t%0.<Vetype>, %0.<Vetype>, %2.<Vetype>, #%3
7301 1.1.1.3 mrg movprfx\t%0, %1\;ftmad\t%0.<Vetype>, %0.<Vetype>, %2.<Vetype>, #%3"
7302 1.1.1.3 mrg [(set_attr "movprfx" "*,yes")]
7303 1.1.1.2 mrg )
7304 1.1.1.2 mrg
7305 1.1.1.3 mrg ;; -------------------------------------------------------------------------
7306 1.1.1.3 mrg ;; ---- [FP] Bfloat16 long ternary arithmetic (SF,BF,BF)
7307 1.1.1.3 mrg ;; -------------------------------------------------------------------------
7308 1.1.1.3 mrg ;; Includes:
7309 1.1.1.3 mrg ;; - BFDOT (BF16)
7310 1.1.1.3 mrg ;; - BFMLALB (BF16)
7311 1.1.1.3 mrg ;; - BFMLALT (BF16)
7312 1.1.1.3 mrg ;; - BFMMLA (BF16)
7313 1.1.1.3 mrg ;; -------------------------------------------------------------------------
7314 1.1.1.3 mrg
7315 1.1.1.3 mrg (define_insn "@aarch64_sve_<sve_fp_op>vnx4sf"
7316 1.1.1.3 mrg [(set (match_operand:VNx4SF 0 "register_operand" "=w, ?&w")
7317 1.1.1.3 mrg (unspec:VNx4SF
7318 1.1.1.3 mrg [(match_operand:VNx4SF 1 "register_operand" "0, w")
7319 1.1.1.3 mrg (match_operand:VNx8BF 2 "register_operand" "w, w")
7320 1.1.1.3 mrg (match_operand:VNx8BF 3 "register_operand" "w, w")]
7321 1.1.1.3 mrg SVE_BFLOAT_TERNARY_LONG))]
7322 1.1.1.3 mrg "TARGET_SVE_BF16"
7323 1.1.1.3 mrg "@
7324 1.1.1.3 mrg <sve_fp_op>\t%0.s, %2.h, %3.h
7325 1.1.1.3 mrg movprfx\t%0, %1\;<sve_fp_op>\t%0.s, %2.h, %3.h"
7326 1.1.1.3 mrg [(set_attr "movprfx" "*,yes")]
7327 1.1.1.2 mrg )
7328 1.1.1.2 mrg
7329 1.1.1.3 mrg ;; The immediate range is enforced before generating the instruction.
7330 1.1.1.3 mrg (define_insn "@aarch64_sve_<sve_fp_op>_lanevnx4sf"
7331 1.1.1.3 mrg [(set (match_operand:VNx4SF 0 "register_operand" "=w, ?&w")
7332 1.1.1.3 mrg (unspec:VNx4SF
7333 1.1.1.3 mrg [(match_operand:VNx4SF 1 "register_operand" "0, w")
7334 1.1.1.3 mrg (match_operand:VNx8BF 2 "register_operand" "w, w")
7335 1.1.1.3 mrg (match_operand:VNx8BF 3 "register_operand" "y, y")
7336 1.1.1.3 mrg (match_operand:SI 4 "const_int_operand")]
7337 1.1.1.3 mrg SVE_BFLOAT_TERNARY_LONG_LANE))]
7338 1.1.1.3 mrg "TARGET_SVE_BF16"
7339 1.1.1.3 mrg "@
7340 1.1.1.3 mrg <sve_fp_op>\t%0.s, %2.h, %3.h[%4]
7341 1.1.1.3 mrg movprfx\t%0, %1\;<sve_fp_op>\t%0.s, %2.h, %3.h[%4]"
7342 1.1.1.3 mrg [(set_attr "movprfx" "*,yes")]
7343 1.1.1.3 mrg )
7344 1.1.1.3 mrg
7345 1.1.1.3 mrg ;; -------------------------------------------------------------------------
7346 1.1.1.3 mrg ;; ---- [FP] Matrix multiply-accumulate
7347 1.1.1.3 mrg ;; -------------------------------------------------------------------------
7348 1.1.1.3 mrg ;; Includes:
7349 1.1.1.3 mrg ;; - FMMLA (F32MM,F64MM)
7350 1.1.1.3 mrg ;; -------------------------------------------------------------------------
7351 1.1.1.3 mrg
7352 1.1.1.3 mrg ;; The mode iterator enforces the target requirements.
7353 1.1.1.3 mrg (define_insn "@aarch64_sve_<sve_fp_op><mode>"
7354 1.1.1.3 mrg [(set (match_operand:SVE_MATMULF 0 "register_operand" "=w, ?&w")
7355 1.1.1.3 mrg (unspec:SVE_MATMULF
7356 1.1.1.3 mrg [(match_operand:SVE_MATMULF 2 "register_operand" "w, w")
7357 1.1.1.3 mrg (match_operand:SVE_MATMULF 3 "register_operand" "w, w")
7358 1.1.1.3 mrg (match_operand:SVE_MATMULF 1 "register_operand" "0, w")]
7359 1.1.1.3 mrg FMMLA))]
7360 1.1.1.2 mrg "TARGET_SVE"
7361 1.1.1.2 mrg "@
7362 1.1.1.3 mrg <sve_fp_op>\\t%0.<Vetype>, %2.<Vetype>, %3.<Vetype>
7363 1.1.1.3 mrg movprfx\t%0, %1\;<sve_fp_op>\\t%0.<Vetype>, %2.<Vetype>, %3.<Vetype>"
7364 1.1.1.3 mrg [(set_attr "movprfx" "*,yes")]
7365 1.1.1.2 mrg )
7366 1.1.1.2 mrg
7367 1.1.1.3 mrg ;; =========================================================================
7368 1.1.1.3 mrg ;; == Comparisons and selects
7369 1.1.1.3 mrg ;; =========================================================================
7370 1.1.1.3 mrg
7371 1.1.1.3 mrg ;; -------------------------------------------------------------------------
7372 1.1.1.3 mrg ;; ---- [INT,FP] Select based on predicates
7373 1.1.1.3 mrg ;; -------------------------------------------------------------------------
7374 1.1.1.3 mrg ;; Includes merging patterns for:
7375 1.1.1.3 mrg ;; - FMOV
7376 1.1.1.3 mrg ;; - MOV
7377 1.1.1.3 mrg ;; - SEL
7378 1.1.1.3 mrg ;; -------------------------------------------------------------------------
7379 1.1.1.3 mrg
7380 1.1 mrg ;; vcond_mask operand order: true, false, mask
7381 1.1 mrg ;; UNSPEC_SEL operand order: mask, true, false (as for VEC_COND_EXPR)
7382 1.1 mrg ;; SEL operand order: mask, true, false
7383 1.1.1.3 mrg (define_expand "@vcond_mask_<mode><vpred>"
7384 1.1.1.3 mrg [(set (match_operand:SVE_FULL 0 "register_operand")
7385 1.1.1.3 mrg (unspec:SVE_FULL
7386 1.1.1.3 mrg [(match_operand:<VPRED> 3 "register_operand")
7387 1.1.1.3 mrg (match_operand:SVE_FULL 1 "aarch64_sve_reg_or_dup_imm")
7388 1.1.1.3 mrg (match_operand:SVE_FULL 2 "aarch64_simd_reg_or_zero")]
7389 1.1 mrg UNSPEC_SEL))]
7390 1.1 mrg "TARGET_SVE"
7391 1.1.1.3 mrg {
7392 1.1.1.3 mrg if (register_operand (operands[1], <MODE>mode))
7393 1.1.1.3 mrg operands[2] = force_reg (<MODE>mode, operands[2]);
7394 1.1.1.3 mrg }
7395 1.1 mrg )
7396 1.1 mrg
7397 1.1.1.3 mrg ;; Selects between:
7398 1.1.1.3 mrg ;; - two registers
7399 1.1.1.3 mrg ;; - a duplicated immediate and a register
7400 1.1.1.3 mrg ;; - a duplicated immediate and zero
7401 1.1.1.3 mrg (define_insn "*vcond_mask_<mode><vpred>"
7402 1.1.1.3 mrg [(set (match_operand:SVE_FULL 0 "register_operand" "=w, w, w, w, ?w, ?&w, ?&w")
7403 1.1.1.3 mrg (unspec:SVE_FULL
7404 1.1.1.3 mrg [(match_operand:<VPRED> 3 "register_operand" "Upa, Upa, Upa, Upa, Upl, Upl, Upl")
7405 1.1.1.3 mrg (match_operand:SVE_FULL 1 "aarch64_sve_reg_or_dup_imm" "w, vss, vss, Ufc, Ufc, vss, Ufc")
7406 1.1.1.3 mrg (match_operand:SVE_FULL 2 "aarch64_simd_reg_or_zero" "w, 0, Dz, 0, Dz, w, w")]
7407 1.1.1.3 mrg UNSPEC_SEL))]
7408 1.1.1.3 mrg "TARGET_SVE
7409 1.1.1.3 mrg && (!register_operand (operands[1], <MODE>mode)
7410 1.1.1.3 mrg || register_operand (operands[2], <MODE>mode))"
7411 1.1.1.3 mrg "@
7412 1.1.1.3 mrg sel\t%0.<Vetype>, %3, %1.<Vetype>, %2.<Vetype>
7413 1.1.1.3 mrg mov\t%0.<Vetype>, %3/m, #%I1
7414 1.1.1.3 mrg mov\t%0.<Vetype>, %3/z, #%I1
7415 1.1.1.3 mrg fmov\t%0.<Vetype>, %3/m, #%1
7416 1.1.1.3 mrg movprfx\t%0.<Vetype>, %3/z, %0.<Vetype>\;fmov\t%0.<Vetype>, %3/m, #%1
7417 1.1.1.3 mrg movprfx\t%0, %2\;mov\t%0.<Vetype>, %3/m, #%I1
7418 1.1.1.3 mrg movprfx\t%0, %2\;fmov\t%0.<Vetype>, %3/m, #%1"
7419 1.1.1.3 mrg [(set_attr "movprfx" "*,*,*,*,yes,yes,yes")]
7420 1.1.1.3 mrg )
7421 1.1.1.3 mrg
7422 1.1.1.3 mrg ;; Optimize selects between a duplicated scalar variable and another vector,
7423 1.1.1.3 mrg ;; the latter of which can be a zero constant or a variable. Treat duplicates
7424 1.1.1.3 mrg ;; of GPRs as being more expensive than duplicates of FPRs, since they
7425 1.1.1.3 mrg ;; involve a cross-file move.
7426 1.1.1.3 mrg (define_insn "@aarch64_sel_dup<mode>"
7427 1.1.1.3 mrg [(set (match_operand:SVE_FULL 0 "register_operand" "=?w, w, ??w, ?&w, ??&w, ?&w")
7428 1.1.1.3 mrg (unspec:SVE_FULL
7429 1.1.1.3 mrg [(match_operand:<VPRED> 3 "register_operand" "Upl, Upl, Upl, Upl, Upl, Upl")
7430 1.1.1.3 mrg (vec_duplicate:SVE_FULL
7431 1.1.1.3 mrg (match_operand:<VEL> 1 "register_operand" "r, w, r, w, r, w"))
7432 1.1.1.3 mrg (match_operand:SVE_FULL 2 "aarch64_simd_reg_or_zero" "0, 0, Dz, Dz, w, w")]
7433 1.1 mrg UNSPEC_SEL))]
7434 1.1 mrg "TARGET_SVE"
7435 1.1.1.3 mrg "@
7436 1.1.1.3 mrg mov\t%0.<Vetype>, %3/m, %<vwcore>1
7437 1.1.1.3 mrg mov\t%0.<Vetype>, %3/m, %<Vetype>1
7438 1.1.1.3 mrg movprfx\t%0.<Vetype>, %3/z, %0.<Vetype>\;mov\t%0.<Vetype>, %3/m, %<vwcore>1
7439 1.1.1.3 mrg movprfx\t%0.<Vetype>, %3/z, %0.<Vetype>\;mov\t%0.<Vetype>, %3/m, %<Vetype>1
7440 1.1.1.3 mrg movprfx\t%0, %2\;mov\t%0.<Vetype>, %3/m, %<vwcore>1
7441 1.1.1.3 mrg movprfx\t%0, %2\;mov\t%0.<Vetype>, %3/m, %<Vetype>1"
7442 1.1.1.3 mrg [(set_attr "movprfx" "*,*,yes,yes,yes,yes")]
7443 1.1 mrg )
7444 1.1 mrg
7445 1.1.1.3 mrg ;; -------------------------------------------------------------------------
7446 1.1.1.3 mrg ;; ---- [INT,FP] Compare and select
7447 1.1.1.3 mrg ;; -------------------------------------------------------------------------
7448 1.1.1.3 mrg ;; The patterns in this section are synthetic.
7449 1.1.1.3 mrg ;; -------------------------------------------------------------------------
7450 1.1.1.3 mrg
7451 1.1 mrg ;; Integer (signed) vcond. Don't enforce an immediate range here, since it
7452 1.1 mrg ;; depends on the comparison; leave it to aarch64_expand_sve_vcond instead.
7453 1.1 mrg (define_expand "vcond<mode><v_int_equiv>"
7454 1.1.1.3 mrg [(set (match_operand:SVE_FULL 0 "register_operand")
7455 1.1.1.3 mrg (if_then_else:SVE_FULL
7456 1.1 mrg (match_operator 3 "comparison_operator"
7457 1.1 mrg [(match_operand:<V_INT_EQUIV> 4 "register_operand")
7458 1.1 mrg (match_operand:<V_INT_EQUIV> 5 "nonmemory_operand")])
7459 1.1.1.3 mrg (match_operand:SVE_FULL 1 "nonmemory_operand")
7460 1.1.1.3 mrg (match_operand:SVE_FULL 2 "nonmemory_operand")))]
7461 1.1 mrg "TARGET_SVE"
7462 1.1 mrg {
7463 1.1 mrg aarch64_expand_sve_vcond (<MODE>mode, <V_INT_EQUIV>mode, operands);
7464 1.1 mrg DONE;
7465 1.1 mrg }
7466 1.1 mrg )
7467 1.1 mrg
7468 1.1 mrg ;; Integer vcondu. Don't enforce an immediate range here, since it
7469 1.1 mrg ;; depends on the comparison; leave it to aarch64_expand_sve_vcond instead.
7470 1.1 mrg (define_expand "vcondu<mode><v_int_equiv>"
7471 1.1.1.3 mrg [(set (match_operand:SVE_FULL 0 "register_operand")
7472 1.1.1.3 mrg (if_then_else:SVE_FULL
7473 1.1 mrg (match_operator 3 "comparison_operator"
7474 1.1 mrg [(match_operand:<V_INT_EQUIV> 4 "register_operand")
7475 1.1 mrg (match_operand:<V_INT_EQUIV> 5 "nonmemory_operand")])
7476 1.1.1.3 mrg (match_operand:SVE_FULL 1 "nonmemory_operand")
7477 1.1.1.3 mrg (match_operand:SVE_FULL 2 "nonmemory_operand")))]
7478 1.1 mrg "TARGET_SVE"
7479 1.1 mrg {
7480 1.1 mrg aarch64_expand_sve_vcond (<MODE>mode, <V_INT_EQUIV>mode, operands);
7481 1.1 mrg DONE;
7482 1.1 mrg }
7483 1.1 mrg )
7484 1.1 mrg
7485 1.1.1.3 mrg ;; Floating-point vcond. All comparisons except FCMUO allow a zero operand;
7486 1.1.1.3 mrg ;; aarch64_expand_sve_vcond handles the case of an FCMUO with zero.
7487 1.1 mrg (define_expand "vcond<mode><v_fp_equiv>"
7488 1.1.1.3 mrg [(set (match_operand:SVE_FULL_HSD 0 "register_operand")
7489 1.1.1.3 mrg (if_then_else:SVE_FULL_HSD
7490 1.1 mrg (match_operator 3 "comparison_operator"
7491 1.1 mrg [(match_operand:<V_FP_EQUIV> 4 "register_operand")
7492 1.1 mrg (match_operand:<V_FP_EQUIV> 5 "aarch64_simd_reg_or_zero")])
7493 1.1.1.3 mrg (match_operand:SVE_FULL_HSD 1 "nonmemory_operand")
7494 1.1.1.3 mrg (match_operand:SVE_FULL_HSD 2 "nonmemory_operand")))]
7495 1.1 mrg "TARGET_SVE"
7496 1.1 mrg {
7497 1.1 mrg aarch64_expand_sve_vcond (<MODE>mode, <V_FP_EQUIV>mode, operands);
7498 1.1 mrg DONE;
7499 1.1 mrg }
7500 1.1 mrg )
7501 1.1 mrg
7502 1.1.1.3 mrg ;; -------------------------------------------------------------------------
7503 1.1.1.3 mrg ;; ---- [INT] Comparisons
7504 1.1.1.3 mrg ;; -------------------------------------------------------------------------
7505 1.1.1.3 mrg ;; Includes:
7506 1.1.1.3 mrg ;; - CMPEQ
7507 1.1.1.3 mrg ;; - CMPGE
7508 1.1.1.3 mrg ;; - CMPGT
7509 1.1.1.3 mrg ;; - CMPHI
7510 1.1.1.3 mrg ;; - CMPHS
7511 1.1.1.3 mrg ;; - CMPLE
7512 1.1.1.3 mrg ;; - CMPLO
7513 1.1.1.3 mrg ;; - CMPLS
7514 1.1.1.3 mrg ;; - CMPLT
7515 1.1.1.3 mrg ;; - CMPNE
7516 1.1.1.3 mrg ;; -------------------------------------------------------------------------
7517 1.1.1.3 mrg
7518 1.1 mrg ;; Signed integer comparisons. Don't enforce an immediate range here, since
7519 1.1 mrg ;; it depends on the comparison; leave it to aarch64_expand_sve_vec_cmp_int
7520 1.1 mrg ;; instead.
7521 1.1 mrg (define_expand "vec_cmp<mode><vpred>"
7522 1.1 mrg [(parallel
7523 1.1 mrg [(set (match_operand:<VPRED> 0 "register_operand")
7524 1.1 mrg (match_operator:<VPRED> 1 "comparison_operator"
7525 1.1.1.3 mrg [(match_operand:SVE_FULL_I 2 "register_operand")
7526 1.1.1.3 mrg (match_operand:SVE_FULL_I 3 "nonmemory_operand")]))
7527 1.1.1.3 mrg (clobber (reg:CC_NZC CC_REGNUM))])]
7528 1.1 mrg "TARGET_SVE"
7529 1.1 mrg {
7530 1.1 mrg aarch64_expand_sve_vec_cmp_int (operands[0], GET_CODE (operands[1]),
7531 1.1 mrg operands[2], operands[3]);
7532 1.1 mrg DONE;
7533 1.1 mrg }
7534 1.1 mrg )
7535 1.1 mrg
7536 1.1 mrg ;; Unsigned integer comparisons. Don't enforce an immediate range here, since
7537 1.1 mrg ;; it depends on the comparison; leave it to aarch64_expand_sve_vec_cmp_int
7538 1.1 mrg ;; instead.
7539 1.1 mrg (define_expand "vec_cmpu<mode><vpred>"
7540 1.1 mrg [(parallel
7541 1.1 mrg [(set (match_operand:<VPRED> 0 "register_operand")
7542 1.1 mrg (match_operator:<VPRED> 1 "comparison_operator"
7543 1.1.1.3 mrg [(match_operand:SVE_FULL_I 2 "register_operand")
7544 1.1.1.3 mrg (match_operand:SVE_FULL_I 3 "nonmemory_operand")]))
7545 1.1.1.3 mrg (clobber (reg:CC_NZC CC_REGNUM))])]
7546 1.1 mrg "TARGET_SVE"
7547 1.1 mrg {
7548 1.1 mrg aarch64_expand_sve_vec_cmp_int (operands[0], GET_CODE (operands[1]),
7549 1.1 mrg operands[2], operands[3]);
7550 1.1 mrg DONE;
7551 1.1 mrg }
7552 1.1 mrg )
7553 1.1 mrg
7554 1.1.1.3 mrg ;; Predicated integer comparisons.
7555 1.1.1.3 mrg (define_insn "@aarch64_pred_cmp<cmp_op><mode>"
7556 1.1.1.3 mrg [(set (match_operand:<VPRED> 0 "register_operand" "=Upa, Upa")
7557 1.1.1.3 mrg (unspec:<VPRED>
7558 1.1.1.2 mrg [(match_operand:<VPRED> 1 "register_operand" "Upl, Upl")
7559 1.1.1.3 mrg (match_operand:SI 2 "aarch64_sve_ptrue_flag")
7560 1.1.1.3 mrg (SVE_INT_CMP:<VPRED>
7561 1.1.1.3 mrg (match_operand:SVE_FULL_I 3 "register_operand" "w, w")
7562 1.1.1.3 mrg (match_operand:SVE_FULL_I 4 "aarch64_sve_cmp_<sve_imm_con>_operand" "<sve_imm_con>, w"))]
7563 1.1.1.3 mrg UNSPEC_PRED_Z))
7564 1.1.1.3 mrg (clobber (reg:CC_NZC CC_REGNUM))]
7565 1.1.1.3 mrg "TARGET_SVE"
7566 1.1.1.3 mrg "@
7567 1.1.1.3 mrg cmp<cmp_op>\t%0.<Vetype>, %1/z, %3.<Vetype>, #%4
7568 1.1.1.3 mrg cmp<cmp_op>\t%0.<Vetype>, %1/z, %3.<Vetype>, %4.<Vetype>"
7569 1.1.1.3 mrg )
7570 1.1.1.3 mrg
7571 1.1.1.3 mrg ;; Predicated integer comparisons in which both the flag and predicate
7572 1.1.1.3 mrg ;; results are interesting.
7573 1.1.1.3 mrg (define_insn_and_rewrite "*cmp<cmp_op><mode>_cc"
7574 1.1.1.3 mrg [(set (reg:CC_NZC CC_REGNUM)
7575 1.1.1.3 mrg (unspec:CC_NZC
7576 1.1.1.3 mrg [(match_operand:VNx16BI 1 "register_operand" "Upl, Upl")
7577 1.1.1.3 mrg (match_operand 4)
7578 1.1.1.3 mrg (match_operand:SI 5 "aarch64_sve_ptrue_flag")
7579 1.1.1.3 mrg (unspec:<VPRED>
7580 1.1.1.3 mrg [(match_operand 6)
7581 1.1.1.3 mrg (match_operand:SI 7 "aarch64_sve_ptrue_flag")
7582 1.1.1.3 mrg (SVE_INT_CMP:<VPRED>
7583 1.1.1.3 mrg (match_operand:SVE_FULL_I 2 "register_operand" "w, w")
7584 1.1.1.3 mrg (match_operand:SVE_FULL_I 3 "aarch64_sve_cmp_<sve_imm_con>_operand" "<sve_imm_con>, w"))]
7585 1.1.1.3 mrg UNSPEC_PRED_Z)]
7586 1.1.1.3 mrg UNSPEC_PTEST))
7587 1.1.1.3 mrg (set (match_operand:<VPRED> 0 "register_operand" "=Upa, Upa")
7588 1.1.1.3 mrg (unspec:<VPRED>
7589 1.1.1.3 mrg [(match_dup 6)
7590 1.1.1.3 mrg (match_dup 7)
7591 1.1.1.3 mrg (SVE_INT_CMP:<VPRED>
7592 1.1.1.3 mrg (match_dup 2)
7593 1.1.1.3 mrg (match_dup 3))]
7594 1.1.1.3 mrg UNSPEC_PRED_Z))]
7595 1.1.1.3 mrg "TARGET_SVE
7596 1.1.1.3 mrg && aarch64_sve_same_pred_for_ptest_p (&operands[4], &operands[6])"
7597 1.1.1.2 mrg "@
7598 1.1.1.3 mrg cmp<cmp_op>\t%0.<Vetype>, %1/z, %2.<Vetype>, #%3
7599 1.1.1.3 mrg cmp<cmp_op>\t%0.<Vetype>, %1/z, %2.<Vetype>, %3.<Vetype>"
7600 1.1.1.3 mrg "&& !rtx_equal_p (operands[4], operands[6])"
7601 1.1 mrg {
7602 1.1.1.3 mrg operands[6] = copy_rtx (operands[4]);
7603 1.1.1.3 mrg operands[7] = operands[5];
7604 1.1 mrg }
7605 1.1 mrg )
7606 1.1 mrg
7607 1.1.1.3 mrg ;; Predicated integer comparisons in which only the flags result is
7608 1.1.1.3 mrg ;; interesting.
7609 1.1.1.3 mrg (define_insn_and_rewrite "*cmp<cmp_op><mode>_ptest"
7610 1.1.1.3 mrg [(set (reg:CC_NZC CC_REGNUM)
7611 1.1.1.3 mrg (unspec:CC_NZC
7612 1.1.1.3 mrg [(match_operand:VNx16BI 1 "register_operand" "Upl, Upl")
7613 1.1.1.3 mrg (match_operand 4)
7614 1.1.1.3 mrg (match_operand:SI 5 "aarch64_sve_ptrue_flag")
7615 1.1.1.3 mrg (unspec:<VPRED>
7616 1.1.1.3 mrg [(match_operand 6)
7617 1.1.1.3 mrg (match_operand:SI 7 "aarch64_sve_ptrue_flag")
7618 1.1.1.3 mrg (SVE_INT_CMP:<VPRED>
7619 1.1.1.3 mrg (match_operand:SVE_FULL_I 2 "register_operand" "w, w")
7620 1.1.1.3 mrg (match_operand:SVE_FULL_I 3 "aarch64_sve_cmp_<sve_imm_con>_operand" "<sve_imm_con>, w"))]
7621 1.1.1.3 mrg UNSPEC_PRED_Z)]
7622 1.1.1.3 mrg UNSPEC_PTEST))
7623 1.1.1.3 mrg (clobber (match_scratch:<VPRED> 0 "=Upa, Upa"))]
7624 1.1.1.3 mrg "TARGET_SVE
7625 1.1.1.3 mrg && aarch64_sve_same_pred_for_ptest_p (&operands[4], &operands[6])"
7626 1.1.1.2 mrg "@
7627 1.1.1.3 mrg cmp<cmp_op>\t%0.<Vetype>, %1/z, %2.<Vetype>, #%3
7628 1.1.1.3 mrg cmp<cmp_op>\t%0.<Vetype>, %1/z, %2.<Vetype>, %3.<Vetype>"
7629 1.1.1.3 mrg "&& !rtx_equal_p (operands[4], operands[6])"
7630 1.1 mrg {
7631 1.1.1.3 mrg operands[6] = copy_rtx (operands[4]);
7632 1.1.1.3 mrg operands[7] = operands[5];
7633 1.1 mrg }
7634 1.1 mrg )
7635 1.1 mrg
7636 1.1.1.3 mrg ;; Predicated integer comparisons, formed by combining a PTRUE-predicated
7637 1.1.1.3 mrg ;; comparison with an AND. Split the instruction into its preferred form
7638 1.1.1.3 mrg ;; at the earliest opportunity, in order to get rid of the redundant
7639 1.1.1.3 mrg ;; operand 4.
7640 1.1.1.3 mrg (define_insn_and_split "*cmp<cmp_op><mode>_and"
7641 1.1.1.3 mrg [(set (match_operand:<VPRED> 0 "register_operand" "=Upa, Upa")
7642 1.1.1.3 mrg (and:<VPRED>
7643 1.1.1.3 mrg (unspec:<VPRED>
7644 1.1.1.3 mrg [(match_operand 4)
7645 1.1.1.3 mrg (const_int SVE_KNOWN_PTRUE)
7646 1.1.1.3 mrg (SVE_INT_CMP:<VPRED>
7647 1.1.1.3 mrg (match_operand:SVE_FULL_I 2 "register_operand" "w, w")
7648 1.1.1.3 mrg (match_operand:SVE_FULL_I 3 "aarch64_sve_cmp_<sve_imm_con>_operand" "<sve_imm_con>, w"))]
7649 1.1.1.3 mrg UNSPEC_PRED_Z)
7650 1.1.1.3 mrg (match_operand:<VPRED> 1 "register_operand" "Upl, Upl")))
7651 1.1.1.3 mrg (clobber (reg:CC_NZC CC_REGNUM))]
7652 1.1 mrg "TARGET_SVE"
7653 1.1.1.3 mrg "#"
7654 1.1.1.3 mrg "&& 1"
7655 1.1.1.3 mrg [(parallel
7656 1.1.1.3 mrg [(set (match_dup 0)
7657 1.1.1.3 mrg (unspec:<VPRED>
7658 1.1.1.3 mrg [(match_dup 1)
7659 1.1.1.3 mrg (const_int SVE_MAYBE_NOT_PTRUE)
7660 1.1.1.3 mrg (SVE_INT_CMP:<VPRED>
7661 1.1.1.3 mrg (match_dup 2)
7662 1.1.1.3 mrg (match_dup 3))]
7663 1.1.1.3 mrg UNSPEC_PRED_Z))
7664 1.1.1.3 mrg (clobber (reg:CC_NZC CC_REGNUM))])]
7665 1.1 mrg )
7666 1.1 mrg
7667 1.1.1.3 mrg ;; Predicated integer wide comparisons.
7668 1.1.1.3 mrg (define_insn "@aarch64_pred_cmp<cmp_op><mode>_wide"
7669 1.1.1.3 mrg [(set (match_operand:<VPRED> 0 "register_operand" "=Upa")
7670 1.1.1.3 mrg (unspec:<VPRED>
7671 1.1.1.3 mrg [(match_operand:VNx16BI 1 "register_operand" "Upl")
7672 1.1.1.3 mrg (match_operand:SI 2 "aarch64_sve_ptrue_flag")
7673 1.1.1.3 mrg (unspec:<VPRED>
7674 1.1.1.3 mrg [(match_operand:SVE_FULL_BHSI 3 "register_operand" "w")
7675 1.1.1.3 mrg (match_operand:VNx2DI 4 "register_operand" "w")]
7676 1.1.1.3 mrg SVE_COND_INT_CMP_WIDE)]
7677 1.1.1.3 mrg UNSPEC_PRED_Z))
7678 1.1.1.3 mrg (clobber (reg:CC_NZC CC_REGNUM))]
7679 1.1.1.2 mrg "TARGET_SVE"
7680 1.1.1.3 mrg "cmp<cmp_op>\t%0.<Vetype>, %1/z, %3.<Vetype>, %4.d"
7681 1.1.1.2 mrg )
7682 1.1.1.2 mrg
7683 1.1.1.3 mrg ;; Predicated integer wide comparisons in which both the flag and
7684 1.1.1.3 mrg ;; predicate results are interesting.
7685 1.1.1.3 mrg (define_insn "*aarch64_pred_cmp<cmp_op><mode>_wide_cc"
7686 1.1.1.3 mrg [(set (reg:CC_NZC CC_REGNUM)
7687 1.1.1.3 mrg (unspec:CC_NZC
7688 1.1.1.3 mrg [(match_operand:VNx16BI 1 "register_operand" "Upl")
7689 1.1.1.3 mrg (match_operand 4)
7690 1.1.1.3 mrg (match_operand:SI 5 "aarch64_sve_ptrue_flag")
7691 1.1.1.3 mrg (unspec:<VPRED>
7692 1.1.1.3 mrg [(match_operand:VNx16BI 6 "register_operand" "Upl")
7693 1.1.1.3 mrg (match_operand:SI 7 "aarch64_sve_ptrue_flag")
7694 1.1.1.3 mrg (unspec:<VPRED>
7695 1.1.1.3 mrg [(match_operand:SVE_FULL_BHSI 2 "register_operand" "w")
7696 1.1.1.3 mrg (match_operand:VNx2DI 3 "register_operand" "w")]
7697 1.1.1.3 mrg SVE_COND_INT_CMP_WIDE)]
7698 1.1.1.3 mrg UNSPEC_PRED_Z)]
7699 1.1.1.3 mrg UNSPEC_PTEST))
7700 1.1.1.3 mrg (set (match_operand:<VPRED> 0 "register_operand" "=Upa")
7701 1.1.1.3 mrg (unspec:<VPRED>
7702 1.1.1.3 mrg [(match_dup 6)
7703 1.1.1.3 mrg (match_dup 7)
7704 1.1.1.3 mrg (unspec:<VPRED>
7705 1.1.1.3 mrg [(match_dup 2)
7706 1.1.1.3 mrg (match_dup 3)]
7707 1.1.1.3 mrg SVE_COND_INT_CMP_WIDE)]
7708 1.1.1.3 mrg UNSPEC_PRED_Z))]
7709 1.1.1.3 mrg "TARGET_SVE
7710 1.1.1.3 mrg && aarch64_sve_same_pred_for_ptest_p (&operands[4], &operands[6])"
7711 1.1.1.3 mrg "cmp<cmp_op>\t%0.<Vetype>, %1/z, %2.<Vetype>, %3.d"
7712 1.1.1.2 mrg )
7713 1.1.1.2 mrg
7714 1.1.1.3 mrg ;; Predicated integer wide comparisons in which only the flags result
7715 1.1.1.3 mrg ;; is interesting.
7716 1.1.1.3 mrg (define_insn "*aarch64_pred_cmp<cmp_op><mode>_wide_ptest"
7717 1.1.1.3 mrg [(set (reg:CC_NZC CC_REGNUM)
7718 1.1.1.3 mrg (unspec:CC_NZC
7719 1.1.1.3 mrg [(match_operand:VNx16BI 1 "register_operand" "Upl")
7720 1.1.1.3 mrg (match_operand 4)
7721 1.1.1.3 mrg (match_operand:SI 5 "aarch64_sve_ptrue_flag")
7722 1.1.1.3 mrg (unspec:<VPRED>
7723 1.1.1.3 mrg [(match_operand:VNx16BI 6 "register_operand" "Upl")
7724 1.1.1.3 mrg (match_operand:SI 7 "aarch64_sve_ptrue_flag")
7725 1.1.1.3 mrg (unspec:<VPRED>
7726 1.1.1.3 mrg [(match_operand:SVE_FULL_BHSI 2 "register_operand" "w")
7727 1.1.1.3 mrg (match_operand:VNx2DI 3 "register_operand" "w")]
7728 1.1.1.3 mrg SVE_COND_INT_CMP_WIDE)]
7729 1.1.1.3 mrg UNSPEC_PRED_Z)]
7730 1.1.1.3 mrg UNSPEC_PTEST))
7731 1.1.1.3 mrg (clobber (match_scratch:<VPRED> 0 "=Upa"))]
7732 1.1.1.3 mrg "TARGET_SVE
7733 1.1.1.3 mrg && aarch64_sve_same_pred_for_ptest_p (&operands[4], &operands[6])"
7734 1.1.1.3 mrg "cmp<cmp_op>\t%0.<Vetype>, %1/z, %2.<Vetype>, %3.d"
7735 1.1.1.2 mrg )
7736 1.1.1.2 mrg
7737 1.1.1.3 mrg ;; -------------------------------------------------------------------------
7738 1.1.1.3 mrg ;; ---- [INT] While tests
7739 1.1.1.3 mrg ;; -------------------------------------------------------------------------
7740 1.1.1.3 mrg ;; Includes:
7741 1.1.1.3 mrg ;; - WHILEGE (SVE2)
7742 1.1.1.3 mrg ;; - WHILEGT (SVE2)
7743 1.1.1.3 mrg ;; - WHILEHI (SVE2)
7744 1.1.1.3 mrg ;; - WHILEHS (SVE2)
7745 1.1.1.3 mrg ;; - WHILELE
7746 1.1.1.3 mrg ;; - WHILELO
7747 1.1.1.3 mrg ;; - WHILELS
7748 1.1.1.3 mrg ;; - WHILELT
7749 1.1.1.3 mrg ;; - WHILERW (SVE2)
7750 1.1.1.3 mrg ;; - WHILEWR (SVE2)
7751 1.1.1.3 mrg ;; -------------------------------------------------------------------------
7752 1.1.1.3 mrg
7753 1.1.1.3 mrg ;; Set element I of the result if (cmp (plus operand1 J) operand2) is
7754 1.1.1.3 mrg ;; true for all J in [0, I].
7755 1.1.1.3 mrg (define_insn "@while_<while_optab_cmp><GPI:mode><PRED_ALL:mode>"
7756 1.1.1.3 mrg [(set (match_operand:PRED_ALL 0 "register_operand" "=Upa")
7757 1.1.1.3 mrg (unspec:PRED_ALL [(match_operand:GPI 1 "aarch64_reg_or_zero" "rZ")
7758 1.1.1.3 mrg (match_operand:GPI 2 "aarch64_reg_or_zero" "rZ")]
7759 1.1.1.3 mrg SVE_WHILE))
7760 1.1.1.3 mrg (clobber (reg:CC_NZC CC_REGNUM))]
7761 1.1.1.2 mrg "TARGET_SVE"
7762 1.1.1.3 mrg "while<cmp_op>\t%0.<PRED_ALL:Vetype>, %<w>1, %<w>2"
7763 1.1.1.2 mrg )
7764 1.1.1.2 mrg
7765 1.1.1.3 mrg ;; The WHILE instructions set the flags in the same way as a PTEST with
7766 1.1.1.3 mrg ;; a PTRUE GP. Handle the case in which both results are useful. The GP
7767 1.1.1.3 mrg ;; operands to the PTEST aren't needed, so we allow them to be anything.
7768 1.1.1.3 mrg (define_insn_and_rewrite "*while_<while_optab_cmp><GPI:mode><PRED_ALL:mode>_cc"
7769 1.1.1.3 mrg [(set (reg:CC_NZC CC_REGNUM)
7770 1.1.1.3 mrg (unspec:CC_NZC
7771 1.1.1.3 mrg [(match_operand 3)
7772 1.1.1.3 mrg (match_operand 4)
7773 1.1.1.3 mrg (const_int SVE_KNOWN_PTRUE)
7774 1.1.1.3 mrg (unspec:PRED_ALL
7775 1.1.1.3 mrg [(match_operand:GPI 1 "aarch64_reg_or_zero" "rZ")
7776 1.1.1.3 mrg (match_operand:GPI 2 "aarch64_reg_or_zero" "rZ")]
7777 1.1.1.3 mrg SVE_WHILE)]
7778 1.1.1.3 mrg UNSPEC_PTEST))
7779 1.1.1.3 mrg (set (match_operand:PRED_ALL 0 "register_operand" "=Upa")
7780 1.1.1.3 mrg (unspec:PRED_ALL [(match_dup 1)
7781 1.1.1.3 mrg (match_dup 2)]
7782 1.1.1.3 mrg SVE_WHILE))]
7783 1.1.1.2 mrg "TARGET_SVE"
7784 1.1.1.3 mrg "while<cmp_op>\t%0.<PRED_ALL:Vetype>, %<w>1, %<w>2"
7785 1.1.1.3 mrg ;; Force the compiler to drop the unused predicate operand, so that we
7786 1.1.1.3 mrg ;; don't have an unnecessary PTRUE.
7787 1.1.1.3 mrg "&& (!CONSTANT_P (operands[3]) || !CONSTANT_P (operands[4]))"
7788 1.1.1.3 mrg {
7789 1.1.1.3 mrg operands[3] = CONSTM1_RTX (VNx16BImode);
7790 1.1.1.3 mrg operands[4] = CONSTM1_RTX (<PRED_ALL:MODE>mode);
7791 1.1.1.3 mrg }
7792 1.1.1.2 mrg )
7793 1.1.1.2 mrg
7794 1.1.1.3 mrg ;; Same, but handle the case in which only the flags result is useful.
7795 1.1.1.3 mrg (define_insn_and_rewrite "@while_<while_optab_cmp><GPI:mode><PRED_ALL:mode>_ptest"
7796 1.1.1.3 mrg [(set (reg:CC_NZC CC_REGNUM)
7797 1.1.1.3 mrg (unspec:CC_NZC
7798 1.1.1.3 mrg [(match_operand 3)
7799 1.1.1.3 mrg (match_operand 4)
7800 1.1.1.3 mrg (const_int SVE_KNOWN_PTRUE)
7801 1.1.1.3 mrg (unspec:PRED_ALL
7802 1.1.1.3 mrg [(match_operand:GPI 1 "aarch64_reg_or_zero" "rZ")
7803 1.1.1.3 mrg (match_operand:GPI 2 "aarch64_reg_or_zero" "rZ")]
7804 1.1.1.3 mrg SVE_WHILE)]
7805 1.1.1.3 mrg UNSPEC_PTEST))
7806 1.1.1.3 mrg (clobber (match_scratch:PRED_ALL 0 "=Upa"))]
7807 1.1.1.2 mrg "TARGET_SVE"
7808 1.1.1.3 mrg "while<cmp_op>\t%0.<PRED_ALL:Vetype>, %<w>1, %<w>2"
7809 1.1.1.3 mrg ;; Force the compiler to drop the unused predicate operand, so that we
7810 1.1.1.3 mrg ;; don't have an unnecessary PTRUE.
7811 1.1.1.3 mrg "&& (!CONSTANT_P (operands[3]) || !CONSTANT_P (operands[4]))"
7812 1.1.1.3 mrg {
7813 1.1.1.3 mrg operands[3] = CONSTM1_RTX (VNx16BImode);
7814 1.1.1.3 mrg operands[4] = CONSTM1_RTX (<PRED_ALL:MODE>mode);
7815 1.1.1.3 mrg }
7816 1.1.1.2 mrg )
7817 1.1.1.2 mrg
7818 1.1.1.3 mrg ;; -------------------------------------------------------------------------
7819 1.1.1.3 mrg ;; ---- [FP] Direct comparisons
7820 1.1.1.3 mrg ;; -------------------------------------------------------------------------
7821 1.1.1.3 mrg ;; Includes:
7822 1.1.1.3 mrg ;; - FCMEQ
7823 1.1.1.3 mrg ;; - FCMGE
7824 1.1.1.3 mrg ;; - FCMGT
7825 1.1.1.3 mrg ;; - FCMLE
7826 1.1.1.3 mrg ;; - FCMLT
7827 1.1.1.3 mrg ;; - FCMNE
7828 1.1.1.3 mrg ;; - FCMUO
7829 1.1.1.3 mrg ;; -------------------------------------------------------------------------
7830 1.1.1.3 mrg
7831 1.1.1.3 mrg ;; Floating-point comparisons. All comparisons except FCMUO allow a zero
7832 1.1.1.3 mrg ;; operand; aarch64_expand_sve_vec_cmp_float handles the case of an FCMUO
7833 1.1.1.3 mrg ;; with zero.
7834 1.1.1.3 mrg (define_expand "vec_cmp<mode><vpred>"
7835 1.1.1.3 mrg [(set (match_operand:<VPRED> 0 "register_operand")
7836 1.1.1.3 mrg (match_operator:<VPRED> 1 "comparison_operator"
7837 1.1.1.3 mrg [(match_operand:SVE_FULL_F 2 "register_operand")
7838 1.1.1.3 mrg (match_operand:SVE_FULL_F 3 "aarch64_simd_reg_or_zero")]))]
7839 1.1.1.2 mrg "TARGET_SVE"
7840 1.1.1.3 mrg {
7841 1.1.1.3 mrg aarch64_expand_sve_vec_cmp_float (operands[0], GET_CODE (operands[1]),
7842 1.1.1.3 mrg operands[2], operands[3], false);
7843 1.1.1.3 mrg DONE;
7844 1.1.1.3 mrg }
7845 1.1.1.2 mrg )
7846 1.1.1.2 mrg
7847 1.1.1.3 mrg ;; Predicated floating-point comparisons.
7848 1.1.1.3 mrg (define_insn "@aarch64_pred_fcm<cmp_op><mode>"
7849 1.1.1.3 mrg [(set (match_operand:<VPRED> 0 "register_operand" "=Upa, Upa")
7850 1.1.1.3 mrg (unspec:<VPRED>
7851 1.1.1.2 mrg [(match_operand:<VPRED> 1 "register_operand" "Upl, Upl")
7852 1.1.1.3 mrg (match_operand:SI 2 "aarch64_sve_ptrue_flag")
7853 1.1.1.3 mrg (match_operand:SVE_FULL_F 3 "register_operand" "w, w")
7854 1.1.1.3 mrg (match_operand:SVE_FULL_F 4 "aarch64_simd_reg_or_zero" "Dz, w")]
7855 1.1.1.3 mrg SVE_COND_FP_CMP_I0))]
7856 1.1.1.2 mrg "TARGET_SVE"
7857 1.1.1.2 mrg "@
7858 1.1.1.3 mrg fcm<cmp_op>\t%0.<Vetype>, %1/z, %3.<Vetype>, #0.0
7859 1.1.1.3 mrg fcm<cmp_op>\t%0.<Vetype>, %1/z, %3.<Vetype>, %4.<Vetype>"
7860 1.1.1.2 mrg )
7861 1.1.1.2 mrg
7862 1.1.1.3 mrg ;; Same for unordered comparisons.
7863 1.1.1.3 mrg (define_insn "@aarch64_pred_fcmuo<mode>"
7864 1.1.1.3 mrg [(set (match_operand:<VPRED> 0 "register_operand" "=Upa")
7865 1.1.1.3 mrg (unspec:<VPRED>
7866 1.1 mrg [(match_operand:<VPRED> 1 "register_operand" "Upl")
7867 1.1.1.3 mrg (match_operand:SI 2 "aarch64_sve_ptrue_flag")
7868 1.1.1.3 mrg (match_operand:SVE_FULL_F 3 "register_operand" "w")
7869 1.1.1.3 mrg (match_operand:SVE_FULL_F 4 "register_operand" "w")]
7870 1.1.1.3 mrg UNSPEC_COND_FCMUO))]
7871 1.1 mrg "TARGET_SVE"
7872 1.1.1.3 mrg "fcmuo\t%0.<Vetype>, %1/z, %3.<Vetype>, %4.<Vetype>"
7873 1.1.1.2 mrg )
7874 1.1.1.2 mrg
7875 1.1.1.3 mrg ;; Floating-point comparisons predicated on a PTRUE, with the results ANDed
7876 1.1.1.3 mrg ;; with another predicate P. This does not have the same trapping behavior
7877 1.1.1.3 mrg ;; as predicating the comparison itself on P, but it's a legitimate fold,
7878 1.1.1.3 mrg ;; since we can drop any potentially-trapping operations whose results
7879 1.1.1.3 mrg ;; are not needed.
7880 1.1.1.3 mrg ;;
7881 1.1.1.3 mrg ;; Split the instruction into its preferred form (below) at the earliest
7882 1.1.1.3 mrg ;; opportunity, in order to get rid of the redundant operand 1.
7883 1.1.1.3 mrg (define_insn_and_split "*fcm<cmp_op><mode>_and_combine"
7884 1.1.1.3 mrg [(set (match_operand:<VPRED> 0 "register_operand" "=Upa, Upa")
7885 1.1.1.3 mrg (and:<VPRED>
7886 1.1.1.3 mrg (unspec:<VPRED>
7887 1.1.1.3 mrg [(match_operand:<VPRED> 1)
7888 1.1.1.3 mrg (const_int SVE_KNOWN_PTRUE)
7889 1.1.1.3 mrg (match_operand:SVE_FULL_F 2 "register_operand" "w, w")
7890 1.1.1.3 mrg (match_operand:SVE_FULL_F 3 "aarch64_simd_reg_or_zero" "Dz, w")]
7891 1.1.1.3 mrg SVE_COND_FP_CMP_I0)
7892 1.1.1.3 mrg (match_operand:<VPRED> 4 "register_operand" "Upl, Upl")))]
7893 1.1.1.2 mrg "TARGET_SVE"
7894 1.1.1.3 mrg "#"
7895 1.1.1.3 mrg "&& 1"
7896 1.1.1.3 mrg [(set (match_dup 0)
7897 1.1.1.3 mrg (unspec:<VPRED>
7898 1.1.1.3 mrg [(match_dup 4)
7899 1.1.1.3 mrg (const_int SVE_MAYBE_NOT_PTRUE)
7900 1.1.1.3 mrg (match_dup 2)
7901 1.1.1.3 mrg (match_dup 3)]
7902 1.1.1.3 mrg SVE_COND_FP_CMP_I0))]
7903 1.1.1.2 mrg )
7904 1.1.1.2 mrg
7905 1.1.1.3 mrg ;; Same for unordered comparisons.
7906 1.1.1.3 mrg (define_insn_and_split "*fcmuo<mode>_and_combine"
7907 1.1.1.3 mrg [(set (match_operand:<VPRED> 0 "register_operand" "=Upa")
7908 1.1.1.3 mrg (and:<VPRED>
7909 1.1.1.3 mrg (unspec:<VPRED>
7910 1.1.1.3 mrg [(match_operand:<VPRED> 1)
7911 1.1.1.3 mrg (const_int SVE_KNOWN_PTRUE)
7912 1.1.1.3 mrg (match_operand:SVE_FULL_F 2 "register_operand" "w")
7913 1.1.1.3 mrg (match_operand:SVE_FULL_F 3 "register_operand" "w")]
7914 1.1.1.3 mrg UNSPEC_COND_FCMUO)
7915 1.1.1.3 mrg (match_operand:<VPRED> 4 "register_operand" "Upl")))]
7916 1.1.1.2 mrg "TARGET_SVE"
7917 1.1.1.2 mrg "#"
7918 1.1.1.3 mrg "&& 1"
7919 1.1.1.3 mrg [(set (match_dup 0)
7920 1.1.1.3 mrg (unspec:<VPRED>
7921 1.1.1.3 mrg [(match_dup 4)
7922 1.1.1.3 mrg (const_int SVE_MAYBE_NOT_PTRUE)
7923 1.1.1.3 mrg (match_dup 2)
7924 1.1.1.3 mrg (match_dup 3)]
7925 1.1.1.3 mrg UNSPEC_COND_FCMUO))]
7926 1.1.1.2 mrg )
7927 1.1.1.2 mrg
7928 1.1.1.3 mrg ;; -------------------------------------------------------------------------
7929 1.1.1.3 mrg ;; ---- [FP] Absolute comparisons
7930 1.1.1.3 mrg ;; -------------------------------------------------------------------------
7931 1.1.1.3 mrg ;; Includes:
7932 1.1.1.3 mrg ;; - FACGE
7933 1.1.1.3 mrg ;; - FACGT
7934 1.1.1.3 mrg ;; - FACLE
7935 1.1.1.3 mrg ;; - FACLT
7936 1.1.1.3 mrg ;; -------------------------------------------------------------------------
7937 1.1.1.3 mrg
7938 1.1.1.3 mrg ;; Predicated floating-point absolute comparisons.
7939 1.1.1.3 mrg (define_expand "@aarch64_pred_fac<cmp_op><mode>"
7940 1.1.1.3 mrg [(set (match_operand:<VPRED> 0 "register_operand")
7941 1.1.1.3 mrg (unspec:<VPRED>
7942 1.1.1.3 mrg [(match_operand:<VPRED> 1 "register_operand")
7943 1.1.1.3 mrg (match_operand:SI 2 "aarch64_sve_ptrue_flag")
7944 1.1.1.3 mrg (unspec:SVE_FULL_F
7945 1.1.1.3 mrg [(match_dup 1)
7946 1.1.1.3 mrg (match_dup 2)
7947 1.1.1.3 mrg (match_operand:SVE_FULL_F 3 "register_operand")]
7948 1.1.1.3 mrg UNSPEC_COND_FABS)
7949 1.1.1.3 mrg (unspec:SVE_FULL_F
7950 1.1.1.3 mrg [(match_dup 1)
7951 1.1.1.3 mrg (match_dup 2)
7952 1.1.1.3 mrg (match_operand:SVE_FULL_F 4 "register_operand")]
7953 1.1.1.3 mrg UNSPEC_COND_FABS)]
7954 1.1.1.3 mrg SVE_COND_FP_ABS_CMP))]
7955 1.1.1.2 mrg "TARGET_SVE"
7956 1.1.1.2 mrg )
7957 1.1.1.2 mrg
7958 1.1.1.3 mrg (define_insn_and_rewrite "*aarch64_pred_fac<cmp_op><mode>_relaxed"
7959 1.1.1.3 mrg [(set (match_operand:<VPRED> 0 "register_operand" "=Upa")
7960 1.1.1.3 mrg (unspec:<VPRED>
7961 1.1.1.3 mrg [(match_operand:<VPRED> 1 "register_operand" "Upl")
7962 1.1.1.3 mrg (match_operand:SI 4 "aarch64_sve_ptrue_flag")
7963 1.1.1.3 mrg (unspec:SVE_FULL_F
7964 1.1.1.3 mrg [(match_operand 5)
7965 1.1.1.3 mrg (const_int SVE_RELAXED_GP)
7966 1.1.1.3 mrg (match_operand:SVE_FULL_F 2 "register_operand" "w")]
7967 1.1.1.3 mrg UNSPEC_COND_FABS)
7968 1.1.1.3 mrg (unspec:SVE_FULL_F
7969 1.1.1.3 mrg [(match_operand 6)
7970 1.1.1.3 mrg (const_int SVE_RELAXED_GP)
7971 1.1.1.3 mrg (match_operand:SVE_FULL_F 3 "register_operand" "w")]
7972 1.1.1.3 mrg UNSPEC_COND_FABS)]
7973 1.1.1.3 mrg SVE_COND_FP_ABS_CMP))]
7974 1.1.1.3 mrg "TARGET_SVE"
7975 1.1.1.3 mrg "fac<cmp_op>\t%0.<Vetype>, %1/z, %2.<Vetype>, %3.<Vetype>"
7976 1.1.1.3 mrg "&& (!rtx_equal_p (operands[1], operands[5])
7977 1.1.1.3 mrg || !rtx_equal_p (operands[1], operands[6]))"
7978 1.1.1.3 mrg {
7979 1.1.1.3 mrg operands[5] = copy_rtx (operands[1]);
7980 1.1.1.3 mrg operands[6] = copy_rtx (operands[1]);
7981 1.1.1.3 mrg }
7982 1.1.1.3 mrg )
7983 1.1.1.3 mrg
7984 1.1.1.3 mrg (define_insn "*aarch64_pred_fac<cmp_op><mode>_strict"
7985 1.1.1.3 mrg [(set (match_operand:<VPRED> 0 "register_operand" "=Upa")
7986 1.1.1.3 mrg (unspec:<VPRED>
7987 1.1.1.3 mrg [(match_operand:<VPRED> 1 "register_operand" "Upl")
7988 1.1.1.3 mrg (match_operand:SI 4 "aarch64_sve_ptrue_flag")
7989 1.1.1.3 mrg (unspec:SVE_FULL_F
7990 1.1.1.3 mrg [(match_dup 1)
7991 1.1.1.3 mrg (match_operand:SI 5 "aarch64_sve_gp_strictness")
7992 1.1.1.3 mrg (match_operand:SVE_FULL_F 2 "register_operand" "w")]
7993 1.1.1.3 mrg UNSPEC_COND_FABS)
7994 1.1.1.3 mrg (unspec:SVE_FULL_F
7995 1.1.1.3 mrg [(match_dup 1)
7996 1.1.1.3 mrg (match_operand:SI 6 "aarch64_sve_gp_strictness")
7997 1.1.1.3 mrg (match_operand:SVE_FULL_F 3 "register_operand" "w")]
7998 1.1.1.3 mrg UNSPEC_COND_FABS)]
7999 1.1.1.3 mrg SVE_COND_FP_ABS_CMP))]
8000 1.1.1.3 mrg "TARGET_SVE"
8001 1.1.1.3 mrg "fac<cmp_op>\t%0.<Vetype>, %1/z, %2.<Vetype>, %3.<Vetype>"
8002 1.1.1.3 mrg )
8003 1.1.1.3 mrg
8004 1.1.1.3 mrg ;; -------------------------------------------------------------------------
8005 1.1.1.3 mrg ;; ---- [PRED] Select
8006 1.1.1.3 mrg ;; -------------------------------------------------------------------------
8007 1.1.1.3 mrg ;; Includes:
8008 1.1.1.3 mrg ;; - SEL
8009 1.1.1.3 mrg ;; -------------------------------------------------------------------------
8010 1.1.1.3 mrg
8011 1.1.1.3 mrg (define_insn "@vcond_mask_<mode><mode>"
8012 1.1.1.3 mrg [(set (match_operand:PRED_ALL 0 "register_operand" "=Upa")
8013 1.1.1.3 mrg (ior:PRED_ALL
8014 1.1.1.3 mrg (and:PRED_ALL
8015 1.1.1.3 mrg (match_operand:PRED_ALL 3 "register_operand" "Upa")
8016 1.1.1.3 mrg (match_operand:PRED_ALL 1 "register_operand" "Upa"))
8017 1.1.1.3 mrg (and:PRED_ALL
8018 1.1.1.3 mrg (not (match_dup 3))
8019 1.1.1.3 mrg (match_operand:PRED_ALL 2 "register_operand" "Upa"))))]
8020 1.1.1.3 mrg "TARGET_SVE"
8021 1.1.1.3 mrg "sel\t%0.b, %3, %1.b, %2.b"
8022 1.1.1.3 mrg )
8023 1.1.1.3 mrg
8024 1.1.1.3 mrg ;; -------------------------------------------------------------------------
8025 1.1.1.3 mrg ;; ---- [PRED] Test bits
8026 1.1.1.3 mrg ;; -------------------------------------------------------------------------
8027 1.1.1.3 mrg ;; Includes:
8028 1.1.1.3 mrg ;; - PTEST
8029 1.1.1.3 mrg ;; -------------------------------------------------------------------------
8030 1.1.1.3 mrg
8031 1.1.1.3 mrg ;; Branch based on predicate equality or inequality.
8032 1.1.1.3 mrg (define_expand "cbranch<mode>4"
8033 1.1.1.3 mrg [(set (pc)
8034 1.1.1.3 mrg (if_then_else
8035 1.1.1.3 mrg (match_operator 0 "aarch64_equality_operator"
8036 1.1.1.3 mrg [(match_operand:PRED_ALL 1 "register_operand")
8037 1.1.1.3 mrg (match_operand:PRED_ALL 2 "aarch64_simd_reg_or_zero")])
8038 1.1.1.3 mrg (label_ref (match_operand 3 ""))
8039 1.1.1.3 mrg (pc)))]
8040 1.1.1.3 mrg ""
8041 1.1.1.3 mrg {
8042 1.1.1.3 mrg rtx ptrue = force_reg (VNx16BImode, aarch64_ptrue_all (<data_bytes>));
8043 1.1.1.3 mrg rtx cast_ptrue = gen_lowpart (<MODE>mode, ptrue);
8044 1.1.1.3 mrg rtx ptrue_flag = gen_int_mode (SVE_KNOWN_PTRUE, SImode);
8045 1.1.1.3 mrg rtx pred;
8046 1.1.1.3 mrg if (operands[2] == CONST0_RTX (<MODE>mode))
8047 1.1.1.3 mrg pred = operands[1];
8048 1.1.1.3 mrg else
8049 1.1.1.3 mrg {
8050 1.1.1.3 mrg pred = gen_reg_rtx (<MODE>mode);
8051 1.1.1.3 mrg emit_insn (gen_aarch64_pred_xor<mode>_z (pred, cast_ptrue, operands[1],
8052 1.1.1.3 mrg operands[2]));
8053 1.1.1.3 mrg }
8054 1.1.1.3 mrg emit_insn (gen_aarch64_ptest<mode> (ptrue, cast_ptrue, ptrue_flag, pred));
8055 1.1.1.3 mrg operands[1] = gen_rtx_REG (CC_NZCmode, CC_REGNUM);
8056 1.1.1.3 mrg operands[2] = const0_rtx;
8057 1.1.1.3 mrg }
8058 1.1 mrg )
8059 1.1 mrg
8060 1.1.1.3 mrg ;; See "Description of UNSPEC_PTEST" above for details.
8061 1.1.1.3 mrg (define_insn "aarch64_ptest<mode>"
8062 1.1.1.3 mrg [(set (reg:CC_NZC CC_REGNUM)
8063 1.1.1.3 mrg (unspec:CC_NZC [(match_operand:VNx16BI 0 "register_operand" "Upa")
8064 1.1.1.3 mrg (match_operand 1)
8065 1.1.1.3 mrg (match_operand:SI 2 "aarch64_sve_ptrue_flag")
8066 1.1.1.3 mrg (match_operand:PRED_ALL 3 "register_operand" "Upa")]
8067 1.1.1.3 mrg UNSPEC_PTEST))]
8068 1.1.1.3 mrg "TARGET_SVE"
8069 1.1.1.3 mrg "ptest\t%0, %3.b"
8070 1.1.1.3 mrg )
8071 1.1.1.3 mrg
8072 1.1.1.3 mrg ;; =========================================================================
8073 1.1.1.3 mrg ;; == Reductions
8074 1.1.1.3 mrg ;; =========================================================================
8075 1.1.1.3 mrg
8076 1.1.1.3 mrg ;; -------------------------------------------------------------------------
8077 1.1.1.3 mrg ;; ---- [INT,FP] Conditional reductions
8078 1.1.1.3 mrg ;; -------------------------------------------------------------------------
8079 1.1.1.3 mrg ;; Includes:
8080 1.1.1.3 mrg ;; - CLASTA
8081 1.1.1.3 mrg ;; - CLASTB
8082 1.1.1.3 mrg ;; -------------------------------------------------------------------------
8083 1.1.1.3 mrg
8084 1.1 mrg ;; Set operand 0 to the last active element in operand 3, or to tied
8085 1.1 mrg ;; operand 1 if no elements are active.
8086 1.1.1.3 mrg (define_insn "@fold_extract_<last_op>_<mode>"
8087 1.1.1.3 mrg [(set (match_operand:<VEL> 0 "register_operand" "=?r, w")
8088 1.1 mrg (unspec:<VEL>
8089 1.1 mrg [(match_operand:<VEL> 1 "register_operand" "0, 0")
8090 1.1 mrg (match_operand:<VPRED> 2 "register_operand" "Upl, Upl")
8091 1.1.1.3 mrg (match_operand:SVE_FULL 3 "register_operand" "w, w")]
8092 1.1.1.3 mrg CLAST))]
8093 1.1.1.3 mrg "TARGET_SVE"
8094 1.1.1.3 mrg "@
8095 1.1.1.3 mrg clast<ab>\t%<vwcore>0, %2, %<vwcore>0, %3.<Vetype>
8096 1.1.1.3 mrg clast<ab>\t%<Vetype>0, %2, %<Vetype>0, %3.<Vetype>"
8097 1.1.1.3 mrg )
8098 1.1.1.3 mrg
8099 1.1.1.3 mrg (define_insn "@aarch64_fold_extract_vector_<last_op>_<mode>"
8100 1.1.1.3 mrg [(set (match_operand:SVE_FULL 0 "register_operand" "=w, ?&w")
8101 1.1.1.3 mrg (unspec:SVE_FULL
8102 1.1.1.3 mrg [(match_operand:SVE_FULL 1 "register_operand" "0, w")
8103 1.1.1.3 mrg (match_operand:<VPRED> 2 "register_operand" "Upl, Upl")
8104 1.1.1.3 mrg (match_operand:SVE_FULL 3 "register_operand" "w, w")]
8105 1.1.1.3 mrg CLAST))]
8106 1.1 mrg "TARGET_SVE"
8107 1.1 mrg "@
8108 1.1.1.3 mrg clast<ab>\t%0.<Vetype>, %2, %0.<Vetype>, %3.<Vetype>
8109 1.1.1.3 mrg movprfx\t%0, %1\;clast<ab>\t%0.<Vetype>, %2, %0.<Vetype>, %3.<Vetype>"
8110 1.1 mrg )
8111 1.1 mrg
8112 1.1.1.3 mrg ;; -------------------------------------------------------------------------
8113 1.1.1.3 mrg ;; ---- [INT] Tree reductions
8114 1.1.1.3 mrg ;; -------------------------------------------------------------------------
8115 1.1.1.3 mrg ;; Includes:
8116 1.1.1.3 mrg ;; - ANDV
8117 1.1.1.3 mrg ;; - EORV
8118 1.1.1.3 mrg ;; - ORV
8119 1.1.1.3 mrg ;; - SADDV
8120 1.1.1.3 mrg ;; - SMAXV
8121 1.1.1.3 mrg ;; - SMINV
8122 1.1.1.3 mrg ;; - UADDV
8123 1.1.1.3 mrg ;; - UMAXV
8124 1.1.1.3 mrg ;; - UMINV
8125 1.1.1.3 mrg ;; -------------------------------------------------------------------------
8126 1.1.1.3 mrg
8127 1.1 mrg ;; Unpredicated integer add reduction.
8128 1.1 mrg (define_expand "reduc_plus_scal_<mode>"
8129 1.1.1.3 mrg [(match_operand:<VEL> 0 "register_operand")
8130 1.1.1.3 mrg (match_operand:SVE_FULL_I 1 "register_operand")]
8131 1.1 mrg "TARGET_SVE"
8132 1.1 mrg {
8133 1.1.1.3 mrg rtx pred = aarch64_ptrue_reg (<VPRED>mode);
8134 1.1.1.3 mrg rtx tmp = <VEL>mode == DImode ? operands[0] : gen_reg_rtx (DImode);
8135 1.1.1.3 mrg emit_insn (gen_aarch64_pred_reduc_uadd_<mode> (tmp, pred, operands[1]));
8136 1.1.1.3 mrg if (tmp != operands[0])
8137 1.1.1.3 mrg emit_move_insn (operands[0], gen_lowpart (<VEL>mode, tmp));
8138 1.1.1.3 mrg DONE;
8139 1.1 mrg }
8140 1.1 mrg )
8141 1.1 mrg
8142 1.1 mrg ;; Predicated integer add reduction. The result is always 64-bits.
8143 1.1.1.3 mrg (define_insn "@aarch64_pred_reduc_<optab>_<mode>"
8144 1.1.1.3 mrg [(set (match_operand:DI 0 "register_operand" "=w")
8145 1.1.1.3 mrg (unspec:DI [(match_operand:<VPRED> 1 "register_operand" "Upl")
8146 1.1.1.3 mrg (match_operand:SVE_FULL_I 2 "register_operand" "w")]
8147 1.1.1.3 mrg SVE_INT_ADDV))]
8148 1.1.1.3 mrg "TARGET_SVE && <max_elem_bits> >= <elem_bits>"
8149 1.1.1.3 mrg "<su>addv\t%d0, %1, %2.<Vetype>"
8150 1.1 mrg )
8151 1.1 mrg
8152 1.1.1.3 mrg ;; Unpredicated integer reductions.
8153 1.1.1.3 mrg (define_expand "reduc_<optab>_scal_<mode>"
8154 1.1 mrg [(set (match_operand:<VEL> 0 "register_operand")
8155 1.1 mrg (unspec:<VEL> [(match_dup 2)
8156 1.1.1.3 mrg (match_operand:SVE_FULL_I 1 "register_operand")]
8157 1.1.1.3 mrg SVE_INT_REDUCTION))]
8158 1.1 mrg "TARGET_SVE"
8159 1.1 mrg {
8160 1.1.1.3 mrg operands[2] = aarch64_ptrue_reg (<VPRED>mode);
8161 1.1 mrg }
8162 1.1 mrg )
8163 1.1 mrg
8164 1.1.1.3 mrg ;; Predicated integer reductions.
8165 1.1.1.3 mrg (define_insn "@aarch64_pred_reduc_<optab>_<mode>"
8166 1.1 mrg [(set (match_operand:<VEL> 0 "register_operand" "=w")
8167 1.1 mrg (unspec:<VEL> [(match_operand:<VPRED> 1 "register_operand" "Upl")
8168 1.1.1.3 mrg (match_operand:SVE_FULL_I 2 "register_operand" "w")]
8169 1.1.1.3 mrg SVE_INT_REDUCTION))]
8170 1.1 mrg "TARGET_SVE"
8171 1.1.1.3 mrg "<sve_int_op>\t%<Vetype>0, %1, %2.<Vetype>"
8172 1.1 mrg )
8173 1.1 mrg
8174 1.1.1.3 mrg ;; -------------------------------------------------------------------------
8175 1.1.1.3 mrg ;; ---- [FP] Tree reductions
8176 1.1.1.3 mrg ;; -------------------------------------------------------------------------
8177 1.1.1.3 mrg ;; Includes:
8178 1.1.1.3 mrg ;; - FADDV
8179 1.1.1.3 mrg ;; - FMAXNMV
8180 1.1.1.3 mrg ;; - FMAXV
8181 1.1.1.3 mrg ;; - FMINNMV
8182 1.1.1.3 mrg ;; - FMINV
8183 1.1.1.3 mrg ;; -------------------------------------------------------------------------
8184 1.1.1.3 mrg
8185 1.1.1.3 mrg ;; Unpredicated floating-point tree reductions.
8186 1.1.1.3 mrg (define_expand "reduc_<optab>_scal_<mode>"
8187 1.1 mrg [(set (match_operand:<VEL> 0 "register_operand")
8188 1.1 mrg (unspec:<VEL> [(match_dup 2)
8189 1.1.1.3 mrg (match_operand:SVE_FULL_F 1 "register_operand")]
8190 1.1.1.3 mrg SVE_FP_REDUCTION))]
8191 1.1 mrg "TARGET_SVE"
8192 1.1 mrg {
8193 1.1.1.3 mrg operands[2] = aarch64_ptrue_reg (<VPRED>mode);
8194 1.1 mrg }
8195 1.1 mrg )
8196 1.1 mrg
8197 1.1.1.3 mrg ;; Predicated floating-point tree reductions.
8198 1.1.1.3 mrg (define_insn "@aarch64_pred_reduc_<optab>_<mode>"
8199 1.1 mrg [(set (match_operand:<VEL> 0 "register_operand" "=w")
8200 1.1 mrg (unspec:<VEL> [(match_operand:<VPRED> 1 "register_operand" "Upl")
8201 1.1.1.3 mrg (match_operand:SVE_FULL_F 2 "register_operand" "w")]
8202 1.1.1.3 mrg SVE_FP_REDUCTION))]
8203 1.1 mrg "TARGET_SVE"
8204 1.1.1.3 mrg "<sve_fp_op>\t%<Vetype>0, %1, %2.<Vetype>"
8205 1.1 mrg )
8206 1.1 mrg
8207 1.1.1.3 mrg ;; -------------------------------------------------------------------------
8208 1.1.1.3 mrg ;; ---- [FP] Left-to-right reductions
8209 1.1.1.3 mrg ;; -------------------------------------------------------------------------
8210 1.1.1.3 mrg ;; Includes:
8211 1.1.1.3 mrg ;; - FADDA
8212 1.1.1.3 mrg ;; -------------------------------------------------------------------------
8213 1.1.1.3 mrg
8214 1.1.1.3 mrg ;; Unpredicated in-order FP reductions.
8215 1.1.1.3 mrg (define_expand "fold_left_plus_<mode>"
8216 1.1 mrg [(set (match_operand:<VEL> 0 "register_operand")
8217 1.1.1.3 mrg (unspec:<VEL> [(match_dup 3)
8218 1.1.1.3 mrg (match_operand:<VEL> 1 "register_operand")
8219 1.1.1.3 mrg (match_operand:SVE_FULL_F 2 "register_operand")]
8220 1.1.1.3 mrg UNSPEC_FADDA))]
8221 1.1 mrg "TARGET_SVE"
8222 1.1 mrg {
8223 1.1.1.3 mrg operands[3] = aarch64_ptrue_reg (<VPRED>mode);
8224 1.1 mrg }
8225 1.1 mrg )
8226 1.1 mrg
8227 1.1.1.3 mrg ;; Predicated in-order FP reductions.
8228 1.1.1.3 mrg (define_insn "mask_fold_left_plus_<mode>"
8229 1.1 mrg [(set (match_operand:<VEL> 0 "register_operand" "=w")
8230 1.1.1.3 mrg (unspec:<VEL> [(match_operand:<VPRED> 3 "register_operand" "Upl")
8231 1.1.1.3 mrg (match_operand:<VEL> 1 "register_operand" "0")
8232 1.1.1.3 mrg (match_operand:SVE_FULL_F 2 "register_operand" "w")]
8233 1.1.1.3 mrg UNSPEC_FADDA))]
8234 1.1 mrg "TARGET_SVE"
8235 1.1.1.3 mrg "fadda\t%<Vetype>0, %3, %<Vetype>0, %2.<Vetype>"
8236 1.1 mrg )
8237 1.1 mrg
8238 1.1.1.3 mrg ;; =========================================================================
8239 1.1.1.3 mrg ;; == Permutes
8240 1.1.1.3 mrg ;; =========================================================================
8241 1.1.1.3 mrg
8242 1.1.1.3 mrg ;; -------------------------------------------------------------------------
8243 1.1.1.3 mrg ;; ---- [INT,FP] General permutes
8244 1.1.1.3 mrg ;; -------------------------------------------------------------------------
8245 1.1.1.3 mrg ;; Includes:
8246 1.1.1.3 mrg ;; - TBL
8247 1.1.1.3 mrg ;; -------------------------------------------------------------------------
8248 1.1.1.3 mrg
8249 1.1.1.3 mrg (define_expand "vec_perm<mode>"
8250 1.1.1.3 mrg [(match_operand:SVE_FULL 0 "register_operand")
8251 1.1.1.3 mrg (match_operand:SVE_FULL 1 "register_operand")
8252 1.1.1.3 mrg (match_operand:SVE_FULL 2 "register_operand")
8253 1.1.1.3 mrg (match_operand:<V_INT_EQUIV> 3 "aarch64_sve_vec_perm_operand")]
8254 1.1.1.3 mrg "TARGET_SVE && GET_MODE_NUNITS (<MODE>mode).is_constant ()"
8255 1.1 mrg {
8256 1.1.1.3 mrg aarch64_expand_sve_vec_perm (operands[0], operands[1],
8257 1.1.1.3 mrg operands[2], operands[3]);
8258 1.1.1.3 mrg DONE;
8259 1.1 mrg }
8260 1.1 mrg )
8261 1.1 mrg
8262 1.1.1.3 mrg (define_insn "@aarch64_sve_tbl<mode>"
8263 1.1.1.3 mrg [(set (match_operand:SVE_FULL 0 "register_operand" "=w")
8264 1.1.1.3 mrg (unspec:SVE_FULL
8265 1.1.1.3 mrg [(match_operand:SVE_FULL 1 "register_operand" "w")
8266 1.1.1.3 mrg (match_operand:<V_INT_EQUIV> 2 "register_operand" "w")]
8267 1.1.1.3 mrg UNSPEC_TBL))]
8268 1.1 mrg "TARGET_SVE"
8269 1.1.1.3 mrg "tbl\t%0.<Vetype>, %1.<Vetype>, %2.<Vetype>"
8270 1.1 mrg )
8271 1.1 mrg
8272 1.1.1.3 mrg ;; -------------------------------------------------------------------------
8273 1.1.1.3 mrg ;; ---- [INT,FP] Special-purpose unary permutes
8274 1.1.1.3 mrg ;; -------------------------------------------------------------------------
8275 1.1.1.3 mrg ;; Includes:
8276 1.1.1.3 mrg ;; - COMPACT
8277 1.1.1.3 mrg ;; - DUP
8278 1.1.1.3 mrg ;; - REV
8279 1.1.1.3 mrg ;; -------------------------------------------------------------------------
8280 1.1.1.3 mrg
8281 1.1.1.3 mrg ;; Compact active elements and pad with zeros.
8282 1.1.1.3 mrg (define_insn "@aarch64_sve_compact<mode>"
8283 1.1.1.3 mrg [(set (match_operand:SVE_FULL_SD 0 "register_operand" "=w")
8284 1.1.1.3 mrg (unspec:SVE_FULL_SD
8285 1.1.1.3 mrg [(match_operand:<VPRED> 1 "register_operand" "Upl")
8286 1.1.1.3 mrg (match_operand:SVE_FULL_SD 2 "register_operand" "w")]
8287 1.1.1.3 mrg UNSPEC_SVE_COMPACT))]
8288 1.1.1.3 mrg "TARGET_SVE"
8289 1.1.1.3 mrg "compact\t%0.<Vetype>, %1, %2.<Vetype>"
8290 1.1.1.3 mrg )
8291 1.1.1.3 mrg
8292 1.1.1.3 mrg ;; Duplicate one element of a vector.
8293 1.1.1.3 mrg (define_insn "@aarch64_sve_dup_lane<mode>"
8294 1.1.1.3 mrg [(set (match_operand:SVE_FULL 0 "register_operand" "=w")
8295 1.1.1.3 mrg (vec_duplicate:SVE_FULL
8296 1.1.1.3 mrg (vec_select:<VEL>
8297 1.1.1.3 mrg (match_operand:SVE_FULL 1 "register_operand" "w")
8298 1.1.1.3 mrg (parallel [(match_operand:SI 2 "const_int_operand")]))))]
8299 1.1.1.3 mrg "TARGET_SVE
8300 1.1.1.3 mrg && IN_RANGE (INTVAL (operands[2]) * GET_MODE_SIZE (<VEL>mode), 0, 63)"
8301 1.1.1.3 mrg "dup\t%0.<Vetype>, %1.<Vetype>[%2]"
8302 1.1.1.3 mrg )
8303 1.1.1.3 mrg
8304 1.1.1.3 mrg ;; Use DUP.Q to duplicate a 128-bit segment of a register.
8305 1.1.1.3 mrg ;;
8306 1.1.1.3 mrg ;; The vec_select:<V128> sets memory lane number N of the V128 to lane
8307 1.1.1.3 mrg ;; number op2 + N of op1. (We don't need to distinguish between memory
8308 1.1.1.3 mrg ;; and architectural register lane numbering for op1 or op0, since the
8309 1.1.1.3 mrg ;; two numbering schemes are the same for SVE.)
8310 1.1.1.3 mrg ;;
8311 1.1.1.3 mrg ;; The vec_duplicate:SVE_FULL then copies memory lane number N of the
8312 1.1.1.3 mrg ;; V128 (and thus lane number op2 + N of op1) to lane numbers N + I * STEP
8313 1.1.1.3 mrg ;; of op0. We therefore get the correct result for both endiannesses.
8314 1.1.1.3 mrg ;;
8315 1.1.1.3 mrg ;; The wrinkle is that for big-endian V128 registers, memory lane numbering
8316 1.1.1.3 mrg ;; is in the opposite order to architectural register lane numbering.
8317 1.1.1.3 mrg ;; Thus if we were to do this operation via a V128 temporary register,
8318 1.1.1.3 mrg ;; the vec_select and vec_duplicate would both involve a reverse operation
8319 1.1.1.3 mrg ;; for big-endian targets. In this fused pattern the two reverses cancel
8320 1.1.1.3 mrg ;; each other out.
8321 1.1.1.3 mrg (define_insn "@aarch64_sve_dupq_lane<mode>"
8322 1.1.1.3 mrg [(set (match_operand:SVE_FULL 0 "register_operand" "=w")
8323 1.1.1.3 mrg (vec_duplicate:SVE_FULL
8324 1.1.1.3 mrg (vec_select:<V128>
8325 1.1.1.3 mrg (match_operand:SVE_FULL 1 "register_operand" "w")
8326 1.1.1.3 mrg (match_operand 2 "ascending_int_parallel"))))]
8327 1.1.1.3 mrg "TARGET_SVE
8328 1.1.1.3 mrg && (INTVAL (XVECEXP (operands[2], 0, 0))
8329 1.1.1.3 mrg * GET_MODE_SIZE (<VEL>mode)) % 16 == 0
8330 1.1.1.3 mrg && IN_RANGE (INTVAL (XVECEXP (operands[2], 0, 0))
8331 1.1.1.3 mrg * GET_MODE_SIZE (<VEL>mode), 0, 63)"
8332 1.1.1.3 mrg {
8333 1.1.1.3 mrg unsigned int byte = (INTVAL (XVECEXP (operands[2], 0, 0))
8334 1.1.1.3 mrg * GET_MODE_SIZE (<VEL>mode));
8335 1.1.1.3 mrg operands[2] = gen_int_mode (byte / 16, DImode);
8336 1.1.1.3 mrg return "dup\t%0.q, %1.q[%2]";
8337 1.1.1.3 mrg }
8338 1.1.1.3 mrg )
8339 1.1.1.3 mrg
8340 1.1.1.3 mrg ;; Reverse the order of elements within a full vector.
8341 1.1.1.3 mrg (define_insn "@aarch64_sve_rev<mode>"
8342 1.1.1.3 mrg [(set (match_operand:SVE_FULL 0 "register_operand" "=w")
8343 1.1.1.3 mrg (unspec:SVE_FULL
8344 1.1.1.3 mrg [(match_operand:SVE_FULL 1 "register_operand" "w")]
8345 1.1.1.3 mrg UNSPEC_REV))]
8346 1.1 mrg "TARGET_SVE"
8347 1.1.1.3 mrg "rev\t%0.<Vetype>, %1.<Vetype>")
8348 1.1.1.3 mrg
8349 1.1.1.3 mrg ;; -------------------------------------------------------------------------
8350 1.1.1.3 mrg ;; ---- [INT,FP] Special-purpose binary permutes
8351 1.1.1.3 mrg ;; -------------------------------------------------------------------------
8352 1.1.1.3 mrg ;; Includes:
8353 1.1.1.3 mrg ;; - SPLICE
8354 1.1.1.3 mrg ;; - TRN1
8355 1.1.1.3 mrg ;; - TRN2
8356 1.1.1.3 mrg ;; - UZP1
8357 1.1.1.3 mrg ;; - UZP2
8358 1.1.1.3 mrg ;; - ZIP1
8359 1.1.1.3 mrg ;; - ZIP2
8360 1.1.1.3 mrg ;; -------------------------------------------------------------------------
8361 1.1.1.3 mrg
8362 1.1.1.3 mrg ;; Like EXT, but start at the first active element.
8363 1.1.1.3 mrg (define_insn "@aarch64_sve_splice<mode>"
8364 1.1.1.3 mrg [(set (match_operand:SVE_FULL 0 "register_operand" "=w, ?&w")
8365 1.1.1.3 mrg (unspec:SVE_FULL
8366 1.1.1.3 mrg [(match_operand:<VPRED> 1 "register_operand" "Upl, Upl")
8367 1.1.1.3 mrg (match_operand:SVE_FULL 2 "register_operand" "0, w")
8368 1.1.1.3 mrg (match_operand:SVE_FULL 3 "register_operand" "w, w")]
8369 1.1.1.3 mrg UNSPEC_SVE_SPLICE))]
8370 1.1.1.3 mrg "TARGET_SVE"
8371 1.1.1.3 mrg "@
8372 1.1.1.3 mrg splice\t%0.<Vetype>, %1, %0.<Vetype>, %3.<Vetype>
8373 1.1.1.3 mrg movprfx\t%0, %2\;splice\t%0.<Vetype>, %1, %0.<Vetype>, %3.<Vetype>"
8374 1.1.1.3 mrg [(set_attr "movprfx" "*, yes")]
8375 1.1.1.3 mrg )
8376 1.1.1.3 mrg
8377 1.1.1.3 mrg ;; Permutes that take half the elements from one vector and half the
8378 1.1.1.3 mrg ;; elements from the other.
8379 1.1.1.3 mrg (define_insn "@aarch64_sve_<perm_insn><mode>"
8380 1.1.1.3 mrg [(set (match_operand:SVE_FULL 0 "register_operand" "=w")
8381 1.1.1.3 mrg (unspec:SVE_FULL
8382 1.1.1.3 mrg [(match_operand:SVE_FULL 1 "register_operand" "w")
8383 1.1.1.3 mrg (match_operand:SVE_FULL 2 "register_operand" "w")]
8384 1.1.1.3 mrg PERMUTE))]
8385 1.1.1.3 mrg "TARGET_SVE"
8386 1.1.1.3 mrg "<perm_insn>\t%0.<Vetype>, %1.<Vetype>, %2.<Vetype>"
8387 1.1.1.3 mrg )
8388 1.1.1.3 mrg
8389 1.1.1.3 mrg ;; Apply PERMUTE to 128-bit sequences. The behavior of these patterns
8390 1.1.1.3 mrg ;; doesn't depend on the mode.
8391 1.1.1.3 mrg (define_insn "@aarch64_sve_<optab><mode>"
8392 1.1.1.3 mrg [(set (match_operand:SVE_FULL 0 "register_operand" "=w")
8393 1.1.1.3 mrg (unspec:SVE_FULL
8394 1.1.1.3 mrg [(match_operand:SVE_FULL 1 "register_operand" "w")
8395 1.1.1.3 mrg (match_operand:SVE_FULL 2 "register_operand" "w")]
8396 1.1.1.3 mrg PERMUTEQ))]
8397 1.1.1.3 mrg "TARGET_SVE_F64MM"
8398 1.1.1.3 mrg "<perm_insn>\t%0.q, %1.q, %2.q"
8399 1.1.1.3 mrg )
8400 1.1.1.3 mrg
8401 1.1.1.3 mrg ;; Concatenate two vectors and extract a subvector. Note that the
8402 1.1.1.3 mrg ;; immediate (third) operand is the lane index not the byte index.
8403 1.1.1.3 mrg (define_insn "@aarch64_sve_ext<mode>"
8404 1.1.1.3 mrg [(set (match_operand:SVE_FULL 0 "register_operand" "=w, ?&w")
8405 1.1.1.3 mrg (unspec:SVE_FULL
8406 1.1.1.3 mrg [(match_operand:SVE_FULL 1 "register_operand" "0, w")
8407 1.1.1.3 mrg (match_operand:SVE_FULL 2 "register_operand" "w, w")
8408 1.1.1.3 mrg (match_operand:SI 3 "const_int_operand")]
8409 1.1.1.3 mrg UNSPEC_EXT))]
8410 1.1.1.3 mrg "TARGET_SVE
8411 1.1.1.3 mrg && IN_RANGE (INTVAL (operands[3]) * GET_MODE_SIZE (<VEL>mode), 0, 255)"
8412 1.1 mrg {
8413 1.1.1.3 mrg operands[3] = GEN_INT (INTVAL (operands[3]) * GET_MODE_SIZE (<VEL>mode));
8414 1.1.1.3 mrg return (which_alternative == 0
8415 1.1.1.3 mrg ? "ext\\t%0.b, %0.b, %2.b, #%3"
8416 1.1.1.3 mrg : "movprfx\t%0, %1\;ext\\t%0.b, %0.b, %2.b, #%3");
8417 1.1 mrg }
8418 1.1.1.3 mrg [(set_attr "movprfx" "*,yes")]
8419 1.1 mrg )
8420 1.1 mrg
8421 1.1.1.3 mrg ;; -------------------------------------------------------------------------
8422 1.1.1.3 mrg ;; ---- [PRED] Special-purpose unary permutes
8423 1.1.1.3 mrg ;; -------------------------------------------------------------------------
8424 1.1.1.3 mrg ;; Includes:
8425 1.1.1.3 mrg ;; - REV
8426 1.1.1.3 mrg ;; -------------------------------------------------------------------------
8427 1.1.1.3 mrg
8428 1.1.1.3 mrg (define_insn "@aarch64_sve_rev<mode>"
8429 1.1.1.3 mrg [(set (match_operand:PRED_ALL 0 "register_operand" "=Upa")
8430 1.1.1.3 mrg (unspec:PRED_ALL [(match_operand:PRED_ALL 1 "register_operand" "Upa")]
8431 1.1.1.3 mrg UNSPEC_REV))]
8432 1.1.1.3 mrg "TARGET_SVE"
8433 1.1.1.3 mrg "rev\t%0.<Vetype>, %1.<Vetype>")
8434 1.1.1.3 mrg
8435 1.1.1.3 mrg ;; -------------------------------------------------------------------------
8436 1.1.1.3 mrg ;; ---- [PRED] Special-purpose binary permutes
8437 1.1.1.3 mrg ;; -------------------------------------------------------------------------
8438 1.1.1.3 mrg ;; Includes:
8439 1.1.1.3 mrg ;; - TRN1
8440 1.1.1.3 mrg ;; - TRN2
8441 1.1.1.3 mrg ;; - UZP1
8442 1.1.1.3 mrg ;; - UZP2
8443 1.1.1.3 mrg ;; - ZIP1
8444 1.1.1.3 mrg ;; - ZIP2
8445 1.1.1.3 mrg ;; -------------------------------------------------------------------------
8446 1.1.1.3 mrg
8447 1.1.1.3 mrg ;; Permutes that take half the elements from one vector and half the
8448 1.1.1.3 mrg ;; elements from the other.
8449 1.1.1.3 mrg (define_insn "@aarch64_sve_<perm_insn><mode>"
8450 1.1.1.3 mrg [(set (match_operand:PRED_ALL 0 "register_operand" "=Upa")
8451 1.1.1.3 mrg (unspec:PRED_ALL [(match_operand:PRED_ALL 1 "register_operand" "Upa")
8452 1.1.1.3 mrg (match_operand:PRED_ALL 2 "register_operand" "Upa")]
8453 1.1.1.3 mrg PERMUTE))]
8454 1.1 mrg "TARGET_SVE"
8455 1.1.1.3 mrg "<perm_insn>\t%0.<Vetype>, %1.<Vetype>, %2.<Vetype>"
8456 1.1 mrg )
8457 1.1 mrg
8458 1.1.1.3 mrg ;; Special purpose permute used by the predicate generation instructions.
8459 1.1.1.3 mrg ;; Unlike the normal permute patterns, these instructions operate on VNx16BI
8460 1.1.1.3 mrg ;; regardless of the element size, so that all input and output bits are
8461 1.1.1.3 mrg ;; well-defined. Operand 3 then indicates the size of the permute.
8462 1.1.1.3 mrg (define_insn "@aarch64_sve_trn1_conv<mode>"
8463 1.1.1.3 mrg [(set (match_operand:VNx16BI 0 "register_operand" "=Upa")
8464 1.1.1.3 mrg (unspec:VNx16BI [(match_operand:VNx16BI 1 "register_operand" "Upa")
8465 1.1.1.3 mrg (match_operand:VNx16BI 2 "register_operand" "Upa")
8466 1.1.1.3 mrg (match_operand:PRED_ALL 3 "aarch64_simd_imm_zero")]
8467 1.1.1.3 mrg UNSPEC_TRN1_CONV))]
8468 1.1.1.3 mrg "TARGET_SVE"
8469 1.1.1.3 mrg "trn1\t%0.<PRED_ALL:Vetype>, %1.<PRED_ALL:Vetype>, %2.<PRED_ALL:Vetype>"
8470 1.1.1.3 mrg )
8471 1.1.1.3 mrg
8472 1.1.1.3 mrg ;; =========================================================================
8473 1.1.1.3 mrg ;; == Conversions
8474 1.1.1.3 mrg ;; =========================================================================
8475 1.1.1.3 mrg
8476 1.1.1.3 mrg ;; -------------------------------------------------------------------------
8477 1.1.1.3 mrg ;; ---- [INT<-INT] Packs
8478 1.1.1.3 mrg ;; -------------------------------------------------------------------------
8479 1.1.1.3 mrg ;; Includes:
8480 1.1.1.3 mrg ;; - UZP1
8481 1.1.1.3 mrg ;; -------------------------------------------------------------------------
8482 1.1.1.3 mrg
8483 1.1.1.3 mrg ;; Integer pack. Use UZP1 on the narrower type, which discards
8484 1.1.1.3 mrg ;; the high part of each wide element.
8485 1.1.1.3 mrg (define_insn "vec_pack_trunc_<Vwide>"
8486 1.1.1.3 mrg [(set (match_operand:SVE_FULL_BHSI 0 "register_operand" "=w")
8487 1.1.1.3 mrg (unspec:SVE_FULL_BHSI
8488 1.1.1.3 mrg [(match_operand:<VWIDE> 1 "register_operand" "w")
8489 1.1.1.3 mrg (match_operand:<VWIDE> 2 "register_operand" "w")]
8490 1.1.1.3 mrg UNSPEC_PACK))]
8491 1.1.1.3 mrg "TARGET_SVE"
8492 1.1.1.3 mrg "uzp1\t%0.<Vetype>, %1.<Vetype>, %2.<Vetype>"
8493 1.1 mrg )
8494 1.1 mrg
8495 1.1.1.3 mrg ;; -------------------------------------------------------------------------
8496 1.1.1.3 mrg ;; ---- [INT<-INT] Unpacks
8497 1.1.1.3 mrg ;; -------------------------------------------------------------------------
8498 1.1.1.3 mrg ;; Includes:
8499 1.1.1.3 mrg ;; - SUNPKHI
8500 1.1.1.3 mrg ;; - SUNPKLO
8501 1.1.1.3 mrg ;; - UUNPKHI
8502 1.1.1.3 mrg ;; - UUNPKLO
8503 1.1.1.3 mrg ;; -------------------------------------------------------------------------
8504 1.1.1.3 mrg
8505 1.1.1.3 mrg ;; Unpack the low or high half of a vector, where "high" refers to
8506 1.1.1.3 mrg ;; the low-numbered lanes for big-endian and the high-numbered lanes
8507 1.1.1.3 mrg ;; for little-endian.
8508 1.1.1.3 mrg (define_expand "vec_unpack<su>_<perm_hilo>_<SVE_FULL_BHSI:mode>"
8509 1.1.1.3 mrg [(match_operand:<VWIDE> 0 "register_operand")
8510 1.1.1.3 mrg (unspec:<VWIDE>
8511 1.1.1.3 mrg [(match_operand:SVE_FULL_BHSI 1 "register_operand")] UNPACK)]
8512 1.1 mrg "TARGET_SVE"
8513 1.1 mrg {
8514 1.1.1.3 mrg emit_insn ((<hi_lanes_optab>
8515 1.1.1.3 mrg ? gen_aarch64_sve_<su>unpkhi_<SVE_FULL_BHSI:mode>
8516 1.1.1.3 mrg : gen_aarch64_sve_<su>unpklo_<SVE_FULL_BHSI:mode>)
8517 1.1.1.3 mrg (operands[0], operands[1]));
8518 1.1.1.3 mrg DONE;
8519 1.1 mrg }
8520 1.1 mrg )
8521 1.1 mrg
8522 1.1.1.3 mrg (define_insn "@aarch64_sve_<su>unpk<perm_hilo>_<SVE_FULL_BHSI:mode>"
8523 1.1.1.3 mrg [(set (match_operand:<VWIDE> 0 "register_operand" "=w")
8524 1.1.1.3 mrg (unspec:<VWIDE>
8525 1.1.1.3 mrg [(match_operand:SVE_FULL_BHSI 1 "register_operand" "w")]
8526 1.1.1.3 mrg UNPACK))]
8527 1.1 mrg "TARGET_SVE"
8528 1.1.1.3 mrg "<su>unpk<perm_hilo>\t%0.<Vewtype>, %1.<Vetype>"
8529 1.1 mrg )
8530 1.1 mrg
8531 1.1.1.3 mrg ;; -------------------------------------------------------------------------
8532 1.1.1.3 mrg ;; ---- [INT<-FP] Conversions
8533 1.1.1.3 mrg ;; -------------------------------------------------------------------------
8534 1.1.1.3 mrg ;; Includes:
8535 1.1.1.3 mrg ;; - FCVTZS
8536 1.1.1.3 mrg ;; - FCVTZU
8537 1.1.1.3 mrg ;; -------------------------------------------------------------------------
8538 1.1.1.3 mrg
8539 1.1.1.3 mrg ;; Unpredicated conversion of floats to integers of the same size (HF to HI,
8540 1.1.1.3 mrg ;; SF to SI or DF to DI).
8541 1.1.1.3 mrg (define_expand "<optab><mode><v_int_equiv>2"
8542 1.1.1.3 mrg [(set (match_operand:<V_INT_EQUIV> 0 "register_operand")
8543 1.1.1.3 mrg (unspec:<V_INT_EQUIV>
8544 1.1.1.3 mrg [(match_dup 2)
8545 1.1.1.3 mrg (const_int SVE_RELAXED_GP)
8546 1.1.1.3 mrg (match_operand:SVE_FULL_F 1 "register_operand")]
8547 1.1.1.3 mrg SVE_COND_FCVTI))]
8548 1.1 mrg "TARGET_SVE"
8549 1.1 mrg {
8550 1.1.1.3 mrg operands[2] = aarch64_ptrue_reg (<VPRED>mode);
8551 1.1 mrg }
8552 1.1 mrg )
8553 1.1 mrg
8554 1.1.1.3 mrg ;; Predicated float-to-integer conversion, either to the same width or wider.
8555 1.1.1.3 mrg (define_insn "@aarch64_sve_<optab>_nontrunc<SVE_FULL_F:mode><SVE_FULL_HSDI:mode>"
8556 1.1.1.3 mrg [(set (match_operand:SVE_FULL_HSDI 0 "register_operand" "=w, ?&w")
8557 1.1.1.3 mrg (unspec:SVE_FULL_HSDI
8558 1.1.1.3 mrg [(match_operand:<SVE_FULL_HSDI:VPRED> 1 "register_operand" "Upl, Upl")
8559 1.1.1.3 mrg (match_operand:SI 3 "aarch64_sve_gp_strictness")
8560 1.1.1.3 mrg (match_operand:SVE_FULL_F 2 "register_operand" "0, w")]
8561 1.1.1.3 mrg SVE_COND_FCVTI))]
8562 1.1.1.3 mrg "TARGET_SVE && <SVE_FULL_HSDI:elem_bits> >= <SVE_FULL_F:elem_bits>"
8563 1.1 mrg "@
8564 1.1.1.3 mrg fcvtz<su>\t%0.<SVE_FULL_HSDI:Vetype>, %1/m, %2.<SVE_FULL_F:Vetype>
8565 1.1.1.3 mrg movprfx\t%0, %2\;fcvtz<su>\t%0.<SVE_FULL_HSDI:Vetype>, %1/m, %2.<SVE_FULL_F:Vetype>"
8566 1.1.1.3 mrg [(set_attr "movprfx" "*,yes")]
8567 1.1 mrg )
8568 1.1 mrg
8569 1.1.1.3 mrg ;; Predicated narrowing float-to-integer conversion.
8570 1.1.1.3 mrg (define_insn "@aarch64_sve_<optab>_trunc<VNx2DF_ONLY:mode><VNx4SI_ONLY:mode>"
8571 1.1.1.3 mrg [(set (match_operand:VNx4SI_ONLY 0 "register_operand" "=w, ?&w")
8572 1.1.1.3 mrg (unspec:VNx4SI_ONLY
8573 1.1.1.3 mrg [(match_operand:VNx2BI 1 "register_operand" "Upl, Upl")
8574 1.1.1.3 mrg (match_operand:SI 3 "aarch64_sve_gp_strictness")
8575 1.1.1.3 mrg (match_operand:VNx2DF_ONLY 2 "register_operand" "0, w")]
8576 1.1.1.3 mrg SVE_COND_FCVTI))]
8577 1.1 mrg "TARGET_SVE"
8578 1.1.1.3 mrg "@
8579 1.1.1.3 mrg fcvtz<su>\t%0.<VNx4SI_ONLY:Vetype>, %1/m, %2.<VNx2DF_ONLY:Vetype>
8580 1.1.1.3 mrg movprfx\t%0, %2\;fcvtz<su>\t%0.<VNx4SI_ONLY:Vetype>, %1/m, %2.<VNx2DF_ONLY:Vetype>"
8581 1.1.1.3 mrg [(set_attr "movprfx" "*,yes")]
8582 1.1 mrg )
8583 1.1 mrg
8584 1.1.1.3 mrg ;; Predicated float-to-integer conversion with merging, either to the same
8585 1.1.1.3 mrg ;; width or wider.
8586 1.1.1.3 mrg (define_expand "@cond_<optab>_nontrunc<SVE_FULL_F:mode><SVE_FULL_HSDI:mode>"
8587 1.1.1.3 mrg [(set (match_operand:SVE_FULL_HSDI 0 "register_operand")
8588 1.1.1.3 mrg (unspec:SVE_FULL_HSDI
8589 1.1.1.3 mrg [(match_operand:<SVE_FULL_HSDI:VPRED> 1 "register_operand")
8590 1.1.1.3 mrg (unspec:SVE_FULL_HSDI
8591 1.1.1.3 mrg [(match_dup 1)
8592 1.1.1.3 mrg (const_int SVE_STRICT_GP)
8593 1.1.1.3 mrg (match_operand:SVE_FULL_F 2 "register_operand")]
8594 1.1.1.3 mrg SVE_COND_FCVTI)
8595 1.1.1.3 mrg (match_operand:SVE_FULL_HSDI 3 "aarch64_simd_reg_or_zero")]
8596 1.1.1.3 mrg UNSPEC_SEL))]
8597 1.1.1.3 mrg "TARGET_SVE && <SVE_FULL_HSDI:elem_bits> >= <SVE_FULL_F:elem_bits>"
8598 1.1.1.3 mrg )
8599 1.1.1.3 mrg
8600 1.1.1.3 mrg ;; The first alternative doesn't need the earlyclobber, but the only case
8601 1.1.1.3 mrg ;; it would help is the uninteresting one in which operands 2 and 3 are
8602 1.1.1.3 mrg ;; the same register (despite having different modes). Making all the
8603 1.1.1.3 mrg ;; alternatives earlyclobber makes things more consistent for the
8604 1.1.1.3 mrg ;; register allocator.
8605 1.1.1.3 mrg (define_insn_and_rewrite "*cond_<optab>_nontrunc<SVE_FULL_F:mode><SVE_FULL_HSDI:mode>_relaxed"
8606 1.1.1.3 mrg [(set (match_operand:SVE_FULL_HSDI 0 "register_operand" "=&w, &w, ?&w")
8607 1.1.1.3 mrg (unspec:SVE_FULL_HSDI
8608 1.1.1.3 mrg [(match_operand:<SVE_FULL_HSDI:VPRED> 1 "register_operand" "Upl, Upl, Upl")
8609 1.1.1.3 mrg (unspec:SVE_FULL_HSDI
8610 1.1.1.3 mrg [(match_operand 4)
8611 1.1.1.3 mrg (const_int SVE_RELAXED_GP)
8612 1.1.1.3 mrg (match_operand:SVE_FULL_F 2 "register_operand" "w, w, w")]
8613 1.1.1.3 mrg SVE_COND_FCVTI)
8614 1.1.1.3 mrg (match_operand:SVE_FULL_HSDI 3 "aarch64_simd_reg_or_zero" "0, Dz, w")]
8615 1.1.1.3 mrg UNSPEC_SEL))]
8616 1.1.1.3 mrg "TARGET_SVE && <SVE_FULL_HSDI:elem_bits> >= <SVE_FULL_F:elem_bits>"
8617 1.1.1.3 mrg "@
8618 1.1.1.3 mrg fcvtz<su>\t%0.<SVE_FULL_HSDI:Vetype>, %1/m, %2.<SVE_FULL_F:Vetype>
8619 1.1.1.3 mrg movprfx\t%0.<SVE_FULL_HSDI:Vetype>, %1/z, %2.<SVE_FULL_HSDI:Vetype>\;fcvtz<su>\t%0.<SVE_FULL_HSDI:Vetype>, %1/m, %2.<SVE_FULL_F:Vetype>
8620 1.1.1.3 mrg movprfx\t%0, %3\;fcvtz<su>\t%0.<SVE_FULL_HSDI:Vetype>, %1/m, %2.<SVE_FULL_F:Vetype>"
8621 1.1.1.3 mrg "&& !rtx_equal_p (operands[1], operands[4])"
8622 1.1.1.3 mrg {
8623 1.1.1.3 mrg operands[4] = copy_rtx (operands[1]);
8624 1.1.1.3 mrg }
8625 1.1.1.3 mrg [(set_attr "movprfx" "*,yes,yes")]
8626 1.1.1.3 mrg )
8627 1.1.1.3 mrg
8628 1.1.1.3 mrg (define_insn "*cond_<optab>_nontrunc<SVE_FULL_F:mode><SVE_FULL_HSDI:mode>_strict"
8629 1.1.1.3 mrg [(set (match_operand:SVE_FULL_HSDI 0 "register_operand" "=&w, &w, ?&w")
8630 1.1.1.3 mrg (unspec:SVE_FULL_HSDI
8631 1.1.1.3 mrg [(match_operand:<SVE_FULL_HSDI:VPRED> 1 "register_operand" "Upl, Upl, Upl")
8632 1.1.1.3 mrg (unspec:SVE_FULL_HSDI
8633 1.1.1.3 mrg [(match_dup 1)
8634 1.1.1.3 mrg (const_int SVE_STRICT_GP)
8635 1.1.1.3 mrg (match_operand:SVE_FULL_F 2 "register_operand" "w, w, w")]
8636 1.1.1.3 mrg SVE_COND_FCVTI)
8637 1.1.1.3 mrg (match_operand:SVE_FULL_HSDI 3 "aarch64_simd_reg_or_zero" "0, Dz, w")]
8638 1.1.1.3 mrg UNSPEC_SEL))]
8639 1.1.1.3 mrg "TARGET_SVE && <SVE_FULL_HSDI:elem_bits> >= <SVE_FULL_F:elem_bits>"
8640 1.1.1.3 mrg "@
8641 1.1.1.3 mrg fcvtz<su>\t%0.<SVE_FULL_HSDI:Vetype>, %1/m, %2.<SVE_FULL_F:Vetype>
8642 1.1.1.3 mrg movprfx\t%0.<SVE_FULL_HSDI:Vetype>, %1/z, %2.<SVE_FULL_HSDI:Vetype>\;fcvtz<su>\t%0.<SVE_FULL_HSDI:Vetype>, %1/m, %2.<SVE_FULL_F:Vetype>
8643 1.1.1.3 mrg movprfx\t%0, %3\;fcvtz<su>\t%0.<SVE_FULL_HSDI:Vetype>, %1/m, %2.<SVE_FULL_F:Vetype>"
8644 1.1.1.3 mrg [(set_attr "movprfx" "*,yes,yes")]
8645 1.1.1.3 mrg )
8646 1.1.1.3 mrg
8647 1.1.1.3 mrg ;; Predicated narrowing float-to-integer conversion with merging.
8648 1.1.1.3 mrg (define_expand "@cond_<optab>_trunc<VNx2DF_ONLY:mode><VNx4SI_ONLY:mode>"
8649 1.1.1.3 mrg [(set (match_operand:VNx4SI_ONLY 0 "register_operand")
8650 1.1.1.3 mrg (unspec:VNx4SI_ONLY
8651 1.1.1.3 mrg [(match_operand:VNx2BI 1 "register_operand")
8652 1.1.1.3 mrg (unspec:VNx4SI_ONLY
8653 1.1.1.3 mrg [(match_dup 1)
8654 1.1.1.3 mrg (const_int SVE_STRICT_GP)
8655 1.1.1.3 mrg (match_operand:VNx2DF_ONLY 2 "register_operand")]
8656 1.1.1.3 mrg SVE_COND_FCVTI)
8657 1.1.1.3 mrg (match_operand:VNx4SI_ONLY 3 "aarch64_simd_reg_or_zero")]
8658 1.1.1.3 mrg UNSPEC_SEL))]
8659 1.1.1.3 mrg "TARGET_SVE"
8660 1.1.1.3 mrg )
8661 1.1.1.3 mrg
8662 1.1.1.3 mrg (define_insn "*cond_<optab>_trunc<VNx2DF_ONLY:mode><VNx4SI_ONLY:mode>"
8663 1.1.1.3 mrg [(set (match_operand:VNx4SI_ONLY 0 "register_operand" "=&w, &w, ?&w")
8664 1.1.1.3 mrg (unspec:VNx4SI_ONLY
8665 1.1.1.3 mrg [(match_operand:VNx2BI 1 "register_operand" "Upl, Upl, Upl")
8666 1.1.1.3 mrg (unspec:VNx4SI_ONLY
8667 1.1.1.3 mrg [(match_dup 1)
8668 1.1.1.3 mrg (match_operand:SI 4 "aarch64_sve_gp_strictness")
8669 1.1.1.3 mrg (match_operand:VNx2DF_ONLY 2 "register_operand" "w, w, w")]
8670 1.1.1.3 mrg SVE_COND_FCVTI)
8671 1.1.1.3 mrg (match_operand:VNx4SI_ONLY 3 "aarch64_simd_reg_or_zero" "0, Dz, w")]
8672 1.1.1.3 mrg UNSPEC_SEL))]
8673 1.1 mrg "TARGET_SVE"
8674 1.1 mrg "@
8675 1.1.1.3 mrg fcvtz<su>\t%0.<VNx4SI_ONLY:Vetype>, %1/m, %2.<VNx2DF_ONLY:Vetype>
8676 1.1.1.3 mrg movprfx\t%0.<VNx2DF_ONLY:Vetype>, %1/z, %2.<VNx2DF_ONLY:Vetype>\;fcvtz<su>\t%0.<VNx4SI_ONLY:Vetype>, %1/m, %2.<VNx2DF_ONLY:Vetype>
8677 1.1.1.3 mrg movprfx\t%0, %3\;fcvtz<su>\t%0.<VNx4SI_ONLY:Vetype>, %1/m, %2.<VNx2DF_ONLY:Vetype>"
8678 1.1.1.3 mrg [(set_attr "movprfx" "*,yes,yes")]
8679 1.1 mrg )
8680 1.1 mrg
8681 1.1.1.3 mrg ;; -------------------------------------------------------------------------
8682 1.1.1.3 mrg ;; ---- [INT<-FP] Packs
8683 1.1.1.3 mrg ;; -------------------------------------------------------------------------
8684 1.1.1.3 mrg ;; The patterns in this section are synthetic.
8685 1.1.1.3 mrg ;; -------------------------------------------------------------------------
8686 1.1.1.2 mrg
8687 1.1.1.3 mrg ;; Convert two vectors of DF to SI and pack the results into a single vector.
8688 1.1.1.3 mrg (define_expand "vec_pack_<su>fix_trunc_vnx2df"
8689 1.1.1.3 mrg [(set (match_dup 4)
8690 1.1.1.3 mrg (unspec:VNx4SI
8691 1.1.1.3 mrg [(match_dup 3)
8692 1.1.1.3 mrg (const_int SVE_RELAXED_GP)
8693 1.1.1.3 mrg (match_operand:VNx2DF 1 "register_operand")]
8694 1.1.1.3 mrg SVE_COND_FCVTI))
8695 1.1.1.3 mrg (set (match_dup 5)
8696 1.1.1.3 mrg (unspec:VNx4SI
8697 1.1.1.3 mrg [(match_dup 3)
8698 1.1.1.3 mrg (const_int SVE_RELAXED_GP)
8699 1.1.1.3 mrg (match_operand:VNx2DF 2 "register_operand")]
8700 1.1.1.3 mrg SVE_COND_FCVTI))
8701 1.1.1.3 mrg (set (match_operand:VNx4SI 0 "register_operand")
8702 1.1.1.3 mrg (unspec:VNx4SI [(match_dup 4) (match_dup 5)] UNSPEC_UZP1))]
8703 1.1 mrg "TARGET_SVE"
8704 1.1 mrg {
8705 1.1.1.3 mrg operands[3] = aarch64_ptrue_reg (VNx2BImode);
8706 1.1.1.3 mrg operands[4] = gen_reg_rtx (VNx4SImode);
8707 1.1.1.3 mrg operands[5] = gen_reg_rtx (VNx4SImode);
8708 1.1 mrg }
8709 1.1 mrg )
8710 1.1 mrg
8711 1.1.1.3 mrg ;; -------------------------------------------------------------------------
8712 1.1.1.3 mrg ;; ---- [INT<-FP] Unpacks
8713 1.1.1.3 mrg ;; -------------------------------------------------------------------------
8714 1.1.1.3 mrg ;; No patterns here yet!
8715 1.1.1.3 mrg ;; -------------------------------------------------------------------------
8716 1.1.1.3 mrg
8717 1.1.1.3 mrg ;; -------------------------------------------------------------------------
8718 1.1.1.3 mrg ;; ---- [FP<-INT] Conversions
8719 1.1.1.3 mrg ;; -------------------------------------------------------------------------
8720 1.1.1.3 mrg ;; Includes:
8721 1.1.1.3 mrg ;; - SCVTF
8722 1.1.1.3 mrg ;; - UCVTF
8723 1.1.1.3 mrg ;; -------------------------------------------------------------------------
8724 1.1 mrg
8725 1.1.1.3 mrg ;; Unpredicated conversion of integers to floats of the same size
8726 1.1.1.3 mrg ;; (HI to HF, SI to SF or DI to DF).
8727 1.1.1.3 mrg (define_expand "<optab><v_int_equiv><mode>2"
8728 1.1.1.3 mrg [(set (match_operand:SVE_FULL_F 0 "register_operand")
8729 1.1.1.3 mrg (unspec:SVE_FULL_F
8730 1.1.1.3 mrg [(match_dup 2)
8731 1.1.1.3 mrg (const_int SVE_RELAXED_GP)
8732 1.1.1.3 mrg (match_operand:<V_INT_EQUIV> 1 "register_operand")]
8733 1.1.1.3 mrg SVE_COND_ICVTF))]
8734 1.1 mrg "TARGET_SVE"
8735 1.1 mrg {
8736 1.1.1.3 mrg operands[2] = aarch64_ptrue_reg (<VPRED>mode);
8737 1.1 mrg }
8738 1.1 mrg )
8739 1.1 mrg
8740 1.1.1.3 mrg ;; Predicated integer-to-float conversion, either to the same width or
8741 1.1.1.3 mrg ;; narrower.
8742 1.1.1.3 mrg (define_insn "@aarch64_sve_<optab>_nonextend<SVE_FULL_HSDI:mode><SVE_FULL_F:mode>"
8743 1.1.1.3 mrg [(set (match_operand:SVE_FULL_F 0 "register_operand" "=w, ?&w")
8744 1.1.1.3 mrg (unspec:SVE_FULL_F
8745 1.1.1.3 mrg [(match_operand:<SVE_FULL_HSDI:VPRED> 1 "register_operand" "Upl, Upl")
8746 1.1.1.3 mrg (match_operand:SI 3 "aarch64_sve_gp_strictness")
8747 1.1.1.3 mrg (match_operand:SVE_FULL_HSDI 2 "register_operand" "0, w")]
8748 1.1.1.3 mrg SVE_COND_ICVTF))]
8749 1.1.1.3 mrg "TARGET_SVE && <SVE_FULL_HSDI:elem_bits> >= <SVE_FULL_F:elem_bits>"
8750 1.1.1.3 mrg "@
8751 1.1.1.3 mrg <su>cvtf\t%0.<SVE_FULL_F:Vetype>, %1/m, %2.<SVE_FULL_HSDI:Vetype>
8752 1.1.1.3 mrg movprfx\t%0, %2\;<su>cvtf\t%0.<SVE_FULL_F:Vetype>, %1/m, %2.<SVE_FULL_HSDI:Vetype>"
8753 1.1.1.3 mrg [(set_attr "movprfx" "*,yes")]
8754 1.1.1.3 mrg )
8755 1.1.1.3 mrg
8756 1.1.1.3 mrg ;; Predicated widening integer-to-float conversion.
8757 1.1.1.3 mrg (define_insn "@aarch64_sve_<optab>_extend<VNx4SI_ONLY:mode><VNx2DF_ONLY:mode>"
8758 1.1.1.3 mrg [(set (match_operand:VNx2DF_ONLY 0 "register_operand" "=w, ?&w")
8759 1.1.1.3 mrg (unspec:VNx2DF_ONLY
8760 1.1.1.3 mrg [(match_operand:VNx2BI 1 "register_operand" "Upl, Upl")
8761 1.1.1.3 mrg (match_operand:SI 3 "aarch64_sve_gp_strictness")
8762 1.1.1.3 mrg (match_operand:VNx4SI_ONLY 2 "register_operand" "0, w")]
8763 1.1.1.3 mrg SVE_COND_ICVTF))]
8764 1.1 mrg "TARGET_SVE"
8765 1.1 mrg "@
8766 1.1.1.3 mrg <su>cvtf\t%0.<VNx2DF_ONLY:Vetype>, %1/m, %2.<VNx4SI_ONLY:Vetype>
8767 1.1.1.3 mrg movprfx\t%0, %2\;<su>cvtf\t%0.<VNx2DF_ONLY:Vetype>, %1/m, %2.<VNx4SI_ONLY:Vetype>"
8768 1.1.1.3 mrg [(set_attr "movprfx" "*,yes")]
8769 1.1 mrg )
8770 1.1 mrg
8771 1.1.1.3 mrg ;; Predicated integer-to-float conversion with merging, either to the same
8772 1.1.1.3 mrg ;; width or narrower.
8773 1.1.1.3 mrg (define_expand "@cond_<optab>_nonextend<SVE_FULL_HSDI:mode><SVE_FULL_F:mode>"
8774 1.1.1.3 mrg [(set (match_operand:SVE_FULL_F 0 "register_operand")
8775 1.1.1.3 mrg (unspec:SVE_FULL_F
8776 1.1.1.3 mrg [(match_operand:<SVE_FULL_HSDI:VPRED> 1 "register_operand")
8777 1.1.1.3 mrg (unspec:SVE_FULL_F
8778 1.1.1.3 mrg [(match_dup 1)
8779 1.1.1.3 mrg (const_int SVE_STRICT_GP)
8780 1.1.1.3 mrg (match_operand:SVE_FULL_HSDI 2 "register_operand")]
8781 1.1.1.3 mrg SVE_COND_ICVTF)
8782 1.1.1.3 mrg (match_operand:SVE_FULL_F 3 "aarch64_simd_reg_or_zero")]
8783 1.1.1.3 mrg UNSPEC_SEL))]
8784 1.1.1.3 mrg "TARGET_SVE && <SVE_FULL_HSDI:elem_bits> >= <SVE_FULL_F:elem_bits>"
8785 1.1.1.3 mrg )
8786 1.1.1.3 mrg
8787 1.1.1.3 mrg ;; The first alternative doesn't need the earlyclobber, but the only case
8788 1.1.1.3 mrg ;; it would help is the uninteresting one in which operands 2 and 3 are
8789 1.1.1.3 mrg ;; the same register (despite having different modes). Making all the
8790 1.1.1.3 mrg ;; alternatives earlyclobber makes things more consistent for the
8791 1.1.1.3 mrg ;; register allocator.
8792 1.1.1.3 mrg (define_insn_and_rewrite "*cond_<optab>_nonextend<SVE_FULL_HSDI:mode><SVE_FULL_F:mode>_relaxed"
8793 1.1.1.3 mrg [(set (match_operand:SVE_FULL_F 0 "register_operand" "=&w, &w, ?&w")
8794 1.1.1.3 mrg (unspec:SVE_FULL_F
8795 1.1.1.3 mrg [(match_operand:<SVE_FULL_HSDI:VPRED> 1 "register_operand" "Upl, Upl, Upl")
8796 1.1.1.3 mrg (unspec:SVE_FULL_F
8797 1.1.1.3 mrg [(match_operand 4)
8798 1.1.1.3 mrg (const_int SVE_RELAXED_GP)
8799 1.1.1.3 mrg (match_operand:SVE_FULL_HSDI 2 "register_operand" "w, w, w")]
8800 1.1.1.3 mrg SVE_COND_ICVTF)
8801 1.1.1.3 mrg (match_operand:SVE_FULL_F 3 "aarch64_simd_reg_or_zero" "0, Dz, w")]
8802 1.1.1.3 mrg UNSPEC_SEL))]
8803 1.1.1.3 mrg "TARGET_SVE && <SVE_FULL_HSDI:elem_bits> >= <SVE_FULL_F:elem_bits>"
8804 1.1.1.3 mrg "@
8805 1.1.1.3 mrg <su>cvtf\t%0.<SVE_FULL_F:Vetype>, %1/m, %2.<SVE_FULL_HSDI:Vetype>
8806 1.1.1.3 mrg movprfx\t%0.<SVE_FULL_HSDI:Vetype>, %1/z, %2.<SVE_FULL_HSDI:Vetype>\;<su>cvtf\t%0.<SVE_FULL_F:Vetype>, %1/m, %2.<SVE_FULL_HSDI:Vetype>
8807 1.1.1.3 mrg movprfx\t%0, %3\;<su>cvtf\t%0.<SVE_FULL_F:Vetype>, %1/m, %2.<SVE_FULL_HSDI:Vetype>"
8808 1.1.1.3 mrg "&& !rtx_equal_p (operands[1], operands[4])"
8809 1.1.1.3 mrg {
8810 1.1.1.3 mrg operands[4] = copy_rtx (operands[1]);
8811 1.1.1.3 mrg }
8812 1.1.1.3 mrg [(set_attr "movprfx" "*,yes,yes")]
8813 1.1.1.3 mrg )
8814 1.1.1.3 mrg
8815 1.1.1.3 mrg (define_insn "*cond_<optab>_nonextend<SVE_FULL_HSDI:mode><SVE_FULL_F:mode>_strict"
8816 1.1.1.3 mrg [(set (match_operand:SVE_FULL_F 0 "register_operand" "=&w, &w, ?&w")
8817 1.1.1.3 mrg (unspec:SVE_FULL_F
8818 1.1.1.3 mrg [(match_operand:<SVE_FULL_HSDI:VPRED> 1 "register_operand" "Upl, Upl, Upl")
8819 1.1.1.3 mrg (unspec:SVE_FULL_F
8820 1.1.1.3 mrg [(match_dup 1)
8821 1.1.1.3 mrg (const_int SVE_STRICT_GP)
8822 1.1.1.3 mrg (match_operand:SVE_FULL_HSDI 2 "register_operand" "w, w, w")]
8823 1.1.1.3 mrg SVE_COND_ICVTF)
8824 1.1.1.3 mrg (match_operand:SVE_FULL_F 3 "aarch64_simd_reg_or_zero" "0, Dz, w")]
8825 1.1.1.3 mrg UNSPEC_SEL))]
8826 1.1.1.3 mrg "TARGET_SVE && <SVE_FULL_HSDI:elem_bits> >= <SVE_FULL_F:elem_bits>"
8827 1.1.1.3 mrg "@
8828 1.1.1.3 mrg <su>cvtf\t%0.<SVE_FULL_F:Vetype>, %1/m, %2.<SVE_FULL_HSDI:Vetype>
8829 1.1.1.3 mrg movprfx\t%0.<SVE_FULL_HSDI:Vetype>, %1/z, %2.<SVE_FULL_HSDI:Vetype>\;<su>cvtf\t%0.<SVE_FULL_F:Vetype>, %1/m, %2.<SVE_FULL_HSDI:Vetype>
8830 1.1.1.3 mrg movprfx\t%0, %3\;<su>cvtf\t%0.<SVE_FULL_F:Vetype>, %1/m, %2.<SVE_FULL_HSDI:Vetype>"
8831 1.1.1.3 mrg [(set_attr "movprfx" "*,yes,yes")]
8832 1.1.1.3 mrg )
8833 1.1.1.3 mrg
8834 1.1.1.3 mrg ;; Predicated widening integer-to-float conversion with merging.
8835 1.1.1.3 mrg (define_expand "@cond_<optab>_extend<VNx4SI_ONLY:mode><VNx2DF_ONLY:mode>"
8836 1.1.1.3 mrg [(set (match_operand:VNx2DF_ONLY 0 "register_operand")
8837 1.1.1.3 mrg (unspec:VNx2DF_ONLY
8838 1.1.1.3 mrg [(match_operand:VNx2BI 1 "register_operand")
8839 1.1.1.3 mrg (unspec:VNx2DF_ONLY
8840 1.1.1.3 mrg [(match_dup 1)
8841 1.1.1.3 mrg (const_int SVE_STRICT_GP)
8842 1.1.1.3 mrg (match_operand:VNx4SI_ONLY 2 "register_operand")]
8843 1.1.1.3 mrg SVE_COND_ICVTF)
8844 1.1.1.3 mrg (match_operand:VNx2DF_ONLY 3 "aarch64_simd_reg_or_zero")]
8845 1.1.1.3 mrg UNSPEC_SEL))]
8846 1.1 mrg "TARGET_SVE"
8847 1.1 mrg )
8848 1.1 mrg
8849 1.1.1.3 mrg (define_insn "*cond_<optab>_extend<VNx4SI_ONLY:mode><VNx2DF_ONLY:mode>"
8850 1.1.1.3 mrg [(set (match_operand:VNx2DF_ONLY 0 "register_operand" "=w, ?&w, ?&w")
8851 1.1.1.3 mrg (unspec:VNx2DF_ONLY
8852 1.1.1.3 mrg [(match_operand:VNx2BI 1 "register_operand" "Upl, Upl, Upl")
8853 1.1.1.3 mrg (unspec:VNx2DF_ONLY
8854 1.1.1.3 mrg [(match_dup 1)
8855 1.1.1.3 mrg (match_operand:SI 4 "aarch64_sve_gp_strictness")
8856 1.1.1.3 mrg (match_operand:VNx4SI_ONLY 2 "register_operand" "w, w, w")]
8857 1.1.1.3 mrg SVE_COND_ICVTF)
8858 1.1.1.3 mrg (match_operand:VNx2DF_ONLY 3 "aarch64_simd_reg_or_zero" "0, Dz, w")]
8859 1.1.1.3 mrg UNSPEC_SEL))]
8860 1.1 mrg "TARGET_SVE"
8861 1.1 mrg "@
8862 1.1.1.3 mrg <su>cvtf\t%0.<VNx2DF_ONLY:Vetype>, %1/m, %2.<VNx4SI_ONLY:Vetype>
8863 1.1.1.3 mrg movprfx\t%0.<VNx2DF_ONLY:Vetype>, %1/z, %2.<VNx2DF_ONLY:Vetype>\;<su>cvtf\t%0.<VNx2DF_ONLY:Vetype>, %1/m, %2.<VNx4SI_ONLY:Vetype>
8864 1.1.1.3 mrg movprfx\t%0, %3\;<su>cvtf\t%0.<VNx2DF_ONLY:Vetype>, %1/m, %2.<VNx4SI_ONLY:Vetype>"
8865 1.1.1.3 mrg [(set_attr "movprfx" "*,yes,yes")]
8866 1.1.1.3 mrg )
8867 1.1.1.3 mrg
8868 1.1.1.3 mrg ;; -------------------------------------------------------------------------
8869 1.1.1.3 mrg ;; ---- [FP<-INT] Packs
8870 1.1.1.3 mrg ;; -------------------------------------------------------------------------
8871 1.1.1.3 mrg ;; No patterns here yet!
8872 1.1.1.3 mrg ;; -------------------------------------------------------------------------
8873 1.1.1.3 mrg
8874 1.1.1.3 mrg ;; -------------------------------------------------------------------------
8875 1.1.1.3 mrg ;; ---- [FP<-INT] Unpacks
8876 1.1.1.3 mrg ;; -------------------------------------------------------------------------
8877 1.1.1.3 mrg ;; The patterns in this section are synthetic.
8878 1.1.1.3 mrg ;; -------------------------------------------------------------------------
8879 1.1 mrg
8880 1.1.1.3 mrg ;; Unpack one half of a VNx4SI to VNx2DF. First unpack from VNx4SI
8881 1.1.1.3 mrg ;; to VNx2DI, reinterpret the VNx2DI as a VNx4SI, then convert the
8882 1.1.1.3 mrg ;; unpacked VNx4SI to VNx2DF.
8883 1.1.1.3 mrg (define_expand "vec_unpack<su_optab>_float_<perm_hilo>_vnx4si"
8884 1.1.1.3 mrg [(match_operand:VNx2DF 0 "register_operand")
8885 1.1.1.3 mrg (FLOATUORS:VNx2DF
8886 1.1.1.3 mrg (unspec:VNx2DI [(match_operand:VNx4SI 1 "register_operand")]
8887 1.1.1.3 mrg UNPACK_UNSIGNED))]
8888 1.1 mrg "TARGET_SVE"
8889 1.1 mrg {
8890 1.1.1.3 mrg /* Use ZIP to do the unpack, since we don't care about the upper halves
8891 1.1.1.3 mrg and since it has the nice property of not needing any subregs.
8892 1.1.1.3 mrg If using UUNPK* turns out to be preferable, we could model it as
8893 1.1.1.3 mrg a ZIP whose first operand is zero. */
8894 1.1.1.3 mrg rtx temp = gen_reg_rtx (VNx4SImode);
8895 1.1.1.3 mrg emit_insn ((<hi_lanes_optab>
8896 1.1.1.3 mrg ? gen_aarch64_sve_zip2vnx4si
8897 1.1.1.3 mrg : gen_aarch64_sve_zip1vnx4si)
8898 1.1.1.3 mrg (temp, operands[1], operands[1]));
8899 1.1.1.3 mrg rtx ptrue = aarch64_ptrue_reg (VNx2BImode);
8900 1.1.1.3 mrg rtx strictness = gen_int_mode (SVE_RELAXED_GP, SImode);
8901 1.1.1.3 mrg emit_insn (gen_aarch64_sve_<FLOATUORS:optab>_extendvnx4sivnx2df
8902 1.1.1.3 mrg (operands[0], ptrue, temp, strictness));
8903 1.1.1.3 mrg DONE;
8904 1.1 mrg }
8905 1.1 mrg )
8906 1.1 mrg
8907 1.1.1.3 mrg ;; -------------------------------------------------------------------------
8908 1.1.1.3 mrg ;; ---- [FP<-FP] Packs
8909 1.1.1.3 mrg ;; -------------------------------------------------------------------------
8910 1.1.1.3 mrg ;; Includes:
8911 1.1.1.3 mrg ;; - FCVT
8912 1.1.1.3 mrg ;; -------------------------------------------------------------------------
8913 1.1 mrg
8914 1.1.1.3 mrg ;; Convert two vectors of DF to SF, or two vectors of SF to HF, and pack
8915 1.1.1.3 mrg ;; the results into a single vector.
8916 1.1.1.3 mrg (define_expand "vec_pack_trunc_<Vwide>"
8917 1.1.1.3 mrg [(set (match_dup 4)
8918 1.1.1.3 mrg (unspec:SVE_FULL_HSF
8919 1.1.1.3 mrg [(match_dup 3)
8920 1.1.1.3 mrg (const_int SVE_RELAXED_GP)
8921 1.1.1.3 mrg (match_operand:<VWIDE> 1 "register_operand")]
8922 1.1.1.3 mrg UNSPEC_COND_FCVT))
8923 1.1.1.3 mrg (set (match_dup 5)
8924 1.1.1.3 mrg (unspec:SVE_FULL_HSF
8925 1.1 mrg [(match_dup 3)
8926 1.1.1.3 mrg (const_int SVE_RELAXED_GP)
8927 1.1.1.3 mrg (match_operand:<VWIDE> 2 "register_operand")]
8928 1.1.1.3 mrg UNSPEC_COND_FCVT))
8929 1.1.1.3 mrg (set (match_operand:SVE_FULL_HSF 0 "register_operand")
8930 1.1.1.3 mrg (unspec:SVE_FULL_HSF [(match_dup 4) (match_dup 5)] UNSPEC_UZP1))]
8931 1.1 mrg "TARGET_SVE"
8932 1.1 mrg {
8933 1.1.1.3 mrg operands[3] = aarch64_ptrue_reg (<VWIDE_PRED>mode);
8934 1.1.1.3 mrg operands[4] = gen_reg_rtx (<MODE>mode);
8935 1.1.1.3 mrg operands[5] = gen_reg_rtx (<MODE>mode);
8936 1.1 mrg }
8937 1.1 mrg )
8938 1.1 mrg
8939 1.1.1.3 mrg ;; Predicated float-to-float truncation.
8940 1.1.1.3 mrg (define_insn "@aarch64_sve_<optab>_trunc<SVE_FULL_SDF:mode><SVE_FULL_HSF:mode>"
8941 1.1.1.3 mrg [(set (match_operand:SVE_FULL_HSF 0 "register_operand" "=w, ?&w")
8942 1.1.1.3 mrg (unspec:SVE_FULL_HSF
8943 1.1.1.3 mrg [(match_operand:<SVE_FULL_SDF:VPRED> 1 "register_operand" "Upl, Upl")
8944 1.1.1.3 mrg (match_operand:SI 3 "aarch64_sve_gp_strictness")
8945 1.1.1.3 mrg (match_operand:SVE_FULL_SDF 2 "register_operand" "0, w")]
8946 1.1.1.3 mrg SVE_COND_FCVT))]
8947 1.1.1.3 mrg "TARGET_SVE && <SVE_FULL_SDF:elem_bits> > <SVE_FULL_HSF:elem_bits>"
8948 1.1 mrg "@
8949 1.1.1.3 mrg fcvt\t%0.<SVE_FULL_HSF:Vetype>, %1/m, %2.<SVE_FULL_SDF:Vetype>
8950 1.1.1.3 mrg movprfx\t%0, %2\;fcvt\t%0.<SVE_FULL_HSF:Vetype>, %1/m, %2.<SVE_FULL_SDF:Vetype>"
8951 1.1.1.3 mrg [(set_attr "movprfx" "*,yes")]
8952 1.1 mrg )
8953 1.1 mrg
8954 1.1.1.3 mrg ;; Predicated float-to-float truncation with merging.
8955 1.1.1.3 mrg (define_expand "@cond_<optab>_trunc<SVE_FULL_SDF:mode><SVE_FULL_HSF:mode>"
8956 1.1.1.3 mrg [(set (match_operand:SVE_FULL_HSF 0 "register_operand")
8957 1.1.1.3 mrg (unspec:SVE_FULL_HSF
8958 1.1.1.3 mrg [(match_operand:<SVE_FULL_SDF:VPRED> 1 "register_operand")
8959 1.1.1.3 mrg (unspec:SVE_FULL_HSF
8960 1.1.1.3 mrg [(match_dup 1)
8961 1.1.1.3 mrg (const_int SVE_STRICT_GP)
8962 1.1.1.3 mrg (match_operand:SVE_FULL_SDF 2 "register_operand")]
8963 1.1.1.3 mrg SVE_COND_FCVT)
8964 1.1.1.3 mrg (match_operand:SVE_FULL_HSF 3 "aarch64_simd_reg_or_zero")]
8965 1.1.1.3 mrg UNSPEC_SEL))]
8966 1.1.1.3 mrg "TARGET_SVE && <SVE_FULL_SDF:elem_bits> > <SVE_FULL_HSF:elem_bits>"
8967 1.1 mrg )
8968 1.1 mrg
8969 1.1.1.3 mrg (define_insn "*cond_<optab>_trunc<SVE_FULL_SDF:mode><SVE_FULL_HSF:mode>"
8970 1.1.1.3 mrg [(set (match_operand:SVE_FULL_HSF 0 "register_operand" "=w, ?&w, ?&w")
8971 1.1.1.3 mrg (unspec:SVE_FULL_HSF
8972 1.1.1.3 mrg [(match_operand:<SVE_FULL_SDF:VPRED> 1 "register_operand" "Upl, Upl, Upl")
8973 1.1.1.3 mrg (unspec:SVE_FULL_HSF
8974 1.1.1.3 mrg [(match_dup 1)
8975 1.1.1.3 mrg (match_operand:SI 4 "aarch64_sve_gp_strictness")
8976 1.1.1.3 mrg (match_operand:SVE_FULL_SDF 2 "register_operand" "w, w, w")]
8977 1.1.1.3 mrg SVE_COND_FCVT)
8978 1.1.1.3 mrg (match_operand:SVE_FULL_HSF 3 "aarch64_simd_reg_or_zero" "0, Dz, w")]
8979 1.1.1.3 mrg UNSPEC_SEL))]
8980 1.1.1.3 mrg "TARGET_SVE && <SVE_FULL_SDF:elem_bits> > <SVE_FULL_HSF:elem_bits>"
8981 1.1.1.3 mrg "@
8982 1.1.1.3 mrg fcvt\t%0.<SVE_FULL_HSF:Vetype>, %1/m, %2.<SVE_FULL_SDF:Vetype>
8983 1.1.1.3 mrg movprfx\t%0.<SVE_FULL_SDF:Vetype>, %1/z, %2.<SVE_FULL_SDF:Vetype>\;fcvt\t%0.<SVE_FULL_HSF:Vetype>, %1/m, %2.<SVE_FULL_SDF:Vetype>
8984 1.1.1.3 mrg movprfx\t%0, %3\;fcvt\t%0.<SVE_FULL_HSF:Vetype>, %1/m, %2.<SVE_FULL_SDF:Vetype>"
8985 1.1.1.3 mrg [(set_attr "movprfx" "*,yes,yes")]
8986 1.1.1.3 mrg )
8987 1.1.1.3 mrg
8988 1.1.1.3 mrg ;; -------------------------------------------------------------------------
8989 1.1.1.3 mrg ;; ---- [FP<-FP] Packs (bfloat16)
8990 1.1.1.3 mrg ;; -------------------------------------------------------------------------
8991 1.1.1.3 mrg ;; Includes:
8992 1.1.1.3 mrg ;; - BFCVT (BF16)
8993 1.1.1.3 mrg ;; - BFCVTNT (BF16)
8994 1.1.1.3 mrg ;; -------------------------------------------------------------------------
8995 1.1.1.3 mrg
8996 1.1.1.3 mrg ;; Predicated BFCVT.
8997 1.1.1.3 mrg (define_insn "@aarch64_sve_<optab>_trunc<VNx4SF_ONLY:mode><VNx8BF_ONLY:mode>"
8998 1.1.1.3 mrg [(set (match_operand:VNx8BF_ONLY 0 "register_operand" "=w, ?&w")
8999 1.1.1.3 mrg (unspec:VNx8BF_ONLY
9000 1.1.1.3 mrg [(match_operand:VNx4BI 1 "register_operand" "Upl, Upl")
9001 1.1.1.3 mrg (match_operand:SI 3 "aarch64_sve_gp_strictness")
9002 1.1.1.3 mrg (match_operand:VNx4SF_ONLY 2 "register_operand" "0, w")]
9003 1.1.1.3 mrg SVE_COND_FCVT))]
9004 1.1.1.3 mrg "TARGET_SVE_BF16"
9005 1.1.1.3 mrg "@
9006 1.1.1.3 mrg bfcvt\t%0.h, %1/m, %2.s
9007 1.1.1.3 mrg movprfx\t%0, %2\;bfcvt\t%0.h, %1/m, %2.s"
9008 1.1.1.3 mrg [(set_attr "movprfx" "*,yes")]
9009 1.1 mrg )
9010 1.1 mrg
9011 1.1.1.3 mrg ;; Predicated BFCVT with merging.
9012 1.1.1.3 mrg (define_expand "@cond_<optab>_trunc<VNx4SF_ONLY:mode><VNx8BF_ONLY:mode>"
9013 1.1.1.3 mrg [(set (match_operand:VNx8BF_ONLY 0 "register_operand")
9014 1.1.1.3 mrg (unspec:VNx8BF_ONLY
9015 1.1.1.3 mrg [(match_operand:VNx4BI 1 "register_operand")
9016 1.1.1.3 mrg (unspec:VNx8BF_ONLY
9017 1.1.1.3 mrg [(match_dup 1)
9018 1.1.1.3 mrg (const_int SVE_STRICT_GP)
9019 1.1.1.3 mrg (match_operand:VNx4SF_ONLY 2 "register_operand")]
9020 1.1.1.3 mrg SVE_COND_FCVT)
9021 1.1.1.3 mrg (match_operand:VNx8BF_ONLY 3 "aarch64_simd_reg_or_zero")]
9022 1.1.1.3 mrg UNSPEC_SEL))]
9023 1.1.1.3 mrg "TARGET_SVE_BF16"
9024 1.1 mrg )
9025 1.1 mrg
9026 1.1.1.3 mrg (define_insn "*cond_<optab>_trunc<VNx4SF_ONLY:mode><VNx8BF_ONLY:mode>"
9027 1.1.1.3 mrg [(set (match_operand:VNx8BF_ONLY 0 "register_operand" "=w, ?&w, ?&w")
9028 1.1.1.3 mrg (unspec:VNx8BF_ONLY
9029 1.1.1.3 mrg [(match_operand:VNx4BI 1 "register_operand" "Upl, Upl, Upl")
9030 1.1.1.3 mrg (unspec:VNx8BF_ONLY
9031 1.1.1.3 mrg [(match_dup 1)
9032 1.1.1.3 mrg (match_operand:SI 4 "aarch64_sve_gp_strictness")
9033 1.1.1.3 mrg (match_operand:VNx4SF_ONLY 2 "register_operand" "w, w, w")]
9034 1.1.1.3 mrg SVE_COND_FCVT)
9035 1.1.1.3 mrg (match_operand:VNx8BF_ONLY 3 "aarch64_simd_reg_or_zero" "0, Dz, w")]
9036 1.1.1.3 mrg UNSPEC_SEL))]
9037 1.1.1.3 mrg "TARGET_SVE_BF16"
9038 1.1.1.3 mrg "@
9039 1.1.1.3 mrg bfcvt\t%0.h, %1/m, %2.s
9040 1.1.1.3 mrg movprfx\t%0.s, %1/z, %2.s\;bfcvt\t%0.h, %1/m, %2.s
9041 1.1.1.3 mrg movprfx\t%0, %3\;bfcvt\t%0.h, %1/m, %2.s"
9042 1.1.1.3 mrg [(set_attr "movprfx" "*,yes,yes")]
9043 1.1 mrg )
9044 1.1 mrg
9045 1.1.1.3 mrg ;; Predicated BFCVTNT. This doesn't give a natural aarch64_pred_*/cond_*
9046 1.1.1.3 mrg ;; pair because the even elements always have to be supplied for active
9047 1.1.1.3 mrg ;; elements, even if the inactive elements don't matter.
9048 1.1.1.3 mrg ;;
9049 1.1.1.3 mrg ;; This instructions does not take MOVPRFX.
9050 1.1.1.3 mrg (define_insn "@aarch64_sve_cvtnt<mode>"
9051 1.1.1.3 mrg [(set (match_operand:VNx8BF_ONLY 0 "register_operand" "=w")
9052 1.1.1.3 mrg (unspec:VNx8BF_ONLY
9053 1.1.1.3 mrg [(match_operand:VNx4BI 2 "register_operand" "Upl")
9054 1.1.1.3 mrg (const_int SVE_STRICT_GP)
9055 1.1.1.3 mrg (match_operand:VNx8BF_ONLY 1 "register_operand" "0")
9056 1.1.1.3 mrg (match_operand:VNx4SF 3 "register_operand" "w")]
9057 1.1.1.3 mrg UNSPEC_COND_FCVTNT))]
9058 1.1.1.3 mrg "TARGET_SVE_BF16"
9059 1.1.1.3 mrg "bfcvtnt\t%0.h, %2/m, %3.s"
9060 1.1.1.3 mrg )
9061 1.1.1.3 mrg
9062 1.1.1.3 mrg ;; -------------------------------------------------------------------------
9063 1.1.1.3 mrg ;; ---- [FP<-FP] Unpacks
9064 1.1.1.3 mrg ;; -------------------------------------------------------------------------
9065 1.1.1.3 mrg ;; Includes:
9066 1.1.1.3 mrg ;; - FCVT
9067 1.1.1.3 mrg ;; -------------------------------------------------------------------------
9068 1.1.1.3 mrg
9069 1.1.1.3 mrg ;; Unpack one half of a VNx4SF to VNx2DF, or one half of a VNx8HF to VNx4SF.
9070 1.1.1.3 mrg ;; First unpack the source without conversion, then float-convert the
9071 1.1.1.3 mrg ;; unpacked source.
9072 1.1.1.3 mrg (define_expand "vec_unpacks_<perm_hilo>_<mode>"
9073 1.1.1.3 mrg [(match_operand:<VWIDE> 0 "register_operand")
9074 1.1.1.3 mrg (unspec:SVE_FULL_HSF
9075 1.1.1.3 mrg [(match_operand:SVE_FULL_HSF 1 "register_operand")]
9076 1.1.1.3 mrg UNPACK_UNSIGNED)]
9077 1.1 mrg "TARGET_SVE"
9078 1.1 mrg {
9079 1.1.1.3 mrg /* Use ZIP to do the unpack, since we don't care about the upper halves
9080 1.1.1.3 mrg and since it has the nice property of not needing any subregs.
9081 1.1.1.3 mrg If using UUNPK* turns out to be preferable, we could model it as
9082 1.1.1.3 mrg a ZIP whose first operand is zero. */
9083 1.1.1.3 mrg rtx temp = gen_reg_rtx (<MODE>mode);
9084 1.1.1.3 mrg emit_insn ((<hi_lanes_optab>
9085 1.1.1.3 mrg ? gen_aarch64_sve_zip2<mode>
9086 1.1.1.3 mrg : gen_aarch64_sve_zip1<mode>)
9087 1.1.1.3 mrg (temp, operands[1], operands[1]));
9088 1.1.1.3 mrg rtx ptrue = aarch64_ptrue_reg (<VWIDE_PRED>mode);
9089 1.1.1.3 mrg rtx strictness = gen_int_mode (SVE_RELAXED_GP, SImode);
9090 1.1.1.3 mrg emit_insn (gen_aarch64_sve_fcvt_nontrunc<mode><Vwide>
9091 1.1.1.3 mrg (operands[0], ptrue, temp, strictness));
9092 1.1.1.3 mrg DONE;
9093 1.1 mrg }
9094 1.1 mrg )
9095 1.1 mrg
9096 1.1.1.3 mrg ;; Predicated float-to-float extension.
9097 1.1.1.3 mrg (define_insn "@aarch64_sve_<optab>_nontrunc<SVE_FULL_HSF:mode><SVE_FULL_SDF:mode>"
9098 1.1.1.3 mrg [(set (match_operand:SVE_FULL_SDF 0 "register_operand" "=w, ?&w")
9099 1.1.1.3 mrg (unspec:SVE_FULL_SDF
9100 1.1.1.3 mrg [(match_operand:<SVE_FULL_SDF:VPRED> 1 "register_operand" "Upl, Upl")
9101 1.1.1.3 mrg (match_operand:SI 3 "aarch64_sve_gp_strictness")
9102 1.1.1.3 mrg (match_operand:SVE_FULL_HSF 2 "register_operand" "0, w")]
9103 1.1.1.3 mrg SVE_COND_FCVT))]
9104 1.1.1.3 mrg "TARGET_SVE && <SVE_FULL_SDF:elem_bits> > <SVE_FULL_HSF:elem_bits>"
9105 1.1.1.3 mrg "@
9106 1.1.1.3 mrg fcvt\t%0.<SVE_FULL_SDF:Vetype>, %1/m, %2.<SVE_FULL_HSF:Vetype>
9107 1.1.1.3 mrg movprfx\t%0, %2\;fcvt\t%0.<SVE_FULL_SDF:Vetype>, %1/m, %2.<SVE_FULL_HSF:Vetype>"
9108 1.1.1.3 mrg [(set_attr "movprfx" "*,yes")]
9109 1.1 mrg )
9110 1.1 mrg
9111 1.1.1.3 mrg ;; Predicated float-to-float extension with merging.
9112 1.1.1.3 mrg (define_expand "@cond_<optab>_nontrunc<SVE_FULL_HSF:mode><SVE_FULL_SDF:mode>"
9113 1.1.1.3 mrg [(set (match_operand:SVE_FULL_SDF 0 "register_operand")
9114 1.1.1.3 mrg (unspec:SVE_FULL_SDF
9115 1.1.1.3 mrg [(match_operand:<SVE_FULL_SDF:VPRED> 1 "register_operand")
9116 1.1.1.3 mrg (unspec:SVE_FULL_SDF
9117 1.1.1.3 mrg [(match_dup 1)
9118 1.1.1.3 mrg (const_int SVE_STRICT_GP)
9119 1.1.1.3 mrg (match_operand:SVE_FULL_HSF 2 "register_operand")]
9120 1.1.1.3 mrg SVE_COND_FCVT)
9121 1.1.1.3 mrg (match_operand:SVE_FULL_SDF 3 "aarch64_simd_reg_or_zero")]
9122 1.1.1.3 mrg UNSPEC_SEL))]
9123 1.1.1.3 mrg "TARGET_SVE && <SVE_FULL_SDF:elem_bits> > <SVE_FULL_HSF:elem_bits>"
9124 1.1 mrg )
9125 1.1 mrg
9126 1.1.1.3 mrg (define_insn "*cond_<optab>_nontrunc<SVE_FULL_HSF:mode><SVE_FULL_SDF:mode>"
9127 1.1.1.3 mrg [(set (match_operand:SVE_FULL_SDF 0 "register_operand" "=w, ?&w, ?&w")
9128 1.1.1.3 mrg (unspec:SVE_FULL_SDF
9129 1.1.1.3 mrg [(match_operand:<SVE_FULL_SDF:VPRED> 1 "register_operand" "Upl, Upl, Upl")
9130 1.1.1.3 mrg (unspec:SVE_FULL_SDF
9131 1.1.1.3 mrg [(match_dup 1)
9132 1.1.1.3 mrg (match_operand:SI 4 "aarch64_sve_gp_strictness")
9133 1.1.1.3 mrg (match_operand:SVE_FULL_HSF 2 "register_operand" "w, w, w")]
9134 1.1.1.3 mrg SVE_COND_FCVT)
9135 1.1.1.3 mrg (match_operand:SVE_FULL_SDF 3 "aarch64_simd_reg_or_zero" "0, Dz, w")]
9136 1.1.1.3 mrg UNSPEC_SEL))]
9137 1.1.1.3 mrg "TARGET_SVE && <SVE_FULL_SDF:elem_bits> > <SVE_FULL_HSF:elem_bits>"
9138 1.1.1.3 mrg "@
9139 1.1.1.3 mrg fcvt\t%0.<SVE_FULL_SDF:Vetype>, %1/m, %2.<SVE_FULL_HSF:Vetype>
9140 1.1.1.3 mrg movprfx\t%0.<SVE_FULL_SDF:Vetype>, %1/z, %2.<SVE_FULL_SDF:Vetype>\;fcvt\t%0.<SVE_FULL_SDF:Vetype>, %1/m, %2.<SVE_FULL_HSF:Vetype>
9141 1.1.1.3 mrg movprfx\t%0, %3\;fcvt\t%0.<SVE_FULL_SDF:Vetype>, %1/m, %2.<SVE_FULL_HSF:Vetype>"
9142 1.1.1.3 mrg [(set_attr "movprfx" "*,yes,yes")]
9143 1.1 mrg )
9144 1.1 mrg
9145 1.1.1.3 mrg ;; -------------------------------------------------------------------------
9146 1.1.1.3 mrg ;; ---- [PRED<-PRED] Packs
9147 1.1.1.3 mrg ;; -------------------------------------------------------------------------
9148 1.1.1.3 mrg ;; Includes:
9149 1.1.1.3 mrg ;; - UZP1
9150 1.1.1.3 mrg ;; -------------------------------------------------------------------------
9151 1.1 mrg
9152 1.1.1.3 mrg ;; Predicate pack. Use UZP1 on the narrower type, which discards
9153 1.1.1.3 mrg ;; the high part of each wide element.
9154 1.1.1.3 mrg (define_insn "vec_pack_trunc_<Vwide>"
9155 1.1.1.3 mrg [(set (match_operand:PRED_BHS 0 "register_operand" "=Upa")
9156 1.1.1.3 mrg (unspec:PRED_BHS
9157 1.1.1.3 mrg [(match_operand:<VWIDE> 1 "register_operand" "Upa")
9158 1.1.1.3 mrg (match_operand:<VWIDE> 2 "register_operand" "Upa")]
9159 1.1.1.3 mrg UNSPEC_PACK))]
9160 1.1 mrg "TARGET_SVE"
9161 1.1.1.3 mrg "uzp1\t%0.<Vetype>, %1.<Vetype>, %2.<Vetype>"
9162 1.1 mrg )
9163 1.1 mrg
9164 1.1.1.3 mrg ;; -------------------------------------------------------------------------
9165 1.1.1.3 mrg ;; ---- [PRED<-PRED] Unpacks
9166 1.1.1.3 mrg ;; -------------------------------------------------------------------------
9167 1.1.1.3 mrg ;; Includes:
9168 1.1.1.3 mrg ;; - PUNPKHI
9169 1.1.1.3 mrg ;; - PUNPKLO
9170 1.1.1.3 mrg ;; -------------------------------------------------------------------------
9171 1.1.1.3 mrg
9172 1.1 mrg ;; Unpack the low or high half of a predicate, where "high" refers to
9173 1.1 mrg ;; the low-numbered lanes for big-endian and the high-numbered lanes
9174 1.1 mrg ;; for little-endian.
9175 1.1 mrg (define_expand "vec_unpack<su>_<perm_hilo>_<mode>"
9176 1.1 mrg [(match_operand:<VWIDE> 0 "register_operand")
9177 1.1 mrg (unspec:<VWIDE> [(match_operand:PRED_BHS 1 "register_operand")]
9178 1.1 mrg UNPACK)]
9179 1.1 mrg "TARGET_SVE"
9180 1.1 mrg {
9181 1.1 mrg emit_insn ((<hi_lanes_optab>
9182 1.1 mrg ? gen_aarch64_sve_punpkhi_<PRED_BHS:mode>
9183 1.1 mrg : gen_aarch64_sve_punpklo_<PRED_BHS:mode>)
9184 1.1 mrg (operands[0], operands[1]));
9185 1.1 mrg DONE;
9186 1.1 mrg }
9187 1.1 mrg )
9188 1.1 mrg
9189 1.1.1.3 mrg (define_insn "@aarch64_sve_punpk<perm_hilo>_<mode>"
9190 1.1 mrg [(set (match_operand:<VWIDE> 0 "register_operand" "=Upa")
9191 1.1 mrg (unspec:<VWIDE> [(match_operand:PRED_BHS 1 "register_operand" "Upa")]
9192 1.1 mrg UNPACK_UNSIGNED))]
9193 1.1 mrg "TARGET_SVE"
9194 1.1 mrg "punpk<perm_hilo>\t%0.h, %1.b"
9195 1.1 mrg )
9196 1.1 mrg
9197 1.1.1.3 mrg ;; =========================================================================
9198 1.1.1.3 mrg ;; == Vector partitioning
9199 1.1.1.3 mrg ;; =========================================================================
9200 1.1.1.3 mrg
9201 1.1.1.3 mrg ;; -------------------------------------------------------------------------
9202 1.1.1.3 mrg ;; ---- [PRED] Unary partitioning
9203 1.1.1.3 mrg ;; -------------------------------------------------------------------------
9204 1.1.1.3 mrg ;; Includes:
9205 1.1.1.3 mrg ;; - BRKA
9206 1.1.1.3 mrg ;; - BRKAS
9207 1.1.1.3 mrg ;; - BRKB
9208 1.1.1.3 mrg ;; - BRKBS
9209 1.1.1.3 mrg ;; -------------------------------------------------------------------------
9210 1.1.1.3 mrg
9211 1.1.1.3 mrg ;; Note that unlike most other instructions that have both merging and
9212 1.1.1.3 mrg ;; zeroing forms, these instructions don't operate elementwise and so
9213 1.1.1.3 mrg ;; don't fit the IFN_COND model.
9214 1.1.1.3 mrg (define_insn "@aarch64_brk<brk_op>"
9215 1.1.1.3 mrg [(set (match_operand:VNx16BI 0 "register_operand" "=Upa, Upa")
9216 1.1.1.3 mrg (unspec:VNx16BI
9217 1.1.1.3 mrg [(match_operand:VNx16BI 1 "register_operand" "Upa, Upa")
9218 1.1.1.3 mrg (match_operand:VNx16BI 2 "register_operand" "Upa, Upa")
9219 1.1.1.3 mrg (match_operand:VNx16BI 3 "aarch64_simd_reg_or_zero" "Dz, 0")]
9220 1.1.1.3 mrg SVE_BRK_UNARY))]
9221 1.1.1.3 mrg "TARGET_SVE"
9222 1.1.1.3 mrg "@
9223 1.1.1.3 mrg brk<brk_op>\t%0.b, %1/z, %2.b
9224 1.1.1.3 mrg brk<brk_op>\t%0.b, %1/m, %2.b"
9225 1.1.1.3 mrg )
9226 1.1.1.3 mrg
9227 1.1.1.3 mrg ;; Same, but also producing a flags result.
9228 1.1.1.3 mrg (define_insn "*aarch64_brk<brk_op>_cc"
9229 1.1.1.3 mrg [(set (reg:CC_NZC CC_REGNUM)
9230 1.1.1.3 mrg (unspec:CC_NZC
9231 1.1.1.3 mrg [(match_operand:VNx16BI 1 "register_operand" "Upa, Upa")
9232 1.1.1.3 mrg (match_dup 1)
9233 1.1.1.3 mrg (match_operand:SI 4 "aarch64_sve_ptrue_flag")
9234 1.1.1.3 mrg (unspec:VNx16BI
9235 1.1.1.3 mrg [(match_dup 1)
9236 1.1.1.3 mrg (match_operand:VNx16BI 2 "register_operand" "Upa, Upa")
9237 1.1.1.3 mrg (match_operand:VNx16BI 3 "aarch64_simd_reg_or_zero" "Dz, 0")]
9238 1.1.1.3 mrg SVE_BRK_UNARY)]
9239 1.1.1.3 mrg UNSPEC_PTEST))
9240 1.1.1.3 mrg (set (match_operand:VNx16BI 0 "register_operand" "=Upa, Upa")
9241 1.1.1.3 mrg (unspec:VNx16BI
9242 1.1.1.3 mrg [(match_dup 1)
9243 1.1.1.3 mrg (match_dup 2)
9244 1.1.1.3 mrg (match_dup 3)]
9245 1.1.1.3 mrg SVE_BRK_UNARY))]
9246 1.1.1.3 mrg "TARGET_SVE"
9247 1.1.1.3 mrg "@
9248 1.1.1.3 mrg brk<brk_op>s\t%0.b, %1/z, %2.b
9249 1.1.1.3 mrg brk<brk_op>s\t%0.b, %1/m, %2.b"
9250 1.1.1.3 mrg )
9251 1.1.1.3 mrg
9252 1.1.1.3 mrg ;; Same, but with only the flags result being interesting.
9253 1.1.1.3 mrg (define_insn "*aarch64_brk<brk_op>_ptest"
9254 1.1.1.3 mrg [(set (reg:CC_NZC CC_REGNUM)
9255 1.1.1.3 mrg (unspec:CC_NZC
9256 1.1.1.3 mrg [(match_operand:VNx16BI 1 "register_operand" "Upa, Upa")
9257 1.1.1.3 mrg (match_dup 1)
9258 1.1.1.3 mrg (match_operand:SI 4 "aarch64_sve_ptrue_flag")
9259 1.1.1.3 mrg (unspec:VNx16BI
9260 1.1.1.3 mrg [(match_dup 1)
9261 1.1.1.3 mrg (match_operand:VNx16BI 2 "register_operand" "Upa, Upa")
9262 1.1.1.3 mrg (match_operand:VNx16BI 3 "aarch64_simd_reg_or_zero" "Dz, 0")]
9263 1.1.1.3 mrg SVE_BRK_UNARY)]
9264 1.1.1.3 mrg UNSPEC_PTEST))
9265 1.1.1.3 mrg (clobber (match_scratch:VNx16BI 0 "=Upa, Upa"))]
9266 1.1.1.3 mrg "TARGET_SVE"
9267 1.1.1.3 mrg "@
9268 1.1.1.3 mrg brk<brk_op>s\t%0.b, %1/z, %2.b
9269 1.1.1.3 mrg brk<brk_op>s\t%0.b, %1/m, %2.b"
9270 1.1.1.3 mrg )
9271 1.1.1.3 mrg
9272 1.1.1.3 mrg ;; -------------------------------------------------------------------------
9273 1.1.1.3 mrg ;; ---- [PRED] Binary partitioning
9274 1.1.1.3 mrg ;; -------------------------------------------------------------------------
9275 1.1.1.3 mrg ;; Includes:
9276 1.1.1.3 mrg ;; - BRKN
9277 1.1.1.3 mrg ;; - BRKNS
9278 1.1.1.3 mrg ;; - BRKPA
9279 1.1.1.3 mrg ;; - BRKPAS
9280 1.1.1.3 mrg ;; - BRKPB
9281 1.1.1.3 mrg ;; - BRKPBS
9282 1.1.1.3 mrg ;; -------------------------------------------------------------------------
9283 1.1.1.3 mrg
9284 1.1.1.3 mrg ;; Binary BRKs (BRKN, BRKPA, BRKPB).
9285 1.1.1.3 mrg (define_insn "@aarch64_brk<brk_op>"
9286 1.1.1.3 mrg [(set (match_operand:VNx16BI 0 "register_operand" "=Upa")
9287 1.1.1.3 mrg (unspec:VNx16BI
9288 1.1.1.3 mrg [(match_operand:VNx16BI 1 "register_operand" "Upa")
9289 1.1.1.3 mrg (match_operand:VNx16BI 2 "register_operand" "Upa")
9290 1.1.1.3 mrg (match_operand:VNx16BI 3 "register_operand" "<brk_reg_con>")]
9291 1.1.1.3 mrg SVE_BRK_BINARY))]
9292 1.1.1.3 mrg "TARGET_SVE"
9293 1.1.1.3 mrg "brk<brk_op>\t%0.b, %1/z, %2.b, %<brk_reg_opno>.b"
9294 1.1.1.3 mrg )
9295 1.1.1.3 mrg
9296 1.1.1.3 mrg ;; Same, but also producing a flags result.
9297 1.1.1.3 mrg (define_insn "*aarch64_brk<brk_op>_cc"
9298 1.1.1.3 mrg [(set (reg:CC_NZC CC_REGNUM)
9299 1.1.1.3 mrg (unspec:CC_NZC
9300 1.1.1.3 mrg [(match_operand:VNx16BI 1 "register_operand" "Upa")
9301 1.1.1.3 mrg (match_dup 1)
9302 1.1.1.3 mrg (match_operand:SI 4 "aarch64_sve_ptrue_flag")
9303 1.1.1.3 mrg (unspec:VNx16BI
9304 1.1.1.3 mrg [(match_dup 1)
9305 1.1.1.3 mrg (match_operand:VNx16BI 2 "register_operand" "Upa")
9306 1.1.1.3 mrg (match_operand:VNx16BI 3 "register_operand" "<brk_reg_con>")]
9307 1.1.1.3 mrg SVE_BRK_BINARY)]
9308 1.1.1.3 mrg UNSPEC_PTEST))
9309 1.1.1.3 mrg (set (match_operand:VNx16BI 0 "register_operand" "=Upa")
9310 1.1.1.3 mrg (unspec:VNx16BI
9311 1.1.1.3 mrg [(match_dup 1)
9312 1.1.1.3 mrg (match_dup 2)
9313 1.1.1.3 mrg (match_dup 3)]
9314 1.1.1.3 mrg SVE_BRK_BINARY))]
9315 1.1.1.3 mrg "TARGET_SVE"
9316 1.1.1.3 mrg "brk<brk_op>s\t%0.b, %1/z, %2.b, %<brk_reg_opno>.b"
9317 1.1.1.3 mrg )
9318 1.1.1.3 mrg
9319 1.1.1.3 mrg ;; Same, but with only the flags result being interesting.
9320 1.1.1.3 mrg (define_insn "*aarch64_brk<brk_op>_ptest"
9321 1.1.1.3 mrg [(set (reg:CC_NZC CC_REGNUM)
9322 1.1.1.3 mrg (unspec:CC_NZC
9323 1.1.1.3 mrg [(match_operand:VNx16BI 1 "register_operand" "Upa")
9324 1.1.1.3 mrg (match_dup 1)
9325 1.1.1.3 mrg (match_operand:SI 4 "aarch64_sve_ptrue_flag")
9326 1.1.1.3 mrg (unspec:VNx16BI
9327 1.1.1.3 mrg [(match_dup 1)
9328 1.1.1.3 mrg (match_operand:VNx16BI 2 "register_operand" "Upa")
9329 1.1.1.3 mrg (match_operand:VNx16BI 3 "register_operand" "<brk_reg_con>")]
9330 1.1.1.3 mrg SVE_BRK_BINARY)]
9331 1.1.1.3 mrg UNSPEC_PTEST))
9332 1.1.1.3 mrg (clobber (match_scratch:VNx16BI 0 "=Upa"))]
9333 1.1.1.3 mrg "TARGET_SVE"
9334 1.1.1.3 mrg "brk<brk_op>s\t%0.b, %1/z, %2.b, %<brk_reg_opno>.b"
9335 1.1.1.3 mrg )
9336 1.1.1.3 mrg
9337 1.1.1.3 mrg ;; -------------------------------------------------------------------------
9338 1.1.1.3 mrg ;; ---- [PRED] Scalarization
9339 1.1.1.3 mrg ;; -------------------------------------------------------------------------
9340 1.1.1.3 mrg ;; Includes:
9341 1.1.1.3 mrg ;; - PFIRST
9342 1.1.1.3 mrg ;; - PNEXT
9343 1.1.1.3 mrg ;; -------------------------------------------------------------------------
9344 1.1.1.3 mrg
9345 1.1.1.3 mrg (define_insn "@aarch64_sve_<sve_pred_op><mode>"
9346 1.1.1.3 mrg [(set (match_operand:PRED_ALL 0 "register_operand" "=Upa")
9347 1.1.1.3 mrg (unspec:PRED_ALL
9348 1.1.1.3 mrg [(match_operand:PRED_ALL 1 "register_operand" "Upa")
9349 1.1.1.3 mrg (match_operand:SI 2 "aarch64_sve_ptrue_flag")
9350 1.1.1.3 mrg (match_operand:PRED_ALL 3 "register_operand" "0")]
9351 1.1.1.3 mrg SVE_PITER))
9352 1.1.1.3 mrg (clobber (reg:CC_NZC CC_REGNUM))]
9353 1.1.1.3 mrg "TARGET_SVE && <max_elem_bits> >= <elem_bits>"
9354 1.1.1.3 mrg "<sve_pred_op>\t%0.<Vetype>, %1, %0.<Vetype>"
9355 1.1.1.3 mrg )
9356 1.1.1.3 mrg
9357 1.1.1.3 mrg ;; Same, but also producing a flags result.
9358 1.1.1.3 mrg (define_insn_and_rewrite "*aarch64_sve_<sve_pred_op><mode>_cc"
9359 1.1.1.3 mrg [(set (reg:CC_NZC CC_REGNUM)
9360 1.1.1.3 mrg (unspec:CC_NZC
9361 1.1.1.3 mrg [(match_operand:VNx16BI 1 "register_operand" "Upa")
9362 1.1.1.3 mrg (match_operand 2)
9363 1.1.1.3 mrg (match_operand:SI 3 "aarch64_sve_ptrue_flag")
9364 1.1.1.3 mrg (unspec:PRED_ALL
9365 1.1.1.3 mrg [(match_operand 4)
9366 1.1.1.3 mrg (match_operand:SI 5 "aarch64_sve_ptrue_flag")
9367 1.1.1.3 mrg (match_operand:PRED_ALL 6 "register_operand" "0")]
9368 1.1.1.3 mrg SVE_PITER)]
9369 1.1.1.3 mrg UNSPEC_PTEST))
9370 1.1.1.3 mrg (set (match_operand:PRED_ALL 0 "register_operand" "=Upa")
9371 1.1.1.3 mrg (unspec:PRED_ALL
9372 1.1.1.3 mrg [(match_dup 4)
9373 1.1.1.3 mrg (match_dup 5)
9374 1.1.1.3 mrg (match_dup 6)]
9375 1.1.1.3 mrg SVE_PITER))]
9376 1.1.1.3 mrg "TARGET_SVE
9377 1.1.1.3 mrg && <max_elem_bits> >= <elem_bits>
9378 1.1.1.3 mrg && aarch64_sve_same_pred_for_ptest_p (&operands[2], &operands[4])"
9379 1.1.1.3 mrg "<sve_pred_op>\t%0.<Vetype>, %1, %0.<Vetype>"
9380 1.1.1.3 mrg "&& !rtx_equal_p (operands[2], operands[4])"
9381 1.1.1.3 mrg {
9382 1.1.1.3 mrg operands[4] = operands[2];
9383 1.1.1.3 mrg operands[5] = operands[3];
9384 1.1.1.3 mrg }
9385 1.1.1.3 mrg )
9386 1.1.1.3 mrg
9387 1.1.1.3 mrg ;; Same, but with only the flags result being interesting.
9388 1.1.1.3 mrg (define_insn_and_rewrite "*aarch64_sve_<sve_pred_op><mode>_ptest"
9389 1.1.1.3 mrg [(set (reg:CC_NZC CC_REGNUM)
9390 1.1.1.3 mrg (unspec:CC_NZC
9391 1.1.1.3 mrg [(match_operand:VNx16BI 1 "register_operand" "Upa")
9392 1.1.1.3 mrg (match_operand 2)
9393 1.1.1.3 mrg (match_operand:SI 3 "aarch64_sve_ptrue_flag")
9394 1.1.1.3 mrg (unspec:PRED_ALL
9395 1.1.1.3 mrg [(match_operand 4)
9396 1.1.1.3 mrg (match_operand:SI 5 "aarch64_sve_ptrue_flag")
9397 1.1.1.3 mrg (match_operand:PRED_ALL 6 "register_operand" "0")]
9398 1.1.1.3 mrg SVE_PITER)]
9399 1.1.1.3 mrg UNSPEC_PTEST))
9400 1.1.1.3 mrg (clobber (match_scratch:PRED_ALL 0 "=Upa"))]
9401 1.1.1.3 mrg "TARGET_SVE
9402 1.1.1.3 mrg && <max_elem_bits> >= <elem_bits>
9403 1.1.1.3 mrg && aarch64_sve_same_pred_for_ptest_p (&operands[2], &operands[4])"
9404 1.1.1.3 mrg "<sve_pred_op>\t%0.<Vetype>, %1, %0.<Vetype>"
9405 1.1.1.3 mrg "&& !rtx_equal_p (operands[2], operands[4])"
9406 1.1.1.3 mrg {
9407 1.1.1.3 mrg operands[4] = operands[2];
9408 1.1.1.3 mrg operands[5] = operands[3];
9409 1.1.1.3 mrg }
9410 1.1.1.3 mrg )
9411 1.1.1.3 mrg
9412 1.1.1.3 mrg ;; =========================================================================
9413 1.1.1.3 mrg ;; == Counting elements
9414 1.1.1.3 mrg ;; =========================================================================
9415 1.1.1.3 mrg
9416 1.1.1.3 mrg ;; -------------------------------------------------------------------------
9417 1.1.1.3 mrg ;; ---- [INT] Count elements in a pattern (scalar)
9418 1.1.1.3 mrg ;; -------------------------------------------------------------------------
9419 1.1.1.3 mrg ;; Includes:
9420 1.1.1.3 mrg ;; - CNTB
9421 1.1.1.3 mrg ;; - CNTD
9422 1.1.1.3 mrg ;; - CNTH
9423 1.1.1.3 mrg ;; - CNTW
9424 1.1.1.3 mrg ;; -------------------------------------------------------------------------
9425 1.1.1.3 mrg
9426 1.1.1.3 mrg ;; Count the number of elements in an svpattern. Operand 1 is the pattern,
9427 1.1.1.3 mrg ;; operand 2 is the number of elements that fit in a 128-bit block, and
9428 1.1.1.3 mrg ;; operand 3 is a multiplier in the range [1, 16].
9429 1.1.1.3 mrg ;;
9430 1.1.1.3 mrg ;; Note that this pattern isn't used for SV_ALL (but would work for that too).
9431 1.1.1.3 mrg (define_insn "aarch64_sve_cnt_pat"
9432 1.1.1.3 mrg [(set (match_operand:DI 0 "register_operand" "=r")
9433 1.1.1.3 mrg (zero_extend:DI
9434 1.1.1.3 mrg (unspec:SI [(match_operand:DI 1 "const_int_operand")
9435 1.1.1.3 mrg (match_operand:DI 2 "const_int_operand")
9436 1.1.1.3 mrg (match_operand:DI 3 "const_int_operand")]
9437 1.1.1.3 mrg UNSPEC_SVE_CNT_PAT)))]
9438 1.1 mrg "TARGET_SVE"
9439 1.1 mrg {
9440 1.1.1.3 mrg return aarch64_output_sve_cnt_pat_immediate ("cnt", "%x0", operands + 1);
9441 1.1 mrg }
9442 1.1 mrg )
9443 1.1 mrg
9444 1.1.1.3 mrg ;; -------------------------------------------------------------------------
9445 1.1.1.3 mrg ;; ---- [INT] Increment by the number of elements in a pattern (scalar)
9446 1.1.1.3 mrg ;; -------------------------------------------------------------------------
9447 1.1.1.3 mrg ;; Includes:
9448 1.1.1.3 mrg ;; - INC
9449 1.1.1.3 mrg ;; - SQINC
9450 1.1.1.3 mrg ;; - UQINC
9451 1.1.1.3 mrg ;; -------------------------------------------------------------------------
9452 1.1.1.3 mrg
9453 1.1.1.3 mrg ;; Increment a DImode register by the number of elements in an svpattern.
9454 1.1.1.3 mrg ;; See aarch64_sve_cnt_pat for the counting behavior.
9455 1.1.1.3 mrg (define_insn "@aarch64_sve_<inc_dec><mode>_pat"
9456 1.1.1.3 mrg [(set (match_operand:DI 0 "register_operand" "=r")
9457 1.1.1.3 mrg (ANY_PLUS:DI (zero_extend:DI
9458 1.1.1.3 mrg (unspec:SI [(match_operand:DI 2 "const_int_operand")
9459 1.1.1.3 mrg (match_operand:DI 3 "const_int_operand")
9460 1.1.1.3 mrg (match_operand:DI 4 "const_int_operand")]
9461 1.1.1.3 mrg UNSPEC_SVE_CNT_PAT))
9462 1.1.1.3 mrg (match_operand:DI_ONLY 1 "register_operand" "0")))]
9463 1.1 mrg "TARGET_SVE"
9464 1.1.1.3 mrg {
9465 1.1.1.3 mrg return aarch64_output_sve_cnt_pat_immediate ("<inc_dec>", "%x0",
9466 1.1.1.3 mrg operands + 2);
9467 1.1.1.3 mrg }
9468 1.1 mrg )
9469 1.1 mrg
9470 1.1.1.3 mrg ;; Increment an SImode register by the number of elements in an svpattern
9471 1.1.1.3 mrg ;; using modular arithmetic. See aarch64_sve_cnt_pat for the counting
9472 1.1.1.3 mrg ;; behavior.
9473 1.1.1.3 mrg (define_insn "*aarch64_sve_incsi_pat"
9474 1.1.1.3 mrg [(set (match_operand:SI 0 "register_operand" "=r")
9475 1.1.1.3 mrg (plus:SI (unspec:SI [(match_operand:DI 2 "const_int_operand")
9476 1.1.1.3 mrg (match_operand:DI 3 "const_int_operand")
9477 1.1.1.3 mrg (match_operand:DI 4 "const_int_operand")]
9478 1.1.1.3 mrg UNSPEC_SVE_CNT_PAT)
9479 1.1.1.3 mrg (match_operand:SI 1 "register_operand" "0")))]
9480 1.1 mrg "TARGET_SVE"
9481 1.1 mrg {
9482 1.1.1.3 mrg return aarch64_output_sve_cnt_pat_immediate ("inc", "%x0", operands + 2);
9483 1.1.1.3 mrg }
9484 1.1.1.3 mrg )
9485 1.1.1.3 mrg
9486 1.1.1.3 mrg ;; Increment an SImode register by the number of elements in an svpattern
9487 1.1.1.3 mrg ;; using saturating arithmetic, extending the result to 64 bits.
9488 1.1.1.3 mrg ;;
9489 1.1.1.3 mrg ;; See aarch64_sve_cnt_pat for the counting behavior.
9490 1.1.1.3 mrg (define_insn "@aarch64_sve_<inc_dec><mode>_pat"
9491 1.1.1.3 mrg [(set (match_operand:DI 0 "register_operand" "=r")
9492 1.1.1.3 mrg (<paired_extend>:DI
9493 1.1.1.3 mrg (SAT_PLUS:SI
9494 1.1.1.3 mrg (unspec:SI [(match_operand:DI 2 "const_int_operand")
9495 1.1.1.3 mrg (match_operand:DI 3 "const_int_operand")
9496 1.1.1.3 mrg (match_operand:DI 4 "const_int_operand")]
9497 1.1.1.3 mrg UNSPEC_SVE_CNT_PAT)
9498 1.1.1.3 mrg (match_operand:SI_ONLY 1 "register_operand" "0"))))]
9499 1.1.1.3 mrg "TARGET_SVE"
9500 1.1.1.3 mrg {
9501 1.1.1.3 mrg const char *registers = (<CODE> == SS_PLUS ? "%x0, %w0" : "%w0");
9502 1.1.1.3 mrg return aarch64_output_sve_cnt_pat_immediate ("<inc_dec>", registers,
9503 1.1.1.3 mrg operands + 2);
9504 1.1.1.3 mrg }
9505 1.1.1.3 mrg )
9506 1.1.1.3 mrg
9507 1.1.1.3 mrg ;; -------------------------------------------------------------------------
9508 1.1.1.3 mrg ;; ---- [INT] Increment by the number of elements in a pattern (vector)
9509 1.1.1.3 mrg ;; -------------------------------------------------------------------------
9510 1.1.1.3 mrg ;; Includes:
9511 1.1.1.3 mrg ;; - INC
9512 1.1.1.3 mrg ;; - SQINC
9513 1.1.1.3 mrg ;; - UQINC
9514 1.1.1.3 mrg ;; -------------------------------------------------------------------------
9515 1.1.1.3 mrg
9516 1.1.1.3 mrg ;; Increment a vector of DIs by the number of elements in an svpattern.
9517 1.1.1.3 mrg ;; See aarch64_sve_cnt_pat for the counting behavior.
9518 1.1.1.3 mrg (define_insn "@aarch64_sve_<inc_dec><mode>_pat"
9519 1.1.1.3 mrg [(set (match_operand:VNx2DI 0 "register_operand" "=w, ?&w")
9520 1.1.1.3 mrg (ANY_PLUS:VNx2DI
9521 1.1.1.3 mrg (vec_duplicate:VNx2DI
9522 1.1.1.3 mrg (zero_extend:DI
9523 1.1.1.3 mrg (unspec:SI [(match_operand:DI 2 "const_int_operand")
9524 1.1.1.3 mrg (match_operand:DI 3 "const_int_operand")
9525 1.1.1.3 mrg (match_operand:DI 4 "const_int_operand")]
9526 1.1.1.3 mrg UNSPEC_SVE_CNT_PAT)))
9527 1.1.1.3 mrg (match_operand:VNx2DI_ONLY 1 "register_operand" "0, w")))]
9528 1.1.1.3 mrg "TARGET_SVE"
9529 1.1.1.3 mrg {
9530 1.1.1.3 mrg if (which_alternative == 1)
9531 1.1.1.3 mrg output_asm_insn ("movprfx\t%0, %1", operands);
9532 1.1.1.3 mrg return aarch64_output_sve_cnt_pat_immediate ("<inc_dec>", "%0.<Vetype>",
9533 1.1.1.3 mrg operands + 2);
9534 1.1 mrg }
9535 1.1.1.3 mrg [(set_attr "movprfx" "*,yes")]
9536 1.1 mrg )
9537 1.1 mrg
9538 1.1.1.3 mrg ;; Increment a vector of SIs by the number of elements in an svpattern.
9539 1.1.1.3 mrg ;; See aarch64_sve_cnt_pat for the counting behavior.
9540 1.1.1.3 mrg (define_insn "@aarch64_sve_<inc_dec><mode>_pat"
9541 1.1.1.3 mrg [(set (match_operand:VNx4SI 0 "register_operand" "=w, ?&w")
9542 1.1.1.3 mrg (ANY_PLUS:VNx4SI
9543 1.1.1.3 mrg (vec_duplicate:VNx4SI
9544 1.1.1.3 mrg (unspec:SI [(match_operand:DI 2 "const_int_operand")
9545 1.1.1.3 mrg (match_operand:DI 3 "const_int_operand")
9546 1.1.1.3 mrg (match_operand:DI 4 "const_int_operand")]
9547 1.1.1.3 mrg UNSPEC_SVE_CNT_PAT))
9548 1.1.1.3 mrg (match_operand:VNx4SI_ONLY 1 "register_operand" "0, w")))]
9549 1.1.1.3 mrg "TARGET_SVE"
9550 1.1.1.3 mrg {
9551 1.1.1.3 mrg if (which_alternative == 1)
9552 1.1.1.3 mrg output_asm_insn ("movprfx\t%0, %1", operands);
9553 1.1.1.3 mrg return aarch64_output_sve_cnt_pat_immediate ("<inc_dec>", "%0.<Vetype>",
9554 1.1.1.3 mrg operands + 2);
9555 1.1 mrg }
9556 1.1.1.3 mrg [(set_attr "movprfx" "*,yes")]
9557 1.1 mrg )
9558 1.1 mrg
9559 1.1.1.3 mrg ;; Increment a vector of HIs by the number of elements in an svpattern.
9560 1.1.1.3 mrg ;; See aarch64_sve_cnt_pat for the counting behavior.
9561 1.1.1.3 mrg (define_expand "@aarch64_sve_<inc_dec><mode>_pat"
9562 1.1.1.3 mrg [(set (match_operand:VNx8HI 0 "register_operand")
9563 1.1.1.3 mrg (ANY_PLUS:VNx8HI
9564 1.1.1.3 mrg (vec_duplicate:VNx8HI
9565 1.1.1.3 mrg (truncate:HI
9566 1.1.1.3 mrg (unspec:SI [(match_operand:DI 2 "const_int_operand")
9567 1.1.1.3 mrg (match_operand:DI 3 "const_int_operand")
9568 1.1.1.3 mrg (match_operand:DI 4 "const_int_operand")]
9569 1.1.1.3 mrg UNSPEC_SVE_CNT_PAT)))
9570 1.1.1.3 mrg (match_operand:VNx8HI_ONLY 1 "register_operand")))]
9571 1.1 mrg "TARGET_SVE"
9572 1.1 mrg )
9573 1.1 mrg
9574 1.1.1.3 mrg (define_insn "*aarch64_sve_<inc_dec><mode>_pat"
9575 1.1.1.3 mrg [(set (match_operand:VNx8HI 0 "register_operand" "=w, ?&w")
9576 1.1.1.3 mrg (ANY_PLUS:VNx8HI
9577 1.1.1.3 mrg (vec_duplicate:VNx8HI
9578 1.1.1.3 mrg (match_operator:HI 5 "subreg_lowpart_operator"
9579 1.1.1.3 mrg [(unspec:SI [(match_operand:DI 2 "const_int_operand")
9580 1.1.1.3 mrg (match_operand:DI 3 "const_int_operand")
9581 1.1.1.3 mrg (match_operand:DI 4 "const_int_operand")]
9582 1.1.1.3 mrg UNSPEC_SVE_CNT_PAT)]))
9583 1.1.1.3 mrg (match_operand:VNx8HI_ONLY 1 "register_operand" "0, w")))]
9584 1.1.1.3 mrg "TARGET_SVE"
9585 1.1.1.3 mrg {
9586 1.1.1.3 mrg if (which_alternative == 1)
9587 1.1.1.3 mrg output_asm_insn ("movprfx\t%0, %1", operands);
9588 1.1.1.3 mrg return aarch64_output_sve_cnt_pat_immediate ("<inc_dec>", "%0.<Vetype>",
9589 1.1.1.3 mrg operands + 2);
9590 1.1.1.3 mrg }
9591 1.1.1.3 mrg [(set_attr "movprfx" "*,yes")]
9592 1.1 mrg )
9593 1.1 mrg
9594 1.1.1.3 mrg ;; -------------------------------------------------------------------------
9595 1.1.1.3 mrg ;; ---- [INT] Decrement by the number of elements in a pattern (scalar)
9596 1.1.1.3 mrg ;; -------------------------------------------------------------------------
9597 1.1.1.3 mrg ;; Includes:
9598 1.1.1.3 mrg ;; - DEC
9599 1.1.1.3 mrg ;; - SQDEC
9600 1.1.1.3 mrg ;; - UQDEC
9601 1.1.1.3 mrg ;; -------------------------------------------------------------------------
9602 1.1.1.3 mrg
9603 1.1.1.3 mrg ;; Decrement a DImode register by the number of elements in an svpattern.
9604 1.1.1.3 mrg ;; See aarch64_sve_cnt_pat for the counting behavior.
9605 1.1.1.3 mrg (define_insn "@aarch64_sve_<inc_dec><mode>_pat"
9606 1.1.1.3 mrg [(set (match_operand:DI 0 "register_operand" "=r")
9607 1.1.1.3 mrg (ANY_MINUS:DI (match_operand:DI_ONLY 1 "register_operand" "0")
9608 1.1.1.3 mrg (zero_extend:DI
9609 1.1.1.3 mrg (unspec:SI [(match_operand:DI 2 "const_int_operand")
9610 1.1.1.3 mrg (match_operand:DI 3 "const_int_operand")
9611 1.1.1.3 mrg (match_operand:DI 4 "const_int_operand")]
9612 1.1.1.3 mrg UNSPEC_SVE_CNT_PAT))))]
9613 1.1.1.3 mrg "TARGET_SVE"
9614 1.1.1.3 mrg {
9615 1.1.1.3 mrg return aarch64_output_sve_cnt_pat_immediate ("<inc_dec>", "%x0",
9616 1.1.1.3 mrg operands + 2);
9617 1.1 mrg }
9618 1.1 mrg )
9619 1.1 mrg
9620 1.1.1.3 mrg ;; Decrement an SImode register by the number of elements in an svpattern
9621 1.1.1.3 mrg ;; using modular arithmetic. See aarch64_sve_cnt_pat for the counting
9622 1.1.1.3 mrg ;; behavior.
9623 1.1.1.3 mrg (define_insn "*aarch64_sve_decsi_pat"
9624 1.1.1.3 mrg [(set (match_operand:SI 0 "register_operand" "=r")
9625 1.1.1.3 mrg (minus:SI (match_operand:SI 1 "register_operand" "0")
9626 1.1.1.3 mrg (unspec:SI [(match_operand:DI 2 "const_int_operand")
9627 1.1.1.3 mrg (match_operand:DI 3 "const_int_operand")
9628 1.1.1.3 mrg (match_operand:DI 4 "const_int_operand")]
9629 1.1.1.3 mrg UNSPEC_SVE_CNT_PAT)))]
9630 1.1 mrg "TARGET_SVE"
9631 1.1 mrg {
9632 1.1.1.3 mrg return aarch64_output_sve_cnt_pat_immediate ("dec", "%x0", operands + 2);
9633 1.1 mrg }
9634 1.1 mrg )
9635 1.1 mrg
9636 1.1.1.3 mrg ;; Decrement an SImode register by the number of elements in an svpattern
9637 1.1.1.3 mrg ;; using saturating arithmetic, extending the result to 64 bits.
9638 1.1.1.3 mrg ;;
9639 1.1.1.3 mrg ;; See aarch64_sve_cnt_pat for the counting behavior.
9640 1.1.1.3 mrg (define_insn "@aarch64_sve_<inc_dec><mode>_pat"
9641 1.1.1.3 mrg [(set (match_operand:DI 0 "register_operand" "=r")
9642 1.1.1.3 mrg (<paired_extend>:DI
9643 1.1.1.3 mrg (SAT_MINUS:SI
9644 1.1.1.3 mrg (match_operand:SI_ONLY 1 "register_operand" "0")
9645 1.1.1.3 mrg (unspec:SI [(match_operand:DI 2 "const_int_operand")
9646 1.1.1.3 mrg (match_operand:DI 3 "const_int_operand")
9647 1.1.1.3 mrg (match_operand:DI 4 "const_int_operand")]
9648 1.1.1.3 mrg UNSPEC_SVE_CNT_PAT))))]
9649 1.1.1.3 mrg "TARGET_SVE"
9650 1.1.1.3 mrg {
9651 1.1.1.3 mrg const char *registers = (<CODE> == SS_MINUS ? "%x0, %w0" : "%w0");
9652 1.1.1.3 mrg return aarch64_output_sve_cnt_pat_immediate ("<inc_dec>", registers,
9653 1.1.1.3 mrg operands + 2);
9654 1.1.1.3 mrg }
9655 1.1.1.2 mrg )
9656 1.1.1.2 mrg
9657 1.1.1.3 mrg ;; -------------------------------------------------------------------------
9658 1.1.1.3 mrg ;; ---- [INT] Decrement by the number of elements in a pattern (vector)
9659 1.1.1.3 mrg ;; -------------------------------------------------------------------------
9660 1.1.1.3 mrg ;; Includes:
9661 1.1.1.3 mrg ;; - DEC
9662 1.1.1.3 mrg ;; - SQDEC
9663 1.1.1.3 mrg ;; - UQDEC
9664 1.1.1.3 mrg ;; -------------------------------------------------------------------------
9665 1.1.1.3 mrg
9666 1.1.1.3 mrg ;; Decrement a vector of DIs by the number of elements in an svpattern.
9667 1.1.1.3 mrg ;; See aarch64_sve_cnt_pat for the counting behavior.
9668 1.1.1.3 mrg (define_insn "@aarch64_sve_<inc_dec><mode>_pat"
9669 1.1.1.3 mrg [(set (match_operand:VNx2DI 0 "register_operand" "=w, ?&w")
9670 1.1.1.3 mrg (ANY_MINUS:VNx2DI
9671 1.1.1.3 mrg (match_operand:VNx2DI_ONLY 1 "register_operand" "0, w")
9672 1.1.1.3 mrg (vec_duplicate:VNx2DI
9673 1.1.1.3 mrg (zero_extend:DI
9674 1.1.1.3 mrg (unspec:SI [(match_operand:DI 2 "const_int_operand")
9675 1.1.1.3 mrg (match_operand:DI 3 "const_int_operand")
9676 1.1.1.3 mrg (match_operand:DI 4 "const_int_operand")]
9677 1.1.1.3 mrg UNSPEC_SVE_CNT_PAT)))))]
9678 1.1.1.3 mrg "TARGET_SVE"
9679 1.1.1.3 mrg {
9680 1.1.1.3 mrg if (which_alternative == 1)
9681 1.1.1.3 mrg output_asm_insn ("movprfx\t%0, %1", operands);
9682 1.1.1.3 mrg return aarch64_output_sve_cnt_pat_immediate ("<inc_dec>", "%0.<Vetype>",
9683 1.1.1.3 mrg operands + 2);
9684 1.1.1.3 mrg }
9685 1.1.1.3 mrg [(set_attr "movprfx" "*,yes")]
9686 1.1.1.2 mrg )
9687 1.1.1.2 mrg
9688 1.1.1.3 mrg ;; Decrement a vector of SIs by the number of elements in an svpattern.
9689 1.1.1.3 mrg ;; See aarch64_sve_cnt_pat for the counting behavior.
9690 1.1.1.3 mrg (define_insn "@aarch64_sve_<inc_dec><mode>_pat"
9691 1.1.1.3 mrg [(set (match_operand:VNx4SI 0 "register_operand" "=w, ?&w")
9692 1.1.1.3 mrg (ANY_MINUS:VNx4SI
9693 1.1.1.3 mrg (match_operand:VNx4SI_ONLY 1 "register_operand" "0, w")
9694 1.1.1.3 mrg (vec_duplicate:VNx4SI
9695 1.1.1.3 mrg (unspec:SI [(match_operand:DI 2 "const_int_operand")
9696 1.1.1.3 mrg (match_operand:DI 3 "const_int_operand")
9697 1.1.1.3 mrg (match_operand:DI 4 "const_int_operand")]
9698 1.1.1.3 mrg UNSPEC_SVE_CNT_PAT))))]
9699 1.1.1.3 mrg "TARGET_SVE"
9700 1.1.1.3 mrg {
9701 1.1.1.3 mrg if (which_alternative == 1)
9702 1.1.1.3 mrg output_asm_insn ("movprfx\t%0, %1", operands);
9703 1.1.1.3 mrg return aarch64_output_sve_cnt_pat_immediate ("<inc_dec>", "%0.<Vetype>",
9704 1.1.1.3 mrg operands + 2);
9705 1.1.1.3 mrg }
9706 1.1.1.2 mrg [(set_attr "movprfx" "*,yes")]
9707 1.1.1.2 mrg )
9708 1.1.1.2 mrg
9709 1.1.1.3 mrg ;; Decrement a vector of HIs by the number of elements in an svpattern.
9710 1.1.1.3 mrg ;; See aarch64_sve_cnt_pat for the counting behavior.
9711 1.1.1.3 mrg (define_expand "@aarch64_sve_<inc_dec><mode>_pat"
9712 1.1.1.3 mrg [(set (match_operand:VNx8HI 0 "register_operand")
9713 1.1.1.3 mrg (ANY_MINUS:VNx8HI
9714 1.1.1.3 mrg (match_operand:VNx8HI_ONLY 1 "register_operand")
9715 1.1.1.3 mrg (vec_duplicate:VNx8HI
9716 1.1.1.3 mrg (truncate:HI
9717 1.1.1.3 mrg (unspec:SI [(match_operand:DI 2 "const_int_operand")
9718 1.1.1.3 mrg (match_operand:DI 3 "const_int_operand")
9719 1.1.1.3 mrg (match_operand:DI 4 "const_int_operand")]
9720 1.1.1.3 mrg UNSPEC_SVE_CNT_PAT)))))]
9721 1.1.1.2 mrg "TARGET_SVE"
9722 1.1.1.3 mrg )
9723 1.1.1.3 mrg
9724 1.1.1.3 mrg (define_insn "*aarch64_sve_<inc_dec><mode>_pat"
9725 1.1.1.3 mrg [(set (match_operand:VNx8HI 0 "register_operand" "=w, ?&w")
9726 1.1.1.3 mrg (ANY_MINUS:VNx8HI
9727 1.1.1.3 mrg (match_operand:VNx8HI_ONLY 1 "register_operand" "0, w")
9728 1.1.1.3 mrg (vec_duplicate:VNx8HI
9729 1.1.1.3 mrg (match_operator:HI 5 "subreg_lowpart_operator"
9730 1.1.1.3 mrg [(unspec:SI [(match_operand:DI 2 "const_int_operand")
9731 1.1.1.3 mrg (match_operand:DI 3 "const_int_operand")
9732 1.1.1.3 mrg (match_operand:DI 4 "const_int_operand")]
9733 1.1.1.3 mrg UNSPEC_SVE_CNT_PAT)]))))]
9734 1.1.1.3 mrg "TARGET_SVE"
9735 1.1.1.3 mrg {
9736 1.1.1.3 mrg if (which_alternative == 1)
9737 1.1.1.3 mrg output_asm_insn ("movprfx\t%0, %1", operands);
9738 1.1.1.3 mrg return aarch64_output_sve_cnt_pat_immediate ("<inc_dec>", "%0.<Vetype>",
9739 1.1.1.3 mrg operands + 2);
9740 1.1.1.3 mrg }
9741 1.1.1.2 mrg [(set_attr "movprfx" "*,yes")]
9742 1.1.1.2 mrg )
9743 1.1.1.2 mrg
9744 1.1.1.3 mrg ;; -------------------------------------------------------------------------
9745 1.1.1.3 mrg ;; ---- [INT] Count elements in a predicate (scalar)
9746 1.1.1.3 mrg ;; -------------------------------------------------------------------------
9747 1.1.1.3 mrg ;; Includes:
9748 1.1.1.3 mrg ;; - CNTP
9749 1.1.1.3 mrg ;; -------------------------------------------------------------------------
9750 1.1.1.3 mrg
9751 1.1.1.3 mrg ;; Count the number of set bits in a predicate. Operand 3 is true if
9752 1.1.1.3 mrg ;; operand 1 is known to be all-true.
9753 1.1.1.3 mrg (define_insn "@aarch64_pred_cntp<mode>"
9754 1.1.1.3 mrg [(set (match_operand:DI 0 "register_operand" "=r")
9755 1.1.1.3 mrg (zero_extend:DI
9756 1.1.1.3 mrg (unspec:SI [(match_operand:PRED_ALL 1 "register_operand" "Upl")
9757 1.1.1.3 mrg (match_operand:SI 2 "aarch64_sve_ptrue_flag")
9758 1.1.1.3 mrg (match_operand:PRED_ALL 3 "register_operand" "Upa")]
9759 1.1.1.3 mrg UNSPEC_CNTP)))]
9760 1.1.1.3 mrg "TARGET_SVE"
9761 1.1.1.3 mrg "cntp\t%x0, %1, %3.<Vetype>")
9762 1.1.1.3 mrg
9763 1.1.1.3 mrg ;; -------------------------------------------------------------------------
9764 1.1.1.3 mrg ;; ---- [INT] Increment by the number of elements in a predicate (scalar)
9765 1.1.1.3 mrg ;; -------------------------------------------------------------------------
9766 1.1.1.3 mrg ;; Includes:
9767 1.1.1.3 mrg ;; - INCP
9768 1.1.1.3 mrg ;; - SQINCP
9769 1.1.1.3 mrg ;; - UQINCP
9770 1.1.1.3 mrg ;; -------------------------------------------------------------------------
9771 1.1.1.3 mrg
9772 1.1.1.3 mrg ;; Increment a DImode register by the number of set bits in a predicate.
9773 1.1.1.3 mrg ;; See aarch64_sve_cntp for a description of the operands.
9774 1.1.1.3 mrg (define_expand "@aarch64_sve_<inc_dec><DI_ONLY:mode><PRED_ALL:mode>_cntp"
9775 1.1.1.3 mrg [(set (match_operand:DI 0 "register_operand")
9776 1.1.1.3 mrg (ANY_PLUS:DI
9777 1.1.1.3 mrg (zero_extend:DI
9778 1.1.1.3 mrg (unspec:SI [(match_dup 3)
9779 1.1.1.3 mrg (const_int SVE_KNOWN_PTRUE)
9780 1.1.1.3 mrg (match_operand:PRED_ALL 2 "register_operand")]
9781 1.1.1.3 mrg UNSPEC_CNTP))
9782 1.1.1.3 mrg (match_operand:DI_ONLY 1 "register_operand")))]
9783 1.1.1.3 mrg "TARGET_SVE"
9784 1.1.1.3 mrg {
9785 1.1.1.3 mrg operands[3] = CONSTM1_RTX (<PRED_ALL:MODE>mode);
9786 1.1.1.3 mrg }
9787 1.1.1.3 mrg )
9788 1.1.1.3 mrg
9789 1.1.1.3 mrg (define_insn_and_rewrite "*aarch64_sve_<inc_dec><DI_ONLY:mode><PRED_ALL:mode>_cntp"
9790 1.1.1.3 mrg [(set (match_operand:DI 0 "register_operand" "=r")
9791 1.1.1.3 mrg (ANY_PLUS:DI
9792 1.1.1.3 mrg (zero_extend:DI
9793 1.1.1.3 mrg (unspec:SI [(match_operand 3)
9794 1.1.1.3 mrg (const_int SVE_KNOWN_PTRUE)
9795 1.1.1.3 mrg (match_operand:PRED_ALL 2 "register_operand" "Upa")]
9796 1.1.1.3 mrg UNSPEC_CNTP))
9797 1.1.1.3 mrg (match_operand:DI_ONLY 1 "register_operand" "0")))]
9798 1.1.1.3 mrg "TARGET_SVE"
9799 1.1.1.3 mrg "<inc_dec>p\t%x0, %2.<PRED_ALL:Vetype>"
9800 1.1.1.3 mrg "&& !CONSTANT_P (operands[3])"
9801 1.1.1.3 mrg {
9802 1.1.1.3 mrg operands[3] = CONSTM1_RTX (<PRED_ALL:MODE>mode);
9803 1.1.1.3 mrg }
9804 1.1.1.3 mrg )
9805 1.1.1.3 mrg
9806 1.1.1.3 mrg ;; Increment an SImode register by the number of set bits in a predicate
9807 1.1.1.3 mrg ;; using modular arithmetic. See aarch64_sve_cntp for a description of
9808 1.1.1.3 mrg ;; the operands.
9809 1.1.1.3 mrg (define_insn_and_rewrite "*aarch64_incsi<mode>_cntp"
9810 1.1.1.3 mrg [(set (match_operand:SI 0 "register_operand" "=r")
9811 1.1.1.3 mrg (plus:SI
9812 1.1.1.3 mrg (unspec:SI [(match_operand 3)
9813 1.1.1.3 mrg (const_int SVE_KNOWN_PTRUE)
9814 1.1.1.3 mrg (match_operand:PRED_ALL 2 "register_operand" "Upa")]
9815 1.1.1.3 mrg UNSPEC_CNTP)
9816 1.1.1.3 mrg (match_operand:SI 1 "register_operand" "0")))]
9817 1.1.1.3 mrg "TARGET_SVE"
9818 1.1.1.3 mrg "incp\t%x0, %2.<Vetype>"
9819 1.1.1.3 mrg "&& !CONSTANT_P (operands[3])"
9820 1.1.1.3 mrg {
9821 1.1.1.3 mrg operands[3] = CONSTM1_RTX (<MODE>mode);
9822 1.1.1.3 mrg }
9823 1.1.1.2 mrg )
9824 1.1.1.2 mrg
9825 1.1.1.3 mrg ;; Increment an SImode register by the number of set bits in a predicate
9826 1.1.1.3 mrg ;; using saturating arithmetic, extending the result to 64 bits.
9827 1.1.1.3 mrg ;;
9828 1.1.1.3 mrg ;; See aarch64_sve_cntp for a description of the operands.
9829 1.1.1.3 mrg (define_expand "@aarch64_sve_<inc_dec><SI_ONLY:mode><PRED_ALL:mode>_cntp"
9830 1.1.1.3 mrg [(set (match_operand:DI 0 "register_operand")
9831 1.1.1.3 mrg (<paired_extend>:DI
9832 1.1.1.3 mrg (SAT_PLUS:SI
9833 1.1.1.3 mrg (unspec:SI [(match_dup 3)
9834 1.1.1.3 mrg (const_int SVE_KNOWN_PTRUE)
9835 1.1.1.3 mrg (match_operand:PRED_ALL 2 "register_operand")]
9836 1.1.1.3 mrg UNSPEC_CNTP)
9837 1.1.1.3 mrg (match_operand:SI_ONLY 1 "register_operand"))))]
9838 1.1.1.3 mrg "TARGET_SVE"
9839 1.1.1.3 mrg {
9840 1.1.1.3 mrg operands[3] = CONSTM1_RTX (<PRED_ALL:MODE>mode);
9841 1.1.1.3 mrg }
9842 1.1.1.3 mrg )
9843 1.1.1.3 mrg
9844 1.1.1.3 mrg (define_insn_and_rewrite "*aarch64_sve_<inc_dec><SI_ONLY:mode><PRED_ALL:mode>_cntp"
9845 1.1.1.3 mrg [(set (match_operand:DI 0 "register_operand" "=r")
9846 1.1.1.3 mrg (<paired_extend>:DI
9847 1.1.1.3 mrg (SAT_PLUS:SI
9848 1.1.1.3 mrg (unspec:SI [(match_operand 3)
9849 1.1.1.3 mrg (const_int SVE_KNOWN_PTRUE)
9850 1.1.1.3 mrg (match_operand:PRED_ALL 2 "register_operand" "Upa")]
9851 1.1.1.3 mrg UNSPEC_CNTP)
9852 1.1.1.3 mrg (match_operand:SI_ONLY 1 "register_operand" "0"))))]
9853 1.1 mrg "TARGET_SVE"
9854 1.1.1.3 mrg {
9855 1.1.1.3 mrg if (<CODE> == SS_PLUS)
9856 1.1.1.3 mrg return "<inc_dec>p\t%x0, %2.<PRED_ALL:Vetype>, %w0";
9857 1.1.1.3 mrg else
9858 1.1.1.3 mrg return "<inc_dec>p\t%w0, %2.<PRED_ALL:Vetype>";
9859 1.1.1.3 mrg }
9860 1.1.1.3 mrg "&& !CONSTANT_P (operands[3])"
9861 1.1.1.3 mrg {
9862 1.1.1.3 mrg operands[3] = CONSTM1_RTX (<PRED_ALL:MODE>mode);
9863 1.1.1.3 mrg }
9864 1.1.1.2 mrg )
9865 1.1.1.2 mrg
9866 1.1.1.3 mrg ;; -------------------------------------------------------------------------
9867 1.1.1.3 mrg ;; ---- [INT] Increment by the number of elements in a predicate (vector)
9868 1.1.1.3 mrg ;; -------------------------------------------------------------------------
9869 1.1.1.3 mrg ;; Includes:
9870 1.1.1.3 mrg ;; - INCP
9871 1.1.1.3 mrg ;; - SQINCP
9872 1.1.1.3 mrg ;; - UQINCP
9873 1.1.1.3 mrg ;; -------------------------------------------------------------------------
9874 1.1.1.3 mrg
9875 1.1.1.3 mrg ;; Increment a vector of DIs by the number of set bits in a predicate.
9876 1.1.1.3 mrg ;; See aarch64_sve_cntp for a description of the operands.
9877 1.1.1.3 mrg (define_expand "@aarch64_sve_<inc_dec><mode>_cntp"
9878 1.1.1.3 mrg [(set (match_operand:VNx2DI 0 "register_operand")
9879 1.1.1.3 mrg (ANY_PLUS:VNx2DI
9880 1.1.1.3 mrg (vec_duplicate:VNx2DI
9881 1.1.1.3 mrg (zero_extend:DI
9882 1.1.1.3 mrg (unspec:SI
9883 1.1.1.3 mrg [(match_dup 3)
9884 1.1.1.3 mrg (const_int SVE_KNOWN_PTRUE)
9885 1.1.1.3 mrg (match_operand:<VPRED> 2 "register_operand")]
9886 1.1.1.3 mrg UNSPEC_CNTP)))
9887 1.1.1.3 mrg (match_operand:VNx2DI_ONLY 1 "register_operand")))]
9888 1.1.1.2 mrg "TARGET_SVE"
9889 1.1.1.3 mrg {
9890 1.1.1.3 mrg operands[3] = CONSTM1_RTX (<VPRED>mode);
9891 1.1.1.3 mrg }
9892 1.1.1.3 mrg )
9893 1.1.1.2 mrg
9894 1.1.1.3 mrg (define_insn_and_rewrite "*aarch64_sve_<inc_dec><mode>_cntp"
9895 1.1.1.3 mrg [(set (match_operand:VNx2DI 0 "register_operand" "=w, ?&w")
9896 1.1.1.3 mrg (ANY_PLUS:VNx2DI
9897 1.1.1.3 mrg (vec_duplicate:VNx2DI
9898 1.1.1.3 mrg (zero_extend:DI
9899 1.1.1.3 mrg (unspec:SI
9900 1.1.1.3 mrg [(match_operand 3)
9901 1.1.1.3 mrg (const_int SVE_KNOWN_PTRUE)
9902 1.1.1.3 mrg (match_operand:<VPRED> 2 "register_operand" "Upa, Upa")]
9903 1.1.1.3 mrg UNSPEC_CNTP)))
9904 1.1.1.3 mrg (match_operand:VNx2DI_ONLY 1 "register_operand" "0, w")))]
9905 1.1.1.2 mrg "TARGET_SVE"
9906 1.1.1.2 mrg "@
9907 1.1.1.3 mrg <inc_dec>p\t%0.d, %2
9908 1.1.1.3 mrg movprfx\t%0, %1\;<inc_dec>p\t%0.d, %2"
9909 1.1.1.3 mrg "&& !CONSTANT_P (operands[3])"
9910 1.1.1.3 mrg {
9911 1.1.1.3 mrg operands[3] = CONSTM1_RTX (<VPRED>mode);
9912 1.1.1.3 mrg }
9913 1.1.1.2 mrg [(set_attr "movprfx" "*,yes")]
9914 1.1.1.2 mrg )
9915 1.1.1.2 mrg
9916 1.1.1.3 mrg ;; Increment a vector of SIs by the number of set bits in a predicate.
9917 1.1.1.3 mrg ;; See aarch64_sve_cntp for a description of the operands.
9918 1.1.1.3 mrg (define_expand "@aarch64_sve_<inc_dec><mode>_cntp"
9919 1.1.1.3 mrg [(set (match_operand:VNx4SI 0 "register_operand")
9920 1.1.1.3 mrg (ANY_PLUS:VNx4SI
9921 1.1.1.3 mrg (vec_duplicate:VNx4SI
9922 1.1.1.3 mrg (unspec:SI
9923 1.1.1.3 mrg [(match_dup 3)
9924 1.1.1.3 mrg (const_int SVE_KNOWN_PTRUE)
9925 1.1.1.3 mrg (match_operand:<VPRED> 2 "register_operand")]
9926 1.1.1.3 mrg UNSPEC_CNTP))
9927 1.1.1.3 mrg (match_operand:VNx4SI_ONLY 1 "register_operand")))]
9928 1.1.1.3 mrg "TARGET_SVE"
9929 1.1.1.3 mrg {
9930 1.1.1.3 mrg operands[3] = CONSTM1_RTX (<VPRED>mode);
9931 1.1.1.3 mrg }
9932 1.1.1.3 mrg )
9933 1.1.1.3 mrg
9934 1.1.1.3 mrg (define_insn_and_rewrite "*aarch64_sve_<inc_dec><mode>_cntp"
9935 1.1.1.3 mrg [(set (match_operand:VNx4SI 0 "register_operand" "=w, ?&w")
9936 1.1.1.3 mrg (ANY_PLUS:VNx4SI
9937 1.1.1.3 mrg (vec_duplicate:VNx4SI
9938 1.1.1.3 mrg (unspec:SI
9939 1.1.1.3 mrg [(match_operand 3)
9940 1.1.1.3 mrg (const_int SVE_KNOWN_PTRUE)
9941 1.1.1.3 mrg (match_operand:<VPRED> 2 "register_operand" "Upa, Upa")]
9942 1.1.1.3 mrg UNSPEC_CNTP))
9943 1.1.1.3 mrg (match_operand:VNx4SI_ONLY 1 "register_operand" "0, w")))]
9944 1.1.1.3 mrg "TARGET_SVE"
9945 1.1.1.3 mrg "@
9946 1.1.1.3 mrg <inc_dec>p\t%0.s, %2
9947 1.1.1.3 mrg movprfx\t%0, %1\;<inc_dec>p\t%0.s, %2"
9948 1.1.1.3 mrg "&& !CONSTANT_P (operands[3])"
9949 1.1.1.3 mrg {
9950 1.1.1.3 mrg operands[3] = CONSTM1_RTX (<VPRED>mode);
9951 1.1.1.3 mrg }
9952 1.1.1.2 mrg [(set_attr "movprfx" "*,yes")]
9953 1.1.1.2 mrg )
9954 1.1.1.2 mrg
9955 1.1.1.3 mrg ;; Increment a vector of HIs by the number of set bits in a predicate.
9956 1.1.1.3 mrg ;; See aarch64_sve_cntp for a description of the operands.
9957 1.1.1.3 mrg (define_expand "@aarch64_sve_<inc_dec><mode>_cntp"
9958 1.1.1.3 mrg [(set (match_operand:VNx8HI 0 "register_operand")
9959 1.1.1.3 mrg (ANY_PLUS:VNx8HI
9960 1.1.1.3 mrg (vec_duplicate:VNx8HI
9961 1.1.1.3 mrg (truncate:HI
9962 1.1.1.3 mrg (unspec:SI
9963 1.1.1.3 mrg [(match_dup 3)
9964 1.1.1.3 mrg (const_int SVE_KNOWN_PTRUE)
9965 1.1.1.3 mrg (match_operand:<VPRED> 2 "register_operand")]
9966 1.1.1.3 mrg UNSPEC_CNTP)))
9967 1.1.1.3 mrg (match_operand:VNx8HI_ONLY 1 "register_operand")))]
9968 1.1.1.3 mrg "TARGET_SVE"
9969 1.1.1.3 mrg {
9970 1.1.1.3 mrg operands[3] = CONSTM1_RTX (<VPRED>mode);
9971 1.1.1.3 mrg }
9972 1.1 mrg )
9973 1.1 mrg
9974 1.1.1.3 mrg (define_insn_and_rewrite "*aarch64_sve_<inc_dec><mode>_cntp"
9975 1.1.1.3 mrg [(set (match_operand:VNx8HI 0 "register_operand" "=w, ?&w")
9976 1.1.1.3 mrg (ANY_PLUS:VNx8HI
9977 1.1.1.3 mrg (vec_duplicate:VNx8HI
9978 1.1.1.3 mrg (match_operator:HI 3 "subreg_lowpart_operator"
9979 1.1.1.3 mrg [(unspec:SI
9980 1.1.1.3 mrg [(match_operand 4)
9981 1.1.1.3 mrg (const_int SVE_KNOWN_PTRUE)
9982 1.1.1.3 mrg (match_operand:<VPRED> 2 "register_operand" "Upa, Upa")]
9983 1.1.1.3 mrg UNSPEC_CNTP)]))
9984 1.1.1.3 mrg (match_operand:VNx8HI_ONLY 1 "register_operand" "0, w")))]
9985 1.1.1.3 mrg "TARGET_SVE"
9986 1.1.1.3 mrg "@
9987 1.1.1.3 mrg <inc_dec>p\t%0.h, %2
9988 1.1.1.3 mrg movprfx\t%0, %1\;<inc_dec>p\t%0.h, %2"
9989 1.1.1.3 mrg "&& !CONSTANT_P (operands[4])"
9990 1.1.1.3 mrg {
9991 1.1.1.3 mrg operands[4] = CONSTM1_RTX (<VPRED>mode);
9992 1.1.1.3 mrg }
9993 1.1.1.3 mrg [(set_attr "movprfx" "*,yes")]
9994 1.1 mrg )
9995 1.1.1.2 mrg
9996 1.1.1.3 mrg ;; -------------------------------------------------------------------------
9997 1.1.1.3 mrg ;; ---- [INT] Decrement by the number of elements in a predicate (scalar)
9998 1.1.1.3 mrg ;; -------------------------------------------------------------------------
9999 1.1.1.3 mrg ;; Includes:
10000 1.1.1.3 mrg ;; - DECP
10001 1.1.1.3 mrg ;; - SQDECP
10002 1.1.1.3 mrg ;; - UQDECP
10003 1.1.1.3 mrg ;; -------------------------------------------------------------------------
10004 1.1.1.3 mrg
10005 1.1.1.3 mrg ;; Decrement a DImode register by the number of set bits in a predicate.
10006 1.1.1.3 mrg ;; See aarch64_sve_cntp for a description of the operands.
10007 1.1.1.3 mrg (define_expand "@aarch64_sve_<inc_dec><DI_ONLY:mode><PRED_ALL:mode>_cntp"
10008 1.1.1.3 mrg [(set (match_operand:DI 0 "register_operand")
10009 1.1.1.3 mrg (ANY_MINUS:DI
10010 1.1.1.3 mrg (match_operand:DI_ONLY 1 "register_operand")
10011 1.1.1.3 mrg (zero_extend:DI
10012 1.1.1.3 mrg (unspec:SI [(match_dup 3)
10013 1.1.1.3 mrg (const_int SVE_KNOWN_PTRUE)
10014 1.1.1.3 mrg (match_operand:PRED_ALL 2 "register_operand")]
10015 1.1.1.3 mrg UNSPEC_CNTP))))]
10016 1.1.1.3 mrg "TARGET_SVE"
10017 1.1.1.3 mrg {
10018 1.1.1.3 mrg operands[3] = CONSTM1_RTX (<PRED_ALL:MODE>mode);
10019 1.1.1.3 mrg }
10020 1.1.1.3 mrg )
10021 1.1.1.3 mrg
10022 1.1.1.3 mrg (define_insn_and_rewrite "*aarch64_sve_<inc_dec><DI_ONLY:mode><PRED_ALL:mode>_cntp"
10023 1.1.1.3 mrg [(set (match_operand:DI 0 "register_operand" "=r")
10024 1.1.1.3 mrg (ANY_MINUS:DI
10025 1.1.1.3 mrg (match_operand:DI_ONLY 1 "register_operand" "0")
10026 1.1.1.3 mrg (zero_extend:DI
10027 1.1.1.3 mrg (unspec:SI [(match_operand 3)
10028 1.1.1.3 mrg (const_int SVE_KNOWN_PTRUE)
10029 1.1.1.3 mrg (match_operand:PRED_ALL 2 "register_operand" "Upa")]
10030 1.1.1.3 mrg UNSPEC_CNTP))))]
10031 1.1.1.3 mrg "TARGET_SVE"
10032 1.1.1.3 mrg "<inc_dec>p\t%x0, %2.<PRED_ALL:Vetype>"
10033 1.1.1.3 mrg "&& !CONSTANT_P (operands[3])"
10034 1.1.1.3 mrg {
10035 1.1.1.3 mrg operands[3] = CONSTM1_RTX (<PRED_ALL:MODE>mode);
10036 1.1.1.3 mrg }
10037 1.1.1.3 mrg )
10038 1.1.1.3 mrg
10039 1.1.1.3 mrg ;; Decrement an SImode register by the number of set bits in a predicate
10040 1.1.1.3 mrg ;; using modular arithmetic. See aarch64_sve_cntp for a description of the
10041 1.1.1.3 mrg ;; operands.
10042 1.1.1.3 mrg (define_insn_and_rewrite "*aarch64_decsi<mode>_cntp"
10043 1.1.1.3 mrg [(set (match_operand:SI 0 "register_operand" "=r")
10044 1.1.1.3 mrg (minus:SI
10045 1.1.1.3 mrg (match_operand:SI 1 "register_operand" "0")
10046 1.1.1.3 mrg (unspec:SI [(match_operand 3)
10047 1.1.1.3 mrg (const_int SVE_KNOWN_PTRUE)
10048 1.1.1.3 mrg (match_operand:PRED_ALL 2 "register_operand" "Upa")]
10049 1.1.1.3 mrg UNSPEC_CNTP)))]
10050 1.1.1.3 mrg "TARGET_SVE"
10051 1.1.1.3 mrg "decp\t%x0, %2.<Vetype>"
10052 1.1.1.3 mrg "&& !CONSTANT_P (operands[3])"
10053 1.1.1.3 mrg {
10054 1.1.1.3 mrg operands[3] = CONSTM1_RTX (<MODE>mode);
10055 1.1.1.3 mrg }
10056 1.1.1.3 mrg )
10057 1.1.1.3 mrg
10058 1.1.1.3 mrg ;; Decrement an SImode register by the number of set bits in a predicate
10059 1.1.1.3 mrg ;; using saturating arithmetic, extending the result to 64 bits.
10060 1.1.1.3 mrg ;;
10061 1.1.1.3 mrg ;; See aarch64_sve_cntp for a description of the operands.
10062 1.1.1.3 mrg (define_expand "@aarch64_sve_<inc_dec><SI_ONLY:mode><PRED_ALL:mode>_cntp"
10063 1.1.1.3 mrg [(set (match_operand:DI 0 "register_operand")
10064 1.1.1.3 mrg (<paired_extend>:DI
10065 1.1.1.3 mrg (SAT_MINUS:SI
10066 1.1.1.3 mrg (match_operand:SI_ONLY 1 "register_operand")
10067 1.1.1.3 mrg (unspec:SI [(match_dup 3)
10068 1.1.1.3 mrg (const_int SVE_KNOWN_PTRUE)
10069 1.1.1.3 mrg (match_operand:PRED_ALL 2 "register_operand")]
10070 1.1.1.3 mrg UNSPEC_CNTP))))]
10071 1.1.1.3 mrg "TARGET_SVE"
10072 1.1.1.3 mrg {
10073 1.1.1.3 mrg operands[3] = CONSTM1_RTX (<PRED_ALL:MODE>mode);
10074 1.1.1.3 mrg }
10075 1.1.1.3 mrg )
10076 1.1.1.3 mrg
10077 1.1.1.3 mrg (define_insn_and_rewrite "*aarch64_sve_<inc_dec><SI_ONLY:mode><PRED_ALL:mode>_cntp"
10078 1.1.1.3 mrg [(set (match_operand:DI 0 "register_operand" "=r")
10079 1.1.1.3 mrg (<paired_extend>:DI
10080 1.1.1.3 mrg (SAT_MINUS:SI
10081 1.1.1.3 mrg (match_operand:SI_ONLY 1 "register_operand" "0")
10082 1.1.1.3 mrg (unspec:SI [(match_operand 3)
10083 1.1.1.3 mrg (const_int SVE_KNOWN_PTRUE)
10084 1.1.1.3 mrg (match_operand:PRED_ALL 2 "register_operand" "Upa")]
10085 1.1.1.3 mrg UNSPEC_CNTP))))]
10086 1.1.1.2 mrg "TARGET_SVE"
10087 1.1.1.2 mrg {
10088 1.1.1.3 mrg if (<CODE> == SS_MINUS)
10089 1.1.1.3 mrg return "<inc_dec>p\t%x0, %2.<PRED_ALL:Vetype>, %w0";
10090 1.1.1.3 mrg else
10091 1.1.1.3 mrg return "<inc_dec>p\t%w0, %2.<PRED_ALL:Vetype>";
10092 1.1.1.3 mrg }
10093 1.1.1.3 mrg "&& !CONSTANT_P (operands[3])"
10094 1.1.1.3 mrg {
10095 1.1.1.3 mrg operands[3] = CONSTM1_RTX (<PRED_ALL:MODE>mode);
10096 1.1.1.3 mrg }
10097 1.1.1.3 mrg )
10098 1.1.1.2 mrg
10099 1.1.1.3 mrg ;; -------------------------------------------------------------------------
10100 1.1.1.3 mrg ;; ---- [INT] Decrement by the number of elements in a predicate (vector)
10101 1.1.1.3 mrg ;; -------------------------------------------------------------------------
10102 1.1.1.3 mrg ;; Includes:
10103 1.1.1.3 mrg ;; - DECP
10104 1.1.1.3 mrg ;; - SQDECP
10105 1.1.1.3 mrg ;; - UQDECP
10106 1.1.1.3 mrg ;; -------------------------------------------------------------------------
10107 1.1.1.2 mrg
10108 1.1.1.3 mrg ;; Decrement a vector of DIs by the number of set bits in a predicate.
10109 1.1.1.3 mrg ;; See aarch64_sve_cntp for a description of the operands.
10110 1.1.1.3 mrg (define_expand "@aarch64_sve_<inc_dec><mode>_cntp"
10111 1.1.1.3 mrg [(set (match_operand:VNx2DI 0 "register_operand")
10112 1.1.1.3 mrg (ANY_MINUS:VNx2DI
10113 1.1.1.3 mrg (match_operand:VNx2DI_ONLY 1 "register_operand")
10114 1.1.1.3 mrg (vec_duplicate:VNx2DI
10115 1.1.1.3 mrg (zero_extend:DI
10116 1.1.1.3 mrg (unspec:SI
10117 1.1.1.3 mrg [(match_dup 3)
10118 1.1.1.3 mrg (const_int SVE_KNOWN_PTRUE)
10119 1.1.1.3 mrg (match_operand:<VPRED> 2 "register_operand")]
10120 1.1.1.3 mrg UNSPEC_CNTP)))))]
10121 1.1.1.3 mrg "TARGET_SVE"
10122 1.1.1.3 mrg {
10123 1.1.1.3 mrg operands[3] = CONSTM1_RTX (<VPRED>mode);
10124 1.1.1.2 mrg }
10125 1.1.1.2 mrg )
10126 1.1.1.2 mrg
10127 1.1.1.3 mrg (define_insn_and_rewrite "*aarch64_sve_<inc_dec><mode>_cntp"
10128 1.1.1.3 mrg [(set (match_operand:VNx2DI 0 "register_operand" "=w, ?&w")
10129 1.1.1.3 mrg (ANY_MINUS:VNx2DI
10130 1.1.1.3 mrg (match_operand:VNx2DI_ONLY 1 "register_operand" "0, w")
10131 1.1.1.3 mrg (vec_duplicate:VNx2DI
10132 1.1.1.3 mrg (zero_extend:DI
10133 1.1.1.3 mrg (unspec:SI
10134 1.1.1.3 mrg [(match_operand 3)
10135 1.1.1.3 mrg (const_int SVE_KNOWN_PTRUE)
10136 1.1.1.3 mrg (match_operand:<VPRED> 2 "register_operand" "Upa, Upa")]
10137 1.1.1.3 mrg UNSPEC_CNTP)))))]
10138 1.1.1.2 mrg "TARGET_SVE"
10139 1.1.1.3 mrg "@
10140 1.1.1.3 mrg <inc_dec>p\t%0.d, %2
10141 1.1.1.3 mrg movprfx\t%0, %1\;<inc_dec>p\t%0.d, %2"
10142 1.1.1.3 mrg "&& !CONSTANT_P (operands[3])"
10143 1.1.1.2 mrg {
10144 1.1.1.3 mrg operands[3] = CONSTM1_RTX (<VPRED>mode);
10145 1.1.1.3 mrg }
10146 1.1.1.3 mrg [(set_attr "movprfx" "*,yes")]
10147 1.1.1.3 mrg )
10148 1.1.1.2 mrg
10149 1.1.1.3 mrg ;; Decrement a vector of SIs by the number of set bits in a predicate.
10150 1.1.1.3 mrg ;; See aarch64_sve_cntp for a description of the operands.
10151 1.1.1.3 mrg (define_expand "@aarch64_sve_<inc_dec><mode>_cntp"
10152 1.1.1.3 mrg [(set (match_operand:VNx4SI 0 "register_operand")
10153 1.1.1.3 mrg (ANY_MINUS:VNx4SI
10154 1.1.1.3 mrg (match_operand:VNx4SI_ONLY 1 "register_operand")
10155 1.1.1.3 mrg (vec_duplicate:VNx4SI
10156 1.1.1.3 mrg (unspec:SI
10157 1.1.1.3 mrg [(match_dup 3)
10158 1.1.1.3 mrg (const_int SVE_KNOWN_PTRUE)
10159 1.1.1.3 mrg (match_operand:<VPRED> 2 "register_operand")]
10160 1.1.1.3 mrg UNSPEC_CNTP))))]
10161 1.1.1.3 mrg "TARGET_SVE"
10162 1.1.1.3 mrg {
10163 1.1.1.3 mrg operands[3] = CONSTM1_RTX (<VPRED>mode);
10164 1.1.1.3 mrg }
10165 1.1.1.3 mrg )
10166 1.1.1.2 mrg
10167 1.1.1.3 mrg (define_insn_and_rewrite "*aarch64_sve_<inc_dec><mode>_cntp"
10168 1.1.1.3 mrg [(set (match_operand:VNx4SI 0 "register_operand" "=w, ?&w")
10169 1.1.1.3 mrg (ANY_MINUS:VNx4SI
10170 1.1.1.3 mrg (match_operand:VNx4SI_ONLY 1 "register_operand" "0, w")
10171 1.1.1.3 mrg (vec_duplicate:VNx4SI
10172 1.1.1.3 mrg (unspec:SI
10173 1.1.1.3 mrg [(match_operand 3)
10174 1.1.1.3 mrg (const_int SVE_KNOWN_PTRUE)
10175 1.1.1.3 mrg (match_operand:<VPRED> 2 "register_operand" "Upa, Upa")]
10176 1.1.1.3 mrg UNSPEC_CNTP))))]
10177 1.1.1.3 mrg "TARGET_SVE"
10178 1.1.1.3 mrg "@
10179 1.1.1.3 mrg <inc_dec>p\t%0.s, %2
10180 1.1.1.3 mrg movprfx\t%0, %1\;<inc_dec>p\t%0.s, %2"
10181 1.1.1.3 mrg "&& !CONSTANT_P (operands[3])"
10182 1.1.1.3 mrg {
10183 1.1.1.3 mrg operands[3] = CONSTM1_RTX (<VPRED>mode);
10184 1.1.1.3 mrg }
10185 1.1.1.3 mrg [(set_attr "movprfx" "*,yes")]
10186 1.1.1.3 mrg )
10187 1.1.1.3 mrg
10188 1.1.1.3 mrg ;; Decrement a vector of HIs by the number of set bits in a predicate.
10189 1.1.1.3 mrg ;; See aarch64_sve_cntp for a description of the operands.
10190 1.1.1.3 mrg (define_expand "@aarch64_sve_<inc_dec><mode>_cntp"
10191 1.1.1.3 mrg [(set (match_operand:VNx8HI 0 "register_operand")
10192 1.1.1.3 mrg (ANY_MINUS:VNx8HI
10193 1.1.1.3 mrg (match_operand:VNx8HI_ONLY 1 "register_operand")
10194 1.1.1.3 mrg (vec_duplicate:VNx8HI
10195 1.1.1.3 mrg (truncate:HI
10196 1.1.1.3 mrg (unspec:SI
10197 1.1.1.3 mrg [(match_dup 3)
10198 1.1.1.3 mrg (const_int SVE_KNOWN_PTRUE)
10199 1.1.1.3 mrg (match_operand:<VPRED> 2 "register_operand")]
10200 1.1.1.3 mrg UNSPEC_CNTP)))))]
10201 1.1.1.3 mrg "TARGET_SVE"
10202 1.1.1.3 mrg {
10203 1.1.1.3 mrg operands[3] = CONSTM1_RTX (<VPRED>mode);
10204 1.1.1.3 mrg }
10205 1.1.1.3 mrg )
10206 1.1.1.3 mrg
10207 1.1.1.3 mrg (define_insn_and_rewrite "*aarch64_sve_<inc_dec><mode>_cntp"
10208 1.1.1.3 mrg [(set (match_operand:VNx8HI 0 "register_operand" "=w, ?&w")
10209 1.1.1.3 mrg (ANY_MINUS:VNx8HI
10210 1.1.1.3 mrg (match_operand:VNx8HI_ONLY 1 "register_operand" "0, w")
10211 1.1.1.3 mrg (vec_duplicate:VNx8HI
10212 1.1.1.3 mrg (match_operator:HI 3 "subreg_lowpart_operator"
10213 1.1.1.3 mrg [(unspec:SI
10214 1.1.1.3 mrg [(match_operand 4)
10215 1.1.1.3 mrg (const_int SVE_KNOWN_PTRUE)
10216 1.1.1.3 mrg (match_operand:<VPRED> 2 "register_operand" "Upa, Upa")]
10217 1.1.1.3 mrg UNSPEC_CNTP)]))))]
10218 1.1.1.3 mrg "TARGET_SVE"
10219 1.1.1.3 mrg "@
10220 1.1.1.3 mrg <inc_dec>p\t%0.h, %2
10221 1.1.1.3 mrg movprfx\t%0, %1\;<inc_dec>p\t%0.h, %2"
10222 1.1.1.3 mrg "&& !CONSTANT_P (operands[4])"
10223 1.1.1.3 mrg {
10224 1.1.1.3 mrg operands[4] = CONSTM1_RTX (<VPRED>mode);
10225 1.1.1.2 mrg }
10226 1.1.1.3 mrg [(set_attr "movprfx" "*,yes")]
10227 1.1.1.2 mrg )
10228