annotate gcc/config/c6x/constraints.md @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children 1830386684a0
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 ;; Constraint definitions for TI C6X.
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
2 ;; Copyright (C) 2010-2018 Free Software Foundation, Inc.
111
kono
parents:
diff changeset
3 ;; Contributed by Andrew Jenner <andrew@codesourcery.com>
kono
parents:
diff changeset
4 ;; Contributed by Bernd Schmidt <bernds@codesourcery.com>
kono
parents:
diff changeset
5 ;; Contributed by CodeSourcery.
kono
parents:
diff changeset
6 ;;
kono
parents:
diff changeset
7 ;; This file is part of GCC.
kono
parents:
diff changeset
8 ;;
kono
parents:
diff changeset
9 ;; GCC is free software; you can redistribute it and/or modify
kono
parents:
diff changeset
10 ;; it under the terms of the GNU General Public License as published by
kono
parents:
diff changeset
11 ;; the Free Software Foundation; either version 3, or (at your option)
kono
parents:
diff changeset
12 ;; any later version.
kono
parents:
diff changeset
13 ;;
kono
parents:
diff changeset
14 ;; GCC is distributed in the hope that it will be useful,
kono
parents:
diff changeset
15 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
kono
parents:
diff changeset
16 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
kono
parents:
diff changeset
17 ;; GNU General Public License for more details.
kono
parents:
diff changeset
18 ;;
kono
parents:
diff changeset
19 ;; You should have received a copy of the GNU General Public License
kono
parents:
diff changeset
20 ;; along with GCC; see the file COPYING3. If not see
kono
parents:
diff changeset
21 ;; <http://www.gnu.org/licenses/>.
kono
parents:
diff changeset
22
kono
parents:
diff changeset
23 (define_register_constraint "a" "A_REGS"
kono
parents:
diff changeset
24 "Register file A (A0--A31).")
kono
parents:
diff changeset
25
kono
parents:
diff changeset
26 (define_register_constraint "b" "B_REGS"
kono
parents:
diff changeset
27 "Register file B (B0--B31).")
kono
parents:
diff changeset
28
kono
parents:
diff changeset
29 (define_register_constraint "A" "PREDICATE_A_REGS"
kono
parents:
diff changeset
30 "Predicate registers in register file A (A0--A2 on C64X and higher,
kono
parents:
diff changeset
31 A1 and A2 otherwise).")
kono
parents:
diff changeset
32
kono
parents:
diff changeset
33 (define_register_constraint "B" "PREDICATE_B_REGS"
kono
parents:
diff changeset
34 "Predicate registers in register file B (B0--B2).")
kono
parents:
diff changeset
35
kono
parents:
diff changeset
36 (define_register_constraint "C" "CALL_USED_B_REGS"
kono
parents:
diff changeset
37 "A call-used register in register file B (B0--B9, B16--B31).")
kono
parents:
diff changeset
38
kono
parents:
diff changeset
39 (define_register_constraint "Da" "NONPREDICATE_A_REGS"
kono
parents:
diff changeset
40 "Register file A, excluding predicate registers (A3--A31, plus A0 if
kono
parents:
diff changeset
41 not C64X or higher).")
kono
parents:
diff changeset
42
kono
parents:
diff changeset
43 (define_register_constraint "Db" "NONPREDICATE_B_REGS"
kono
parents:
diff changeset
44 "Register file B, excluding predicate registers (B3--B31).")
kono
parents:
diff changeset
45
kono
parents:
diff changeset
46 (define_register_constraint "Z" "PICREG"
kono
parents:
diff changeset
47 "Register B14 (aka DP).")
kono
parents:
diff changeset
48
kono
parents:
diff changeset
49 (define_register_constraint "z" "SPREG"
kono
parents:
diff changeset
50 "Register B15 (aka SP).")
kono
parents:
diff changeset
51
kono
parents:
diff changeset
52 (define_constraint "Iu4"
kono
parents:
diff changeset
53 "Integer constant in the range 0 @dots{} 15, aka ucst4."
kono
parents:
diff changeset
54 (and (match_code "const_int")
kono
parents:
diff changeset
55 (match_test "ival >= 0 && ival <= 15")))
kono
parents:
diff changeset
56
kono
parents:
diff changeset
57 (define_constraint "Iu5"
kono
parents:
diff changeset
58 "Integer constant in the range 0 @dots{} 31, aka ucst5."
kono
parents:
diff changeset
59 (and (match_code "const_int")
kono
parents:
diff changeset
60 (match_test "ival >= 0 && ival <= 31")))
kono
parents:
diff changeset
61
kono
parents:
diff changeset
62 (define_constraint "In5"
kono
parents:
diff changeset
63 "Integer constant in the range @minus{}31 @dots{} 0, negation of ucst5."
kono
parents:
diff changeset
64 (and (match_code "const_int")
kono
parents:
diff changeset
65 (match_test "ival >= -31 && ival <= 0")))
kono
parents:
diff changeset
66
kono
parents:
diff changeset
67 (define_constraint "Is5"
kono
parents:
diff changeset
68 "Integer constant in the range @minus{}16 @dots{} 15, aka scst5."
kono
parents:
diff changeset
69 (and (match_code "const_int")
kono
parents:
diff changeset
70 (match_test "ival >= -16 && ival <= 15")))
kono
parents:
diff changeset
71
kono
parents:
diff changeset
72 (define_constraint "I5x"
kono
parents:
diff changeset
73 "Integer constant that can be the operand of an ADDA or a SUBA insn."
kono
parents:
diff changeset
74 (and (match_code "const_int")
kono
parents:
diff changeset
75 (match_test "(ival >= -31 && ival <= 31)
kono
parents:
diff changeset
76 || ((ival & 1) == 0 && ival >= -62 && ival <= 62)
kono
parents:
diff changeset
77 || ((ival & 3) == 0 && ival >= -124 && ival <= 124)
kono
parents:
diff changeset
78 || ((TARGET_INSNS_64 || TARGET_INSNS_67)
kono
parents:
diff changeset
79 && (ival & 7) == 0 && ival > 0 && ival <= 248)")))
kono
parents:
diff changeset
80
kono
parents:
diff changeset
81 (define_constraint "Iux"
kono
parents:
diff changeset
82 "Integer constant that can be the operand of a long ADDA or a SUBA insn,
kono
parents:
diff changeset
83 i.e. one involving B14 or B15 as source operand."
kono
parents:
diff changeset
84 (and (match_code "const_int")
kono
parents:
diff changeset
85 (and (match_test "TARGET_INSNS_64PLUS")
kono
parents:
diff changeset
86 (match_test "ival >= 0
kono
parents:
diff changeset
87 && (ival < 32768
kono
parents:
diff changeset
88 || ((ival & 1) == 0 && ival < 65536)
kono
parents:
diff changeset
89 || ((ival & 3) == 0 && ival < 131072))"))))
kono
parents:
diff changeset
90
kono
parents:
diff changeset
91 (define_constraint "IuB"
kono
parents:
diff changeset
92 "Integer constant in the range 0 @dots{} 65535, aka ucst16."
kono
parents:
diff changeset
93 (and (match_code "const_int")
kono
parents:
diff changeset
94 (match_test "ival >= 0 && ival <= 65535")))
kono
parents:
diff changeset
95
kono
parents:
diff changeset
96 (define_constraint "IsB"
kono
parents:
diff changeset
97 "Integer constant in the range @minus{}32768 @dots{} 32767."
kono
parents:
diff changeset
98 (and (match_code "const_int")
kono
parents:
diff changeset
99 (match_test "ival >= -32768 && ival <= 32767")))
kono
parents:
diff changeset
100
kono
parents:
diff changeset
101 (define_constraint "IsC"
kono
parents:
diff changeset
102 "Integer constant in the range @math{-2^{20}} @dots{} @math{2^{20} - 1}."
kono
parents:
diff changeset
103 (and (match_code "const_int")
kono
parents:
diff changeset
104 (match_test "ival >= -0x100000 && ival <= 0xfffff")))
kono
parents:
diff changeset
105
kono
parents:
diff changeset
106 (define_constraint "JA"
kono
parents:
diff changeset
107 "@internal
kono
parents:
diff changeset
108 Integer constant in the range 0 @dots{} 31, corresponding to an A register
kono
parents:
diff changeset
109 number."
kono
parents:
diff changeset
110 (and (match_code "const_int")
kono
parents:
diff changeset
111 (match_test "ival >= 0 && ival < 32")))
kono
parents:
diff changeset
112
kono
parents:
diff changeset
113 (define_constraint "JB"
kono
parents:
diff changeset
114 "@internal
kono
parents:
diff changeset
115 Integer constant in the range 32 @dots{} 63, corresponding to a B register
kono
parents:
diff changeset
116 number."
kono
parents:
diff changeset
117 (and (match_code "const_int")
kono
parents:
diff changeset
118 (match_test "ival >= 32 && ival < 64")))
kono
parents:
diff changeset
119
kono
parents:
diff changeset
120 (define_constraint "Jc"
kono
parents:
diff changeset
121 "Integer constant that is a valid mask for the clr instruction"
kono
parents:
diff changeset
122 (and (match_code "const_int")
kono
parents:
diff changeset
123 (match_test "c6x_valid_mask_p (ival)")))
kono
parents:
diff changeset
124
kono
parents:
diff changeset
125 (define_constraint "Js"
kono
parents:
diff changeset
126 "Integer constant that is a valid mask for the set instruction"
kono
parents:
diff changeset
127 (and (match_code "const_int")
kono
parents:
diff changeset
128 (match_test "c6x_valid_mask_p (~ival)")))
kono
parents:
diff changeset
129
kono
parents:
diff changeset
130 (define_memory_constraint "Q"
kono
parents:
diff changeset
131 "Memory location with A base register."
kono
parents:
diff changeset
132 (and (match_code "mem")
kono
parents:
diff changeset
133 (match_test "c6x_mem_operand (op, A_REGS, false)")))
kono
parents:
diff changeset
134
kono
parents:
diff changeset
135 (define_memory_constraint "R"
kono
parents:
diff changeset
136 "Memory location with B base register."
kono
parents:
diff changeset
137 (and (match_code "mem")
kono
parents:
diff changeset
138 (match_test "c6x_mem_operand (op, B_REGS, false)")))
kono
parents:
diff changeset
139
kono
parents:
diff changeset
140 (define_memory_constraint "T"
kono
parents:
diff changeset
141 "@internal
kono
parents:
diff changeset
142 Memory location with B base register, but not using a long offset."
kono
parents:
diff changeset
143 (and (match_code "mem")
kono
parents:
diff changeset
144 (match_test "c6x_mem_operand (op, B_REGS, true)")))
kono
parents:
diff changeset
145
kono
parents:
diff changeset
146 (define_constraint "S0"
kono
parents:
diff changeset
147 "@internal
kono
parents:
diff changeset
148 On C64x+ targets, a GP-relative small data reference"
kono
parents:
diff changeset
149 (and (match_test "TARGET_INSNS_64PLUS")
kono
parents:
diff changeset
150 (match_operand 0 "sdata_symbolic_operand")))
kono
parents:
diff changeset
151
kono
parents:
diff changeset
152 (define_constraint "S1"
kono
parents:
diff changeset
153 "@internal
kono
parents:
diff changeset
154 Any kind of @code{SYMBOL_REF}, for use in a call address."
kono
parents:
diff changeset
155 (and (match_code "symbol_ref")
kono
parents:
diff changeset
156 (match_operand 0 "c6x_call_operand")))
kono
parents:
diff changeset
157
kono
parents:
diff changeset
158 (define_constraint "S2"
kono
parents:
diff changeset
159 "@internal
kono
parents:
diff changeset
160 Any SYMBOL_REF or LABEL_REF."
kono
parents:
diff changeset
161 (ior (match_code "symbol_ref") (match_code "label_ref")))
kono
parents:
diff changeset
162
kono
parents:
diff changeset
163 (define_constraint "S3"
kono
parents:
diff changeset
164 "Matches a symbolic integer constant, even if invalid for PIC."
kono
parents:
diff changeset
165 (and (match_test "CONSTANT_P (op)")
kono
parents:
diff changeset
166 (match_test "!CONST_SCALAR_INT_P (op)")))
kono
parents:
diff changeset
167
kono
parents:
diff changeset
168 (define_constraint "Si"
kono
parents:
diff changeset
169 "@internal
kono
parents:
diff changeset
170 Any immediate value, unless it matches the S0 constraint."
kono
parents:
diff changeset
171 (and (match_operand 0 "immediate_operand")
kono
parents:
diff changeset
172 (match_test "!satisfies_constraint_S0 (op)")))
kono
parents:
diff changeset
173
kono
parents:
diff changeset
174 (define_memory_constraint "W"
kono
parents:
diff changeset
175 "@internal
kono
parents:
diff changeset
176 A memory operand with an address that can't be used in an unaligned access."
kono
parents:
diff changeset
177 (and (match_code "mem")
kono
parents:
diff changeset
178 (match_test "!c6x_legitimate_address_p_1 (GET_MODE (op), XEXP (op, 0),
kono
parents:
diff changeset
179 reload_completed, true)")))