summaryrefslogtreecommitdiff
path: root/gcc/config/bfin/constraints.md
blob: 7cebbbff90a55b36a38e5f42c72a4f27b1f03adb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
;; Constraint definitions for Blackfin
;; Copyright (C) 2008-2014 Free Software Foundation, Inc.
;; Contributed by Analog Devices

;; This file is part of GCC.

;; GCC is free software; you can redistribute it and/or modify it
;; under the terms of the GNU General Public License as published
;; by the Free Software Foundation; either version 3, or (at your
;; option) any later version.

;; GCC is distributed in the hope that it will be useful, but WITHOUT
;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
;; or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
;; License for more details.

;; You should have received a copy of the GNU General Public License
;; along with GCC; see the file COPYING3.  If not see
;; <http://www.gnu.org/licenses/>.

(define_register_constraint "a" "PREGS"
  "A Pn register.")

(define_register_constraint "d" "DREGS"
  "A Rn register.")

(define_register_constraint "z" "PREGS_CLOBBERED"
  "A call clobbered Pn register.")

(define_register_constraint "D" "EVEN_DREGS"
  "An even-numbered Rn register.")

(define_register_constraint "W" "ODD_DREGS"
  "An odd-numbered Rn register.")

(define_register_constraint "e" "AREGS"
  "An accumulator register.")

(define_register_constraint "A" "EVEN_AREGS"
  "An even-numbered accumulator; A0.")

(define_register_constraint "B" "ODD_AREGS"
  "An odd-numbered accumulator; A1.")

(define_register_constraint "b" "IREGS"
  "An I register.")

(define_register_constraint "v" "BREGS"
  "A B register.")

(define_register_constraint "f" "MREGS"
  "An M register.")

(define_register_constraint "c" "CIRCREGS"
  "A register used for circular buffering, i.e. I, B, or L registers.")

(define_register_constraint "C" "CCREGS"
  "The CC register.")

(define_register_constraint "t" "LT_REGS"
  "LT0 or LT1.")

(define_register_constraint "u" "LB_REGS"
  "LB0 or LB1.")

(define_register_constraint "k" "LC_REGS"
  "LC0 or LC1.")

(define_register_constraint "x" "MOST_REGS"
  "Any R, P, B, M, I or L register.")

(define_register_constraint "y" "PROLOGUE_REGS"
  "Additional registers typically used only in prologues and epilogues:
   RETS, RETN, RETI, RETX, RETE, ASTAT, SEQSTAT and USP.")

(define_register_constraint "w" "NON_A_CC_REGS"
  "Any register except accumulators or CC.")

(define_register_constraint "Z" "FDPIC_REGS"
  "@internal The FD-PIC GOT pointer; P3.")

(define_register_constraint "Y" "FDPIC_FPTR_REGS"
  "@internal The FD-PIC function pointer register; P1.")

(define_register_constraint "q0" "D0REGS"
  "The register R0.")

(define_register_constraint "q1" "D1REGS"
  "The register R1.")

(define_register_constraint "q2" "D2REGS"
  "The register R2.")

(define_register_constraint "q3" "D3REGS"
  "The register R3.")

(define_register_constraint "q4" "D4REGS"
  "The register R4.")

(define_register_constraint "q5" "D5REGS"
  "The register R5.")

(define_register_constraint "q6" "D6REGS"
  "The register R6.")

(define_register_constraint "q7" "D7REGS"
  "The register R7.")

(define_register_constraint "qA" "P0REGS"
  "The register P0.")

;; Constant constraints.

(define_constraint "J"
  "A constant value of the form 2**N, where N 5-bit wide."
  (and (match_code "const_int")
       (match_test "log2constp (ival)")))

(define_constraint "Ks3"
  "A signed 3 bit immediate."
  (and (match_code "const_int")
       (match_test "ival >= -4 && ival <= 3")))

(define_constraint "Ku3"
  "An unsigned 3 bit immediate."
  (and (match_code "const_int")
       (match_test "ival >= 0 && ival <= 7")))

(define_constraint "Ks4"
  "A signed 4 bit immediate."
  (and (match_code "const_int")
       (match_test "ival >= -8 && ival <= 7")))

(define_constraint "Ku4"
  "An unsigned 4 bit immediate."
  (and (match_code "const_int")
       (match_test "ival >= 0 && ival <= 15")))

(define_constraint "Ks5"
  "A signed 5 bit immediate."
  (and (match_code "const_int")
       (match_test "ival >= -16 && ival <= 15")))

(define_constraint "Ku5"
  "An unsigned 5 bit immediate."
  (and (match_code "const_int")
       (match_test "ival >= 0 && ival <= 31")))

(define_constraint "Ks7"
  "A signed 7 bit immediate."
  (and (match_code "const_int")
       (match_test "ival >= -64 && ival <= 63")))

(define_constraint "KN7"
  "A constant that when negated is a signed 7 bit immediate."
  (and (match_code "const_int")
       (match_test "ival >= -63 && ival <= 64")))

(define_constraint "Ksh"
  "A signed 16 bit immediate."
  (and (match_code "const_int")
       (match_test "ival >= -32768 && ival <= 32767")))

(define_constraint "Kuh"
  "An unsigned 16 bit immediate."
  (and (match_code "const_int")
       (match_test "ival >= 0 && ival <= 65535")))

(define_constraint "L"
  "A constant value of the form ~(2**N)."
  (and (match_code "const_int")
       (match_test "log2constp (~ival)")))

(define_constraint "M1"
  "An integer with the value 255."
  (and (match_code "const_int")
       (match_test "ival == 255")))

(define_constraint "M2"
  "An integer with the value 65535."
  (and (match_code "const_int")
       (match_test "ival == 65535")))

(define_constraint "P0"
  "An integer with the value 0."
  (and (match_code "const_int")
       (match_test "ival == 0")))

(define_constraint "P1"
  "An integer with the value 1."
  (and (match_code "const_int")
       (match_test "ival == 1")))

(define_constraint "P2"
  "An integer with the value 2."
  (and (match_code "const_int")
       (match_test "ival == 2")))

(define_constraint "P3"
  "An integer with the value 3."
  (and (match_code "const_int")
       (match_test "ival == 3")))

(define_constraint "P4"
  "An integer with the value 4."
  (and (match_code "const_int")
       (match_test "ival == 4")))

(define_constraint "PA"
  "An integer constant describing any macflag except variants involving M."
  (and (match_code "const_int")
       (match_test "ival != MACFLAG_M && ival != MACFLAG_IS_M")))

(define_constraint "PB"
  "An integer constant describing any macflag involving M."
  (and (match_code "const_int")
       (match_test "ival == MACFLAG_M || ival == MACFLAG_IS_M")))


;; Extra constraints

(define_constraint "Q"
  "A SYMBOL_REF."
  (match_code "symbol_ref"))