1 ;; Constraint definitions for Blackfin
2 ;; Copyright (C) 2008 Free Software Foundation, Inc.
3 ;; Contributed by Analog Devices
5 ;; This file is part of GCC.
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.
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.
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/>.
21 (define_register_constraint "a" "PREGS"
24 (define_register_constraint "d" "DREGS"
27 (define_register_constraint "z" "PREGS_CLOBBERED"
28 "A call clobbered Pn register.")
30 (define_register_constraint "D" "EVEN_DREGS"
31 "An even-numbered Rn register.")
33 (define_register_constraint "W" "ODD_DREGS"
34 "An odd-numbered Rn register.")
36 (define_register_constraint "e" "AREGS"
37 "An accumulator register.")
39 (define_register_constraint "A" "EVEN_AREGS"
40 "An even-numbered accumulator; A0.")
42 (define_register_constraint "B" "ODD_AREGS"
43 "An odd-numbered accumulator; A1.")
45 (define_register_constraint "b" "IREGS"
48 (define_register_constraint "v" "BREGS"
51 (define_register_constraint "f" "MREGS"
54 (define_register_constraint "c" "CIRCREGS"
55 "A register used for circular buffering, i.e. I, B, or L registers.")
57 (define_register_constraint "C" "CCREGS"
60 (define_register_constraint "t" "LT_REGS"
63 (define_register_constraint "u" "LB_REGS"
66 (define_register_constraint "k" "LC_REGS"
69 (define_register_constraint "x" "MOST_REGS"
70 "Any R, P, B, M, I or L register.")
72 (define_register_constraint "y" "PROLOGUE_REGS"
73 "Additional registers typically used only in prologues and epilogues:
74 RETS, RETN, RETI, RETX, RETE, ASTAT, SEQSTAT and USP.")
76 (define_register_constraint "w" "NON_A_CC_REGS"
77 "Any register except accumulators or CC.")
79 (define_register_constraint "Z" "FDPIC_REGS"
80 "@internal The FD-PIC GOT pointer; P3.")
82 (define_register_constraint "Y" "FDPIC_FPTR_REGS"
83 "@internal The FD-PIC function pointer register; P1.")
85 (define_register_constraint "q0" "D0REGS"
88 (define_register_constraint "q1" "D1REGS"
91 (define_register_constraint "q2" "D2REGS"
94 (define_register_constraint "q3" "D3REGS"
97 (define_register_constraint "q4" "D4REGS"
100 (define_register_constraint "q5" "D5REGS"
103 (define_register_constraint "q6" "D6REGS"
106 (define_register_constraint "q7" "D7REGS"
109 (define_register_constraint "qA" "P0REGS"
112 ;; Constant constraints.
114 (define_constraint "J"
115 "A constant value of the form 2**N, where N 5-bit wide."
116 (and (match_code "const_int")
117 (match_test "log2constp (ival)")))
119 (define_constraint "Ks3"
120 "A signed 3 bit immediate."
121 (and (match_code "const_int")
122 (match_test "ival >= -4 && ival <= 3")))
124 (define_constraint "Ku3"
125 "An unsigned 3 bit immediate."
126 (and (match_code "const_int")
127 (match_test "ival >= 0 && ival <= 7")))
129 (define_constraint "Ks4"
130 "A signed 4 bit immediate."
131 (and (match_code "const_int")
132 (match_test "ival >= -8 && ival <= 7")))
134 (define_constraint "Ku4"
135 "An unsigned 4 bit immediate."
136 (and (match_code "const_int")
137 (match_test "ival >= 0 && ival <= 15")))
139 (define_constraint "Ks5"
140 "A signed 5 bit immediate."
141 (and (match_code "const_int")
142 (match_test "ival >= -16 && ival <= 15")))
144 (define_constraint "Ku5"
145 "An unsigned 5 bit immediate."
146 (and (match_code "const_int")
147 (match_test "ival >= 0 && ival <= 31")))
149 (define_constraint "Ks7"
150 "A signed 7 bit immediate."
151 (and (match_code "const_int")
152 (match_test "ival >= -64 && ival <= 63")))
154 (define_constraint "KN7"
155 "A constant that when negated is a signed 7 bit immediate."
156 (and (match_code "const_int")
157 (match_test "ival >= -63 && ival <= 64")))
159 (define_constraint "Ksh"
160 "A signed 16 bit immediate."
161 (and (match_code "const_int")
162 (match_test "ival >= -32768 && ival <= 32767")))
164 (define_constraint "Kuh"
165 "An unsigned 16 bit immediate."
166 (and (match_code "const_int")
167 (match_test "ival >= 0 && ival <= 65535")))
169 (define_constraint "L"
170 "A constant value of the form ~(2**N)."
171 (and (match_code "const_int")
172 (match_test "log2constp (~ival)")))
174 (define_constraint "M1"
175 "An integer with the value 255."
176 (and (match_code "const_int")
177 (match_test "ival == 255")))
179 (define_constraint "M2"
180 "An integer with the value 65535."
181 (and (match_code "const_int")
182 (match_test "ival == 65535")))
184 (define_constraint "P0"
185 "An integer with the value 0."
186 (and (match_code "const_int")
187 (match_test "ival == 0")))
189 (define_constraint "P1"
190 "An integer with the value 1."
191 (and (match_code "const_int")
192 (match_test "ival == 1")))
194 (define_constraint "P2"
195 "An integer with the value 2."
196 (and (match_code "const_int")
197 (match_test "ival == 2")))
199 (define_constraint "P3"
200 "An integer with the value 3."
201 (and (match_code "const_int")
202 (match_test "ival == 3")))
204 (define_constraint "P4"
205 "An integer with the value 4."
206 (and (match_code "const_int")
207 (match_test "ival == 4")))
209 (define_constraint "PA"
210 "An integer constant describing any macflag except variants involving M."
211 (and (match_code "const_int")
212 (match_test "ival != MACFLAG_M && ival != MACFLAG_IS_M")))
214 (define_constraint "PB"
215 "An integer constant describing any macflag involving M."
216 (and (match_code "const_int")
217 (match_test "ival == MACFLAG_M || ival == MACFLAG_IS_M")))
222 (define_constraint "Q"
224 (match_code "symbol_ref"))