annotate gcc/config/rs6000/predicates.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
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1 ;; Predicate definitions for POWER and PowerPC.
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
2 ;; Copyright (C) 2005-2018 Free Software Foundation, Inc.
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
3 ;;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
4 ;; This file is part of GCC.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
5 ;;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
6 ;; GCC is free software; you can redistribute it and/or modify
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
7 ;; it under the terms of the GNU General Public License as published by
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
8 ;; the Free Software Foundation; either version 3, or (at your option)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
9 ;; any later version.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
10 ;;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
11 ;; GCC is distributed in the hope that it will be useful,
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
12 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
13 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
14 ;; GNU General Public License for more details.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
15 ;;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
16 ;; You should have received a copy of the GNU General Public License
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
17 ;; along with GCC; see the file COPYING3. If not see
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
18 ;; <http://www.gnu.org/licenses/>.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
19
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
20 ;; Return 1 for anything except PARALLEL.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
21 (define_predicate "any_operand"
111
kono
parents: 67
diff changeset
22 (match_code "const_int,const_double,const_wide_int,const,symbol_ref,label_ref,subreg,reg,mem"))
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
23
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
24 ;; Return 1 for any PARALLEL.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
25 (define_predicate "any_parallel_operand"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
26 (match_code "parallel"))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
27
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
28 ;; Return 1 if op is COUNT register.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
29 (define_predicate "count_register_operand"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
30 (and (match_code "reg")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
31 (match_test "REGNO (op) == CTR_REGNO
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
32 || REGNO (op) > LAST_VIRTUAL_REGISTER")))
111
kono
parents: 67
diff changeset
33
kono
parents: 67
diff changeset
34 ;; Return 1 if op is a SUBREG that is used to look at a SFmode value as
kono
parents: 67
diff changeset
35 ;; and integer or vice versa.
kono
parents: 67
diff changeset
36 ;;
kono
parents: 67
diff changeset
37 ;; In the normal case where SFmode is in a floating point/vector register, it
kono
parents: 67
diff changeset
38 ;; is stored as a DFmode and has a different format. If we don't transform the
kono
parents: 67
diff changeset
39 ;; value, things that use logical operations on the values will get the wrong
kono
parents: 67
diff changeset
40 ;; value.
kono
parents: 67
diff changeset
41 ;;
kono
parents: 67
diff changeset
42 ;; If we don't have 64-bit and direct move, this conversion will be done by
kono
parents: 67
diff changeset
43 ;; store and load, instead of by fiddling with the bits within the register.
kono
parents: 67
diff changeset
44 (define_predicate "sf_subreg_operand"
kono
parents: 67
diff changeset
45 (match_code "subreg")
kono
parents: 67
diff changeset
46 {
kono
parents: 67
diff changeset
47 rtx inner_reg = SUBREG_REG (op);
kono
parents: 67
diff changeset
48 machine_mode inner_mode = GET_MODE (inner_reg);
kono
parents: 67
diff changeset
49
kono
parents: 67
diff changeset
50 if (TARGET_ALLOW_SF_SUBREG || !REG_P (inner_reg))
kono
parents: 67
diff changeset
51 return 0;
kono
parents: 67
diff changeset
52
kono
parents: 67
diff changeset
53 if ((mode == SFmode && GET_MODE_CLASS (inner_mode) == MODE_INT)
kono
parents: 67
diff changeset
54 || (GET_MODE_CLASS (mode) == MODE_INT && inner_mode == SFmode))
kono
parents: 67
diff changeset
55 {
kono
parents: 67
diff changeset
56 if (INT_REGNO_P (REGNO (inner_reg)))
kono
parents: 67
diff changeset
57 return 0;
kono
parents: 67
diff changeset
58
kono
parents: 67
diff changeset
59 return 1;
kono
parents: 67
diff changeset
60 }
kono
parents: 67
diff changeset
61 return 0;
kono
parents: 67
diff changeset
62 })
kono
parents: 67
diff changeset
63
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
64 ;; Return 1 if op is an Altivec register.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
65 (define_predicate "altivec_register_operand"
111
kono
parents: 67
diff changeset
66 (match_operand 0 "register_operand")
kono
parents: 67
diff changeset
67 {
kono
parents: 67
diff changeset
68 if (GET_CODE (op) == SUBREG)
kono
parents: 67
diff changeset
69 {
kono
parents: 67
diff changeset
70 if (TARGET_NO_SF_SUBREG && sf_subreg_operand (op, mode))
kono
parents: 67
diff changeset
71 return 0;
kono
parents: 67
diff changeset
72
kono
parents: 67
diff changeset
73 op = SUBREG_REG (op);
kono
parents: 67
diff changeset
74 }
kono
parents: 67
diff changeset
75
kono
parents: 67
diff changeset
76 if (!REG_P (op))
kono
parents: 67
diff changeset
77 return 0;
kono
parents: 67
diff changeset
78
kono
parents: 67
diff changeset
79 if (REGNO (op) >= FIRST_PSEUDO_REGISTER)
kono
parents: 67
diff changeset
80 return 1;
kono
parents: 67
diff changeset
81
kono
parents: 67
diff changeset
82 return ALTIVEC_REGNO_P (REGNO (op));
kono
parents: 67
diff changeset
83 })
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
84
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
85 ;; Return 1 if op is a VSX register.
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
86 (define_predicate "vsx_register_operand"
111
kono
parents: 67
diff changeset
87 (match_operand 0 "register_operand")
kono
parents: 67
diff changeset
88 {
kono
parents: 67
diff changeset
89 if (GET_CODE (op) == SUBREG)
kono
parents: 67
diff changeset
90 {
kono
parents: 67
diff changeset
91 if (TARGET_NO_SF_SUBREG && sf_subreg_operand (op, mode))
kono
parents: 67
diff changeset
92 return 0;
kono
parents: 67
diff changeset
93
kono
parents: 67
diff changeset
94 op = SUBREG_REG (op);
kono
parents: 67
diff changeset
95 }
kono
parents: 67
diff changeset
96
kono
parents: 67
diff changeset
97 if (!REG_P (op))
kono
parents: 67
diff changeset
98 return 0;
kono
parents: 67
diff changeset
99
kono
parents: 67
diff changeset
100 if (REGNO (op) >= FIRST_PSEUDO_REGISTER)
kono
parents: 67
diff changeset
101 return 1;
kono
parents: 67
diff changeset
102
kono
parents: 67
diff changeset
103 return VSX_REGNO_P (REGNO (op));
kono
parents: 67
diff changeset
104 })
kono
parents: 67
diff changeset
105
kono
parents: 67
diff changeset
106 ;; Like vsx_register_operand, but allow SF SUBREGS
kono
parents: 67
diff changeset
107 (define_predicate "vsx_reg_sfsubreg_ok"
kono
parents: 67
diff changeset
108 (match_operand 0 "register_operand")
kono
parents: 67
diff changeset
109 {
kono
parents: 67
diff changeset
110 if (GET_CODE (op) == SUBREG)
kono
parents: 67
diff changeset
111 op = SUBREG_REG (op);
kono
parents: 67
diff changeset
112
kono
parents: 67
diff changeset
113 if (!REG_P (op))
kono
parents: 67
diff changeset
114 return 0;
kono
parents: 67
diff changeset
115
kono
parents: 67
diff changeset
116 if (REGNO (op) >= FIRST_PSEUDO_REGISTER)
kono
parents: 67
diff changeset
117 return 1;
kono
parents: 67
diff changeset
118
kono
parents: 67
diff changeset
119 return VSX_REGNO_P (REGNO (op));
kono
parents: 67
diff changeset
120 })
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
121
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
122 ;; Return 1 if op is a vector register that operates on floating point vectors
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
123 ;; (either altivec or VSX).
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
124 (define_predicate "vfloat_operand"
111
kono
parents: 67
diff changeset
125 (match_operand 0 "register_operand")
kono
parents: 67
diff changeset
126 {
kono
parents: 67
diff changeset
127 if (GET_CODE (op) == SUBREG)
kono
parents: 67
diff changeset
128 {
kono
parents: 67
diff changeset
129 if (TARGET_NO_SF_SUBREG && sf_subreg_operand (op, mode))
kono
parents: 67
diff changeset
130 return 0;
kono
parents: 67
diff changeset
131
kono
parents: 67
diff changeset
132 op = SUBREG_REG (op);
kono
parents: 67
diff changeset
133 }
kono
parents: 67
diff changeset
134
kono
parents: 67
diff changeset
135 if (!REG_P (op))
kono
parents: 67
diff changeset
136 return 0;
kono
parents: 67
diff changeset
137
kono
parents: 67
diff changeset
138 if (REGNO (op) >= FIRST_PSEUDO_REGISTER)
kono
parents: 67
diff changeset
139 return 1;
kono
parents: 67
diff changeset
140
kono
parents: 67
diff changeset
141 return VFLOAT_REGNO_P (REGNO (op));
kono
parents: 67
diff changeset
142 })
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
143
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
144 ;; Return 1 if op is a vector register that operates on integer vectors
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
145 ;; (only altivec, VSX doesn't support integer vectors)
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
146 (define_predicate "vint_operand"
111
kono
parents: 67
diff changeset
147 (match_operand 0 "register_operand")
kono
parents: 67
diff changeset
148 {
kono
parents: 67
diff changeset
149 if (GET_CODE (op) == SUBREG)
kono
parents: 67
diff changeset
150 {
kono
parents: 67
diff changeset
151 if (TARGET_NO_SF_SUBREG && sf_subreg_operand (op, mode))
kono
parents: 67
diff changeset
152 return 0;
kono
parents: 67
diff changeset
153
kono
parents: 67
diff changeset
154 op = SUBREG_REG (op);
kono
parents: 67
diff changeset
155 }
kono
parents: 67
diff changeset
156
kono
parents: 67
diff changeset
157 if (!REG_P (op))
kono
parents: 67
diff changeset
158 return 0;
kono
parents: 67
diff changeset
159
kono
parents: 67
diff changeset
160 if (REGNO (op) >= FIRST_PSEUDO_REGISTER)
kono
parents: 67
diff changeset
161 return 1;
kono
parents: 67
diff changeset
162
kono
parents: 67
diff changeset
163 return VINT_REGNO_P (REGNO (op));
kono
parents: 67
diff changeset
164 })
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
165
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
166 ;; Return 1 if op is a vector register to do logical operations on (and, or,
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
167 ;; xor, etc.)
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
168 (define_predicate "vlogical_operand"
111
kono
parents: 67
diff changeset
169 (match_operand 0 "register_operand")
kono
parents: 67
diff changeset
170 {
kono
parents: 67
diff changeset
171 if (GET_CODE (op) == SUBREG)
kono
parents: 67
diff changeset
172 {
kono
parents: 67
diff changeset
173 if (TARGET_NO_SF_SUBREG && sf_subreg_operand (op, mode))
kono
parents: 67
diff changeset
174 return 0;
kono
parents: 67
diff changeset
175
kono
parents: 67
diff changeset
176 op = SUBREG_REG (op);
kono
parents: 67
diff changeset
177 }
kono
parents: 67
diff changeset
178
kono
parents: 67
diff changeset
179
kono
parents: 67
diff changeset
180 if (!REG_P (op))
kono
parents: 67
diff changeset
181 return 0;
kono
parents: 67
diff changeset
182
kono
parents: 67
diff changeset
183 if (REGNO (op) >= FIRST_PSEUDO_REGISTER)
kono
parents: 67
diff changeset
184 return 1;
kono
parents: 67
diff changeset
185
kono
parents: 67
diff changeset
186 return VLOGICAL_REGNO_P (REGNO (op));
kono
parents: 67
diff changeset
187 })
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
188
67
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
189 ;; Return 1 if op is the carry register.
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
190 (define_predicate "ca_operand"
111
kono
parents: 67
diff changeset
191 (match_operand 0 "register_operand")
kono
parents: 67
diff changeset
192 {
kono
parents: 67
diff changeset
193 if (GET_CODE (op) == SUBREG)
kono
parents: 67
diff changeset
194 op = SUBREG_REG (op);
kono
parents: 67
diff changeset
195
kono
parents: 67
diff changeset
196 if (!REG_P (op))
kono
parents: 67
diff changeset
197 return 0;
kono
parents: 67
diff changeset
198
kono
parents: 67
diff changeset
199 return CA_REGNO_P (REGNO (op));
kono
parents: 67
diff changeset
200 })
kono
parents: 67
diff changeset
201
kono
parents: 67
diff changeset
202 ;; Return 1 if operand is constant zero (scalars and vectors).
kono
parents: 67
diff changeset
203 (define_predicate "zero_constant"
kono
parents: 67
diff changeset
204 (and (match_code "const_int,const_double,const_wide_int,const_vector")
kono
parents: 67
diff changeset
205 (match_test "op == CONST0_RTX (mode)")))
kono
parents: 67
diff changeset
206
kono
parents: 67
diff changeset
207 ;; Return 1 if operand is constant -1 (scalars and vectors).
kono
parents: 67
diff changeset
208 (define_predicate "all_ones_constant"
kono
parents: 67
diff changeset
209 (and (match_code "const_int,const_double,const_wide_int,const_vector")
kono
parents: 67
diff changeset
210 (match_test "op == CONSTM1_RTX (mode) && !FLOAT_MODE_P (mode)")))
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
211
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
212 ;; Return 1 if op is a signed 5-bit constant integer.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
213 (define_predicate "s5bit_cint_operand"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
214 (and (match_code "const_int")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
215 (match_test "INTVAL (op) >= -16 && INTVAL (op) <= 15")))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
216
111
kono
parents: 67
diff changeset
217 ;; Return 1 if op is a unsigned 3-bit constant integer.
kono
parents: 67
diff changeset
218 (define_predicate "u3bit_cint_operand"
kono
parents: 67
diff changeset
219 (and (match_code "const_int")
kono
parents: 67
diff changeset
220 (match_test "INTVAL (op) >= 0 && INTVAL (op) <= 7")))
kono
parents: 67
diff changeset
221
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
222 ;; Return 1 if op is a unsigned 5-bit constant integer.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
223 (define_predicate "u5bit_cint_operand"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
224 (and (match_code "const_int")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
225 (match_test "INTVAL (op) >= 0 && INTVAL (op) <= 31")))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
226
111
kono
parents: 67
diff changeset
227 ;; Return 1 if op is a unsigned 6-bit constant integer.
kono
parents: 67
diff changeset
228 (define_predicate "u6bit_cint_operand"
kono
parents: 67
diff changeset
229 (and (match_code "const_int")
kono
parents: 67
diff changeset
230 (match_test "INTVAL (op) >= 0 && INTVAL (op) <= 63")))
kono
parents: 67
diff changeset
231
kono
parents: 67
diff changeset
232 ;; Return 1 if op is an unsigned 7-bit constant integer.
kono
parents: 67
diff changeset
233 (define_predicate "u7bit_cint_operand"
kono
parents: 67
diff changeset
234 (and (match_code "const_int")
kono
parents: 67
diff changeset
235 (match_test "IN_RANGE (INTVAL (op), 0, 127)")))
kono
parents: 67
diff changeset
236
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
237 ;; Return 1 if op is a signed 8-bit constant integer.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
238 ;; Integer multiplication complete more quickly
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
239 (define_predicate "s8bit_cint_operand"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
240 (and (match_code "const_int")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
241 (match_test "INTVAL (op) >= -128 && INTVAL (op) <= 127")))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
242
111
kono
parents: 67
diff changeset
243 ;; Return 1 if op is a unsigned 10-bit constant integer.
kono
parents: 67
diff changeset
244 (define_predicate "u10bit_cint_operand"
kono
parents: 67
diff changeset
245 (and (match_code "const_int")
kono
parents: 67
diff changeset
246 (match_test "INTVAL (op) >= 0 && INTVAL (op) <= 1023")))
kono
parents: 67
diff changeset
247
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
248 ;; Return 1 if op is a constant integer that can fit in a D field.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
249 (define_predicate "short_cint_operand"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
250 (and (match_code "const_int")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
251 (match_test "satisfies_constraint_I (op)")))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
252
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
253 ;; Return 1 if op is a constant integer that can fit in an unsigned D field.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
254 (define_predicate "u_short_cint_operand"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
255 (and (match_code "const_int")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
256 (match_test "satisfies_constraint_K (op)")))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
257
111
kono
parents: 67
diff changeset
258 ;; Return 1 if op is a constant integer that is a signed 16-bit constant
kono
parents: 67
diff changeset
259 ;; shifted left 16 bits
kono
parents: 67
diff changeset
260 (define_predicate "upper16_cint_operand"
kono
parents: 67
diff changeset
261 (and (match_code "const_int")
kono
parents: 67
diff changeset
262 (match_test "satisfies_constraint_L (op)")))
kono
parents: 67
diff changeset
263
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
264 ;; Return 1 if op is a constant integer that cannot fit in a signed D field.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
265 (define_predicate "non_short_cint_operand"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
266 (and (match_code "const_int")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
267 (match_test "(unsigned HOST_WIDE_INT)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
268 (INTVAL (op) + 0x8000) >= 0x10000")))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
269
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
270 ;; Return 1 if op is a positive constant integer that is an exact power of 2.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
271 (define_predicate "exact_log2_cint_operand"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
272 (and (match_code "const_int")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
273 (match_test "INTVAL (op) > 0 && exact_log2 (INTVAL (op)) >= 0")))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
274
111
kono
parents: 67
diff changeset
275 ;; Match op = 0 or op = 1.
kono
parents: 67
diff changeset
276 (define_predicate "const_0_to_1_operand"
kono
parents: 67
diff changeset
277 (and (match_code "const_int")
kono
parents: 67
diff changeset
278 (match_test "IN_RANGE (INTVAL (op), 0, 1)")))
kono
parents: 67
diff changeset
279
kono
parents: 67
diff changeset
280 ;; Match op = 0..3.
kono
parents: 67
diff changeset
281 (define_predicate "const_0_to_3_operand"
kono
parents: 67
diff changeset
282 (and (match_code "const_int")
kono
parents: 67
diff changeset
283 (match_test "IN_RANGE (INTVAL (op), 0, 3)")))
kono
parents: 67
diff changeset
284
kono
parents: 67
diff changeset
285 ;; Match op = 2 or op = 3.
kono
parents: 67
diff changeset
286 (define_predicate "const_2_to_3_operand"
kono
parents: 67
diff changeset
287 (and (match_code "const_int")
kono
parents: 67
diff changeset
288 (match_test "IN_RANGE (INTVAL (op), 2, 3)")))
kono
parents: 67
diff changeset
289
kono
parents: 67
diff changeset
290 ;; Match op = 0..7.
kono
parents: 67
diff changeset
291 (define_predicate "const_0_to_7_operand"
kono
parents: 67
diff changeset
292 (and (match_code "const_int")
kono
parents: 67
diff changeset
293 (match_test "IN_RANGE (INTVAL (op), 0, 7)")))
kono
parents: 67
diff changeset
294
kono
parents: 67
diff changeset
295 ;; Match op = 0..11
kono
parents: 67
diff changeset
296 (define_predicate "const_0_to_12_operand"
kono
parents: 67
diff changeset
297 (and (match_code "const_int")
kono
parents: 67
diff changeset
298 (match_test "IN_RANGE (INTVAL (op), 0, 12)")))
kono
parents: 67
diff changeset
299
kono
parents: 67
diff changeset
300 ;; Match op = 0..15
kono
parents: 67
diff changeset
301 (define_predicate "const_0_to_15_operand"
kono
parents: 67
diff changeset
302 (and (match_code "const_int")
kono
parents: 67
diff changeset
303 (match_test "IN_RANGE (INTVAL (op), 0, 15)")))
kono
parents: 67
diff changeset
304
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
305 ;; Return 1 if op is a register that is not special.
111
kono
parents: 67
diff changeset
306 ;; Disallow (SUBREG:SF (REG:SI)) and (SUBREG:SI (REG:SF)) on VSX systems where
kono
parents: 67
diff changeset
307 ;; you need to be careful in moving a SFmode to SImode and vice versa due to
kono
parents: 67
diff changeset
308 ;; the fact that SFmode is represented as DFmode in the VSX registers.
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
309 (define_predicate "gpc_reg_operand"
111
kono
parents: 67
diff changeset
310 (match_operand 0 "register_operand")
kono
parents: 67
diff changeset
311 {
kono
parents: 67
diff changeset
312 if (GET_CODE (op) == SUBREG)
kono
parents: 67
diff changeset
313 {
kono
parents: 67
diff changeset
314 if (TARGET_NO_SF_SUBREG && sf_subreg_operand (op, mode))
kono
parents: 67
diff changeset
315 return 0;
kono
parents: 67
diff changeset
316
kono
parents: 67
diff changeset
317 op = SUBREG_REG (op);
kono
parents: 67
diff changeset
318 }
kono
parents: 67
diff changeset
319
kono
parents: 67
diff changeset
320 if (!REG_P (op))
kono
parents: 67
diff changeset
321 return 0;
kono
parents: 67
diff changeset
322
kono
parents: 67
diff changeset
323 if (REGNO (op) >= FIRST_PSEUDO_REGISTER)
kono
parents: 67
diff changeset
324 return 1;
kono
parents: 67
diff changeset
325
kono
parents: 67
diff changeset
326 if (TARGET_ALTIVEC && ALTIVEC_REGNO_P (REGNO (op)))
kono
parents: 67
diff changeset
327 return 1;
kono
parents: 67
diff changeset
328
kono
parents: 67
diff changeset
329 if (TARGET_VSX && VSX_REGNO_P (REGNO (op)))
kono
parents: 67
diff changeset
330 return 1;
kono
parents: 67
diff changeset
331
kono
parents: 67
diff changeset
332 return INT_REGNO_P (REGNO (op)) || FP_REGNO_P (REGNO (op));
kono
parents: 67
diff changeset
333 })
kono
parents: 67
diff changeset
334
kono
parents: 67
diff changeset
335 ;; Return 1 if op is a general purpose register. Unlike gpc_reg_operand, don't
kono
parents: 67
diff changeset
336 ;; allow floating point or vector registers. Since vector registers are not
kono
parents: 67
diff changeset
337 ;; allowed, we don't have to reject SFmode/SImode subregs.
kono
parents: 67
diff changeset
338 (define_predicate "int_reg_operand"
kono
parents: 67
diff changeset
339 (match_operand 0 "register_operand")
kono
parents: 67
diff changeset
340 {
kono
parents: 67
diff changeset
341 if (GET_CODE (op) == SUBREG)
kono
parents: 67
diff changeset
342 {
kono
parents: 67
diff changeset
343 if (TARGET_NO_SF_SUBREG && sf_subreg_operand (op, mode))
kono
parents: 67
diff changeset
344 return 0;
kono
parents: 67
diff changeset
345
kono
parents: 67
diff changeset
346 op = SUBREG_REG (op);
kono
parents: 67
diff changeset
347 }
kono
parents: 67
diff changeset
348
kono
parents: 67
diff changeset
349 if (!REG_P (op))
kono
parents: 67
diff changeset
350 return 0;
kono
parents: 67
diff changeset
351
kono
parents: 67
diff changeset
352 if (REGNO (op) >= FIRST_PSEUDO_REGISTER)
kono
parents: 67
diff changeset
353 return 1;
kono
parents: 67
diff changeset
354
kono
parents: 67
diff changeset
355 return INT_REGNO_P (REGNO (op));
kono
parents: 67
diff changeset
356 })
kono
parents: 67
diff changeset
357
kono
parents: 67
diff changeset
358 ;; Like int_reg_operand, but don't return true for pseudo registers
kono
parents: 67
diff changeset
359 ;; We don't have to check for SF SUBREGS because pseudo registers
kono
parents: 67
diff changeset
360 ;; are not allowed, and SF SUBREGs are ok within GPR registers.
kono
parents: 67
diff changeset
361 (define_predicate "int_reg_operand_not_pseudo"
kono
parents: 67
diff changeset
362 (match_operand 0 "register_operand")
kono
parents: 67
diff changeset
363 {
kono
parents: 67
diff changeset
364 if (GET_CODE (op) == SUBREG)
kono
parents: 67
diff changeset
365 op = SUBREG_REG (op);
kono
parents: 67
diff changeset
366
kono
parents: 67
diff changeset
367 if (!REG_P (op))
kono
parents: 67
diff changeset
368 return 0;
kono
parents: 67
diff changeset
369
kono
parents: 67
diff changeset
370 if (REGNO (op) >= FIRST_PSEUDO_REGISTER)
kono
parents: 67
diff changeset
371 return 0;
kono
parents: 67
diff changeset
372
kono
parents: 67
diff changeset
373 return INT_REGNO_P (REGNO (op));
kono
parents: 67
diff changeset
374 })
kono
parents: 67
diff changeset
375
kono
parents: 67
diff changeset
376 ;; Like int_reg_operand, but only return true for base registers
kono
parents: 67
diff changeset
377 (define_predicate "base_reg_operand"
kono
parents: 67
diff changeset
378 (match_operand 0 "int_reg_operand")
kono
parents: 67
diff changeset
379 {
kono
parents: 67
diff changeset
380 if (GET_CODE (op) == SUBREG)
kono
parents: 67
diff changeset
381 op = SUBREG_REG (op);
kono
parents: 67
diff changeset
382
kono
parents: 67
diff changeset
383 if (!REG_P (op))
kono
parents: 67
diff changeset
384 return 0;
kono
parents: 67
diff changeset
385
kono
parents: 67
diff changeset
386 return (REGNO (op) != FIRST_GPR_REGNO);
kono
parents: 67
diff changeset
387 })
kono
parents: 67
diff changeset
388
kono
parents: 67
diff changeset
389
kono
parents: 67
diff changeset
390 ;; Return true if this is a traditional floating point register
kono
parents: 67
diff changeset
391 (define_predicate "fpr_reg_operand"
kono
parents: 67
diff changeset
392 (match_code "reg,subreg")
kono
parents: 67
diff changeset
393 {
kono
parents: 67
diff changeset
394 HOST_WIDE_INT r;
kono
parents: 67
diff changeset
395
kono
parents: 67
diff changeset
396 if (GET_CODE (op) == SUBREG)
kono
parents: 67
diff changeset
397 op = SUBREG_REG (op);
kono
parents: 67
diff changeset
398
kono
parents: 67
diff changeset
399 if (!REG_P (op))
kono
parents: 67
diff changeset
400 return 0;
kono
parents: 67
diff changeset
401
kono
parents: 67
diff changeset
402 r = REGNO (op);
kono
parents: 67
diff changeset
403 if (r >= FIRST_PSEUDO_REGISTER)
kono
parents: 67
diff changeset
404 return 1;
kono
parents: 67
diff changeset
405
kono
parents: 67
diff changeset
406 return FP_REGNO_P (r);
kono
parents: 67
diff changeset
407 })
kono
parents: 67
diff changeset
408
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
409 ;; Return true if this is a register that can has D-form addressing (GPR,
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
410 ;; traditional FPR registers, and Altivec registers for scalars). Unlike
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
411 ;; power8 fusion, this fusion does not depend on putting the ADDIS instruction
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
412 ;; into the GPR register being loaded.
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
413 (define_predicate "p9_fusion_reg_operand"
111
kono
parents: 67
diff changeset
414 (match_code "reg,subreg")
kono
parents: 67
diff changeset
415 {
kono
parents: 67
diff changeset
416 HOST_WIDE_INT r;
kono
parents: 67
diff changeset
417 bool gpr_p = (mode == QImode || mode == HImode || mode == SImode
kono
parents: 67
diff changeset
418 || mode == SFmode
kono
parents: 67
diff changeset
419 || (TARGET_POWERPC64 && (mode == DImode || mode == DFmode)));
kono
parents: 67
diff changeset
420 bool fpr_p = (TARGET_P9_FUSION
kono
parents: 67
diff changeset
421 && (mode == DFmode || mode == SFmode
kono
parents: 67
diff changeset
422 || (TARGET_POWERPC64 && mode == DImode)));
kono
parents: 67
diff changeset
423 bool vmx_p = (TARGET_P9_FUSION && TARGET_P9_VECTOR
kono
parents: 67
diff changeset
424 && (mode == DFmode || mode == SFmode));
kono
parents: 67
diff changeset
425
kono
parents: 67
diff changeset
426 if (!TARGET_P8_FUSION)
kono
parents: 67
diff changeset
427 return 0;
kono
parents: 67
diff changeset
428
kono
parents: 67
diff changeset
429 if (GET_CODE (op) == SUBREG)
kono
parents: 67
diff changeset
430 op = SUBREG_REG (op);
kono
parents: 67
diff changeset
431
kono
parents: 67
diff changeset
432 if (!REG_P (op))
kono
parents: 67
diff changeset
433 return 0;
kono
parents: 67
diff changeset
434
kono
parents: 67
diff changeset
435 r = REGNO (op);
kono
parents: 67
diff changeset
436 if (r >= FIRST_PSEUDO_REGISTER)
kono
parents: 67
diff changeset
437 return (gpr_p || fpr_p || vmx_p);
kono
parents: 67
diff changeset
438
kono
parents: 67
diff changeset
439 if (INT_REGNO_P (r))
kono
parents: 67
diff changeset
440 return gpr_p;
kono
parents: 67
diff changeset
441
kono
parents: 67
diff changeset
442 if (FP_REGNO_P (r))
kono
parents: 67
diff changeset
443 return fpr_p;
kono
parents: 67
diff changeset
444
kono
parents: 67
diff changeset
445 if (ALTIVEC_REGNO_P (r))
kono
parents: 67
diff changeset
446 return vmx_p;
kono
parents: 67
diff changeset
447
kono
parents: 67
diff changeset
448 return 0;
kono
parents: 67
diff changeset
449 })
kono
parents: 67
diff changeset
450
kono
parents: 67
diff changeset
451 ;; Return 1 if op is a HTM specific SPR register.
kono
parents: 67
diff changeset
452 (define_predicate "htm_spr_reg_operand"
kono
parents: 67
diff changeset
453 (match_operand 0 "register_operand")
kono
parents: 67
diff changeset
454 {
kono
parents: 67
diff changeset
455 if (!TARGET_HTM)
kono
parents: 67
diff changeset
456 return 0;
kono
parents: 67
diff changeset
457
kono
parents: 67
diff changeset
458 if (GET_CODE (op) == SUBREG)
kono
parents: 67
diff changeset
459 op = SUBREG_REG (op);
kono
parents: 67
diff changeset
460
kono
parents: 67
diff changeset
461 if (!REG_P (op))
kono
parents: 67
diff changeset
462 return 0;
kono
parents: 67
diff changeset
463
kono
parents: 67
diff changeset
464 switch (REGNO (op))
kono
parents: 67
diff changeset
465 {
kono
parents: 67
diff changeset
466 case TFHAR_REGNO:
kono
parents: 67
diff changeset
467 case TFIAR_REGNO:
kono
parents: 67
diff changeset
468 case TEXASR_REGNO:
kono
parents: 67
diff changeset
469 return 1;
kono
parents: 67
diff changeset
470 default:
kono
parents: 67
diff changeset
471 break;
kono
parents: 67
diff changeset
472 }
kono
parents: 67
diff changeset
473
kono
parents: 67
diff changeset
474 /* Unknown SPR. */
kono
parents: 67
diff changeset
475 return 0;
kono
parents: 67
diff changeset
476 })
kono
parents: 67
diff changeset
477
kono
parents: 67
diff changeset
478 ;; Return 1 if op is a general purpose register that is an even register
kono
parents: 67
diff changeset
479 ;; which suitable for a load/store quad operation
kono
parents: 67
diff changeset
480 ;; Subregs are not allowed here because when they are combine can
kono
parents: 67
diff changeset
481 ;; create (subreg:PTI (reg:TI pseudo)) which will cause reload to
kono
parents: 67
diff changeset
482 ;; think the innermost reg needs reloading, in TImode instead of
kono
parents: 67
diff changeset
483 ;; PTImode. So reload will choose a reg in TImode which has no
kono
parents: 67
diff changeset
484 ;; requirement that the reg be even.
kono
parents: 67
diff changeset
485 (define_predicate "quad_int_reg_operand"
kono
parents: 67
diff changeset
486 (match_code "reg")
kono
parents: 67
diff changeset
487 {
kono
parents: 67
diff changeset
488 HOST_WIDE_INT r;
kono
parents: 67
diff changeset
489
kono
parents: 67
diff changeset
490 if (!TARGET_QUAD_MEMORY && !TARGET_QUAD_MEMORY_ATOMIC)
kono
parents: 67
diff changeset
491 return 0;
kono
parents: 67
diff changeset
492
kono
parents: 67
diff changeset
493 r = REGNO (op);
kono
parents: 67
diff changeset
494 if (r >= FIRST_PSEUDO_REGISTER)
kono
parents: 67
diff changeset
495 return 1;
kono
parents: 67
diff changeset
496
kono
parents: 67
diff changeset
497 return (INT_REGNO_P (r) && ((r & 1) == 0));
kono
parents: 67
diff changeset
498 })
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
499
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
500 ;; Return 1 if op is a register that is a condition register field.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
501 (define_predicate "cc_reg_operand"
111
kono
parents: 67
diff changeset
502 (match_operand 0 "register_operand")
kono
parents: 67
diff changeset
503 {
kono
parents: 67
diff changeset
504 if (GET_CODE (op) == SUBREG)
kono
parents: 67
diff changeset
505 op = SUBREG_REG (op);
kono
parents: 67
diff changeset
506
kono
parents: 67
diff changeset
507 if (!REG_P (op))
kono
parents: 67
diff changeset
508 return 0;
kono
parents: 67
diff changeset
509
kono
parents: 67
diff changeset
510 if (REGNO (op) > LAST_VIRTUAL_REGISTER)
kono
parents: 67
diff changeset
511 return 1;
kono
parents: 67
diff changeset
512
kono
parents: 67
diff changeset
513 return CR_REGNO_P (REGNO (op));
kono
parents: 67
diff changeset
514 })
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
515
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
516 ;; Return 1 if op is a register that is a condition register field not cr0.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
517 (define_predicate "cc_reg_not_cr0_operand"
111
kono
parents: 67
diff changeset
518 (match_operand 0 "register_operand")
kono
parents: 67
diff changeset
519 {
kono
parents: 67
diff changeset
520 if (GET_CODE (op) == SUBREG)
kono
parents: 67
diff changeset
521 op = SUBREG_REG (op);
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
522
111
kono
parents: 67
diff changeset
523 if (!REG_P (op))
kono
parents: 67
diff changeset
524 return 0;
kono
parents: 67
diff changeset
525
kono
parents: 67
diff changeset
526 if (REGNO (op) > LAST_VIRTUAL_REGISTER)
kono
parents: 67
diff changeset
527 return 1;
kono
parents: 67
diff changeset
528
kono
parents: 67
diff changeset
529 return CR_REGNO_NOT_CR0_P (REGNO (op));
kono
parents: 67
diff changeset
530 })
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
531
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
532 ;; Return 1 if op is a constant integer valid for D field
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
533 ;; or non-special register register.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
534 (define_predicate "reg_or_short_operand"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
535 (if_then_else (match_code "const_int")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
536 (match_operand 0 "short_cint_operand")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
537 (match_operand 0 "gpc_reg_operand")))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
538
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
539 ;; Return 1 if op is a constant integer valid for DS field
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
540 ;; or non-special register.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
541 (define_predicate "reg_or_aligned_short_operand"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
542 (if_then_else (match_code "const_int")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
543 (and (match_operand 0 "short_cint_operand")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
544 (match_test "!(INTVAL (op) & 3)"))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
545 (match_operand 0 "gpc_reg_operand")))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
546
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
547 ;; Return 1 if op is a constant integer whose high-order 16 bits are zero
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
548 ;; or non-special register.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
549 (define_predicate "reg_or_u_short_operand"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
550 (if_then_else (match_code "const_int")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
551 (match_operand 0 "u_short_cint_operand")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
552 (match_operand 0 "gpc_reg_operand")))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
553
111
kono
parents: 67
diff changeset
554 ;; Return 1 if op is any constant integer or a non-special register.
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
555 (define_predicate "reg_or_cint_operand"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
556 (ior (match_code "const_int")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
557 (match_operand 0 "gpc_reg_operand")))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
558
111
kono
parents: 67
diff changeset
559 ;; Return 1 if op is constant zero or a non-special register.
kono
parents: 67
diff changeset
560 (define_predicate "reg_or_zero_operand"
kono
parents: 67
diff changeset
561 (ior (match_operand 0 "zero_constant")
kono
parents: 67
diff changeset
562 (match_operand 0 "gpc_reg_operand")))
kono
parents: 67
diff changeset
563
kono
parents: 67
diff changeset
564 ;; Return 1 if op is a constant integer valid for addition with addis, addi.
kono
parents: 67
diff changeset
565 (define_predicate "add_cint_operand"
kono
parents: 67
diff changeset
566 (and (match_code "const_int")
kono
parents: 67
diff changeset
567 (match_test "((unsigned HOST_WIDE_INT) INTVAL (op)
kono
parents: 67
diff changeset
568 + (mode == SImode ? 0x80000000 : 0x80008000))
kono
parents: 67
diff changeset
569 < (unsigned HOST_WIDE_INT) 0x100000000ll")))
kono
parents: 67
diff changeset
570
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
571 ;; Return 1 if op is a constant integer valid for addition
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
572 ;; or non-special register.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
573 (define_predicate "reg_or_add_cint_operand"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
574 (if_then_else (match_code "const_int")
111
kono
parents: 67
diff changeset
575 (match_operand 0 "add_cint_operand")
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
576 (match_operand 0 "gpc_reg_operand")))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
577
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
578 ;; Return 1 if op is a constant integer valid for subtraction
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
579 ;; or non-special register.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
580 (define_predicate "reg_or_sub_cint_operand"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
581 (if_then_else (match_code "const_int")
111
kono
parents: 67
diff changeset
582 (match_test "(unsigned HOST_WIDE_INT)
kono
parents: 67
diff changeset
583 (- UINTVAL (op) + (mode == SImode ? 0x80000000 : 0x80008000))
kono
parents: 67
diff changeset
584 < (unsigned HOST_WIDE_INT) 0x100000000ll")
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
585 (match_operand 0 "gpc_reg_operand")))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
586
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
587 ;; Return 1 if op is any 32-bit unsigned constant integer
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
588 ;; or non-special register.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
589 (define_predicate "reg_or_logical_cint_operand"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
590 (if_then_else (match_code "const_int")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
591 (match_test "(GET_MODE_BITSIZE (mode) > HOST_BITS_PER_WIDE_INT
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
592 && INTVAL (op) >= 0)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
593 || ((INTVAL (op) & GET_MODE_MASK (mode)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
594 & (~ (unsigned HOST_WIDE_INT) 0xffffffff)) == 0)")
111
kono
parents: 67
diff changeset
595 (match_operand 0 "gpc_reg_operand")))
kono
parents: 67
diff changeset
596
kono
parents: 67
diff changeset
597 ;; Like reg_or_logical_cint_operand, but allow vsx registers
kono
parents: 67
diff changeset
598 (define_predicate "vsx_reg_or_cint_operand"
kono
parents: 67
diff changeset
599 (ior (match_operand 0 "vsx_register_operand")
kono
parents: 67
diff changeset
600 (match_operand 0 "reg_or_logical_cint_operand")))
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
601
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
602 ;; Return 1 if operand is a CONST_DOUBLE that can be set in a register
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
603 ;; with no more than one instruction per word.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
604 (define_predicate "easy_fp_constant"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
605 (match_code "const_double")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
606 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
607 if (GET_MODE (op) != mode
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
608 || (!SCALAR_FLOAT_MODE_P (mode) && mode != DImode))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
609 return 0;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
610
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
611 /* Consider all constants with -msoft-float to be easy. */
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
612 if (TARGET_SOFT_FLOAT && mode != DImode)
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
613 return 1;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
614
111
kono
parents: 67
diff changeset
615 /* 0.0D is not all zero bits. */
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
616 if (DECIMAL_FLOAT_MODE_P (mode))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
617 return 0;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
618
111
kono
parents: 67
diff changeset
619 /* The constant 0.0 is easy under VSX. */
kono
parents: 67
diff changeset
620 if (TARGET_VSX && SCALAR_FLOAT_MODE_P (mode) && op == CONST0_RTX (mode))
kono
parents: 67
diff changeset
621 return 1;
kono
parents: 67
diff changeset
622
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
623 /* If we are using V.4 style PIC, consider all constants to be hard. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
624 if (flag_pic && DEFAULT_ABI == ABI_V4)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
625 return 0;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
626
111
kono
parents: 67
diff changeset
627 /* If we have real FPRs, consider floating point constants hard (other than
kono
parents: 67
diff changeset
628 0.0 under VSX), so that the constant gets pushed to memory during the
kono
parents: 67
diff changeset
629 early RTL phases. This has the advantage that double precision constants
kono
parents: 67
diff changeset
630 that can be represented in single precision without a loss of precision
kono
parents: 67
diff changeset
631 will use single precision loads. */
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
632
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
633 switch (mode)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
634 {
111
kono
parents: 67
diff changeset
635 case E_KFmode:
kono
parents: 67
diff changeset
636 case E_IFmode:
kono
parents: 67
diff changeset
637 case E_TFmode:
kono
parents: 67
diff changeset
638 case E_DFmode:
kono
parents: 67
diff changeset
639 case E_SFmode:
kono
parents: 67
diff changeset
640 return 0;
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
641
111
kono
parents: 67
diff changeset
642 case E_DImode:
kono
parents: 67
diff changeset
643 return (num_insns_constant (op, DImode) <= 2);
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
644
111
kono
parents: 67
diff changeset
645 case E_SImode:
kono
parents: 67
diff changeset
646 return 1;
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
647
111
kono
parents: 67
diff changeset
648 default:
kono
parents: 67
diff changeset
649 gcc_unreachable ();
kono
parents: 67
diff changeset
650 }
kono
parents: 67
diff changeset
651 })
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
652
111
kono
parents: 67
diff changeset
653 ;; Return 1 if the operand is a constant that can loaded with a XXSPLTIB
kono
parents: 67
diff changeset
654 ;; instruction and then a VUPKHSB, VECSB2W or VECSB2D instruction.
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
655
111
kono
parents: 67
diff changeset
656 (define_predicate "xxspltib_constant_split"
kono
parents: 67
diff changeset
657 (match_code "const_vector,vec_duplicate,const_int")
kono
parents: 67
diff changeset
658 {
kono
parents: 67
diff changeset
659 int value = 256;
kono
parents: 67
diff changeset
660 int num_insns = -1;
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
661
111
kono
parents: 67
diff changeset
662 if (!xxspltib_constant_p (op, mode, &num_insns, &value))
kono
parents: 67
diff changeset
663 return false;
kono
parents: 67
diff changeset
664
kono
parents: 67
diff changeset
665 return num_insns > 1;
kono
parents: 67
diff changeset
666 })
kono
parents: 67
diff changeset
667
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
668
111
kono
parents: 67
diff changeset
669 ;; Return 1 if the operand is constant that can loaded directly with a XXSPLTIB
kono
parents: 67
diff changeset
670 ;; instruction.
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
671
111
kono
parents: 67
diff changeset
672 (define_predicate "xxspltib_constant_nosplit"
kono
parents: 67
diff changeset
673 (match_code "const_vector,vec_duplicate,const_int")
kono
parents: 67
diff changeset
674 {
kono
parents: 67
diff changeset
675 int value = 256;
kono
parents: 67
diff changeset
676 int num_insns = -1;
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
677
111
kono
parents: 67
diff changeset
678 if (!xxspltib_constant_p (op, mode, &num_insns, &value))
kono
parents: 67
diff changeset
679 return false;
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
680
111
kono
parents: 67
diff changeset
681 return num_insns == 1;
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
682 })
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
683
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
684 ;; Return 1 if the operand is a CONST_VECTOR and can be loaded into a
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
685 ;; vector register without using memory.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
686 (define_predicate "easy_vector_constant"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
687 (match_code "const_vector")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
688 {
111
kono
parents: 67
diff changeset
689 /* Because IEEE 128-bit floating point is considered a vector type
kono
parents: 67
diff changeset
690 in order to pass it in VSX registers, it might use this function
kono
parents: 67
diff changeset
691 instead of easy_fp_constant. */
kono
parents: 67
diff changeset
692 if (FLOAT128_VECTOR_P (mode))
kono
parents: 67
diff changeset
693 return easy_fp_constant (op, mode);
kono
parents: 67
diff changeset
694
67
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
695 if (VECTOR_MEM_ALTIVEC_OR_VSX_P (mode))
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
696 {
111
kono
parents: 67
diff changeset
697 int value = 256;
kono
parents: 67
diff changeset
698 int num_insns = -1;
kono
parents: 67
diff changeset
699
kono
parents: 67
diff changeset
700 if (zero_constant (op, mode) || all_ones_constant (op, mode))
kono
parents: 67
diff changeset
701 return true;
kono
parents: 67
diff changeset
702
kono
parents: 67
diff changeset
703 if (TARGET_P9_VECTOR
kono
parents: 67
diff changeset
704 && xxspltib_constant_p (op, mode, &num_insns, &value))
67
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
705 return true;
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
706
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
707 return easy_altivec_constant (op, mode);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
708 }
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
709
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
710 return false;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
711 })
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
712
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
713 ;; Same as easy_vector_constant but only for EASY_VECTOR_15_ADD_SELF.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
714 (define_predicate "easy_vector_constant_add_self"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
715 (and (match_code "const_vector")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
716 (and (match_test "TARGET_ALTIVEC")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
717 (match_test "easy_altivec_constant (op, mode)")))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
718 {
67
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
719 HOST_WIDE_INT val;
111
kono
parents: 67
diff changeset
720 int elt;
67
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
721 if (mode == V2DImode || mode == V2DFmode)
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
722 return 0;
111
kono
parents: 67
diff changeset
723 elt = BYTES_BIG_ENDIAN ? GET_MODE_NUNITS (mode) - 1 : 0;
kono
parents: 67
diff changeset
724 val = const_vector_elt_as_int (op, elt);
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
725 val = ((val & 0xff) ^ 0x80) - 0x80;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
726 return EASY_VECTOR_15_ADD_SELF (val);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
727 })
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
728
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
729 ;; Same as easy_vector_constant but only for EASY_VECTOR_MSB.
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
730 (define_predicate "easy_vector_constant_msb"
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
731 (and (match_code "const_vector")
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
732 (and (match_test "TARGET_ALTIVEC")
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
733 (match_test "easy_altivec_constant (op, mode)")))
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
734 {
67
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
735 HOST_WIDE_INT val;
111
kono
parents: 67
diff changeset
736 int elt;
67
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
737 if (mode == V2DImode || mode == V2DFmode)
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
738 return 0;
111
kono
parents: 67
diff changeset
739 elt = BYTES_BIG_ENDIAN ? GET_MODE_NUNITS (mode) - 1 : 0;
kono
parents: 67
diff changeset
740 val = const_vector_elt_as_int (op, elt);
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
741 return EASY_VECTOR_MSB (val, GET_MODE_INNER (mode));
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
742 })
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
743
111
kono
parents: 67
diff changeset
744 ;; Return true if this is an easy altivec constant that we form
kono
parents: 67
diff changeset
745 ;; by using VSLDOI.
kono
parents: 67
diff changeset
746 (define_predicate "easy_vector_constant_vsldoi"
kono
parents: 67
diff changeset
747 (and (match_code "const_vector")
kono
parents: 67
diff changeset
748 (and (match_test "TARGET_ALTIVEC")
kono
parents: 67
diff changeset
749 (and (match_test "easy_altivec_constant (op, mode)")
kono
parents: 67
diff changeset
750 (match_test "vspltis_shifted (op) != 0")))))
kono
parents: 67
diff changeset
751
kono
parents: 67
diff changeset
752 ;; Return 1 if operand is a vector int register or is either a vector constant
kono
parents: 67
diff changeset
753 ;; of all 0 bits of a vector constant of all 1 bits.
kono
parents: 67
diff changeset
754 (define_predicate "vector_int_reg_or_same_bit"
kono
parents: 67
diff changeset
755 (match_code "reg,subreg,const_vector")
kono
parents: 67
diff changeset
756 {
kono
parents: 67
diff changeset
757 if (GET_MODE_CLASS (mode) != MODE_VECTOR_INT)
kono
parents: 67
diff changeset
758 return 0;
kono
parents: 67
diff changeset
759
kono
parents: 67
diff changeset
760 else if (REG_P (op) || SUBREG_P (op))
kono
parents: 67
diff changeset
761 return vint_operand (op, mode);
kono
parents: 67
diff changeset
762
kono
parents: 67
diff changeset
763 else
kono
parents: 67
diff changeset
764 return op == CONST0_RTX (mode) || op == CONSTM1_RTX (mode);
kono
parents: 67
diff changeset
765 })
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
766
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
767 ;; Return 1 if operand is 0.0.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
768 (define_predicate "zero_fp_constant"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
769 (and (match_code "const_double")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
770 (match_test "SCALAR_FLOAT_MODE_P (mode)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
771 && op == CONST0_RTX (mode)")))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
772
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
773 ;; Return 1 if the operand is in volatile memory. Note that during the
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
774 ;; RTL generation phase, memory_operand does not return TRUE for volatile
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
775 ;; memory references. So this function allows us to recognize volatile
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
776 ;; references where it's safe.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
777 (define_predicate "volatile_mem_operand"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
778 (and (and (match_code "mem")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
779 (match_test "MEM_VOLATILE_P (op)"))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
780 (if_then_else (match_test "reload_completed")
111
kono
parents: 67
diff changeset
781 (match_operand 0 "memory_operand")
kono
parents: 67
diff changeset
782 (match_test "memory_address_p (mode, XEXP (op, 0))"))))
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
783
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
784 ;; Return 1 if the operand is an offsettable memory operand.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
785 (define_predicate "offsettable_mem_operand"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
786 (and (match_operand 0 "memory_operand")
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
787 (match_test "offsettable_nonstrict_memref_p (op)")))
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
788
111
kono
parents: 67
diff changeset
789 ;; Return 1 if the operand is a simple offsettable memory operand
kono
parents: 67
diff changeset
790 ;; that does not include pre-increment, post-increment, etc.
kono
parents: 67
diff changeset
791 (define_predicate "simple_offsettable_mem_operand"
kono
parents: 67
diff changeset
792 (match_operand 0 "offsettable_mem_operand")
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
793 {
111
kono
parents: 67
diff changeset
794 rtx addr = XEXP (op, 0);
kono
parents: 67
diff changeset
795
kono
parents: 67
diff changeset
796 if (GET_CODE (addr) != PLUS && GET_CODE (addr) != LO_SUM)
kono
parents: 67
diff changeset
797 return 0;
kono
parents: 67
diff changeset
798
kono
parents: 67
diff changeset
799 if (!CONSTANT_P (XEXP (addr, 1)))
kono
parents: 67
diff changeset
800 return 0;
kono
parents: 67
diff changeset
801
kono
parents: 67
diff changeset
802 return base_reg_operand (XEXP (addr, 0), Pmode);
kono
parents: 67
diff changeset
803 })
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
804
111
kono
parents: 67
diff changeset
805 ;; Return 1 if the operand is suitable for load/store quad memory.
kono
parents: 67
diff changeset
806 ;; This predicate only checks for non-atomic loads/stores (not lqarx/stqcx).
kono
parents: 67
diff changeset
807 (define_predicate "quad_memory_operand"
kono
parents: 67
diff changeset
808 (match_code "mem")
kono
parents: 67
diff changeset
809 {
kono
parents: 67
diff changeset
810 if (!TARGET_QUAD_MEMORY && !TARGET_SYNC_TI)
kono
parents: 67
diff changeset
811 return false;
kono
parents: 67
diff changeset
812
kono
parents: 67
diff changeset
813 if (GET_MODE_SIZE (mode) != 16 || !MEM_P (op) || MEM_ALIGN (op) < 128)
kono
parents: 67
diff changeset
814 return false;
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
815
111
kono
parents: 67
diff changeset
816 return quad_address_p (XEXP (op, 0), mode, false);
kono
parents: 67
diff changeset
817 })
kono
parents: 67
diff changeset
818
kono
parents: 67
diff changeset
819 ;; Return 1 if the operand is suitable for load/store to vector registers with
kono
parents: 67
diff changeset
820 ;; d-form addressing (register+offset), which was added in ISA 3.0.
kono
parents: 67
diff changeset
821 ;; Unlike quad_memory_operand, we do not have to check for alignment.
kono
parents: 67
diff changeset
822 (define_predicate "vsx_quad_dform_memory_operand"
kono
parents: 67
diff changeset
823 (match_code "mem")
kono
parents: 67
diff changeset
824 {
kono
parents: 67
diff changeset
825 if (!TARGET_P9_VECTOR || !MEM_P (op) || GET_MODE_SIZE (mode) != 16)
kono
parents: 67
diff changeset
826 return false;
kono
parents: 67
diff changeset
827
kono
parents: 67
diff changeset
828 return quad_address_p (XEXP (op, 0), mode, false);
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
829 })
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
830
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
831 ;; Return 1 if the operand is an indexed or indirect memory operand.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
832 (define_predicate "indexed_or_indirect_operand"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
833 (match_code "mem")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
834 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
835 op = XEXP (op, 0);
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
836 if (VECTOR_MEM_ALTIVEC_P (mode)
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
837 && GET_CODE (op) == AND
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
838 && GET_CODE (XEXP (op, 1)) == CONST_INT
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
839 && INTVAL (XEXP (op, 1)) == -16)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
840 op = XEXP (op, 0);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
841
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
842 return indexed_or_indirect_address (op, mode);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
843 })
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
844
111
kono
parents: 67
diff changeset
845 ;; Like indexed_or_indirect_operand, but also allow a GPR register if direct
kono
parents: 67
diff changeset
846 ;; moves are supported.
kono
parents: 67
diff changeset
847 (define_predicate "reg_or_indexed_operand"
kono
parents: 67
diff changeset
848 (match_code "mem,reg,subreg")
kono
parents: 67
diff changeset
849 {
kono
parents: 67
diff changeset
850 if (MEM_P (op))
kono
parents: 67
diff changeset
851 return indexed_or_indirect_operand (op, mode);
kono
parents: 67
diff changeset
852 else if (TARGET_DIRECT_MOVE)
kono
parents: 67
diff changeset
853 return register_operand (op, mode);
kono
parents: 67
diff changeset
854 return
kono
parents: 67
diff changeset
855 0;
kono
parents: 67
diff changeset
856 })
kono
parents: 67
diff changeset
857
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
858 ;; Return 1 if the operand is an indexed or indirect memory operand with an
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
859 ;; AND -16 in it, used to recognize when we need to switch to Altivec loads
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
860 ;; to realign loops instead of VSX (altivec silently ignores the bottom bits,
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
861 ;; while VSX uses the full address and traps)
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
862 (define_predicate "altivec_indexed_or_indirect_operand"
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
863 (match_code "mem")
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
864 {
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
865 op = XEXP (op, 0);
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
866 if (VECTOR_MEM_ALTIVEC_OR_VSX_P (mode)
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
867 && GET_CODE (op) == AND
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
868 && GET_CODE (XEXP (op, 1)) == CONST_INT
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
869 && INTVAL (XEXP (op, 1)) == -16)
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
870 return indexed_or_indirect_address (XEXP (op, 0), mode);
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
871
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
872 return 0;
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
873 })
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
874
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
875 ;; Return 1 if the operand is an indexed or indirect address.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
876 (define_special_predicate "indexed_or_indirect_address"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
877 (and (match_test "REG_P (op)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
878 || (GET_CODE (op) == PLUS
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
879 /* Omit testing REG_P (XEXP (op, 0)). */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
880 && REG_P (XEXP (op, 1)))")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
881 (match_operand 0 "address_operand")))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
882
111
kono
parents: 67
diff changeset
883 ;; Return 1 if the operand is an index-form address.
kono
parents: 67
diff changeset
884 (define_special_predicate "indexed_address"
kono
parents: 67
diff changeset
885 (match_test "(GET_CODE (op) == PLUS
kono
parents: 67
diff changeset
886 && REG_P (XEXP (op, 0))
kono
parents: 67
diff changeset
887 && REG_P (XEXP (op, 1)))"))
kono
parents: 67
diff changeset
888
kono
parents: 67
diff changeset
889 ;; Return 1 if the operand is a MEM with an update-form address. This may
kono
parents: 67
diff changeset
890 ;; also include update-indexed form.
kono
parents: 67
diff changeset
891 (define_special_predicate "update_address_mem"
kono
parents: 67
diff changeset
892 (match_test "(MEM_P (op)
kono
parents: 67
diff changeset
893 && (GET_CODE (XEXP (op, 0)) == PRE_INC
kono
parents: 67
diff changeset
894 || GET_CODE (XEXP (op, 0)) == PRE_DEC
kono
parents: 67
diff changeset
895 || GET_CODE (XEXP (op, 0)) == PRE_MODIFY))"))
kono
parents: 67
diff changeset
896
kono
parents: 67
diff changeset
897 ;; Return 1 if the operand is a MEM with an indexed-form address.
kono
parents: 67
diff changeset
898 (define_special_predicate "indexed_address_mem"
kono
parents: 67
diff changeset
899 (match_test "(MEM_P (op)
kono
parents: 67
diff changeset
900 && (indexed_address (XEXP (op, 0), mode)
kono
parents: 67
diff changeset
901 || (GET_CODE (XEXP (op, 0)) == PRE_MODIFY
kono
parents: 67
diff changeset
902 && indexed_address (XEXP (XEXP (op, 0), 1), mode))))"))
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
903
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
904 ;; Return 1 if the operand is either a non-special register or can be used
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
905 ;; as the operand of a `mode' add insn.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
906 (define_predicate "add_operand"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
907 (if_then_else (match_code "const_int")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
908 (match_test "satisfies_constraint_I (op)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
909 || satisfies_constraint_L (op)")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
910 (match_operand 0 "gpc_reg_operand")))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
911
111
kono
parents: 67
diff changeset
912 ;; Return 1 if the operand is either a non-special register, or 0, or -1.
kono
parents: 67
diff changeset
913 (define_predicate "adde_operand"
kono
parents: 67
diff changeset
914 (if_then_else (match_code "const_int")
kono
parents: 67
diff changeset
915 (match_test "INTVAL (op) == 0 || INTVAL (op) == -1")
kono
parents: 67
diff changeset
916 (match_operand 0 "gpc_reg_operand")))
kono
parents: 67
diff changeset
917
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
918 ;; Return 1 if OP is a constant but not a valid add_operand.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
919 (define_predicate "non_add_cint_operand"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
920 (and (match_code "const_int")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
921 (match_test "!satisfies_constraint_I (op)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
922 && !satisfies_constraint_L (op)")))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
923
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
924 ;; Return 1 if the operand is a constant that can be used as the operand
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
925 ;; of an OR or XOR.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
926 (define_predicate "logical_const_operand"
111
kono
parents: 67
diff changeset
927 (match_code "const_int")
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
928 {
111
kono
parents: 67
diff changeset
929 HOST_WIDE_INT opl;
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
930
111
kono
parents: 67
diff changeset
931 opl = INTVAL (op) & GET_MODE_MASK (mode);
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
932
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
933 return ((opl & ~ (unsigned HOST_WIDE_INT) 0xffff) == 0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
934 || (opl & ~ (unsigned HOST_WIDE_INT) 0xffff0000) == 0);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
935 })
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
936
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
937 ;; Return 1 if the operand is a non-special register or a constant that
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
938 ;; can be used as the operand of an OR or XOR.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
939 (define_predicate "logical_operand"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
940 (ior (match_operand 0 "gpc_reg_operand")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
941 (match_operand 0 "logical_const_operand")))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
942
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
943 ;; Return 1 if op is a constant that is not a logical operand, but could
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
944 ;; be split into one.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
945 (define_predicate "non_logical_cint_operand"
111
kono
parents: 67
diff changeset
946 (and (match_code "const_int,const_wide_int")
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
947 (and (not (match_operand 0 "logical_operand"))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
948 (match_operand 0 "reg_or_logical_cint_operand"))))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
949
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
950 ;; Return 1 if the operand is either a non-special register or a
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
951 ;; constant that can be used as the operand of a logical AND.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
952 (define_predicate "and_operand"
111
kono
parents: 67
diff changeset
953 (ior (and (match_code "const_int")
kono
parents: 67
diff changeset
954 (match_test "rs6000_is_valid_and_mask (op, mode)"))
kono
parents: 67
diff changeset
955 (if_then_else (match_test "fixed_regs[CR0_REGNO]")
kono
parents: 67
diff changeset
956 (match_operand 0 "gpc_reg_operand")
kono
parents: 67
diff changeset
957 (match_operand 0 "logical_operand"))))
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
958
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
959 ;; Return 1 if the operand is either a logical operand or a short cint operand.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
960 (define_predicate "scc_eq_operand"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
961 (ior (match_operand 0 "logical_operand")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
962 (match_operand 0 "short_cint_operand")))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
963
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
964 ;; Return 1 if the operand is a general non-special register or memory operand.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
965 (define_predicate "reg_or_mem_operand"
111
kono
parents: 67
diff changeset
966 (ior (match_operand 0 "memory_operand")
kono
parents: 67
diff changeset
967 (and (match_code "mem")
kono
parents: 67
diff changeset
968 (match_test "macho_lo_sum_memory_operand (op, mode)"))
kono
parents: 67
diff changeset
969 (match_operand 0 "volatile_mem_operand")
kono
parents: 67
diff changeset
970 (match_operand 0 "gpc_reg_operand")))
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
971
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
972 ;; Return 1 if the operand is CONST_DOUBLE 0, register or memory operand.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
973 (define_predicate "zero_reg_mem_operand"
111
kono
parents: 67
diff changeset
974 (ior (and (match_test "TARGET_VSX")
kono
parents: 67
diff changeset
975 (match_operand 0 "zero_fp_constant"))
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
976 (match_operand 0 "reg_or_mem_operand")))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
977
111
kono
parents: 67
diff changeset
978 ;; Return 1 if the operand is a CONST_INT and it is the element for 64-bit
kono
parents: 67
diff changeset
979 ;; data types inside of a vector that scalar instructions operate on
kono
parents: 67
diff changeset
980 (define_predicate "vsx_scalar_64bit"
kono
parents: 67
diff changeset
981 (match_code "const_int")
kono
parents: 67
diff changeset
982 {
kono
parents: 67
diff changeset
983 return (INTVAL (op) == VECTOR_ELEMENT_SCALAR_64BIT);
kono
parents: 67
diff changeset
984 })
kono
parents: 67
diff changeset
985
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
986 ;; Return 1 if the operand is a general register or memory operand without
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
987 ;; pre_inc or pre_dec or pre_modify, which produces invalid form of PowerPC
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
988 ;; lwa instruction.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
989 (define_predicate "lwa_operand"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
990 (match_code "reg,subreg,mem")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
991 {
67
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
992 rtx inner, addr, offset;
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
993
67
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
994 inner = op;
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
995 if (reload_completed && GET_CODE (inner) == SUBREG)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
996 inner = SUBREG_REG (inner);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
997
67
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
998 if (gpc_reg_operand (inner, mode))
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
999 return true;
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
1000 if (!memory_operand (inner, mode))
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
1001 return false;
111
kono
parents: 67
diff changeset
1002
67
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
1003 addr = XEXP (inner, 0);
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
1004 if (GET_CODE (addr) == PRE_INC
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
1005 || GET_CODE (addr) == PRE_DEC
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
1006 || (GET_CODE (addr) == PRE_MODIFY
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
1007 && !legitimate_indexed_address_p (XEXP (addr, 1), 0)))
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
1008 return false;
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
1009 if (GET_CODE (addr) == LO_SUM
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
1010 && GET_CODE (XEXP (addr, 0)) == REG
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
1011 && GET_CODE (XEXP (addr, 1)) == CONST)
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
1012 addr = XEXP (XEXP (addr, 1), 0);
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
1013 if (GET_CODE (addr) != PLUS)
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
1014 return true;
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
1015 offset = XEXP (addr, 1);
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
1016 if (GET_CODE (offset) != CONST_INT)
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
1017 return true;
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
1018 return INTVAL (offset) % 4 == 0;
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1019 })
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1020
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1021 ;; Return 1 if the operand, used inside a MEM, is a SYMBOL_REF.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1022 (define_predicate "symbol_ref_operand"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1023 (and (match_code "symbol_ref")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1024 (match_test "(mode == VOIDmode || GET_MODE (op) == mode)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1025 && (DEFAULT_ABI != ABI_AIX || SYMBOL_REF_FUNCTION_P (op))")))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1026
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1027 ;; Return 1 if op is an operand that can be loaded via the GOT.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1028 ;; or non-special register register field no cr0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1029 (define_predicate "got_operand"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1030 (match_code "symbol_ref,const,label_ref"))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1031
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1032 ;; Return 1 if op is a simple reference that can be loaded via the GOT,
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1033 ;; excluding labels involving addition.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1034 (define_predicate "got_no_const_operand"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1035 (match_code "symbol_ref,label_ref"))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1036
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1037 ;; Return 1 if op is a SYMBOL_REF for a TLS symbol.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1038 (define_predicate "rs6000_tls_symbol_ref"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1039 (and (match_code "symbol_ref")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1040 (match_test "RS6000_SYMBOL_REF_TLS_P (op)")))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1041
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1042 ;; Return 1 if the operand, used inside a MEM, is a valid first argument
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1043 ;; to CALL. This is a SYMBOL_REF, a pseudo-register, LR or CTR.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1044 (define_predicate "call_operand"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1045 (if_then_else (match_code "reg")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1046 (match_test "REGNO (op) == LR_REGNO
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1047 || REGNO (op) == CTR_REGNO
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1048 || REGNO (op) >= FIRST_PSEUDO_REGISTER")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1049 (match_code "symbol_ref")))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1050
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1051 ;; Return 1 if the operand is a SYMBOL_REF for a function known to be in
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1052 ;; this file.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1053 (define_predicate "current_file_function_operand"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1054 (and (match_code "symbol_ref")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1055 (match_test "(DEFAULT_ABI != ABI_AIX || SYMBOL_REF_FUNCTION_P (op))
111
kono
parents: 67
diff changeset
1056 && (SYMBOL_REF_LOCAL_P (op)
kono
parents: 67
diff changeset
1057 || (op == XEXP (DECL_RTL (current_function_decl), 0)
kono
parents: 67
diff changeset
1058 && !decl_replaceable_p (current_function_decl)))
kono
parents: 67
diff changeset
1059 && !((DEFAULT_ABI == ABI_AIX
kono
parents: 67
diff changeset
1060 || DEFAULT_ABI == ABI_ELFv2)
kono
parents: 67
diff changeset
1061 && (SYMBOL_REF_EXTERNAL_P (op)
kono
parents: 67
diff changeset
1062 || SYMBOL_REF_WEAK (op)))")))
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1063
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1064 ;; Return 1 if this operand is a valid input for a move insn.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1065 (define_predicate "input_operand"
111
kono
parents: 67
diff changeset
1066 (match_code "symbol_ref,const,reg,subreg,mem,
kono
parents: 67
diff changeset
1067 const_double,const_wide_int,const_vector,const_int")
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1068 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1069 /* Memory is always valid. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1070 if (memory_operand (op, mode))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1071 return 1;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1072
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1073 /* For floating-point, easy constants are valid. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1074 if (SCALAR_FLOAT_MODE_P (mode)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1075 && easy_fp_constant (op, mode))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1076 return 1;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1077
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1078 /* Allow any integer constant. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1079 if (GET_MODE_CLASS (mode) == MODE_INT
111
kono
parents: 67
diff changeset
1080 && CONST_SCALAR_INT_P (op))
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1081 return 1;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1082
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1083 /* Allow easy vector constants. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1084 if (GET_CODE (op) == CONST_VECTOR
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1085 && easy_vector_constant (op, mode))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1086 return 1;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1087
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1088 /* For floating-point or multi-word mode, the only remaining valid type
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1089 is a register. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1090 if (SCALAR_FLOAT_MODE_P (mode)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1091 || GET_MODE_SIZE (mode) > UNITS_PER_WORD)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1092 return register_operand (op, mode);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1093
111
kono
parents: 67
diff changeset
1094 /* We don't allow moving the carry bit around. */
kono
parents: 67
diff changeset
1095 if (ca_operand (op, mode))
kono
parents: 67
diff changeset
1096 return 0;
kono
parents: 67
diff changeset
1097
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1098 /* The only cases left are integral modes one word or smaller (we
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1099 do not get called for MODE_CC values). These can be in any
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1100 register. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1101 if (register_operand (op, mode))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1102 return 1;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1103
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1104 /* V.4 allows SYMBOL_REFs and CONSTs that are in the small data region
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1105 to be valid. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1106 if (DEFAULT_ABI == ABI_V4
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1107 && (GET_CODE (op) == SYMBOL_REF || GET_CODE (op) == CONST)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1108 && small_data_operand (op, Pmode))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1109 return 1;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1110
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1111 return 0;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1112 })
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1113
111
kono
parents: 67
diff changeset
1114 ;; Return 1 if this operand is a valid input for a vsx_splat insn.
kono
parents: 67
diff changeset
1115 (define_predicate "splat_input_operand"
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1116 (match_code "reg,subreg,mem")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1117 {
111
kono
parents: 67
diff changeset
1118 machine_mode vmode;
kono
parents: 67
diff changeset
1119
kono
parents: 67
diff changeset
1120 if (mode == DFmode)
kono
parents: 67
diff changeset
1121 vmode = V2DFmode;
kono
parents: 67
diff changeset
1122 else if (mode == DImode)
kono
parents: 67
diff changeset
1123 vmode = V2DImode;
kono
parents: 67
diff changeset
1124 else if (mode == SImode && TARGET_P9_VECTOR)
kono
parents: 67
diff changeset
1125 vmode = V4SImode;
kono
parents: 67
diff changeset
1126 else if (mode == SFmode && TARGET_P9_VECTOR)
kono
parents: 67
diff changeset
1127 vmode = V4SFmode;
kono
parents: 67
diff changeset
1128 else
kono
parents: 67
diff changeset
1129 return false;
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1130
111
kono
parents: 67
diff changeset
1131 if (MEM_P (op))
kono
parents: 67
diff changeset
1132 {
kono
parents: 67
diff changeset
1133 rtx addr = XEXP (op, 0);
kono
parents: 67
diff changeset
1134
kono
parents: 67
diff changeset
1135 if (! volatile_ok && MEM_VOLATILE_P (op))
kono
parents: 67
diff changeset
1136 return 0;
kono
parents: 67
diff changeset
1137
kono
parents: 67
diff changeset
1138 if (lra_in_progress || reload_completed)
kono
parents: 67
diff changeset
1139 return indexed_or_indirect_address (addr, vmode);
kono
parents: 67
diff changeset
1140 else
kono
parents: 67
diff changeset
1141 return memory_address_addr_space_p (vmode, addr, MEM_ADDR_SPACE (op));
kono
parents: 67
diff changeset
1142 }
kono
parents: 67
diff changeset
1143 return gpc_reg_operand (op, mode);
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1144 })
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1145
111
kono
parents: 67
diff changeset
1146 ;; Return true if operand is an operator used in rotate-and-mask instructions.
kono
parents: 67
diff changeset
1147 (define_predicate "rotate_mask_operator"
kono
parents: 67
diff changeset
1148 (match_code "rotate,ashift,lshiftrt"))
kono
parents: 67
diff changeset
1149
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1150 ;; Return true if operand is boolean operator.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1151 (define_predicate "boolean_operator"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1152 (match_code "and,ior,xor"))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1153
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1154 ;; Return true if operand is OR-form of boolean operator.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1155 (define_predicate "boolean_or_operator"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1156 (match_code "ior,xor"))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1157
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1158 ;; Return true if operand is an equality operator.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1159 (define_special_predicate "equality_operator"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1160 (match_code "eq,ne"))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1161
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1162 ;; Return 1 if OP is a comparison operation that is valid for a branch
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1163 ;; instruction. We check the opcode against the mode of the CC value.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1164 ;; validate_condition_mode is an assertion.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1165 (define_predicate "branch_comparison_operator"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1166 (and (match_operand 0 "comparison_operator")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1167 (and (match_test "GET_MODE_CLASS (GET_MODE (XEXP (op, 0))) == MODE_CC")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1168 (match_test "validate_condition_mode (GET_CODE (op),
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1169 GET_MODE (XEXP (op, 0))),
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1170 1"))))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1171
111
kono
parents: 67
diff changeset
1172 ;; Return 1 if OP is an unsigned comparison operator.
kono
parents: 67
diff changeset
1173 (define_predicate "unsigned_comparison_operator"
kono
parents: 67
diff changeset
1174 (match_code "ltu,gtu,leu,geu"))
kono
parents: 67
diff changeset
1175
kono
parents: 67
diff changeset
1176 ;; Return 1 if OP is a signed comparison operator.
kono
parents: 67
diff changeset
1177 (define_predicate "signed_comparison_operator"
kono
parents: 67
diff changeset
1178 (match_code "lt,gt,le,ge"))
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
1179
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1180 ;; Return 1 if OP is a comparison operation that is valid for an SCC insn --
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1181 ;; it must be a positive comparison.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1182 (define_predicate "scc_comparison_operator"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1183 (and (match_operand 0 "branch_comparison_operator")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1184 (match_code "eq,lt,gt,ltu,gtu,unordered")))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1185
67
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
1186 ;; Return 1 if OP is a comparison operation whose inverse would be valid for
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
1187 ;; an SCC insn.
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
1188 (define_predicate "scc_rev_comparison_operator"
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
1189 (and (match_operand 0 "branch_comparison_operator")
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
1190 (match_code "ne,le,ge,leu,geu,ordered")))
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
1191
111
kono
parents: 67
diff changeset
1192 ;; Return 1 if OP is a comparison operator suitable for floating point
kono
parents: 67
diff changeset
1193 ;; vector/scalar comparisons that generate a -1/0 mask.
kono
parents: 67
diff changeset
1194 (define_predicate "fpmask_comparison_operator"
kono
parents: 67
diff changeset
1195 (match_code "eq,gt,ge"))
kono
parents: 67
diff changeset
1196
kono
parents: 67
diff changeset
1197 ;; Return 1 if OP is a comparison operator suitable for vector/scalar
kono
parents: 67
diff changeset
1198 ;; comparisons that generate a 0/-1 mask (i.e. the inverse of
kono
parents: 67
diff changeset
1199 ;; fpmask_comparison_operator).
kono
parents: 67
diff changeset
1200 (define_predicate "invert_fpmask_comparison_operator"
kono
parents: 67
diff changeset
1201 (match_code "ne,unlt,unle"))
kono
parents: 67
diff changeset
1202
kono
parents: 67
diff changeset
1203 ;; Return 1 if OP is a comparison operation suitable for integer vector/scalar
kono
parents: 67
diff changeset
1204 ;; comparisons that generate a -1/0 mask.
kono
parents: 67
diff changeset
1205 (define_predicate "vecint_comparison_operator"
kono
parents: 67
diff changeset
1206 (match_code "eq,gt,gtu"))
kono
parents: 67
diff changeset
1207
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1208 ;; Return 1 if OP is a comparison operation that is valid for a branch
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1209 ;; insn, which is true if the corresponding bit in the CC register is set.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1210 (define_predicate "branch_positive_comparison_operator"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1211 (and (match_operand 0 "branch_comparison_operator")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1212 (match_code "eq,lt,gt,ltu,gtu,unordered")))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1213
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1214 ;; Return 1 if OP is valid for a save_world call in prologue, known to be
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1215 ;; a PARLLEL.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1216 (define_predicate "save_world_operation"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1217 (match_code "parallel")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1218 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1219 int index;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1220 int i;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1221 rtx elt;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1222 int count = XVECLEN (op, 0);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1223
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1224 if (count != 54)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1225 return 0;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1226
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1227 index = 0;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1228 if (GET_CODE (XVECEXP (op, 0, index++)) != CLOBBER
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1229 || GET_CODE (XVECEXP (op, 0, index++)) != USE)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1230 return 0;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1231
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1232 for (i=1; i <= 18; i++)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1233 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1234 elt = XVECEXP (op, 0, index++);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1235 if (GET_CODE (elt) != SET
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1236 || GET_CODE (SET_DEST (elt)) != MEM
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1237 || ! memory_operand (SET_DEST (elt), DFmode)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1238 || GET_CODE (SET_SRC (elt)) != REG
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1239 || GET_MODE (SET_SRC (elt)) != DFmode)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1240 return 0;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1241 }
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1242
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1243 for (i=1; i <= 12; i++)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1244 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1245 elt = XVECEXP (op, 0, index++);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1246 if (GET_CODE (elt) != SET
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1247 || GET_CODE (SET_DEST (elt)) != MEM
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1248 || GET_CODE (SET_SRC (elt)) != REG
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1249 || GET_MODE (SET_SRC (elt)) != V4SImode)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1250 return 0;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1251 }
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1252
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1253 for (i=1; i <= 19; i++)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1254 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1255 elt = XVECEXP (op, 0, index++);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1256 if (GET_CODE (elt) != SET
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1257 || GET_CODE (SET_DEST (elt)) != MEM
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1258 || ! memory_operand (SET_DEST (elt), Pmode)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1259 || GET_CODE (SET_SRC (elt)) != REG
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1260 || GET_MODE (SET_SRC (elt)) != Pmode)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1261 return 0;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1262 }
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1263
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1264 elt = XVECEXP (op, 0, index++);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1265 if (GET_CODE (elt) != SET
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1266 || GET_CODE (SET_DEST (elt)) != MEM
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1267 || ! memory_operand (SET_DEST (elt), Pmode)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1268 || GET_CODE (SET_SRC (elt)) != REG
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1269 || REGNO (SET_SRC (elt)) != CR2_REGNO
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1270 || GET_MODE (SET_SRC (elt)) != Pmode)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1271 return 0;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1272
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1273 if (GET_CODE (XVECEXP (op, 0, index++)) != SET
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1274 || GET_CODE (XVECEXP (op, 0, index++)) != SET)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1275 return 0;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1276 return 1;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1277 })
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1278
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1279 ;; Return 1 if OP is valid for a restore_world call in epilogue, known to be
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1280 ;; a PARLLEL.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1281 (define_predicate "restore_world_operation"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1282 (match_code "parallel")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1283 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1284 int index;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1285 int i;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1286 rtx elt;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1287 int count = XVECLEN (op, 0);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1288
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
1289 if (count != 58)
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1290 return 0;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1291
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1292 index = 0;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1293 if (GET_CODE (XVECEXP (op, 0, index++)) != RETURN
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1294 || GET_CODE (XVECEXP (op, 0, index++)) != USE
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1295 || GET_CODE (XVECEXP (op, 0, index++)) != CLOBBER)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1296 return 0;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1297
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1298 elt = XVECEXP (op, 0, index++);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1299 if (GET_CODE (elt) != SET
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1300 || GET_CODE (SET_SRC (elt)) != MEM
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1301 || ! memory_operand (SET_SRC (elt), Pmode)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1302 || GET_CODE (SET_DEST (elt)) != REG
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1303 || REGNO (SET_DEST (elt)) != CR2_REGNO
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1304 || GET_MODE (SET_DEST (elt)) != Pmode)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1305 return 0;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1306
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1307 for (i=1; i <= 19; i++)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1308 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1309 elt = XVECEXP (op, 0, index++);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1310 if (GET_CODE (elt) != SET
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1311 || GET_CODE (SET_SRC (elt)) != MEM
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1312 || ! memory_operand (SET_SRC (elt), Pmode)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1313 || GET_CODE (SET_DEST (elt)) != REG
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1314 || GET_MODE (SET_DEST (elt)) != Pmode)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1315 return 0;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1316 }
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1317
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1318 for (i=1; i <= 12; i++)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1319 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1320 elt = XVECEXP (op, 0, index++);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1321 if (GET_CODE (elt) != SET
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1322 || GET_CODE (SET_SRC (elt)) != MEM
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1323 || GET_CODE (SET_DEST (elt)) != REG
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1324 || GET_MODE (SET_DEST (elt)) != V4SImode)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1325 return 0;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1326 }
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1327
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1328 for (i=1; i <= 18; i++)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1329 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1330 elt = XVECEXP (op, 0, index++);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1331 if (GET_CODE (elt) != SET
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1332 || GET_CODE (SET_SRC (elt)) != MEM
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1333 || ! memory_operand (SET_SRC (elt), DFmode)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1334 || GET_CODE (SET_DEST (elt)) != REG
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1335 || GET_MODE (SET_DEST (elt)) != DFmode)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1336 return 0;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1337 }
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1338
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1339 if (GET_CODE (XVECEXP (op, 0, index++)) != CLOBBER
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1340 || GET_CODE (XVECEXP (op, 0, index++)) != CLOBBER
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1341 || GET_CODE (XVECEXP (op, 0, index++)) != CLOBBER
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1342 || GET_CODE (XVECEXP (op, 0, index++)) != CLOBBER
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1343 || GET_CODE (XVECEXP (op, 0, index++)) != USE)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1344 return 0;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1345 return 1;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1346 })
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1347
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1348 ;; Return 1 if OP is valid for a vrsave call, known to be a PARALLEL.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1349 (define_predicate "vrsave_operation"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1350 (match_code "parallel")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1351 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1352 int count = XVECLEN (op, 0);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1353 unsigned int dest_regno, src_regno;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1354 int i;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1355
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1356 if (count <= 1
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1357 || GET_CODE (XVECEXP (op, 0, 0)) != SET
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1358 || GET_CODE (SET_DEST (XVECEXP (op, 0, 0))) != REG
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1359 || GET_CODE (SET_SRC (XVECEXP (op, 0, 0))) != UNSPEC_VOLATILE
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1360 || XINT (SET_SRC (XVECEXP (op, 0, 0)), 1) != UNSPECV_SET_VRSAVE)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1361 return 0;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1362
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1363 dest_regno = REGNO (SET_DEST (XVECEXP (op, 0, 0)));
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1364 src_regno = REGNO (XVECEXP (SET_SRC (XVECEXP (op, 0, 0)), 0, 1));
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1365
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1366 if (dest_regno != VRSAVE_REGNO || src_regno != VRSAVE_REGNO)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1367 return 0;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1368
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1369 for (i = 1; i < count; i++)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1370 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1371 rtx elt = XVECEXP (op, 0, i);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1372
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1373 if (GET_CODE (elt) != CLOBBER
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1374 && GET_CODE (elt) != SET)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1375 return 0;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1376 }
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1377
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1378 return 1;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1379 })
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1380
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1381 ;; Return 1 if OP is valid for mfcr insn, known to be a PARALLEL.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1382 (define_predicate "mfcr_operation"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1383 (match_code "parallel")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1384 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1385 int count = XVECLEN (op, 0);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1386 int i;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1387
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1388 /* Perform a quick check so we don't blow up below. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1389 if (count < 1
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1390 || GET_CODE (XVECEXP (op, 0, 0)) != SET
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1391 || GET_CODE (SET_SRC (XVECEXP (op, 0, 0))) != UNSPEC
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1392 || XVECLEN (SET_SRC (XVECEXP (op, 0, 0)), 0) != 2)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1393 return 0;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1394
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1395 for (i = 0; i < count; i++)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1396 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1397 rtx exp = XVECEXP (op, 0, i);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1398 rtx unspec;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1399 int maskval;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1400 rtx src_reg;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1401
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1402 src_reg = XVECEXP (SET_SRC (exp), 0, 0);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1403
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1404 if (GET_CODE (src_reg) != REG
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1405 || GET_MODE (src_reg) != CCmode
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1406 || ! CR_REGNO_P (REGNO (src_reg)))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1407 return 0;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1408
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1409 if (GET_CODE (exp) != SET
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1410 || GET_CODE (SET_DEST (exp)) != REG
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1411 || GET_MODE (SET_DEST (exp)) != SImode
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1412 || ! INT_REGNO_P (REGNO (SET_DEST (exp))))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1413 return 0;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1414 unspec = SET_SRC (exp);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1415 maskval = 1 << (MAX_CR_REGNO - REGNO (src_reg));
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1416
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1417 if (GET_CODE (unspec) != UNSPEC
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1418 || XINT (unspec, 1) != UNSPEC_MOVESI_FROM_CR
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1419 || XVECLEN (unspec, 0) != 2
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1420 || XVECEXP (unspec, 0, 0) != src_reg
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1421 || GET_CODE (XVECEXP (unspec, 0, 1)) != CONST_INT
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1422 || INTVAL (XVECEXP (unspec, 0, 1)) != maskval)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1423 return 0;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1424 }
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1425 return 1;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1426 })
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1427
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1428 ;; Return 1 if OP is valid for mtcrf insn, known to be a PARALLEL.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1429 (define_predicate "mtcrf_operation"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1430 (match_code "parallel")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1431 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1432 int count = XVECLEN (op, 0);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1433 int i;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1434 rtx src_reg;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1435
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1436 /* Perform a quick check so we don't blow up below. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1437 if (count < 1
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1438 || GET_CODE (XVECEXP (op, 0, 0)) != SET
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1439 || GET_CODE (SET_SRC (XVECEXP (op, 0, 0))) != UNSPEC
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1440 || XVECLEN (SET_SRC (XVECEXP (op, 0, 0)), 0) != 2)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1441 return 0;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1442 src_reg = XVECEXP (SET_SRC (XVECEXP (op, 0, 0)), 0, 0);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1443
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1444 if (GET_CODE (src_reg) != REG
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1445 || GET_MODE (src_reg) != SImode
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1446 || ! INT_REGNO_P (REGNO (src_reg)))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1447 return 0;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1448
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1449 for (i = 0; i < count; i++)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1450 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1451 rtx exp = XVECEXP (op, 0, i);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1452 rtx unspec;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1453 int maskval;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1454
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1455 if (GET_CODE (exp) != SET
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1456 || GET_CODE (SET_DEST (exp)) != REG
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1457 || GET_MODE (SET_DEST (exp)) != CCmode
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1458 || ! CR_REGNO_P (REGNO (SET_DEST (exp))))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1459 return 0;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1460 unspec = SET_SRC (exp);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1461 maskval = 1 << (MAX_CR_REGNO - REGNO (SET_DEST (exp)));
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1462
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1463 if (GET_CODE (unspec) != UNSPEC
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1464 || XINT (unspec, 1) != UNSPEC_MOVESI_TO_CR
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1465 || XVECLEN (unspec, 0) != 2
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1466 || XVECEXP (unspec, 0, 0) != src_reg
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1467 || GET_CODE (XVECEXP (unspec, 0, 1)) != CONST_INT
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1468 || INTVAL (XVECEXP (unspec, 0, 1)) != maskval)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1469 return 0;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1470 }
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1471 return 1;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1472 })
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1473
111
kono
parents: 67
diff changeset
1474 ;; Return 1 if OP is valid for crsave insn, known to be a PARALLEL.
kono
parents: 67
diff changeset
1475 (define_predicate "crsave_operation"
kono
parents: 67
diff changeset
1476 (match_code "parallel")
kono
parents: 67
diff changeset
1477 {
kono
parents: 67
diff changeset
1478 int count = XVECLEN (op, 0);
kono
parents: 67
diff changeset
1479 int i;
kono
parents: 67
diff changeset
1480
kono
parents: 67
diff changeset
1481 for (i = 1; i < count; i++)
kono
parents: 67
diff changeset
1482 {
kono
parents: 67
diff changeset
1483 rtx exp = XVECEXP (op, 0, i);
kono
parents: 67
diff changeset
1484
kono
parents: 67
diff changeset
1485 if (GET_CODE (exp) != USE
kono
parents: 67
diff changeset
1486 || GET_CODE (XEXP (exp, 0)) != REG
kono
parents: 67
diff changeset
1487 || GET_MODE (XEXP (exp, 0)) != CCmode
kono
parents: 67
diff changeset
1488 || ! CR_REGNO_P (REGNO (XEXP (exp, 0))))
kono
parents: 67
diff changeset
1489 return 0;
kono
parents: 67
diff changeset
1490 }
kono
parents: 67
diff changeset
1491 return 1;
kono
parents: 67
diff changeset
1492 })
kono
parents: 67
diff changeset
1493
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1494 ;; Return 1 if OP is valid for lmw insn, known to be a PARALLEL.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1495 (define_predicate "lmw_operation"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1496 (match_code "parallel")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1497 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1498 int count = XVECLEN (op, 0);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1499 unsigned int dest_regno;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1500 rtx src_addr;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1501 unsigned int base_regno;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1502 HOST_WIDE_INT offset;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1503 int i;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1504
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1505 /* Perform a quick check so we don't blow up below. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1506 if (count <= 1
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1507 || GET_CODE (XVECEXP (op, 0, 0)) != SET
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1508 || GET_CODE (SET_DEST (XVECEXP (op, 0, 0))) != REG
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1509 || GET_CODE (SET_SRC (XVECEXP (op, 0, 0))) != MEM)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1510 return 0;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1511
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1512 dest_regno = REGNO (SET_DEST (XVECEXP (op, 0, 0)));
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1513 src_addr = XEXP (SET_SRC (XVECEXP (op, 0, 0)), 0);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1514
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1515 if (dest_regno > 31
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1516 || count != 32 - (int) dest_regno)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1517 return 0;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1518
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1519 if (legitimate_indirect_address_p (src_addr, 0))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1520 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1521 offset = 0;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1522 base_regno = REGNO (src_addr);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1523 if (base_regno == 0)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1524 return 0;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1525 }
111
kono
parents: 67
diff changeset
1526 else if (rs6000_legitimate_offset_address_p (SImode, src_addr, false, false))
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1527 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1528 offset = INTVAL (XEXP (src_addr, 1));
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1529 base_regno = REGNO (XEXP (src_addr, 0));
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1530 }
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1531 else
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1532 return 0;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1533
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1534 for (i = 0; i < count; i++)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1535 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1536 rtx elt = XVECEXP (op, 0, i);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1537 rtx newaddr;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1538 rtx addr_reg;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1539 HOST_WIDE_INT newoffset;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1540
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1541 if (GET_CODE (elt) != SET
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1542 || GET_CODE (SET_DEST (elt)) != REG
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1543 || GET_MODE (SET_DEST (elt)) != SImode
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1544 || REGNO (SET_DEST (elt)) != dest_regno + i
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1545 || GET_CODE (SET_SRC (elt)) != MEM
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1546 || GET_MODE (SET_SRC (elt)) != SImode)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1547 return 0;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1548 newaddr = XEXP (SET_SRC (elt), 0);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1549 if (legitimate_indirect_address_p (newaddr, 0))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1550 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1551 newoffset = 0;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1552 addr_reg = newaddr;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1553 }
111
kono
parents: 67
diff changeset
1554 else if (rs6000_legitimate_offset_address_p (SImode, newaddr, false, false))
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1555 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1556 addr_reg = XEXP (newaddr, 0);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1557 newoffset = INTVAL (XEXP (newaddr, 1));
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1558 }
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1559 else
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1560 return 0;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1561 if (REGNO (addr_reg) != base_regno
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1562 || newoffset != offset + 4 * i)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1563 return 0;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1564 }
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1565
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1566 return 1;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1567 })
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1568
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1569 ;; Return 1 if OP is valid for stmw insn, known to be a PARALLEL.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1570 (define_predicate "stmw_operation"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1571 (match_code "parallel")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1572 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1573 int count = XVECLEN (op, 0);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1574 unsigned int src_regno;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1575 rtx dest_addr;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1576 unsigned int base_regno;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1577 HOST_WIDE_INT offset;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1578 int i;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1579
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1580 /* Perform a quick check so we don't blow up below. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1581 if (count <= 1
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1582 || GET_CODE (XVECEXP (op, 0, 0)) != SET
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1583 || GET_CODE (SET_DEST (XVECEXP (op, 0, 0))) != MEM
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1584 || GET_CODE (SET_SRC (XVECEXP (op, 0, 0))) != REG)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1585 return 0;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1586
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1587 src_regno = REGNO (SET_SRC (XVECEXP (op, 0, 0)));
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1588 dest_addr = XEXP (SET_DEST (XVECEXP (op, 0, 0)), 0);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1589
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1590 if (src_regno > 31
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1591 || count != 32 - (int) src_regno)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1592 return 0;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1593
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1594 if (legitimate_indirect_address_p (dest_addr, 0))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1595 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1596 offset = 0;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1597 base_regno = REGNO (dest_addr);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1598 if (base_regno == 0)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1599 return 0;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1600 }
111
kono
parents: 67
diff changeset
1601 else if (rs6000_legitimate_offset_address_p (SImode, dest_addr, false, false))
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1602 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1603 offset = INTVAL (XEXP (dest_addr, 1));
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1604 base_regno = REGNO (XEXP (dest_addr, 0));
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1605 }
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1606 else
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1607 return 0;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1608
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1609 for (i = 0; i < count; i++)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1610 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1611 rtx elt = XVECEXP (op, 0, i);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1612 rtx newaddr;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1613 rtx addr_reg;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1614 HOST_WIDE_INT newoffset;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1615
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1616 if (GET_CODE (elt) != SET
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1617 || GET_CODE (SET_SRC (elt)) != REG
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1618 || GET_MODE (SET_SRC (elt)) != SImode
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1619 || REGNO (SET_SRC (elt)) != src_regno + i
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1620 || GET_CODE (SET_DEST (elt)) != MEM
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1621 || GET_MODE (SET_DEST (elt)) != SImode)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1622 return 0;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1623 newaddr = XEXP (SET_DEST (elt), 0);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1624 if (legitimate_indirect_address_p (newaddr, 0))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1625 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1626 newoffset = 0;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1627 addr_reg = newaddr;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1628 }
111
kono
parents: 67
diff changeset
1629 else if (rs6000_legitimate_offset_address_p (SImode, newaddr, false, false))
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1630 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1631 addr_reg = XEXP (newaddr, 0);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1632 newoffset = INTVAL (XEXP (newaddr, 1));
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1633 }
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1634 else
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1635 return 0;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1636 if (REGNO (addr_reg) != base_regno
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1637 || newoffset != offset + 4 * i)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1638 return 0;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1639 }
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1640
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1641 return 1;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1642 })
111
kono
parents: 67
diff changeset
1643
kono
parents: 67
diff changeset
1644 ;; Return 1 if OP is a stack tie operand.
kono
parents: 67
diff changeset
1645 (define_predicate "tie_operand"
kono
parents: 67
diff changeset
1646 (match_code "parallel")
kono
parents: 67
diff changeset
1647 {
kono
parents: 67
diff changeset
1648 return (GET_CODE (XVECEXP (op, 0, 0)) == SET
kono
parents: 67
diff changeset
1649 && GET_CODE (XEXP (XVECEXP (op, 0, 0), 0)) == MEM
kono
parents: 67
diff changeset
1650 && GET_MODE (XEXP (XVECEXP (op, 0, 0), 0)) == BLKmode
kono
parents: 67
diff changeset
1651 && XEXP (XVECEXP (op, 0, 0), 1) == const0_rtx);
kono
parents: 67
diff changeset
1652 })
kono
parents: 67
diff changeset
1653
kono
parents: 67
diff changeset
1654 ;; Match a small code model toc reference (or medium and large
kono
parents: 67
diff changeset
1655 ;; model toc references before reload).
kono
parents: 67
diff changeset
1656 (define_predicate "small_toc_ref"
kono
parents: 67
diff changeset
1657 (match_code "unspec,plus")
kono
parents: 67
diff changeset
1658 {
kono
parents: 67
diff changeset
1659 if (GET_CODE (op) == PLUS && add_cint_operand (XEXP (op, 1), mode))
kono
parents: 67
diff changeset
1660 op = XEXP (op, 0);
kono
parents: 67
diff changeset
1661
kono
parents: 67
diff changeset
1662 return GET_CODE (op) == UNSPEC && XINT (op, 1) == UNSPEC_TOCREL;
kono
parents: 67
diff changeset
1663 })
kono
parents: 67
diff changeset
1664
kono
parents: 67
diff changeset
1665 ;; Match the first insn (addis) in fusing the combination of addis and loads to
kono
parents: 67
diff changeset
1666 ;; GPR registers on power8.
kono
parents: 67
diff changeset
1667 (define_predicate "fusion_gpr_addis"
kono
parents: 67
diff changeset
1668 (match_code "const_int,high,plus")
kono
parents: 67
diff changeset
1669 {
kono
parents: 67
diff changeset
1670 HOST_WIDE_INT value;
kono
parents: 67
diff changeset
1671 rtx int_const;
kono
parents: 67
diff changeset
1672
kono
parents: 67
diff changeset
1673 if (GET_CODE (op) == HIGH)
kono
parents: 67
diff changeset
1674 return 1;
kono
parents: 67
diff changeset
1675
kono
parents: 67
diff changeset
1676 if (CONST_INT_P (op))
kono
parents: 67
diff changeset
1677 int_const = op;
kono
parents: 67
diff changeset
1678
kono
parents: 67
diff changeset
1679 else if (GET_CODE (op) == PLUS
kono
parents: 67
diff changeset
1680 && base_reg_operand (XEXP (op, 0), Pmode)
kono
parents: 67
diff changeset
1681 && CONST_INT_P (XEXP (op, 1)))
kono
parents: 67
diff changeset
1682 int_const = XEXP (op, 1);
kono
parents: 67
diff changeset
1683
kono
parents: 67
diff changeset
1684 else
kono
parents: 67
diff changeset
1685 return 0;
kono
parents: 67
diff changeset
1686
kono
parents: 67
diff changeset
1687 value = INTVAL (int_const);
kono
parents: 67
diff changeset
1688 if ((value & (HOST_WIDE_INT)0xffff) != 0)
kono
parents: 67
diff changeset
1689 return 0;
kono
parents: 67
diff changeset
1690
kono
parents: 67
diff changeset
1691 if ((value & (HOST_WIDE_INT)0xffff0000) == 0)
kono
parents: 67
diff changeset
1692 return 0;
kono
parents: 67
diff changeset
1693
kono
parents: 67
diff changeset
1694 /* Power8 currently will only do the fusion if the top 11 bits of the addis
kono
parents: 67
diff changeset
1695 value are all 1's or 0's. Ignore this restriction if we are testing
kono
parents: 67
diff changeset
1696 advanced fusion. */
kono
parents: 67
diff changeset
1697 if (TARGET_P9_FUSION)
kono
parents: 67
diff changeset
1698 return 1;
kono
parents: 67
diff changeset
1699
kono
parents: 67
diff changeset
1700 return (IN_RANGE (value >> 16, -32, 31));
kono
parents: 67
diff changeset
1701 })
kono
parents: 67
diff changeset
1702
kono
parents: 67
diff changeset
1703 ;; Match the second insn (lbz, lhz, lwz, ld) in fusing the combination of addis
kono
parents: 67
diff changeset
1704 ;; and loads to GPR registers on power8.
kono
parents: 67
diff changeset
1705 (define_predicate "fusion_gpr_mem_load"
kono
parents: 67
diff changeset
1706 (match_code "mem,sign_extend,zero_extend")
kono
parents: 67
diff changeset
1707 {
kono
parents: 67
diff changeset
1708 rtx addr, base, offset;
kono
parents: 67
diff changeset
1709
kono
parents: 67
diff changeset
1710 /* Handle sign/zero extend. */
kono
parents: 67
diff changeset
1711 if (GET_CODE (op) == ZERO_EXTEND
kono
parents: 67
diff changeset
1712 || (TARGET_P8_FUSION_SIGN && GET_CODE (op) == SIGN_EXTEND))
kono
parents: 67
diff changeset
1713 {
kono
parents: 67
diff changeset
1714 op = XEXP (op, 0);
kono
parents: 67
diff changeset
1715 mode = GET_MODE (op);
kono
parents: 67
diff changeset
1716 }
kono
parents: 67
diff changeset
1717
kono
parents: 67
diff changeset
1718 if (!MEM_P (op))
kono
parents: 67
diff changeset
1719 return 0;
kono
parents: 67
diff changeset
1720
kono
parents: 67
diff changeset
1721 switch (mode)
kono
parents: 67
diff changeset
1722 {
kono
parents: 67
diff changeset
1723 case E_QImode:
kono
parents: 67
diff changeset
1724 case E_HImode:
kono
parents: 67
diff changeset
1725 case E_SImode:
kono
parents: 67
diff changeset
1726 break;
kono
parents: 67
diff changeset
1727
kono
parents: 67
diff changeset
1728 case E_DImode:
kono
parents: 67
diff changeset
1729 if (!TARGET_POWERPC64)
kono
parents: 67
diff changeset
1730 return 0;
kono
parents: 67
diff changeset
1731 break;
kono
parents: 67
diff changeset
1732
kono
parents: 67
diff changeset
1733 default:
kono
parents: 67
diff changeset
1734 return 0;
kono
parents: 67
diff changeset
1735 }
kono
parents: 67
diff changeset
1736
kono
parents: 67
diff changeset
1737 addr = XEXP (op, 0);
kono
parents: 67
diff changeset
1738 if (GET_CODE (addr) != PLUS && GET_CODE (addr) != LO_SUM)
kono
parents: 67
diff changeset
1739 return 0;
kono
parents: 67
diff changeset
1740
kono
parents: 67
diff changeset
1741 base = XEXP (addr, 0);
kono
parents: 67
diff changeset
1742 if (!base_reg_operand (base, GET_MODE (base)))
kono
parents: 67
diff changeset
1743 return 0;
kono
parents: 67
diff changeset
1744
kono
parents: 67
diff changeset
1745 offset = XEXP (addr, 1);
kono
parents: 67
diff changeset
1746
kono
parents: 67
diff changeset
1747 if (GET_CODE (addr) == PLUS)
kono
parents: 67
diff changeset
1748 return satisfies_constraint_I (offset);
kono
parents: 67
diff changeset
1749
kono
parents: 67
diff changeset
1750 else if (GET_CODE (addr) == LO_SUM)
kono
parents: 67
diff changeset
1751 {
kono
parents: 67
diff changeset
1752 if (TARGET_XCOFF || (TARGET_ELF && TARGET_POWERPC64))
kono
parents: 67
diff changeset
1753 return small_toc_ref (offset, GET_MODE (offset));
kono
parents: 67
diff changeset
1754
kono
parents: 67
diff changeset
1755 else if (TARGET_ELF && !TARGET_POWERPC64)
kono
parents: 67
diff changeset
1756 return CONSTANT_P (offset);
kono
parents: 67
diff changeset
1757 }
kono
parents: 67
diff changeset
1758
kono
parents: 67
diff changeset
1759 return 0;
kono
parents: 67
diff changeset
1760 })
kono
parents: 67
diff changeset
1761
kono
parents: 67
diff changeset
1762 ;; Match a GPR load (lbz, lhz, lwz, ld) that uses a combined address in the
kono
parents: 67
diff changeset
1763 ;; memory field with both the addis and the memory offset. Sign extension
kono
parents: 67
diff changeset
1764 ;; is not handled here, since lha and lwa are not fused.
kono
parents: 67
diff changeset
1765 ;; With P9 fusion, also match a fpr/vector load and float_extend
kono
parents: 67
diff changeset
1766 (define_predicate "fusion_addis_mem_combo_load"
kono
parents: 67
diff changeset
1767 (match_code "mem,zero_extend,float_extend")
kono
parents: 67
diff changeset
1768 {
kono
parents: 67
diff changeset
1769 rtx addr, base, offset;
kono
parents: 67
diff changeset
1770
kono
parents: 67
diff changeset
1771 /* Handle zero/float extend. */
kono
parents: 67
diff changeset
1772 if (GET_CODE (op) == ZERO_EXTEND || GET_CODE (op) == FLOAT_EXTEND)
kono
parents: 67
diff changeset
1773 {
kono
parents: 67
diff changeset
1774 op = XEXP (op, 0);
kono
parents: 67
diff changeset
1775 mode = GET_MODE (op);
kono
parents: 67
diff changeset
1776 }
kono
parents: 67
diff changeset
1777
kono
parents: 67
diff changeset
1778 if (!MEM_P (op))
kono
parents: 67
diff changeset
1779 return 0;
kono
parents: 67
diff changeset
1780
kono
parents: 67
diff changeset
1781 switch (mode)
kono
parents: 67
diff changeset
1782 {
kono
parents: 67
diff changeset
1783 case E_QImode:
kono
parents: 67
diff changeset
1784 case E_HImode:
kono
parents: 67
diff changeset
1785 case E_SImode:
kono
parents: 67
diff changeset
1786 break;
kono
parents: 67
diff changeset
1787
kono
parents: 67
diff changeset
1788 /* Do not fuse 64-bit DImode in 32-bit since it splits into two
kono
parents: 67
diff changeset
1789 separate instructions. */
kono
parents: 67
diff changeset
1790 case E_DImode:
kono
parents: 67
diff changeset
1791 if (!TARGET_POWERPC64)
kono
parents: 67
diff changeset
1792 return 0;
kono
parents: 67
diff changeset
1793 break;
kono
parents: 67
diff changeset
1794
kono
parents: 67
diff changeset
1795 /* ISA 2.08/power8 only had fusion of GPR loads. */
kono
parents: 67
diff changeset
1796 case E_SFmode:
kono
parents: 67
diff changeset
1797 if (!TARGET_P9_FUSION)
kono
parents: 67
diff changeset
1798 return 0;
kono
parents: 67
diff changeset
1799 break;
kono
parents: 67
diff changeset
1800
kono
parents: 67
diff changeset
1801 /* ISA 2.08/power8 only had fusion of GPR loads. Do not allow 64-bit
kono
parents: 67
diff changeset
1802 DFmode in 32-bit if -msoft-float since it splits into two separate
kono
parents: 67
diff changeset
1803 instructions. */
kono
parents: 67
diff changeset
1804 case E_DFmode:
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
1805 if ((!TARGET_POWERPC64 && !TARGET_HARD_FLOAT) || !TARGET_P9_FUSION)
111
kono
parents: 67
diff changeset
1806 return 0;
kono
parents: 67
diff changeset
1807 break;
kono
parents: 67
diff changeset
1808
kono
parents: 67
diff changeset
1809 default:
kono
parents: 67
diff changeset
1810 return 0;
kono
parents: 67
diff changeset
1811 }
kono
parents: 67
diff changeset
1812
kono
parents: 67
diff changeset
1813 addr = XEXP (op, 0);
kono
parents: 67
diff changeset
1814 if (GET_CODE (addr) != PLUS && GET_CODE (addr) != LO_SUM)
kono
parents: 67
diff changeset
1815 return 0;
kono
parents: 67
diff changeset
1816
kono
parents: 67
diff changeset
1817 base = XEXP (addr, 0);
kono
parents: 67
diff changeset
1818 if (!fusion_gpr_addis (base, GET_MODE (base)))
kono
parents: 67
diff changeset
1819 return 0;
kono
parents: 67
diff changeset
1820
kono
parents: 67
diff changeset
1821 offset = XEXP (addr, 1);
kono
parents: 67
diff changeset
1822 if (GET_CODE (addr) == PLUS)
kono
parents: 67
diff changeset
1823 return satisfies_constraint_I (offset);
kono
parents: 67
diff changeset
1824
kono
parents: 67
diff changeset
1825 else if (GET_CODE (addr) == LO_SUM)
kono
parents: 67
diff changeset
1826 {
kono
parents: 67
diff changeset
1827 if (TARGET_XCOFF || (TARGET_ELF && TARGET_POWERPC64))
kono
parents: 67
diff changeset
1828 return small_toc_ref (offset, GET_MODE (offset));
kono
parents: 67
diff changeset
1829
kono
parents: 67
diff changeset
1830 else if (TARGET_ELF && !TARGET_POWERPC64)
kono
parents: 67
diff changeset
1831 return CONSTANT_P (offset);
kono
parents: 67
diff changeset
1832 }
kono
parents: 67
diff changeset
1833
kono
parents: 67
diff changeset
1834 return 0;
kono
parents: 67
diff changeset
1835 })
kono
parents: 67
diff changeset
1836
kono
parents: 67
diff changeset
1837 ;; Like fusion_addis_mem_combo_load, but for stores
kono
parents: 67
diff changeset
1838 (define_predicate "fusion_addis_mem_combo_store"
kono
parents: 67
diff changeset
1839 (match_code "mem")
kono
parents: 67
diff changeset
1840 {
kono
parents: 67
diff changeset
1841 rtx addr, base, offset;
kono
parents: 67
diff changeset
1842
kono
parents: 67
diff changeset
1843 if (!MEM_P (op) || !TARGET_P9_FUSION)
kono
parents: 67
diff changeset
1844 return 0;
kono
parents: 67
diff changeset
1845
kono
parents: 67
diff changeset
1846 switch (mode)
kono
parents: 67
diff changeset
1847 {
kono
parents: 67
diff changeset
1848 case E_QImode:
kono
parents: 67
diff changeset
1849 case E_HImode:
kono
parents: 67
diff changeset
1850 case E_SImode:
kono
parents: 67
diff changeset
1851 case E_SFmode:
kono
parents: 67
diff changeset
1852 break;
kono
parents: 67
diff changeset
1853
kono
parents: 67
diff changeset
1854 /* Do not fuse 64-bit DImode in 32-bit since it splits into two
kono
parents: 67
diff changeset
1855 separate instructions. */
kono
parents: 67
diff changeset
1856 case E_DImode:
kono
parents: 67
diff changeset
1857 if (!TARGET_POWERPC64)
kono
parents: 67
diff changeset
1858 return 0;
kono
parents: 67
diff changeset
1859 break;
kono
parents: 67
diff changeset
1860
kono
parents: 67
diff changeset
1861 /* Do not allow 64-bit DFmode in 32-bit if -msoft-float since it splits
kono
parents: 67
diff changeset
1862 into two separate instructions. Do allow fusion if we have hardware
kono
parents: 67
diff changeset
1863 floating point. */
kono
parents: 67
diff changeset
1864 case E_DFmode:
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
1865 if (!TARGET_POWERPC64 && !TARGET_HARD_FLOAT)
111
kono
parents: 67
diff changeset
1866 return 0;
kono
parents: 67
diff changeset
1867 break;
kono
parents: 67
diff changeset
1868
kono
parents: 67
diff changeset
1869 default:
kono
parents: 67
diff changeset
1870 return 0;
kono
parents: 67
diff changeset
1871 }
kono
parents: 67
diff changeset
1872
kono
parents: 67
diff changeset
1873 addr = XEXP (op, 0);
kono
parents: 67
diff changeset
1874 if (GET_CODE (addr) != PLUS && GET_CODE (addr) != LO_SUM)
kono
parents: 67
diff changeset
1875 return 0;
kono
parents: 67
diff changeset
1876
kono
parents: 67
diff changeset
1877 base = XEXP (addr, 0);
kono
parents: 67
diff changeset
1878 if (!fusion_gpr_addis (base, GET_MODE (base)))
kono
parents: 67
diff changeset
1879 return 0;
kono
parents: 67
diff changeset
1880
kono
parents: 67
diff changeset
1881 offset = XEXP (addr, 1);
kono
parents: 67
diff changeset
1882 if (GET_CODE (addr) == PLUS)
kono
parents: 67
diff changeset
1883 return satisfies_constraint_I (offset);
kono
parents: 67
diff changeset
1884
kono
parents: 67
diff changeset
1885 else if (GET_CODE (addr) == LO_SUM)
kono
parents: 67
diff changeset
1886 {
kono
parents: 67
diff changeset
1887 if (TARGET_XCOFF || (TARGET_ELF && TARGET_POWERPC64))
kono
parents: 67
diff changeset
1888 return small_toc_ref (offset, GET_MODE (offset));
kono
parents: 67
diff changeset
1889
kono
parents: 67
diff changeset
1890 else if (TARGET_ELF && !TARGET_POWERPC64)
kono
parents: 67
diff changeset
1891 return CONSTANT_P (offset);
kono
parents: 67
diff changeset
1892 }
kono
parents: 67
diff changeset
1893
kono
parents: 67
diff changeset
1894 return 0;
kono
parents: 67
diff changeset
1895 })
kono
parents: 67
diff changeset
1896
kono
parents: 67
diff changeset
1897 ;; Return true if the operand is a float_extend or zero extend of an
kono
parents: 67
diff changeset
1898 ;; offsettable memory operand suitable for use in fusion
kono
parents: 67
diff changeset
1899 (define_predicate "fusion_offsettable_mem_operand"
kono
parents: 67
diff changeset
1900 (match_code "mem,zero_extend,float_extend")
kono
parents: 67
diff changeset
1901 {
kono
parents: 67
diff changeset
1902 if (GET_CODE (op) == ZERO_EXTEND || GET_CODE (op) == FLOAT_EXTEND)
kono
parents: 67
diff changeset
1903 {
kono
parents: 67
diff changeset
1904 op = XEXP (op, 0);
kono
parents: 67
diff changeset
1905 mode = GET_MODE (op);
kono
parents: 67
diff changeset
1906 }
kono
parents: 67
diff changeset
1907
kono
parents: 67
diff changeset
1908 if (!memory_operand (op, mode))
kono
parents: 67
diff changeset
1909 return 0;
kono
parents: 67
diff changeset
1910
kono
parents: 67
diff changeset
1911 return offsettable_nonstrict_memref_p (op);
kono
parents: 67
diff changeset
1912 })