annotate gcc/config/mips/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 MIPS.
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
2 ;; Copyright (C) 2004-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 (define_predicate "const_uns_arith_operand"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
21 (and (match_code "const_int")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
22 (match_test "SMALL_OPERAND_UNSIGNED (INTVAL (op))")))
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 (define_predicate "uns_arith_operand"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
25 (ior (match_operand 0 "const_uns_arith_operand")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
26 (match_operand 0 "register_operand")))
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 (define_predicate "const_arith_operand"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
29 (and (match_code "const_int")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
30 (match_test "SMALL_OPERAND (INTVAL (op))")))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
31
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
32 (define_predicate "arith_operand"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
33 (ior (match_operand 0 "const_arith_operand")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
34 (match_operand 0 "register_operand")))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
35
111
kono
parents: 55
diff changeset
36 (define_predicate "const_immlsa_operand"
kono
parents: 55
diff changeset
37 (and (match_code "const_int")
kono
parents: 55
diff changeset
38 (match_test "IN_RANGE (INTVAL (op), 1, 4)")))
kono
parents: 55
diff changeset
39
kono
parents: 55
diff changeset
40 (define_predicate "const_msa_branch_operand"
kono
parents: 55
diff changeset
41 (and (match_code "const_int")
kono
parents: 55
diff changeset
42 (match_test "IN_RANGE (INTVAL (op), -1024, 1023)")))
kono
parents: 55
diff changeset
43
kono
parents: 55
diff changeset
44 (define_predicate "const_uimm3_operand"
kono
parents: 55
diff changeset
45 (and (match_code "const_int")
kono
parents: 55
diff changeset
46 (match_test "IN_RANGE (INTVAL (op), 0, 7)")))
kono
parents: 55
diff changeset
47
kono
parents: 55
diff changeset
48 (define_predicate "const_uimm4_operand"
kono
parents: 55
diff changeset
49 (and (match_code "const_int")
kono
parents: 55
diff changeset
50 (match_test "IN_RANGE (INTVAL (op), 0, 15)")))
kono
parents: 55
diff changeset
51
kono
parents: 55
diff changeset
52 (define_predicate "const_uimm5_operand"
kono
parents: 55
diff changeset
53 (and (match_code "const_int")
kono
parents: 55
diff changeset
54 (match_test "IN_RANGE (INTVAL (op), 0, 31)")))
kono
parents: 55
diff changeset
55
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
56 (define_predicate "const_uimm6_operand"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
57 (and (match_code "const_int")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
58 (match_test "UIMM6_OPERAND (INTVAL (op))")))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
59
111
kono
parents: 55
diff changeset
60 (define_predicate "const_uimm8_operand"
kono
parents: 55
diff changeset
61 (and (match_code "const_int")
kono
parents: 55
diff changeset
62 (match_test "IN_RANGE (INTVAL (op), 0, 255)")))
kono
parents: 55
diff changeset
63
kono
parents: 55
diff changeset
64 (define_predicate "const_imm5_operand"
kono
parents: 55
diff changeset
65 (and (match_code "const_int")
kono
parents: 55
diff changeset
66 (match_test "IN_RANGE (INTVAL (op), -16, 15)")))
kono
parents: 55
diff changeset
67
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
68 (define_predicate "const_imm10_operand"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
69 (and (match_code "const_int")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
70 (match_test "IMM10_OPERAND (INTVAL (op))")))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
71
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
72 (define_predicate "reg_imm10_operand"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
73 (ior (match_operand 0 "const_imm10_operand")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
74 (match_operand 0 "register_operand")))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
75
111
kono
parents: 55
diff changeset
76 (define_predicate "aq10b_operand"
kono
parents: 55
diff changeset
77 (and (match_code "const_int")
kono
parents: 55
diff changeset
78 (match_test "mips_signed_immediate_p (INTVAL (op), 10, 0)")))
kono
parents: 55
diff changeset
79
kono
parents: 55
diff changeset
80 (define_predicate "aq10h_operand"
kono
parents: 55
diff changeset
81 (and (match_code "const_int")
kono
parents: 55
diff changeset
82 (match_test "mips_signed_immediate_p (INTVAL (op), 10, 1)")))
kono
parents: 55
diff changeset
83
kono
parents: 55
diff changeset
84 (define_predicate "aq10w_operand"
kono
parents: 55
diff changeset
85 (and (match_code "const_int")
kono
parents: 55
diff changeset
86 (match_test "mips_signed_immediate_p (INTVAL (op), 10, 2)")))
kono
parents: 55
diff changeset
87
kono
parents: 55
diff changeset
88 (define_predicate "aq10d_operand"
kono
parents: 55
diff changeset
89 (and (match_code "const_int")
kono
parents: 55
diff changeset
90 (match_test "mips_signed_immediate_p (INTVAL (op), 10, 3)")))
kono
parents: 55
diff changeset
91
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
92 (define_predicate "sle_operand"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
93 (and (match_code "const_int")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
94 (match_test "SMALL_OPERAND (INTVAL (op) + 1)")))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
95
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
96 (define_predicate "sleu_operand"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
97 (and (match_operand 0 "sle_operand")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
98 (match_test "INTVAL (op) + 1 != 0")))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
99
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
100 (define_predicate "const_0_operand"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
101 (and (match_code "const_int,const_double,const_vector")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
102 (match_test "op == CONST0_RTX (GET_MODE (op))")))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
103
111
kono
parents: 55
diff changeset
104 (define_predicate "const_m1_operand"
kono
parents: 55
diff changeset
105 (and (match_code "const_int,const_double,const_vector")
kono
parents: 55
diff changeset
106 (match_test "op == CONSTM1_RTX (GET_MODE (op))")))
kono
parents: 55
diff changeset
107
kono
parents: 55
diff changeset
108 (define_predicate "reg_or_m1_operand"
kono
parents: 55
diff changeset
109 (ior (match_operand 0 "const_m1_operand")
kono
parents: 55
diff changeset
110 (match_operand 0 "register_operand")))
kono
parents: 55
diff changeset
111
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
112 (define_predicate "reg_or_0_operand"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
113 (ior (and (match_operand 0 "const_0_operand")
111
kono
parents: 55
diff changeset
114 (not (match_test "TARGET_MIPS16")))
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
115 (match_operand 0 "register_operand")))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
116
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
117 (define_predicate "const_1_operand"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
118 (and (match_code "const_int,const_double,const_vector")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
119 (match_test "op == CONST1_RTX (GET_MODE (op))")))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
120
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
121 (define_predicate "reg_or_1_operand"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
122 (ior (match_operand 0 "const_1_operand")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
123 (match_operand 0 "register_operand")))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
124
111
kono
parents: 55
diff changeset
125 ;; These are used in vec_merge, hence accept bitmask as const_int.
kono
parents: 55
diff changeset
126 (define_predicate "const_exp_2_operand"
kono
parents: 55
diff changeset
127 (and (match_code "const_int")
kono
parents: 55
diff changeset
128 (match_test "IN_RANGE (exact_log2 (INTVAL (op)), 0, 1)")))
kono
parents: 55
diff changeset
129
kono
parents: 55
diff changeset
130 (define_predicate "const_exp_4_operand"
kono
parents: 55
diff changeset
131 (and (match_code "const_int")
kono
parents: 55
diff changeset
132 (match_test "IN_RANGE (exact_log2 (INTVAL (op)), 0, 3)")))
kono
parents: 55
diff changeset
133
kono
parents: 55
diff changeset
134 (define_predicate "const_exp_8_operand"
kono
parents: 55
diff changeset
135 (and (match_code "const_int")
kono
parents: 55
diff changeset
136 (match_test "IN_RANGE (exact_log2 (INTVAL (op)), 0, 7)")))
kono
parents: 55
diff changeset
137
kono
parents: 55
diff changeset
138 (define_predicate "const_exp_16_operand"
kono
parents: 55
diff changeset
139 (and (match_code "const_int")
kono
parents: 55
diff changeset
140 (match_test "IN_RANGE (exact_log2 (INTVAL (op)), 0, 15)")))
kono
parents: 55
diff changeset
141
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
142 ;; This is used for indexing into vectors, and hence only accepts const_int.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
143 (define_predicate "const_0_or_1_operand"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
144 (and (match_code "const_int")
111
kono
parents: 55
diff changeset
145 (match_test "IN_RANGE (INTVAL (op), 0, 1)")))
kono
parents: 55
diff changeset
146
kono
parents: 55
diff changeset
147 (define_predicate "const_2_or_3_operand"
kono
parents: 55
diff changeset
148 (and (match_code "const_int")
kono
parents: 55
diff changeset
149 (match_test "IN_RANGE (INTVAL (op), 2, 3)")))
kono
parents: 55
diff changeset
150
kono
parents: 55
diff changeset
151 (define_predicate "const_0_to_3_operand"
kono
parents: 55
diff changeset
152 (and (match_code "const_int")
kono
parents: 55
diff changeset
153 (match_test "IN_RANGE (INTVAL (op), 0, 3)")))
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
154
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
155 (define_predicate "qi_mask_operand"
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
156 (and (match_code "const_int")
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
157 (match_test "UINTVAL (op) == 0xff")))
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
158
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
159 (define_predicate "hi_mask_operand"
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
160 (and (match_code "const_int")
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
161 (match_test "UINTVAL (op) == 0xffff")))
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
162
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
163 (define_predicate "si_mask_operand"
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
164 (and (match_code "const_int")
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
165 (match_test "UINTVAL (op) == 0xffffffff")))
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
166
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
167 (define_predicate "and_load_operand"
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
168 (ior (match_operand 0 "qi_mask_operand")
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
169 (match_operand 0 "hi_mask_operand")
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
170 (match_operand 0 "si_mask_operand")))
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
171
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
172 (define_predicate "low_bitmask_operand"
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
173 (and (match_test "ISA_HAS_EXT_INS")
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
174 (match_code "const_int")
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
175 (match_test "low_bitmask_len (mode, INTVAL (op)) > 16")))
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
176
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
177 (define_predicate "and_reg_operand"
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
178 (ior (match_operand 0 "register_operand")
111
kono
parents: 55
diff changeset
179 (and (not (match_test "TARGET_MIPS16"))
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
180 (match_operand 0 "const_uns_arith_operand"))
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
181 (match_operand 0 "low_bitmask_operand")
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
182 (match_operand 0 "si_mask_operand")))
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
183
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
184 (define_predicate "and_operand"
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
185 (ior (match_operand 0 "and_load_operand")
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
186 (match_operand 0 "and_reg_operand")))
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
187
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
188 (define_predicate "d_operand"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
189 (and (match_code "reg")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
190 (match_test "TARGET_MIPS16
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
191 ? M16_REG_P (REGNO (op))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
192 : GP_REG_P (REGNO (op))")))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
193
111
kono
parents: 55
diff changeset
194 (define_predicate "lwsp_swsp_operand"
kono
parents: 55
diff changeset
195 (and (match_code "mem")
kono
parents: 55
diff changeset
196 (match_test "lwsp_swsp_address_p (XEXP (op, 0), mode)")))
kono
parents: 55
diff changeset
197
kono
parents: 55
diff changeset
198 (define_predicate "lw16_sw16_operand"
kono
parents: 55
diff changeset
199 (and (match_code "mem")
kono
parents: 55
diff changeset
200 (match_test "m16_based_address_p (XEXP (op, 0), mode, uw4_operand)")))
kono
parents: 55
diff changeset
201
kono
parents: 55
diff changeset
202 (define_predicate "lhu16_sh16_operand"
kono
parents: 55
diff changeset
203 (and (match_code "mem")
kono
parents: 55
diff changeset
204 (match_test "m16_based_address_p (XEXP (op, 0), mode, uh4_operand)")))
kono
parents: 55
diff changeset
205
kono
parents: 55
diff changeset
206 (define_predicate "lbu16_operand"
kono
parents: 55
diff changeset
207 (and (match_code "mem")
kono
parents: 55
diff changeset
208 (match_test "m16_based_address_p (XEXP (op, 0), mode, db4_operand)")))
kono
parents: 55
diff changeset
209
kono
parents: 55
diff changeset
210 (define_predicate "sb16_operand"
kono
parents: 55
diff changeset
211 (and (match_code "mem")
kono
parents: 55
diff changeset
212 (match_test "m16_based_address_p (XEXP (op, 0), mode, ub4_operand)")))
kono
parents: 55
diff changeset
213
kono
parents: 55
diff changeset
214 (define_predicate "db4_operand"
kono
parents: 55
diff changeset
215 (and (match_code "const_int")
kono
parents: 55
diff changeset
216 (match_test "mips_unsigned_immediate_p (INTVAL (op) + 1, 4, 0)")))
kono
parents: 55
diff changeset
217
kono
parents: 55
diff changeset
218 (define_predicate "db7_operand"
kono
parents: 55
diff changeset
219 (and (match_code "const_int")
kono
parents: 55
diff changeset
220 (match_test "mips_unsigned_immediate_p (INTVAL (op) + 1, 7, 0)")))
kono
parents: 55
diff changeset
221
kono
parents: 55
diff changeset
222 (define_predicate "db8_operand"
kono
parents: 55
diff changeset
223 (and (match_code "const_int")
kono
parents: 55
diff changeset
224 (match_test "mips_unsigned_immediate_p (INTVAL (op) + 1, 8, 0)")))
kono
parents: 55
diff changeset
225
kono
parents: 55
diff changeset
226 (define_predicate "ib3_operand"
kono
parents: 55
diff changeset
227 (and (match_code "const_int")
kono
parents: 55
diff changeset
228 (match_test "mips_unsigned_immediate_p (INTVAL (op) - 1, 3, 0)")))
kono
parents: 55
diff changeset
229
kono
parents: 55
diff changeset
230 (define_predicate "sb4_operand"
kono
parents: 55
diff changeset
231 (and (match_code "const_int")
kono
parents: 55
diff changeset
232 (match_test "mips_signed_immediate_p (INTVAL (op), 4, 0)")))
kono
parents: 55
diff changeset
233
kono
parents: 55
diff changeset
234 (define_predicate "sb5_operand"
kono
parents: 55
diff changeset
235 (and (match_code "const_int")
kono
parents: 55
diff changeset
236 (match_test "mips_signed_immediate_p (INTVAL (op), 5, 0)")))
kono
parents: 55
diff changeset
237
kono
parents: 55
diff changeset
238 (define_predicate "sb8_operand"
kono
parents: 55
diff changeset
239 (and (match_code "const_int")
kono
parents: 55
diff changeset
240 (match_test "mips_signed_immediate_p (INTVAL (op), 8, 0)")))
kono
parents: 55
diff changeset
241
kono
parents: 55
diff changeset
242 (define_predicate "sd8_operand"
kono
parents: 55
diff changeset
243 (and (match_code "const_int")
kono
parents: 55
diff changeset
244 (match_test "mips_signed_immediate_p (INTVAL (op), 8, 3)")))
kono
parents: 55
diff changeset
245
kono
parents: 55
diff changeset
246 (define_predicate "ub4_operand"
kono
parents: 55
diff changeset
247 (and (match_code "const_int")
kono
parents: 55
diff changeset
248 (match_test "mips_unsigned_immediate_p (INTVAL (op), 4, 0)")))
kono
parents: 55
diff changeset
249
kono
parents: 55
diff changeset
250 (define_predicate "ub8_operand"
kono
parents: 55
diff changeset
251 (and (match_code "const_int")
kono
parents: 55
diff changeset
252 (match_test "mips_unsigned_immediate_p (INTVAL (op), 8, 0)")))
kono
parents: 55
diff changeset
253
kono
parents: 55
diff changeset
254 (define_predicate "uh4_operand"
kono
parents: 55
diff changeset
255 (and (match_code "const_int")
kono
parents: 55
diff changeset
256 (match_test "mips_unsigned_immediate_p (INTVAL (op), 4, 1)")))
kono
parents: 55
diff changeset
257
kono
parents: 55
diff changeset
258 (define_predicate "uw4_operand"
kono
parents: 55
diff changeset
259 (and (match_code "const_int")
kono
parents: 55
diff changeset
260 (match_test "mips_unsigned_immediate_p (INTVAL (op), 4, 2)")))
kono
parents: 55
diff changeset
261
kono
parents: 55
diff changeset
262 (define_predicate "uw5_operand"
kono
parents: 55
diff changeset
263 (and (match_code "const_int")
kono
parents: 55
diff changeset
264 (match_test "mips_unsigned_immediate_p (INTVAL (op), 5, 2)")))
kono
parents: 55
diff changeset
265
kono
parents: 55
diff changeset
266 (define_predicate "uw6_operand"
kono
parents: 55
diff changeset
267 (and (match_code "const_int")
kono
parents: 55
diff changeset
268 (match_test "mips_unsigned_immediate_p (INTVAL (op), 6, 2)")))
kono
parents: 55
diff changeset
269
kono
parents: 55
diff changeset
270 (define_predicate "uw8_operand"
kono
parents: 55
diff changeset
271 (and (match_code "const_int")
kono
parents: 55
diff changeset
272 (match_test "mips_unsigned_immediate_p (INTVAL (op), 8, 2)")))
kono
parents: 55
diff changeset
273
kono
parents: 55
diff changeset
274 (define_predicate "addiur2_operand"
kono
parents: 55
diff changeset
275 (and (match_code "const_int")
kono
parents: 55
diff changeset
276 (ior (match_test "INTVAL (op) == -1")
kono
parents: 55
diff changeset
277 (match_test "INTVAL (op) == 1")
kono
parents: 55
diff changeset
278 (match_test "INTVAL (op) == 4")
kono
parents: 55
diff changeset
279 (match_test "INTVAL (op) == 8")
kono
parents: 55
diff changeset
280 (match_test "INTVAL (op) == 12")
kono
parents: 55
diff changeset
281 (match_test "INTVAL (op) == 16")
kono
parents: 55
diff changeset
282 (match_test "INTVAL (op) == 20")
kono
parents: 55
diff changeset
283 (match_test "INTVAL (op) == 24"))))
kono
parents: 55
diff changeset
284
kono
parents: 55
diff changeset
285 (define_predicate "addiusp_operand"
kono
parents: 55
diff changeset
286 (and (match_code "const_int")
kono
parents: 55
diff changeset
287 (ior (match_test "(IN_RANGE (INTVAL (op), 2, 257))")
kono
parents: 55
diff changeset
288 (match_test "(IN_RANGE (INTVAL (op), -258, -3))"))))
kono
parents: 55
diff changeset
289
kono
parents: 55
diff changeset
290 (define_predicate "andi16_operand"
kono
parents: 55
diff changeset
291 (and (match_code "const_int")
kono
parents: 55
diff changeset
292 (ior (match_test "IN_RANGE (INTVAL (op), 1, 4)")
kono
parents: 55
diff changeset
293 (match_test "IN_RANGE (INTVAL (op), 7, 8)")
kono
parents: 55
diff changeset
294 (match_test "IN_RANGE (INTVAL (op), 15, 16)")
kono
parents: 55
diff changeset
295 (match_test "IN_RANGE (INTVAL (op), 31, 32)")
kono
parents: 55
diff changeset
296 (match_test "IN_RANGE (INTVAL (op), 63, 64)")
kono
parents: 55
diff changeset
297 (match_test "INTVAL (op) == 255")
kono
parents: 55
diff changeset
298 (match_test "INTVAL (op) == 32768")
kono
parents: 55
diff changeset
299 (match_test "INTVAL (op) == 65535"))))
kono
parents: 55
diff changeset
300
kono
parents: 55
diff changeset
301 (define_predicate "movep_src_register"
kono
parents: 55
diff changeset
302 (and (match_code "reg")
kono
parents: 55
diff changeset
303 (ior (match_test ("IN_RANGE (REGNO (op), 2, 3)"))
kono
parents: 55
diff changeset
304 (match_test ("IN_RANGE (REGNO (op), 16, 20)")))))
kono
parents: 55
diff changeset
305
kono
parents: 55
diff changeset
306 (define_predicate "movep_src_operand"
kono
parents: 55
diff changeset
307 (ior (match_operand 0 "const_0_operand")
kono
parents: 55
diff changeset
308 (match_operand 0 "movep_src_register")))
kono
parents: 55
diff changeset
309
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
310 (define_predicate "lo_operand"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
311 (and (match_code "reg")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
312 (match_test "REGNO (op) == LO_REGNUM")))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
313
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
314 (define_predicate "hilo_operand"
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
315 (and (match_code "reg")
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
316 (match_test "MD_REG_P (REGNO (op))")))
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
317
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
318 (define_predicate "fcc_reload_operand"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
319 (and (match_code "reg,subreg")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
320 (match_test "ST_REG_P (true_regnum (op))")))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
321
111
kono
parents: 55
diff changeset
322 (define_predicate "muldiv_target_operand"
kono
parents: 55
diff changeset
323 (if_then_else (match_test "TARGET_MIPS16")
kono
parents: 55
diff changeset
324 (match_operand 0 "hilo_operand")
kono
parents: 55
diff changeset
325 (match_operand 0 "register_operand")))
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
326
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
327 (define_predicate "const_call_insn_operand"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
328 (match_code "const,symbol_ref,label_ref")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
329 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
330 enum mips_symbol_type symbol_type;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
331
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
332 if (!mips_symbolic_constant_p (op, SYMBOL_CONTEXT_CALL, &symbol_type))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
333 return false;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
334
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
335 switch (symbol_type)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
336 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
337 case SYMBOL_ABSOLUTE:
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
338 /* We can only use direct calls if we're sure that the target
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
339 function does not need $25 to be valid on entry. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
340 if (mips_use_pic_fn_addr_reg_p (op))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
341 return false;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
342
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
343 /* If -mlong-calls or if this function has an explicit long_call
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
344 attribute, we must use register addressing. The
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
345 SYMBOL_FLAG_LONG_CALL bit is set by mips_encode_section_info. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
346 return !(GET_CODE (op) == SYMBOL_REF && SYMBOL_REF_LONG_CALL_P (op));
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
347
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
348 case SYMBOL_GOT_DISP:
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
349 /* Without explicit relocs, there is no special syntax for
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
350 loading the address of a call destination into a register.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
351 Using "la $25,foo; jal $25" would prevent the lazy binding
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
352 of "foo", so keep the address of global symbols with the
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
353 jal macro. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
354 return !TARGET_EXPLICIT_RELOCS;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
355
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
356 default:
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
357 return false;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
358 }
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
359 })
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
360
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
361 (define_predicate "call_insn_operand"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
362 (ior (match_operand 0 "const_call_insn_operand")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
363 (match_operand 0 "register_operand")))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
364
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
365 ;; A legitimate CONST_INT operand that takes more than one instruction
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
366 ;; to load.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
367 (define_predicate "splittable_const_int_operand"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
368 (match_code "const_int")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
369 {
111
kono
parents: 55
diff changeset
370 /* When generating mips16 code, TARGET_LEGITIMATE_CONSTANT_P rejects
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
371 CONST_INTs that can't be loaded using simple insns. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
372 if (TARGET_MIPS16)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
373 return false;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
374
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
375 /* Don't handle multi-word moves this way; we don't want to introduce
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
376 the individual word-mode moves until after reload. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
377 if (GET_MODE_SIZE (mode) > UNITS_PER_WORD)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
378 return false;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
379
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
380 /* Otherwise check whether the constant can be loaded in a single
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
381 instruction. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
382 return !LUI_INT (op) && !SMALL_INT (op) && !SMALL_INT_UNSIGNED (op);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
383 })
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
384
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
385 (define_predicate "move_operand"
111
kono
parents: 55
diff changeset
386 ;; Allow HI and LO to be used as the source of a MIPS16 move.
kono
parents: 55
diff changeset
387 (ior (match_operand 0 "general_operand")
kono
parents: 55
diff changeset
388 (match_operand 0 "hilo_operand"))
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
389 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
390 enum mips_symbol_type symbol_type;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
391
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
392 /* The thinking here is as follows:
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
393
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
394 (1) The move expanders should split complex load sequences into
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
395 individual instructions. Those individual instructions can
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
396 then be optimized by all rtl passes.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
397
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
398 (2) The target of pre-reload load sequences should not be used
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
399 to store temporary results. If the target register is only
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
400 assigned one value, reload can rematerialize that value
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
401 on demand, rather than spill it to the stack.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
402
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
403 (3) If we allowed pre-reload passes like combine and cse to recreate
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
404 complex load sequences, we would want to be able to split the
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
405 sequences before reload as well, so that the pre-reload scheduler
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
406 can see the individual instructions. This falls foul of (2);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
407 the splitter would be forced to reuse the target register for
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
408 intermediate results.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
409
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
410 (4) We want to define complex load splitters for combine. These
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
411 splitters can request a temporary scratch register, which avoids
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
412 the problem in (2). They allow things like:
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
413
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
414 (set (reg T1) (high SYM))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
415 (set (reg T2) (low (reg T1) SYM))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
416 (set (reg X) (plus (reg T2) (const_int OFFSET)))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
417
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
418 to be combined into:
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
419
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
420 (set (reg T3) (high SYM+OFFSET))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
421 (set (reg X) (lo_sum (reg T3) SYM+OFFSET))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
422
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
423 if T2 is only used this once. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
424 switch (GET_CODE (op))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
425 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
426 case CONST_INT:
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
427 return !splittable_const_int_operand (op, mode);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
428
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
429 case CONST:
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
430 case SYMBOL_REF:
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
431 case LABEL_REF:
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
432 if (CONST_GP_P (op))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
433 return true;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
434 return (mips_symbolic_constant_p (op, SYMBOL_CONTEXT_LEA, &symbol_type)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
435 && !mips_split_p[symbol_type]);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
436
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
437 case HIGH:
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
438 op = XEXP (op, 0);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
439 return (mips_symbolic_constant_p (op, SYMBOL_CONTEXT_LEA, &symbol_type)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
440 && !mips_split_hi_p[symbol_type]);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
441
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
442 default:
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
443 return true;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
444 }
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
445 })
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
446
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
447 (define_predicate "cprestore_save_slot_operand"
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
448 (and (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
449 (match_test "mips_cprestore_address_p (XEXP (op, 0), false)")))
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
450
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
451 (define_predicate "cprestore_load_slot_operand"
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
452 (and (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
453 (match_test "mips_cprestore_address_p (XEXP (op, 0), true)")))
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
454
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
455 (define_predicate "consttable_operand"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
456 (match_test "CONSTANT_P (op)"))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
457
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
458 (define_predicate "symbolic_operand"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
459 (match_code "const,symbol_ref,label_ref")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
460 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
461 enum mips_symbol_type type;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
462 return mips_symbolic_constant_p (op, SYMBOL_CONTEXT_LEA, &type);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
463 })
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
464
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
465 (define_predicate "absolute_symbolic_operand"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
466 (match_code "const,symbol_ref,label_ref")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
467 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
468 enum mips_symbol_type type;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
469 return (mips_symbolic_constant_p (op, SYMBOL_CONTEXT_LEA, &type)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
470 && type == SYMBOL_ABSOLUTE);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
471 })
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
472
111
kono
parents: 55
diff changeset
473 (define_predicate "symbolic_operand_with_high"
kono
parents: 55
diff changeset
474 (match_code "const,symbol_ref,label_ref")
kono
parents: 55
diff changeset
475 {
kono
parents: 55
diff changeset
476 enum mips_symbol_type type;
kono
parents: 55
diff changeset
477 return (mips_symbolic_constant_p (op, SYMBOL_CONTEXT_LEA, &type)
kono
parents: 55
diff changeset
478 && mips_hi_relocs[(int) type]);
kono
parents: 55
diff changeset
479 })
kono
parents: 55
diff changeset
480
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
481 (define_predicate "force_to_mem_operand"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
482 (match_code "const,symbol_ref,label_ref")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
483 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
484 enum mips_symbol_type symbol_type;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
485 return (mips_symbolic_constant_p (op, SYMBOL_CONTEXT_LEA, &symbol_type)
111
kono
parents: 55
diff changeset
486 && mips_use_pcrel_pool_p[(int) symbol_type]);
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
487 })
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
488
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
489 (define_predicate "got_disp_operand"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
490 (match_code "const,symbol_ref,label_ref")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
491 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
492 enum mips_symbol_type type;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
493 return (mips_symbolic_constant_p (op, SYMBOL_CONTEXT_LEA, &type)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
494 && type == SYMBOL_GOT_DISP);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
495 })
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
496
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
497 (define_predicate "got_page_ofst_operand"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
498 (match_code "const,symbol_ref,label_ref")
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 enum mips_symbol_type type;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
501 return (mips_symbolic_constant_p (op, SYMBOL_CONTEXT_LEA, &type)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
502 && type == SYMBOL_GOT_PAGE_OFST);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
503 })
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
504
111
kono
parents: 55
diff changeset
505 (define_predicate "tls_reloc_operand"
kono
parents: 55
diff changeset
506 (match_code "const,symbol_ref,label_ref")
kono
parents: 55
diff changeset
507 {
kono
parents: 55
diff changeset
508 enum mips_symbol_type type;
kono
parents: 55
diff changeset
509 return (mips_symbolic_constant_p (op, SYMBOL_CONTEXT_LEA, &type)
kono
parents: 55
diff changeset
510 && (type == SYMBOL_DTPREL || type == SYMBOL_TPREL));
kono
parents: 55
diff changeset
511 })
kono
parents: 55
diff changeset
512
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
513 (define_predicate "symbol_ref_operand"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
514 (match_code "symbol_ref"))
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 (define_predicate "stack_operand"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
517 (and (match_code "mem")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
518 (match_test "mips_stack_address_p (XEXP (op, 0), GET_MODE (op))")))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
519
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
520 (define_predicate "macc_msac_operand"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
521 (ior (and (match_code "plus") (match_test "ISA_HAS_MACC"))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
522 (and (match_code "minus") (match_test "ISA_HAS_MSAC")))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
523 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
524 rtx mult = XEXP (op, GET_CODE (op) == PLUS ? 0 : 1);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
525 rtx accum = XEXP (op, GET_CODE (op) == PLUS ? 1 : 0);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
526 return (GET_CODE (mult) == MULT
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
527 && REG_P (XEXP (mult, 0))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
528 && REG_P (XEXP (mult, 1))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
529 && REG_P (accum));
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
530 })
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
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
533 (define_predicate "equality_operator"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
534 (match_code "eq,ne"))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
535
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
536 (define_predicate "extend_operator"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
537 (match_code "zero_extend,sign_extend"))
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 (define_predicate "trap_comparison_operator"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
540 (match_code "eq,ne,lt,ltu,ge,geu"))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
541
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
542 (define_predicate "order_operator"
111
kono
parents: 55
diff changeset
543 (match_code "lt,ltu,le,leu,ge,geu,gt,gtu")
kono
parents: 55
diff changeset
544 {
kono
parents: 55
diff changeset
545 if (XEXP (op, 1) == const0_rtx)
kono
parents: 55
diff changeset
546 return true;
kono
parents: 55
diff changeset
547
kono
parents: 55
diff changeset
548 if (TARGET_CB_MAYBE
kono
parents: 55
diff changeset
549 && (GET_CODE (op) == LT || GET_CODE (op) == LTU
kono
parents: 55
diff changeset
550 || GET_CODE (op) == GE || GET_CODE (op) == GEU))
kono
parents: 55
diff changeset
551 return true;
kono
parents: 55
diff changeset
552
kono
parents: 55
diff changeset
553 return false;
kono
parents: 55
diff changeset
554 })
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
555
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
556 ;; For NE, cstore uses sltu instructions in which the first operand is $0.
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
557 ;; This isn't possible in mips16 code.
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
558
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
559 (define_predicate "mips_cstore_operator"
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
560 (ior (match_code "eq,gt,gtu,ge,geu,lt,ltu,le,leu")
111
kono
parents: 55
diff changeset
561 (and (match_code "ne") (not (match_test "TARGET_MIPS16")))))
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
562
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
563 (define_predicate "small_data_pattern"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
564 (and (match_code "set,parallel,unspec,unspec_volatile,prefetch")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
565 (match_test "mips_small_data_pattern_p (op)")))
111
kono
parents: 55
diff changeset
566
kono
parents: 55
diff changeset
567 (define_predicate "mem_noofs_operand"
kono
parents: 55
diff changeset
568 (and (match_code "mem")
kono
parents: 55
diff changeset
569 (match_code "reg" "0")))
kono
parents: 55
diff changeset
570
kono
parents: 55
diff changeset
571 ;; Return 1 if the operand is in non-volatile memory.
kono
parents: 55
diff changeset
572 (define_predicate "non_volatile_mem_operand"
kono
parents: 55
diff changeset
573 (and (match_operand 0 "memory_operand")
kono
parents: 55
diff changeset
574 (not (match_test "MEM_VOLATILE_P (op)"))))
kono
parents: 55
diff changeset
575
kono
parents: 55
diff changeset
576 (define_predicate "const_vector_same_val_operand"
kono
parents: 55
diff changeset
577 (match_code "const_vector")
kono
parents: 55
diff changeset
578 {
kono
parents: 55
diff changeset
579 return mips_const_vector_same_val_p (op, mode);
kono
parents: 55
diff changeset
580 })
kono
parents: 55
diff changeset
581
kono
parents: 55
diff changeset
582 (define_predicate "const_vector_same_simm5_operand"
kono
parents: 55
diff changeset
583 (match_code "const_vector")
kono
parents: 55
diff changeset
584 {
kono
parents: 55
diff changeset
585 return mips_const_vector_same_int_p (op, mode, -16, 15);
kono
parents: 55
diff changeset
586 })
kono
parents: 55
diff changeset
587
kono
parents: 55
diff changeset
588 (define_predicate "const_vector_same_uimm5_operand"
kono
parents: 55
diff changeset
589 (match_code "const_vector")
kono
parents: 55
diff changeset
590 {
kono
parents: 55
diff changeset
591 return mips_const_vector_same_int_p (op, mode, 0, 31);
kono
parents: 55
diff changeset
592 })
kono
parents: 55
diff changeset
593
kono
parents: 55
diff changeset
594 (define_predicate "const_vector_same_ximm5_operand"
kono
parents: 55
diff changeset
595 (match_code "const_vector")
kono
parents: 55
diff changeset
596 {
kono
parents: 55
diff changeset
597 return mips_const_vector_same_int_p (op, mode, -31, 31);
kono
parents: 55
diff changeset
598 })
kono
parents: 55
diff changeset
599
kono
parents: 55
diff changeset
600 (define_predicate "const_vector_same_uimm6_operand"
kono
parents: 55
diff changeset
601 (match_code "const_vector")
kono
parents: 55
diff changeset
602 {
kono
parents: 55
diff changeset
603 return mips_const_vector_same_int_p (op, mode, 0, 63);
kono
parents: 55
diff changeset
604 })
kono
parents: 55
diff changeset
605
kono
parents: 55
diff changeset
606 (define_predicate "const_vector_same_uimm8_operand"
kono
parents: 55
diff changeset
607 (match_code "const_vector")
kono
parents: 55
diff changeset
608 {
kono
parents: 55
diff changeset
609 return mips_const_vector_same_int_p (op, mode, 0, 255);
kono
parents: 55
diff changeset
610 })
kono
parents: 55
diff changeset
611
kono
parents: 55
diff changeset
612 (define_predicate "par_const_vector_shf_set_operand"
kono
parents: 55
diff changeset
613 (match_code "parallel")
kono
parents: 55
diff changeset
614 {
kono
parents: 55
diff changeset
615 return mips_const_vector_shuffle_set_p (op, mode);
kono
parents: 55
diff changeset
616 })
kono
parents: 55
diff changeset
617
kono
parents: 55
diff changeset
618 (define_predicate "reg_or_vector_same_val_operand"
kono
parents: 55
diff changeset
619 (ior (match_operand 0 "register_operand")
kono
parents: 55
diff changeset
620 (match_operand 0 "const_vector_same_val_operand")))
kono
parents: 55
diff changeset
621
kono
parents: 55
diff changeset
622 (define_predicate "reg_or_vector_same_simm5_operand"
kono
parents: 55
diff changeset
623 (ior (match_operand 0 "register_operand")
kono
parents: 55
diff changeset
624 (match_operand 0 "const_vector_same_simm5_operand")))
kono
parents: 55
diff changeset
625
kono
parents: 55
diff changeset
626 (define_predicate "reg_or_vector_same_uimm5_operand"
kono
parents: 55
diff changeset
627 (ior (match_operand 0 "register_operand")
kono
parents: 55
diff changeset
628 (match_operand 0 "const_vector_same_uimm5_operand")))
kono
parents: 55
diff changeset
629
kono
parents: 55
diff changeset
630 (define_predicate "reg_or_vector_same_ximm5_operand"
kono
parents: 55
diff changeset
631 (ior (match_operand 0 "register_operand")
kono
parents: 55
diff changeset
632 (match_operand 0 "const_vector_same_ximm5_operand")))
kono
parents: 55
diff changeset
633
kono
parents: 55
diff changeset
634 (define_predicate "reg_or_vector_same_uimm6_operand"
kono
parents: 55
diff changeset
635 (ior (match_operand 0 "register_operand")
kono
parents: 55
diff changeset
636 (match_operand 0 "const_vector_same_uimm6_operand")))