| 1 |
;; Constraint definitions for Blackfin |
| 2 |
;; Copyright (C) 2008-2025 Free Software Foundation, Inc. |
| 3 |
;; Contributed by Analog Devices |
| 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 |
(define_register_constraint "a" "PREGS" |
| 22 |
"A Pn register.") |
| 23 |
|
| 24 |
(define_register_constraint "d" "DREGS" |
| 25 |
"A Rn register.") |
| 26 |
|
| 27 |
(define_register_constraint "z" "PREGS_CLOBBERED" |
| 28 |
"A call clobbered Pn register.") |
| 29 |
|
| 30 |
(define_register_constraint "D" "EVEN_DREGS" |
| 31 |
"An even-numbered Rn register.") |
| 32 |
|
| 33 |
(define_register_constraint "W" "ODD_DREGS" |
| 34 |
"An odd-numbered Rn register.") |
| 35 |
|
| 36 |
(define_register_constraint "e" "AREGS" |
| 37 |
"An accumulator register.") |
| 38 |
|
| 39 |
(define_register_constraint "A" "EVEN_AREGS" |
| 40 |
"An even-numbered accumulator; A0.") |
| 41 |
|
| 42 |
(define_register_constraint "B" "ODD_AREGS" |
| 43 |
"An odd-numbered accumulator; A1.") |
| 44 |
|
| 45 |
(define_register_constraint "b" "IREGS" |
| 46 |
"An I register.") |
| 47 |
|
| 48 |
(define_register_constraint "v" "BREGS" |
| 49 |
"A B register.") |
| 50 |
|
| 51 |
(define_register_constraint "f" "MREGS" |
| 52 |
"An M register.") |
| 53 |
|
| 54 |
(define_register_constraint "c" "CIRCREGS" |
| 55 |
"A register used for circular buffering, i.e. I, B, or L registers.") |
| 56 |
|
| 57 |
(define_register_constraint "C" "CCREGS" |
| 58 |
"The CC register.") |
| 59 |
|
| 60 |
(define_register_constraint "t" "LT_REGS" |
| 61 |
"LT0 or LT1.") |
| 62 |
|
| 63 |
(define_register_constraint "u" "LB_REGS" |
| 64 |
"LB0 or LB1.") |
| 65 |
|
| 66 |
(define_register_constraint "k" "LC_REGS" |
| 67 |
"LC0 or LC1.") |
| 68 |
|
| 69 |
(define_register_constraint "x" "MOST_REGS" |
| 70 |
"Any R, P, B, M, I or L register.") |
| 71 |
|
| 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.") |
| 75 |
|
| 76 |
(define_register_constraint "w" "NON_A_CC_REGS" |
| 77 |
"Any register except accumulators or CC.") |
| 78 |
|
| 79 |
(define_register_constraint "Z" "FDPIC_REGS" |
| 80 |
"@internal The FD-PIC GOT pointer; P3.") |
| 81 |
|
| 82 |
(define_register_constraint "Y" "FDPIC_FPTR_REGS" |
| 83 |
"@internal The FD-PIC function pointer register; P1.") |
| 84 |
|
| 85 |
(define_register_constraint "q0" "D0REGS" |
| 86 |
"The register R0.") |
| 87 |
|
| 88 |
(define_register_constraint "q1" "D1REGS" |
| 89 |
"The register R1.") |
| 90 |
|
| 91 |
(define_register_constraint "q2" "D2REGS" |
| 92 |
"The register R2.") |
| 93 |
|
| 94 |
(define_register_constraint "q3" "D3REGS" |
| 95 |
"The register R3.") |
| 96 |
|
| 97 |
(define_register_constraint "q4" "D4REGS" |
| 98 |
"The register R4.") |
| 99 |
|
| 100 |
(define_register_constraint "q5" "D5REGS" |
| 101 |
"The register R5.") |
| 102 |
|
| 103 |
(define_register_constraint "q6" "D6REGS" |
| 104 |
"The register R6.") |
| 105 |
|
| 106 |
(define_register_constraint "q7" "D7REGS" |
| 107 |
"The register R7.") |
| 108 |
|
| 109 |
(define_register_constraint "qA" "P0REGS" |
| 110 |
"The register P0.") |
| 111 |
|
| 112 |
;; Constant constraints. |
| 113 |
|
| 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)"))) |
| 118 |
|
| 119 |
(define_constraint "Ks3" |
| 120 |
"A signed 3 bit immediate." |
| 121 |
(and (match_code "const_int") |
| 122 |
(match_test "ival >= -4 && ival <= 3"))) |
| 123 |
|
| 124 |
(define_constraint "Ku3" |
| 125 |
"An unsigned 3 bit immediate." |
| 126 |
(and (match_code "const_int") |
| 127 |
(match_test "ival >= 0 && ival <= 7"))) |
| 128 |
|
| 129 |
(define_constraint "Ks4" |
| 130 |
"A signed 4 bit immediate." |
| 131 |
(and (match_code "const_int") |
| 132 |
(match_test "ival >= -8 && ival <= 7"))) |
| 133 |
|
| 134 |
(define_constraint "Ku4" |
| 135 |
"An unsigned 4 bit immediate." |
| 136 |
(and (match_code "const_int") |
| 137 |
(match_test "ival >= 0 && ival <= 15"))) |
| 138 |
|
| 139 |
(define_constraint "Ks5" |
| 140 |
"A signed 5 bit immediate." |
| 141 |
(and (match_code "const_int") |
| 142 |
(match_test "ival >= -16 && ival <= 15"))) |
| 143 |
|
| 144 |
(define_constraint "Ku5" |
| 145 |
"An unsigned 5 bit immediate." |
| 146 |
(and (match_code "const_int") |
| 147 |
(match_test "ival >= 0 && ival <= 31"))) |
| 148 |
|
| 149 |
(define_constraint "Ks7" |
| 150 |
"A signed 7 bit immediate." |
| 151 |
(and (match_code "const_int") |
| 152 |
(match_test "ival >= -64 && ival <= 63"))) |
| 153 |
|
| 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"))) |
| 158 |
|
| 159 |
(define_constraint "Ksh" |
| 160 |
"A signed 16 bit immediate." |
| 161 |
(and (match_code "const_int") |
| 162 |
(match_test "ival >= -32768 && ival <= 32767"))) |
| 163 |
|
| 164 |
(define_constraint "Kuh" |
| 165 |
"An unsigned 16 bit immediate." |
| 166 |
(and (match_code "const_int") |
| 167 |
(match_test "ival >= 0 && ival <= 65535"))) |
| 168 |
|
| 169 |
(define_constraint "L" |
| 170 |
"A constant value of the form ~(2**N)." |
| 171 |
(and (match_code "const_int") |
| 172 |
(match_test "log2constp (~ival)"))) |
| 173 |
|
| 174 |
(define_constraint "M1" |
| 175 |
"An integer with the value 255." |
| 176 |
(and (match_code "const_int") |
| 177 |
(match_test "ival == 255"))) |
| 178 |
|
| 179 |
(define_constraint "M2" |
| 180 |
"An integer with the value 65535." |
| 181 |
(and (match_code "const_int") |
| 182 |
(match_test "ival == 65535"))) |
| 183 |
|
| 184 |
(define_constraint "P0" |
| 185 |
"An integer with the value 0." |
| 186 |
(and (match_code "const_int") |
| 187 |
(match_test "ival == 0"))) |
| 188 |
|
| 189 |
(define_constraint "P1" |
| 190 |
"An integer with the value 1." |
| 191 |
(and (match_code "const_int") |
| 192 |
(match_test "ival == 1"))) |
| 193 |
|
| 194 |
(define_constraint "P2" |
| 195 |
"An integer with the value 2." |
| 196 |
(and (match_code "const_int") |
| 197 |
(match_test "ival == 2"))) |
| 198 |
|
| 199 |
(define_constraint "P3" |
| 200 |
"An integer with the value 3." |
| 201 |
(and (match_code "const_int") |
| 202 |
(match_test "ival == 3"))) |
| 203 |
|
| 204 |
(define_constraint "P4" |
| 205 |
"An integer with the value 4." |
| 206 |
(and (match_code "const_int") |
| 207 |
(match_test "ival == 4"))) |
| 208 |
|
| 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"))) |
| 213 |
|
| 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"))) |
| 218 |
|
| 219 |
|
| 220 |
;; Extra constraints |
| 221 |
|
| 222 |
(define_constraint "Q" |
| 223 |
"A SYMBOL_REF." |
| 224 |
(match_code "symbol_ref")) |
| 225 |
|