annotate gcc/config/aarch64/constraints.md @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children 84e7813d76e9
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 ;; Machine description for AArch64 architecture.
kono
parents:
diff changeset
2 ;; Copyright (C) 2009-2017 Free Software Foundation, Inc.
kono
parents:
diff changeset
3 ;; Contributed by ARM Ltd.
kono
parents:
diff changeset
4 ;;
kono
parents:
diff changeset
5 ;; This file is part of GCC.
kono
parents:
diff changeset
6 ;;
kono
parents:
diff changeset
7 ;; GCC is free software; you can redistribute it and/or modify it
kono
parents:
diff changeset
8 ;; under the terms of the GNU General Public License as published by
kono
parents:
diff changeset
9 ;; the Free Software Foundation; either version 3, or (at your option)
kono
parents:
diff changeset
10 ;; any later version.
kono
parents:
diff changeset
11 ;;
kono
parents:
diff changeset
12 ;; GCC is distributed in the hope that it will be useful, but
kono
parents:
diff changeset
13 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
kono
parents:
diff changeset
14 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
kono
parents:
diff changeset
15 ;; General Public License for more details.
kono
parents:
diff changeset
16 ;;
kono
parents:
diff changeset
17 ;; You should have received a copy of the GNU General Public License
kono
parents:
diff changeset
18 ;; along with GCC; see the file COPYING3. If not see
kono
parents:
diff changeset
19 ;; <http://www.gnu.org/licenses/>.
kono
parents:
diff changeset
20
kono
parents:
diff changeset
21 (define_register_constraint "k" "STACK_REG"
kono
parents:
diff changeset
22 "@internal The stack register.")
kono
parents:
diff changeset
23
kono
parents:
diff changeset
24 (define_register_constraint "Ucs" "CALLER_SAVE_REGS"
kono
parents:
diff changeset
25 "@internal The caller save registers.")
kono
parents:
diff changeset
26
kono
parents:
diff changeset
27 (define_register_constraint "w" "FP_REGS"
kono
parents:
diff changeset
28 "Floating point and SIMD vector registers.")
kono
parents:
diff changeset
29
kono
parents:
diff changeset
30 (define_register_constraint "x" "FP_LO_REGS"
kono
parents:
diff changeset
31 "Floating point and SIMD vector registers V0 - V15.")
kono
parents:
diff changeset
32
kono
parents:
diff changeset
33 (define_constraint "I"
kono
parents:
diff changeset
34 "A constant that can be used with an ADD operation."
kono
parents:
diff changeset
35 (and (match_code "const_int")
kono
parents:
diff changeset
36 (match_test "aarch64_uimm12_shift (ival)")))
kono
parents:
diff changeset
37
kono
parents:
diff changeset
38 (define_constraint "Upl"
kono
parents:
diff changeset
39 "@internal A constant that matches two uses of add instructions."
kono
parents:
diff changeset
40 (and (match_code "const_int")
kono
parents:
diff changeset
41 (match_test "aarch64_pluslong_strict_immedate (op, VOIDmode)")))
kono
parents:
diff changeset
42
kono
parents:
diff changeset
43 (define_constraint "J"
kono
parents:
diff changeset
44 "A constant that can be used with a SUB operation (once negated)."
kono
parents:
diff changeset
45 (and (match_code "const_int")
kono
parents:
diff changeset
46 (match_test "aarch64_uimm12_shift (-ival)")))
kono
parents:
diff changeset
47
kono
parents:
diff changeset
48 ;; We can't use the mode of a CONST_INT to determine the context in
kono
parents:
diff changeset
49 ;; which it is being used, so we must have a separate constraint for
kono
parents:
diff changeset
50 ;; each context.
kono
parents:
diff changeset
51
kono
parents:
diff changeset
52 (define_constraint "K"
kono
parents:
diff changeset
53 "A constant that can be used with a 32-bit logical operation."
kono
parents:
diff changeset
54 (and (match_code "const_int")
kono
parents:
diff changeset
55 (match_test "aarch64_bitmask_imm (ival, SImode)")))
kono
parents:
diff changeset
56
kono
parents:
diff changeset
57 (define_constraint "L"
kono
parents:
diff changeset
58 "A constant that can be used with a 64-bit logical operation."
kono
parents:
diff changeset
59 (and (match_code "const_int")
kono
parents:
diff changeset
60 (match_test "aarch64_bitmask_imm (ival, DImode)")))
kono
parents:
diff changeset
61
kono
parents:
diff changeset
62 (define_constraint "M"
kono
parents:
diff changeset
63 "A constant that can be used with a 32-bit MOV immediate operation."
kono
parents:
diff changeset
64 (and (match_code "const_int")
kono
parents:
diff changeset
65 (match_test "aarch64_move_imm (ival, SImode)")))
kono
parents:
diff changeset
66
kono
parents:
diff changeset
67 (define_constraint "N"
kono
parents:
diff changeset
68 "A constant that can be used with a 64-bit MOV immediate operation."
kono
parents:
diff changeset
69 (and (match_code "const_int")
kono
parents:
diff changeset
70 (match_test "aarch64_move_imm (ival, DImode)")))
kono
parents:
diff changeset
71
kono
parents:
diff changeset
72 (define_constraint "UsO"
kono
parents:
diff changeset
73 "A constant that can be used with a 32-bit and operation."
kono
parents:
diff changeset
74 (and (match_code "const_int")
kono
parents:
diff changeset
75 (match_test "aarch64_and_bitmask_imm (ival, SImode)")))
kono
parents:
diff changeset
76
kono
parents:
diff changeset
77 (define_constraint "UsP"
kono
parents:
diff changeset
78 "A constant that can be used with a 64-bit and operation."
kono
parents:
diff changeset
79 (and (match_code "const_int")
kono
parents:
diff changeset
80 (match_test "aarch64_and_bitmask_imm (ival, DImode)")))
kono
parents:
diff changeset
81
kono
parents:
diff changeset
82 (define_constraint "S"
kono
parents:
diff changeset
83 "A constraint that matches an absolute symbolic address."
kono
parents:
diff changeset
84 (and (match_code "const,symbol_ref,label_ref")
kono
parents:
diff changeset
85 (match_test "aarch64_symbolic_address_p (op)")))
kono
parents:
diff changeset
86
kono
parents:
diff changeset
87 (define_constraint "Y"
kono
parents:
diff changeset
88 "Floating point constant zero."
kono
parents:
diff changeset
89 (and (match_code "const_double")
kono
parents:
diff changeset
90 (match_test "aarch64_float_const_zero_rtx_p (op)")))
kono
parents:
diff changeset
91
kono
parents:
diff changeset
92 (define_constraint "Z"
kono
parents:
diff changeset
93 "Integer constant zero."
kono
parents:
diff changeset
94 (match_test "op == const0_rtx"))
kono
parents:
diff changeset
95
kono
parents:
diff changeset
96 (define_constraint "Ush"
kono
parents:
diff changeset
97 "A constraint that matches an absolute symbolic address high part."
kono
parents:
diff changeset
98 (and (match_code "high")
kono
parents:
diff changeset
99 (match_test "aarch64_valid_symref (XEXP (op, 0), GET_MODE (XEXP (op, 0)))")))
kono
parents:
diff changeset
100
kono
parents:
diff changeset
101 (define_constraint "Usa"
kono
parents:
diff changeset
102 "@internal
kono
parents:
diff changeset
103 A constraint that matches an absolute symbolic address that can be
kono
parents:
diff changeset
104 loaded by a single ADR."
kono
parents:
diff changeset
105 (and (match_code "const,symbol_ref,label_ref")
kono
parents:
diff changeset
106 (match_test "aarch64_symbolic_address_p (op)")
kono
parents:
diff changeset
107 (match_test "aarch64_mov_operand_p (op, GET_MODE (op))")))
kono
parents:
diff changeset
108
kono
parents:
diff changeset
109 (define_constraint "Uss"
kono
parents:
diff changeset
110 "@internal
kono
parents:
diff changeset
111 A constraint that matches an immediate shift constant in SImode."
kono
parents:
diff changeset
112 (and (match_code "const_int")
kono
parents:
diff changeset
113 (match_test "(unsigned HOST_WIDE_INT) ival < 32")))
kono
parents:
diff changeset
114
kono
parents:
diff changeset
115 (define_constraint "Usn"
kono
parents:
diff changeset
116 "A constant that can be used with a CCMN operation (once negated)."
kono
parents:
diff changeset
117 (and (match_code "const_int")
kono
parents:
diff changeset
118 (match_test "IN_RANGE (ival, -31, 0)")))
kono
parents:
diff changeset
119
kono
parents:
diff changeset
120 (define_constraint "Usd"
kono
parents:
diff changeset
121 "@internal
kono
parents:
diff changeset
122 A constraint that matches an immediate shift constant in DImode."
kono
parents:
diff changeset
123 (and (match_code "const_int")
kono
parents:
diff changeset
124 (match_test "(unsigned HOST_WIDE_INT) ival < 64")))
kono
parents:
diff changeset
125
kono
parents:
diff changeset
126 (define_constraint "Usf"
kono
parents:
diff changeset
127 "@internal Usf is a symbol reference under the context where plt stub allowed."
kono
parents:
diff changeset
128 (and (match_code "symbol_ref")
kono
parents:
diff changeset
129 (match_test "!(aarch64_is_noplt_call_p (op)
kono
parents:
diff changeset
130 || aarch64_is_long_call_p (op))")))
kono
parents:
diff changeset
131
kono
parents:
diff changeset
132 (define_constraint "UsM"
kono
parents:
diff changeset
133 "@internal
kono
parents:
diff changeset
134 A constraint that matches the immediate constant -1."
kono
parents:
diff changeset
135 (match_test "op == constm1_rtx"))
kono
parents:
diff changeset
136
kono
parents:
diff changeset
137 (define_constraint "Ui1"
kono
parents:
diff changeset
138 "@internal
kono
parents:
diff changeset
139 A constraint that matches the immediate constant +1."
kono
parents:
diff changeset
140 (match_test "op == const1_rtx"))
kono
parents:
diff changeset
141
kono
parents:
diff changeset
142 (define_constraint "Ui3"
kono
parents:
diff changeset
143 "@internal
kono
parents:
diff changeset
144 A constraint that matches the integers 0...4."
kono
parents:
diff changeset
145 (and (match_code "const_int")
kono
parents:
diff changeset
146 (match_test "(unsigned HOST_WIDE_INT) ival <= 4")))
kono
parents:
diff changeset
147
kono
parents:
diff changeset
148 (define_constraint "Up3"
kono
parents:
diff changeset
149 "@internal
kono
parents:
diff changeset
150 A constraint that matches the integers 2^(0...4)."
kono
parents:
diff changeset
151 (and (match_code "const_int")
kono
parents:
diff changeset
152 (match_test "(unsigned) exact_log2 (ival) <= 4")))
kono
parents:
diff changeset
153
kono
parents:
diff changeset
154 (define_memory_constraint "Q"
kono
parents:
diff changeset
155 "A memory address which uses a single base register with no offset."
kono
parents:
diff changeset
156 (and (match_code "mem")
kono
parents:
diff changeset
157 (match_test "REG_P (XEXP (op, 0))")))
kono
parents:
diff changeset
158
kono
parents:
diff changeset
159 (define_memory_constraint "Umq"
kono
parents:
diff changeset
160 "@internal
kono
parents:
diff changeset
161 A memory address which uses a base register with an offset small enough for
kono
parents:
diff changeset
162 a load/store pair operation in DI mode."
kono
parents:
diff changeset
163 (and (match_code "mem")
kono
parents:
diff changeset
164 (match_test "aarch64_legitimate_address_p (DImode, XEXP (op, 0),
kono
parents:
diff changeset
165 PARALLEL, false)")))
kono
parents:
diff changeset
166
kono
parents:
diff changeset
167 (define_memory_constraint "Ump"
kono
parents:
diff changeset
168 "@internal
kono
parents:
diff changeset
169 A memory address suitable for a load/store pair operation."
kono
parents:
diff changeset
170 (and (match_code "mem")
kono
parents:
diff changeset
171 (match_test "aarch64_legitimate_address_p (GET_MODE (op), XEXP (op, 0),
kono
parents:
diff changeset
172 PARALLEL, 1)")))
kono
parents:
diff changeset
173
kono
parents:
diff changeset
174 (define_memory_constraint "Utv"
kono
parents:
diff changeset
175 "@internal
kono
parents:
diff changeset
176 An address valid for loading/storing opaque structure
kono
parents:
diff changeset
177 types wider than TImode."
kono
parents:
diff changeset
178 (and (match_code "mem")
kono
parents:
diff changeset
179 (match_test "aarch64_simd_mem_operand_p (op)")))
kono
parents:
diff changeset
180
kono
parents:
diff changeset
181 (define_constraint "Ufc"
kono
parents:
diff changeset
182 "A floating point constant which can be used with an\
kono
parents:
diff changeset
183 FMOV immediate operation."
kono
parents:
diff changeset
184 (and (match_code "const_double")
kono
parents:
diff changeset
185 (match_test "aarch64_float_const_representable_p (op)")))
kono
parents:
diff changeset
186
kono
parents:
diff changeset
187 (define_constraint "Uvi"
kono
parents:
diff changeset
188 "A floating point constant which can be used with a\
kono
parents:
diff changeset
189 MOVI immediate operation."
kono
parents:
diff changeset
190 (and (match_code "const_double")
kono
parents:
diff changeset
191 (match_test "aarch64_can_const_movi_rtx_p (op, GET_MODE (op))")))
kono
parents:
diff changeset
192
kono
parents:
diff changeset
193 (define_constraint "Do"
kono
parents:
diff changeset
194 "@internal
kono
parents:
diff changeset
195 A constraint that matches vector of immediates for orr."
kono
parents:
diff changeset
196 (and (match_code "const_vector")
kono
parents:
diff changeset
197 (match_test "aarch64_simd_valid_immediate (op, mode, false,
kono
parents:
diff changeset
198 NULL, AARCH64_CHECK_ORR)")))
kono
parents:
diff changeset
199
kono
parents:
diff changeset
200 (define_constraint "Db"
kono
parents:
diff changeset
201 "@internal
kono
parents:
diff changeset
202 A constraint that matches vector of immediates for bic."
kono
parents:
diff changeset
203 (and (match_code "const_vector")
kono
parents:
diff changeset
204 (match_test "aarch64_simd_valid_immediate (op, mode, false,
kono
parents:
diff changeset
205 NULL, AARCH64_CHECK_BIC)")))
kono
parents:
diff changeset
206
kono
parents:
diff changeset
207 (define_constraint "Dn"
kono
parents:
diff changeset
208 "@internal
kono
parents:
diff changeset
209 A constraint that matches vector of immediates."
kono
parents:
diff changeset
210 (and (match_code "const_vector")
kono
parents:
diff changeset
211 (match_test "aarch64_simd_valid_immediate (op, GET_MODE (op),
kono
parents:
diff changeset
212 false, NULL)")))
kono
parents:
diff changeset
213
kono
parents:
diff changeset
214 (define_constraint "Dh"
kono
parents:
diff changeset
215 "@internal
kono
parents:
diff changeset
216 A constraint that matches an immediate operand valid for\
kono
parents:
diff changeset
217 AdvSIMD scalar move in HImode."
kono
parents:
diff changeset
218 (and (match_code "const_int")
kono
parents:
diff changeset
219 (match_test "aarch64_simd_scalar_immediate_valid_for_move (op,
kono
parents:
diff changeset
220 HImode)")))
kono
parents:
diff changeset
221
kono
parents:
diff changeset
222 (define_constraint "Dq"
kono
parents:
diff changeset
223 "@internal
kono
parents:
diff changeset
224 A constraint that matches an immediate operand valid for\
kono
parents:
diff changeset
225 AdvSIMD scalar move in QImode."
kono
parents:
diff changeset
226 (and (match_code "const_int")
kono
parents:
diff changeset
227 (match_test "aarch64_simd_scalar_immediate_valid_for_move (op,
kono
parents:
diff changeset
228 QImode)")))
kono
parents:
diff changeset
229
kono
parents:
diff changeset
230 (define_constraint "Dl"
kono
parents:
diff changeset
231 "@internal
kono
parents:
diff changeset
232 A constraint that matches vector of immediates for left shifts."
kono
parents:
diff changeset
233 (and (match_code "const_vector")
kono
parents:
diff changeset
234 (match_test "aarch64_simd_shift_imm_p (op, GET_MODE (op),
kono
parents:
diff changeset
235 true)")))
kono
parents:
diff changeset
236
kono
parents:
diff changeset
237 (define_constraint "Dr"
kono
parents:
diff changeset
238 "@internal
kono
parents:
diff changeset
239 A constraint that matches vector of immediates for right shifts."
kono
parents:
diff changeset
240 (and (match_code "const_vector")
kono
parents:
diff changeset
241 (match_test "aarch64_simd_shift_imm_p (op, GET_MODE (op),
kono
parents:
diff changeset
242 false)")))
kono
parents:
diff changeset
243 (define_constraint "Dz"
kono
parents:
diff changeset
244 "@internal
kono
parents:
diff changeset
245 A constraint that matches vector of immediate zero."
kono
parents:
diff changeset
246 (and (match_code "const_vector")
kono
parents:
diff changeset
247 (match_test "aarch64_simd_imm_zero_p (op, GET_MODE (op))")))
kono
parents:
diff changeset
248
kono
parents:
diff changeset
249 (define_constraint "Dd"
kono
parents:
diff changeset
250 "@internal
kono
parents:
diff changeset
251 A constraint that matches an integer immediate operand valid\
kono
parents:
diff changeset
252 for AdvSIMD scalar operations in DImode."
kono
parents:
diff changeset
253 (and (match_code "const_int")
kono
parents:
diff changeset
254 (match_test "aarch64_can_const_movi_rtx_p (op, DImode)")))
kono
parents:
diff changeset
255
kono
parents:
diff changeset
256 (define_constraint "Ds"
kono
parents:
diff changeset
257 "@internal
kono
parents:
diff changeset
258 A constraint that matches an integer immediate operand valid\
kono
parents:
diff changeset
259 for AdvSIMD scalar operations in SImode."
kono
parents:
diff changeset
260 (and (match_code "const_int")
kono
parents:
diff changeset
261 (match_test "aarch64_can_const_movi_rtx_p (op, SImode)")))
kono
parents:
diff changeset
262
kono
parents:
diff changeset
263 (define_address_constraint "Dp"
kono
parents:
diff changeset
264 "@internal
kono
parents:
diff changeset
265 An address valid for a prefetch instruction."
kono
parents:
diff changeset
266 (match_test "aarch64_address_valid_for_prefetch_p (op, true)"))