Debian Codegraph @

gcc/config/arm/constraints.md

raw
1 ;; Constraint definitions for ARM and Thumb
2 ;; Copyright (C) 2006-2025 Free Software Foundation, Inc.
3 ;; Contributed by ARM Ltd.
4
5 ;; This file is part of GCC.
6
7 ;; GCC is free software; you can redistribute it and/or modify it
8 ;; under the terms of the GNU General Public License as published
9 ;; by the Free Software Foundation; either version 3, or (at your
10 ;; option) any later version.
11
12 ;; GCC is distributed in the hope that it will be useful, but WITHOUT
13 ;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14 ;; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
15 ;; License for more details.
16
17 ;; You should have received a copy of the GNU General Public License
18 ;; along with GCC; see the file COPYING3. If not see
19 ;; <http://www.gnu.org/licenses/>.
20
21 ;; The following register constraints have been used:
22 ;; - in ARM/Thumb-2 state: t, w, x, y, z
23 ;; - in Thumb state: h, b
24 ;; - in both states: l, c, k, q, Cs, Ts, US
25 ;; In ARM state, 'l' is an alias for 'r'
26 ;; 'f' and 'v' were previously used for FPA and MAVERICK registers.
27
28 ;; The following normal constraints have been used:
29 ;; in ARM/Thumb-2 state: G, I, j, J, K, L, M
30 ;; in Thumb-1 state: I, J, K, L, M, N, O
31 ;; 'H' was previously used for FPA.
32
33 ;; The following multi-letter normal constraints have been used:
34 ;; in ARM/Thumb-2 state: Da, Db, Dc, Dd, Dn, DN, Dm, Dl, DL, Do, Dv, Dy, Di,
35 ;; Dj, Ds, Dt, Dp, Dz, Tu, Te
36 ;; in Thumb-1 state: Pa, Pb, Pc, Pd, Pe
37 ;; in Thumb-2 state: Ha, Pg, Ph, Pj, PJ, Ps, Pt, Pu, Pv, Pw, Px, Py, Pz, Ra,
38 ;; Rb, Rd, Rf, Rg, Ri
39
40 ;; The following memory constraints have been used:
41 ;; in ARM/Thumb-2 state: Uh, Ut, Uv, Uy, Un, Um, Us, Uo, Up, Uf, Ux, Ul, Uz
42 ;; in ARM state: Uq
43 ;; in Thumb state: Uu, Uw
44 ;; in all states: Q
45
46 (define_register_constraint "Up" "TARGET_HAVE_MVE ? VPR_REG : NO_REGS"
47 "MVE VPR register")
48
49 (define_memory_constraint "Ul"
50 "@internal
51 In ARM/Thumb-2 state a valid address for load instruction with XEXP (op, 0)
52 being label of the literal data item to be loaded."
53 (and (match_code "mem")
54 (match_test "TARGET_HAVE_MVE && reload_completed
55 && (GET_CODE (XEXP (op, 0)) == LABEL_REF
56 || (GET_CODE (XEXP (op, 0)) == CONST
57 && GET_CODE (XEXP (XEXP (op, 0), 0)) == PLUS
58 && GET_CODE (XEXP (XEXP (XEXP (op, 0), 0), 0)) == LABEL_REF
59 && CONST_INT_P (XEXP (XEXP (XEXP (op, 0), 0), 1))))")))
60
61 (define_register_constraint "Uf" "TARGET_HAVE_MVE ? VFPCC_REG : NO_REGS"
62 "MVE FPCCR register")
63
64 (define_register_constraint "Te" "TARGET_HAVE_MVE ? EVEN_REG : NO_REGS"
65 "EVEN core registers @code{r0}, @code{r2}, @code{r4}, @code{r6}, @code{r8},
66 @code{r10}, @code{r12}, @code{r14}")
67
68 (define_constraint "Rd"
69 "@internal In Thumb-2 state a constant in range 1 to 16"
70 (and (match_code "const_int")
71 (match_test "TARGET_HAVE_MVE && ival >= 1 && ival <= 16")))
72
73 (define_constraint "Ra"
74 "@internal In Thumb-2 state a constant in range 0 to 7"
75 (and (match_code "const_int")
76 (match_test "TARGET_HAVE_MVE && ival >= 0 && ival <= 7")))
77
78 (define_constraint "Rb"
79 "@internal In Thumb-2 state a constant in range 1 to 8"
80 (and (match_code "const_int")
81 (match_test "TARGET_HAVE_MVE && ival >= 1 && ival <= 8")))
82
83 (define_constraint "Rc"
84 "@internal In Thumb-2 state a constant in range 0 to 15"
85 (and (match_code "const_int")
86 (match_test "TARGET_HAVE_MVE && ival >= 0 && ival <= 15")))
87
88 (define_constraint "Re"
89 "@internal In Thumb-2 state a constant in range 0 to 31"
90 (and (match_code "const_int")
91 (match_test "TARGET_HAVE_MVE && ival >= 0 && ival <= 31")))
92
93 (define_constraint "Rf"
94 "@internal In Thumb-2 state a constant in range 1 to 32"
95 (and (match_code "const_int")
96 (match_test "TARGET_HAVE_MVE && ival >= 1 && ival <= 32")))
97
98 (define_constraint "Rg"
99 "@internal In Thumb-2 state a constant is one among 1, 2, 4 and 8"
100 (and (match_code "const_int")
101 (match_test "TARGET_HAVE_MVE && ((ival == 1) || (ival == 2)
102 || (ival == 4) || (ival == 8))")))
103
104 (define_register_constraint "t" "TARGET_32BIT ? VFP_LO_REGS : NO_REGS"
105 "The VFP registers @code{s0}-@code{s31}.")
106
107 (define_register_constraint "w"
108 "TARGET_32BIT ? (TARGET_VFPD32 ? VFP_REGS : VFP_LO_REGS) : NO_REGS"
109 "The VFP registers @code{d0}-@code{d15}, or @code{d0}-@code{d31} for VFPv3.")
110
111 (define_register_constraint "x" "TARGET_32BIT ? VFP_D0_D7_REGS : NO_REGS"
112 "The VFP registers @code{d0}-@code{d7}.")
113
114 (define_register_constraint "y" "TARGET_REALLY_IWMMXT ? IWMMXT_REGS : NO_REGS"
115 "The Intel iWMMX co-processor registers.")
116
117 (define_register_constraint "z"
118 "TARGET_REALLY_IWMMXT ? IWMMXT_GR_REGS : NO_REGS"
119 "The Intel iWMMX GR registers.")
120
121 (define_register_constraint "l" "TARGET_THUMB ? LO_REGS : GENERAL_REGS"
122 "In Thumb state the core registers @code{r0}-@code{r7}.")
123
124 (define_register_constraint "h" "TARGET_THUMB ? HI_REGS : NO_REGS"
125 "In Thumb state the core registers @code{r8}-@code{r15}.")
126
127 (define_constraint "j"
128 "A constant suitable for a MOVW instruction. (ARM/Thumb-2)"
129 (and (match_test "TARGET_HAVE_MOVT")
130 (ior (and (match_code "high")
131 (match_test "arm_valid_symbolic_address_p (XEXP (op, 0))"))
132 (and (match_code "const_int")
133 (match_test "(ival & 0xffff0000) == 0")))))
134
135 (define_constraint "Pj"
136 "@internal A 12-bit constant suitable for an ADDW or SUBW instruction. (Thumb-2)"
137 (and (match_code "const_int")
138 (and (match_test "TARGET_THUMB2")
139 (match_test "(ival & 0xfffff000) == 0"))))
140
141 (define_constraint "PJ"
142 "@internal A constant that satisfies the Pj constrant if negated."
143 (and (match_code "const_int")
144 (and (match_test "TARGET_THUMB2")
145 (match_test "((-ival) & 0xfffff000) == 0"))))
146
147 (define_register_constraint "k" "STACK_REG"
148 "@internal The stack register.")
149
150 (define_register_constraint "b" "TARGET_THUMB ? BASE_REGS : NO_REGS"
151 "@internal
152 Thumb only. The union of the low registers and the stack register.")
153
154 (define_constraint "c"
155 "@internal The condition code register."
156 (match_operand 0 "cc_register"))
157
158 (define_register_constraint "Cs" "CALLER_SAVE_REGS"
159 "@internal The caller save registers. Useful for sibcalls.")
160
161 (define_constraint "I"
162 "In ARM/Thumb-2 state a constant that can be used as an immediate value in a
163 Data Processing instruction. In Thumb-1 state a constant in the range
164 0-255."
165 (and (match_code "const_int")
166 (match_test "TARGET_32BIT ? const_ok_for_arm (ival)
167 : ival >= 0 && ival <= 255")))
168
169 (define_constraint "J"
170 "In ARM/Thumb-2 state a constant in the range @minus{}4095-4095. In Thumb-1
171 state a constant in the range @minus{}255-@minus{}1."
172 (and (match_code "const_int")
173 (match_test "TARGET_32BIT ? (ival >= -4095 && ival <= 4095)
174 : (ival >= -255 && ival <= -1)")))
175
176 (define_constraint "K"
177 "In ARM/Thumb-2 state a constant that satisfies the @code{I} constraint if
178 inverted. In Thumb-1 state a constant that satisfies the @code{I}
179 constraint multiplied by any power of 2."
180 (and (match_code "const_int")
181 (match_test "TARGET_32BIT ? const_ok_for_arm (~ival)
182 : thumb_shiftable_const (ival)")))
183
184 (define_constraint "L"
185 "In ARM/Thumb-2 state a constant that satisfies the @code{I} constraint if
186 negated. In Thumb-1 state a constant in the range @minus{}7-7."
187 (and (match_code "const_int")
188 (match_test "TARGET_32BIT ? const_ok_for_arm (-ival)
189 : (ival >= -7 && ival <= 7)")))
190
191 ;; The ARM state version is internal...
192 ;; @internal In ARM/Thumb-2 state a constant in the range 0-32 or any
193 ;; power of 2.
194 (define_constraint "M"
195 "In Thumb-1 state a constant that is a multiple of 4 in the range 0-1020."
196 (and (match_code "const_int")
197 (match_test "TARGET_32BIT ? ((ival >= 0 && ival <= 32)
198 || (((ival & (ival - 1)) & 0xFFFFFFFF) == 0))
199 : ival >= 0 && ival <= 1020 && (ival & 3) == 0")))
200
201 (define_constraint "N"
202 "Thumb-1 state a constant in the range 0-31."
203 (and (match_code "const_int")
204 (match_test "!TARGET_32BIT && (ival >= 0 && ival <= 31)")))
205
206 (define_constraint "O"
207 "In Thumb-1 state a constant that is a multiple of 4 in the range
208 @minus{}508-508."
209 (and (match_code "const_int")
210 (match_test "TARGET_THUMB1 && ival >= -508 && ival <= 508
211 && ((ival & 3) == 0)")))
212
213 (define_constraint "Pa"
214 "@internal In Thumb-1 state a constant in the range -510 to +510"
215 (and (match_code "const_int")
216 (match_test "TARGET_THUMB1 && ival >= -510 && ival <= 510
217 && (ival > 255 || ival < -255)")))
218
219 (define_constraint "Pb"
220 "@internal In Thumb-1 state a constant in the range -262 to +262"
221 (and (match_code "const_int")
222 (match_test "TARGET_THUMB1 && ival >= -262 && ival <= 262
223 && (ival > 255 || ival < -255)")))
224
225 (define_constraint "Pc"
226 "@internal In Thumb-1 state a constant that is in the range 1021 to 1275"
227 (and (match_code "const_int")
228 (match_test "TARGET_THUMB1
229 && ival > 1020 && ival <= 1275")))
230
231 (define_constraint "Pd"
232 "@internal In Thumb state a constant in the range 0 to 7"
233 (and (match_code "const_int")
234 (match_test "TARGET_THUMB && ival >= 0 && ival <= 7")))
235
236 (define_constraint "Pe"
237 "@internal In Thumb-1 state a constant in the range 256 to +510"
238 (and (match_code "const_int")
239 (match_test "TARGET_THUMB1 && ival >= 256 && ival <= 510")))
240
241 (define_constraint "Pg"
242 "@internal In Thumb-2 state a constant in range 1 to 32"
243 (and (match_code "const_int")
244 (match_test "TARGET_THUMB2 && ival >= 1 && ival <= 32")))
245
246 (define_constraint "Ph"
247 "@internal In Thumb-2 state a constant in range 32 to 255"
248 (and (match_code "const_int")
249 (match_test "TARGET_THUMB2 && ival >= 32 && ival <= 255")))
250
251 (define_constraint "Ps"
252 "@internal In Thumb-2 state a constant in the range -255 to +255"
253 (and (match_code "const_int")
254 (match_test "TARGET_THUMB2 && ival >= -255 && ival <= 255")))
255
256 (define_constraint "Pt"
257 "@internal In Thumb-2 state a constant in the range -7 to +7"
258 (and (match_code "const_int")
259 (match_test "TARGET_THUMB2 && ival >= -7 && ival <= 7")))
260
261 (define_constraint "Pu"
262 "@internal In Thumb-2 state a constant in the range +1 to +8"
263 (and (match_code "const_int")
264 (match_test "TARGET_THUMB2 && ival >= 1 && ival <= 8")))
265
266 (define_constraint "Pv"
267 "@internal In Thumb-2 state a constant in the range -255 to 0"
268 (and (match_code "const_int")
269 (match_test "TARGET_THUMB2 && ival >= -255 && ival <= 0")))
270
271 (define_constraint "Pw"
272 "@internal In Thumb-2 state a constant in the range -255 to -1"
273 (and (match_code "const_int")
274 (match_test "TARGET_THUMB2 && ival >= -255 && ival <= -1")))
275
276 (define_constraint "Px"
277 "@internal In Thumb-2 state a constant in the range -7 to -1"
278 (and (match_code "const_int")
279 (match_test "TARGET_THUMB2 && ival >= -7 && ival <= -1")))
280
281 (define_constraint "Py"
282 "@internal In Thumb-2 state a constant in the range 0 to 255"
283 (and (match_code "const_int")
284 (match_test "TARGET_THUMB2 && ival >= 0 && ival <= 255")))
285
286 (define_constraint "Pz"
287 "@internal In Thumb-2 state the constant 0"
288 (and (match_code "const_int")
289 (match_test "TARGET_THUMB2 && (ival == 0)")))
290
291 (define_constraint "G"
292 "In ARM/Thumb-2 state the floating-point constant 0."
293 (and (match_code "const_double")
294 (match_test "TARGET_32BIT && arm_const_double_rtx (op)")))
295
296 (define_constraint "Ha"
297 "@internal In ARM / Thumb-2 a float constant iff literal pools are allowed."
298 (and (match_code "const_double")
299 (match_test "satisfies_constraint_E (op)")
300 (match_test "!arm_disable_literal_pool")))
301
302 (define_constraint "Dz"
303 "@internal
304 In ARM/Thumb-2 state a vector of constant zeros."
305 (and (match_code "const_vector")
306 (match_test "(TARGET_NEON || TARGET_HAVE_MVE) && op == CONST0_RTX (mode)")))
307
308 (define_constraint "DB"
309 "@internal
310 In ARM/Thumb-2 state with MVE a constant vector of booleans."
311 (and (match_code "const_vector")
312 (match_test "TARGET_HAVE_MVE && VALID_MVE_PRED_MODE (mode)")))
313
314 (define_constraint "Da"
315 "@internal
316 In ARM/Thumb-2 state a const_int, const_double or const_vector that can
317 be generated with two Data Processing insns."
318 (and (match_code "const_double,const_int,const_vector")
319 (match_test "TARGET_32BIT && arm_const_double_inline_cost (op) == 2")))
320
321 (define_constraint "Db"
322 "@internal
323 In ARM/Thumb-2 state a const_int, const_double or const_vector that can
324 be generated with three Data Processing insns."
325 (and (match_code "const_double,const_int,const_vector")
326 (match_test "TARGET_32BIT && arm_const_double_inline_cost (op) == 3")))
327
328 (define_constraint "Dc"
329 "@internal
330 In ARM/Thumb-2 state a const_int, const_double or const_vector that can
331 be generated with four Data Processing insns. This pattern is disabled
332 if optimizing for space or when we have load-delay slots to fill."
333 (and (match_code "const_double,const_int,const_vector")
334 (match_test "TARGET_32BIT && arm_const_double_inline_cost (op) == 4
335 && !(optimize_size || arm_ld_sched)")))
336
337 (define_constraint "Dd"
338 "@internal
339 In ARM/Thumb-2 state a const_int that can be used by insn adddi."
340 (and (match_code "const_int")
341 (match_test "TARGET_32BIT && const_ok_for_dimode_op (ival, PLUS)")))
342
343 (define_constraint "Di"
344 "@internal
345 In ARM/Thumb-2 state a const_int or const_double where both the high
346 and low SImode words can be generated as immediates in 32-bit instructions."
347 (and (match_code "const_double,const_int")
348 (match_test "TARGET_32BIT && arm_const_double_by_immediates (op)")))
349
350 (define_constraint "Dj"
351 "@internal
352 In cores with the v6t2 ISA, a constant with exactly one consecutive
353 string of zero bits."
354 (and (match_code "const_int")
355 (match_test "arm_arch_thumb2
356 && exact_log2 (~ival + (~ival & -~ival)) >= 0")))
357
358 (define_constraint "Dm"
359 "@internal
360 In ARM/Thumb-2 state a const_vector which can be loaded with a Neon vmov
361 immediate instruction."
362 (and (match_code "const_vector")
363 (match_test "TARGET_32BIT
364 && imm_for_neon_mov_operand (op, GET_MODE (op))")))
365
366 (define_constraint "Dn"
367 "@internal
368 In ARM/Thumb-2 state a DImode const_int which can be loaded with a Neon vmov
369 immediate instruction."
370 (and (match_code "const_int")
371 (match_test "TARGET_32BIT && imm_for_neon_mov_operand (op, DImode)")))
372
373 (define_constraint "DN"
374 "@internal
375 In ARM/Thumb-2 state a TImode const_int which can be loaded with a Neon vmov
376 immediate instruction."
377 (and (match_code "const_int")
378 (match_test "TARGET_32BIT && imm_for_neon_mov_operand (op, TImode)")))
379
380 (define_constraint "Dl"
381 "@internal
382 In ARM/Thumb-2 state a const_vector which can be used with a Neon vorr or
383 vbic instruction."
384 (and (match_code "const_vector")
385 (match_test "TARGET_32BIT
386 && imm_for_neon_logic_operand (op, GET_MODE (op))")))
387
388 (define_constraint "DL"
389 "@internal
390 In ARM/Thumb-2 state a const_vector which can be used with a Neon vorn or
391 vand instruction."
392 (and (match_code "const_vector")
393 (match_test "TARGET_32BIT
394 && imm_for_neon_inv_logic_operand (op, GET_MODE (op))")))
395
396 (define_constraint "Do"
397 "@internal
398 In ARM/Thumb2 state valid offset for an ldrd/strd instruction."
399 (and (match_code "const_int")
400 (match_test "TARGET_LDRD && offset_ok_for_ldrd_strd (ival)")))
401
402 (define_constraint "Dv"
403 "@internal
404 In ARM/Thumb-2 state a const_double which can be used with a VFP fconsts
405 instruction."
406 (and (match_code "const_double")
407 (match_test "TARGET_32BIT && vfp3_const_double_rtx (op)")))
408
409 (define_constraint "Dy"
410 "@internal
411 In ARM/Thumb-2 state a const_double which can be used with a VFP fconstd
412 instruction."
413 (and (match_code "const_double")
414 (match_test "TARGET_32BIT && TARGET_VFP_DOUBLE && vfp3_const_double_rtx (op)")))
415
416 (define_constraint "Dt"
417 "@internal
418 In ARM/ Thumb2 a const_double which can be used with a vcvt.f32.s32 with fract bits operation"
419 (and (match_code "const_double")
420 (match_test "TARGET_32BIT && vfp3_const_double_for_fract_bits (op)")))
421
422 (define_constraint "Ds"
423 "@internal
424 In ARM/Thumb-2 state a const_vector which can be used as immediate
425 in vshl instruction."
426 (and (match_code "const_vector")
427 (match_test "TARGET_32BIT
428 && imm_for_neon_lshift_operand (op, GET_MODE (op))")))
429
430 (define_constraint "Dp"
431 "@internal
432 In ARM/ Thumb2 a const_double which can be used with a vcvt.s32.f32 with bits operation"
433 (and (match_code "const_double")
434 (match_test "TARGET_32BIT
435 && vfp3_const_double_for_bits (op) > 0")))
436
437 (define_constraint "Tu"
438 "@internal In ARM / Thumb-2 an integer constant iff literal pools are
439 allowed."
440 (and (match_test "CONSTANT_P (op)")
441 (match_test "!arm_disable_literal_pool")))
442
443 (define_register_constraint "Ts" "(arm_restrict_it) ? LO_REGS : GENERAL_REGS"
444 "For arm_restrict_it the core registers @code{r0}-@code{r7}. GENERAL_REGS otherwise.")
445
446 (define_memory_constraint "Ua"
447 "@internal
448 An address valid for loading/storing register exclusive"
449 (match_operand 0 "mem_noofs_operand"))
450
451 (define_memory_constraint "Uh"
452 "@internal
453 An address suitable for byte and half-word loads which does not point inside a constant pool"
454 (and (match_code "mem")
455 (match_test "arm_legitimate_address_p (GET_MODE (op), XEXP (op, 0), false) && !arm_is_constant_pool_ref (op)")))
456
457 (define_memory_constraint "Ut"
458 "@internal
459 In ARM/Thumb-2 state an address valid for loading/storing opaque structure
460 types wider than TImode."
461 (and (match_code "mem")
462 (match_test "TARGET_32BIT && neon_struct_mem_operand (op)")))
463
464 (define_memory_constraint "Uv"
465 "@internal
466 In ARM/Thumb-2 state a valid VFP load/store address."
467 (and (match_code "mem")
468 (match_test "TARGET_32BIT && arm_coproc_mem_operand (op, FALSE)")))
469
470 (define_memory_constraint "Ug"
471 "@internal
472 In Thumb-2 state a valid MVE struct load/store address."
473 (match_operand 0 "mve_struct_operand"))
474
475 (define_memory_constraint "Uj"
476 "@internal
477 In ARM/Thumb-2 state a VFP load/store address that supports writeback
478 for Neon but not for MVE or VFP_FP16INST"
479 (and (match_code "mem")
480 (match_test "TARGET_32BIT
481 && (arm_coproc_mem_operand_no_writeback (op)
482 || (TARGET_NEON_FP16
483 && neon_vector_mem_operand (op, 2, true)))")))
484
485 (define_memory_constraint "Uy"
486 "@internal
487 In ARM/Thumb-2 state a valid iWMMX load/store address."
488 (and (match_code "mem")
489 (match_test "TARGET_32BIT && arm_coproc_mem_operand (op, TRUE)")))
490
491 (define_memory_constraint "Un"
492 "@internal
493 In ARM/Thumb-2 state a valid address for Neon doubleword vector
494 load/store instructions."
495 (and (match_code "mem")
496 (match_test "TARGET_32BIT && neon_vector_mem_operand (op, 0, true)")))
497
498 (define_memory_constraint "Um"
499 "@internal
500 In ARM/Thumb-2 state a valid address for Neon element and structure
501 load/store instructions."
502 (and (match_code "mem")
503 (match_test "TARGET_32BIT && neon_vector_mem_operand (op, 2, true)")))
504
505 (define_memory_constraint "Us"
506 "@internal
507 In ARM/Thumb-2 state a valid address for non-offset loads/stores of
508 quad-word values in four ARM registers."
509 (and (match_code "mem")
510 (match_test "TARGET_32BIT && neon_vector_mem_operand (op, 1, true)")))
511
512 (define_memory_constraint "Ux"
513 "@internal
514 In ARM/Thumb-2 state a valid address and load into CORE regs or only to
515 LO_REGS based on mode of op."
516 (and (match_code "mem")
517 (match_test "(TARGET_HAVE_MVE || TARGET_HAVE_MVE_FLOAT)
518 && mve_vector_mem_operand (GET_MODE (op),
519 XEXP (op, 0), true)")))
520
521 (define_constraint "Ui"
522 "@internal
523 Match a constant (as per the 'i' constraint) provided that we have the
524 literal pool available. This is useful for load insns that would need
525 to move such constants to the literal pool after RA."
526 (match_test "!arm_disable_literal_pool && satisfies_constraint_i (op)"))
527
528 (define_memory_constraint "Uq"
529 "@internal
530 In ARM state an address valid in ldrsb instructions."
531 (and (match_code "mem")
532 (match_test "TARGET_ARM
533 && arm_legitimate_address_outer_p (GET_MODE (op), XEXP (op, 0),
534 SIGN_EXTEND, 0)
535 && !arm_is_constant_pool_ref (op)")))
536
537 (define_memory_constraint "Q"
538 "@internal
539 An address that is a single base register."
540 (and (match_code "mem")
541 (match_test "REG_P (XEXP (op, 0))")))
542
543 (define_memory_constraint "Uu"
544 "@internal
545 In Thumb state an address that is valid in 16bit encoding."
546 (and (match_code "mem")
547 (match_test "TARGET_THUMB
548 && thumb1_legitimate_address_p (GET_MODE (op), XEXP (op, 0),
549 0)")))
550
551 ; The 16-bit post-increment LDR/STR accepted by thumb1_legitimate_address_p
552 ; are actually LDM/STM instructions, so cannot be used to access unaligned
553 ; data.
554 (define_memory_constraint "Uw"
555 "@internal
556 In Thumb state an address that is valid in 16bit encoding, and that can be
557 used for unaligned accesses."
558 (and (match_code "mem")
559 (match_test "TARGET_THUMB
560 && thumb1_legitimate_address_p (GET_MODE (op), XEXP (op, 0),
561 0)
562 && GET_CODE (XEXP (op, 0)) != POST_INC")))
563
564 (define_constraint "US"
565 "@internal
566 US is a symbol reference."
567 (match_code "symbol_ref")
568 )
569
570 ;; True if the immediate is the range +/- 1016 and multiple of 8 for MVE.
571 (define_constraint "Ri"
572 "@internal In Thumb-2 state a constant is multiple of 8 and in range
573 of -/+ 1016 for MVE"
574 (and (match_code "const_int")
575 (match_test "TARGET_HAVE_MVE && (-1016 <= ival) && (ival <= 1016)
576 && ((ival % 8) == 0)")))
577
578 ;; True if the immediate is multiple of 2 and in range of -/+ 252 for MVE.
579 (define_constraint "Rl"
580 "@internal In Thumb-2 state a constant is multiple of 2 and in range
581 of -/+ 252 for MVE"
582 (and (match_code "const_int")
583 (match_test "TARGET_HAVE_MVE && (-252 <= ival) && (ival <= 252)
584 && ((ival % 2) == 0)")))
585
586 (define_memory_constraint "Uz"
587 "@internal
588 A memory access that is accessible as an LDC/STC operand"
589 (and (match_code "mem")
590 (match_test "arm_coproc_ldc_stc_legitimate_address (op)")))
591
592 (define_memory_constraint "Uo"
593 "@internal
594 A memory operand for Arm/Thumb-2 LDRD/STRD"
595 (and (match_code "mem")
596 (match_test "arm_ldrd_legitimate_address (op)")))
597
598 ;; We used to have constraint letters for S and R in ARM state, but
599 ;; all uses of these now appear to have been removed.
600
601 ;; Additionally, we used to have a Q constraint in Thumb state, but
602 ;; this wasn't really a valid memory constraint. Again, all uses of
603 ;; this now seem to have been removed.
604