annotate gcc/config/cris/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 CRIS.
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
2 ;; Copyright (C) 2011-2018 Free Software Foundation, Inc.
111
kono
parents:
diff changeset
3 ;;
kono
parents:
diff changeset
4 ;; This file is part of GCC.
kono
parents:
diff changeset
5 ;;
kono
parents:
diff changeset
6 ;; GCC is free software; you can redistribute it and/or modify
kono
parents:
diff changeset
7 ;; it under the terms of the GNU General Public License as published by
kono
parents:
diff changeset
8 ;; the Free Software Foundation; either version 3, or (at your option)
kono
parents:
diff changeset
9 ;; any later version.
kono
parents:
diff changeset
10 ;;
kono
parents:
diff changeset
11 ;; GCC is distributed in the hope that it will be useful,
kono
parents:
diff changeset
12 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
kono
parents:
diff changeset
13 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
kono
parents:
diff changeset
14 ;; GNU General Public License for more details.
kono
parents:
diff changeset
15 ;;
kono
parents:
diff changeset
16 ;; You should have received a copy of the GNU General Public License
kono
parents:
diff changeset
17 ;; along with GCC; see the file COPYING3. If not see
kono
parents:
diff changeset
18 ;; <http://www.gnu.org/licenses/>.
kono
parents:
diff changeset
19
kono
parents:
diff changeset
20 ;; Register constraints.
kono
parents:
diff changeset
21 (define_register_constraint "a" "ACR_REGS"
kono
parents:
diff changeset
22 "@internal")
kono
parents:
diff changeset
23
kono
parents:
diff changeset
24 (define_register_constraint "b" "GENNONACR_REGS"
kono
parents:
diff changeset
25 "@internal")
kono
parents:
diff changeset
26
kono
parents:
diff changeset
27 (define_register_constraint "h" "MOF_REGS"
kono
parents:
diff changeset
28 "@internal")
kono
parents:
diff changeset
29
kono
parents:
diff changeset
30 (define_register_constraint "x" "SPECIAL_REGS"
kono
parents:
diff changeset
31 "@internal")
kono
parents:
diff changeset
32
kono
parents:
diff changeset
33 (define_register_constraint "c" "CC0_REGS"
kono
parents:
diff changeset
34 "@internal")
kono
parents:
diff changeset
35
kono
parents:
diff changeset
36 ;; Integer constraints.
kono
parents:
diff changeset
37 (define_constraint "I"
kono
parents:
diff changeset
38 "MOVEQ, CMPQ, ANDQ, ORQ."
kono
parents:
diff changeset
39 (and (match_code "const_int")
kono
parents:
diff changeset
40 (match_test "IN_RANGE (ival, -32, 31)")))
kono
parents:
diff changeset
41
kono
parents:
diff changeset
42 (define_constraint "J"
kono
parents:
diff changeset
43 "ADDQ, SUBQ."
kono
parents:
diff changeset
44 (and (match_code "const_int")
kono
parents:
diff changeset
45 (match_test "IN_RANGE (ival, 0, 63)")))
kono
parents:
diff changeset
46
kono
parents:
diff changeset
47 (define_constraint "Kc"
kono
parents:
diff changeset
48 "ASRQ, BTSTQ, LSRQ, LSLQ."
kono
parents:
diff changeset
49 (and (match_code "const_int")
kono
parents:
diff changeset
50 (match_test "IN_RANGE (ival, 0, 31)")))
kono
parents:
diff changeset
51
kono
parents:
diff changeset
52 (define_constraint "Kp"
kono
parents:
diff changeset
53 "A power of two."
kono
parents:
diff changeset
54 (and (match_code "const_int")
kono
parents:
diff changeset
55 (match_test "exact_log2 (ival) >= 0")))
kono
parents:
diff changeset
56
kono
parents:
diff changeset
57 (define_constraint "L"
kono
parents:
diff changeset
58 "A 16-bit signed number."
kono
parents:
diff changeset
59 (and (match_code "const_int")
kono
parents:
diff changeset
60 (match_test "IN_RANGE (ival, -32768, 32767)")))
kono
parents:
diff changeset
61
kono
parents:
diff changeset
62 (define_constraint "M"
kono
parents:
diff changeset
63 "The constant 0 for CLEAR."
kono
parents:
diff changeset
64 (and (match_code "const_int")
kono
parents:
diff changeset
65 (match_test "ival == 0")))
kono
parents:
diff changeset
66
kono
parents:
diff changeset
67 (define_constraint "N"
kono
parents:
diff changeset
68 "A negative ADDQ or SUBQ."
kono
parents:
diff changeset
69 (and (match_code "const_int")
kono
parents:
diff changeset
70 (match_test "IN_RANGE (ival, -63, -1)")))
kono
parents:
diff changeset
71
kono
parents:
diff changeset
72 (define_constraint "O"
kono
parents:
diff changeset
73 "Quickened ints, QI and HI."
kono
parents:
diff changeset
74 (and (match_code "const_int")
kono
parents:
diff changeset
75 (ior (match_test "IN_RANGE (ival, (65535 - 31), 65535)")
kono
parents:
diff changeset
76 (match_test "IN_RANGE (ival, (255 - 31), 255)"))))
kono
parents:
diff changeset
77
kono
parents:
diff changeset
78 (define_constraint "P"
kono
parents:
diff changeset
79 "A 16-bit number signed *or* unsigned."
kono
parents:
diff changeset
80 (and (match_code "const_int")
kono
parents:
diff changeset
81 (match_test "IN_RANGE (ival, -32768, 65535)")))
kono
parents:
diff changeset
82
kono
parents:
diff changeset
83 ;; Floating-point constant constraints.
kono
parents:
diff changeset
84 (define_constraint "G"
kono
parents:
diff changeset
85 "The floating point zero constant"
kono
parents:
diff changeset
86 (and (match_code "const_double")
kono
parents:
diff changeset
87 (match_test "GET_MODE_CLASS (mode) == MODE_FLOAT")
kono
parents:
diff changeset
88 (match_test "op == CONST0_RTX (mode)")))
kono
parents:
diff changeset
89
kono
parents:
diff changeset
90 ;; Memory constraints.
kono
parents:
diff changeset
91
kono
parents:
diff changeset
92 ;; Just an indirect register (happens to also be "all" slottable
kono
parents:
diff changeset
93 ;; memory addressing modes not covered by other constraints, i.e. '>').
kono
parents:
diff changeset
94 (define_memory_constraint "Q"
kono
parents:
diff changeset
95 "@internal"
kono
parents:
diff changeset
96 (and (match_code "mem")
kono
parents:
diff changeset
97 (match_test "cris_base_p (XEXP (op, 0), reload_in_progress
kono
parents:
diff changeset
98 || reload_completed)")))
kono
parents:
diff changeset
99
kono
parents:
diff changeset
100 ;; Extra constraints.
kono
parents:
diff changeset
101 (define_constraint "R"
kono
parents:
diff changeset
102 "An operand to BDAP or BIAP."
kono
parents:
diff changeset
103 ;; A BIAP; r.S?
kono
parents:
diff changeset
104 (ior (match_test "cris_biap_index_p (op, reload_in_progress
kono
parents:
diff changeset
105 || reload_completed)")
kono
parents:
diff changeset
106 ;; A [reg] or (int) [reg], maybe with post-increment.
kono
parents:
diff changeset
107 (match_test "cris_bdap_index_p (op, reload_in_progress
kono
parents:
diff changeset
108 || reload_completed)")
kono
parents:
diff changeset
109 (match_test "cris_constant_index_p (op)")))
kono
parents:
diff changeset
110
kono
parents:
diff changeset
111 (define_constraint "T"
kono
parents:
diff changeset
112 "Memory three-address operand."
kono
parents:
diff changeset
113 ;; All are indirect-memory:
kono
parents:
diff changeset
114 (and (match_code "mem")
kono
parents:
diff changeset
115 ;; Double indirect: [[reg]] or [[reg+]]?
kono
parents:
diff changeset
116 (ior (and (match_code "mem" "0")
kono
parents:
diff changeset
117 (match_test "cris_base_or_autoincr_p (XEXP (XEXP (op, 0), 0),
kono
parents:
diff changeset
118 reload_in_progress
kono
parents:
diff changeset
119 || reload_completed)"))
kono
parents:
diff changeset
120 ;; Just an explicit indirect reference: [const]?
kono
parents:
diff changeset
121 (match_test "CRIS_CONSTANT_P (XEXP (op, 0))")
kono
parents:
diff changeset
122 ;; Something that is indexed; [...+...]?
kono
parents:
diff changeset
123 (and (match_code "plus" "0")
kono
parents:
diff changeset
124 ;; A BDAP constant: [reg+(8|16|32)bit offset]?
kono
parents:
diff changeset
125 (ior (and (match_test "cris_base_p (XEXP (XEXP (op, 0), 0),
kono
parents:
diff changeset
126 reload_in_progress
kono
parents:
diff changeset
127 || reload_completed)")
kono
parents:
diff changeset
128 (match_test "cris_constant_index_p (XEXP (XEXP (op, 0), 1))"))
kono
parents:
diff changeset
129 ;; A BDAP register: [reg+[reg(+)].S]?
kono
parents:
diff changeset
130 (and (match_test "cris_base_p (XEXP (XEXP (op, 0), 0),
kono
parents:
diff changeset
131 reload_in_progress
kono
parents:
diff changeset
132 || reload_completed)")
kono
parents:
diff changeset
133 (match_test "cris_bdap_index_p (XEXP (XEXP (op, 0), 1),
kono
parents:
diff changeset
134 reload_in_progress
kono
parents:
diff changeset
135 || reload_completed)"))
kono
parents:
diff changeset
136 ;; Same, but with swapped arguments (no canonical
kono
parents:
diff changeset
137 ;; ordering between e.g. REG and MEM as of LAST_UPDATED
kono
parents:
diff changeset
138 ;; "Thu May 12 03:59:11 UTC 2005").
kono
parents:
diff changeset
139 (and (match_test "cris_base_p (XEXP (XEXP (op, 0), 1),
kono
parents:
diff changeset
140 reload_in_progress
kono
parents:
diff changeset
141 || reload_completed)")
kono
parents:
diff changeset
142 (match_test "cris_bdap_index_p (XEXP (XEXP (op, 0), 0),
kono
parents:
diff changeset
143 reload_in_progress
kono
parents:
diff changeset
144 || reload_completed)"))
kono
parents:
diff changeset
145 ;; A BIAP: [reg+reg.S] (MULT comes first).
kono
parents:
diff changeset
146 (and (match_test "cris_base_p (XEXP (XEXP (op, 0), 1),
kono
parents:
diff changeset
147 reload_in_progress
kono
parents:
diff changeset
148 || reload_completed)")
kono
parents:
diff changeset
149 (match_test "cris_biap_index_p (XEXP (XEXP (op, 0), 0),
kono
parents:
diff changeset
150 reload_in_progress
kono
parents:
diff changeset
151 || reload_completed)")))))))
kono
parents:
diff changeset
152
kono
parents:
diff changeset
153 (define_constraint "S"
kono
parents:
diff changeset
154 "PIC-constructs for symbols."
kono
parents:
diff changeset
155 (and (match_test "flag_pic")
kono
parents:
diff changeset
156 (match_code "const")
kono
parents:
diff changeset
157 (match_test "cris_valid_pic_const (op, false)")))
kono
parents:
diff changeset
158
kono
parents:
diff changeset
159 (define_constraint "U"
kono
parents:
diff changeset
160 "@internal"
kono
parents:
diff changeset
161 (and (match_test "flag_pic")
kono
parents:
diff changeset
162 ;; We're just interested in the ..._or_callable_symbol part.
kono
parents:
diff changeset
163 ;; (Using CRIS_CONSTANT_P would exclude that too.)
kono
parents:
diff changeset
164 (match_test "CONSTANT_P (op)")
kono
parents:
diff changeset
165 (match_operand 0 "cris_nonmemory_operand_or_callable_symbol")))
kono
parents:
diff changeset
166