annotate gcc/config/arm/predicates.md @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents f6334be47118
children 84e7813d76e9
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 ARM and Thumb
111
kono
parents: 67
diff changeset
2 ;; Copyright (C) 2004-2017 Free Software Foundation, Inc.
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
3 ;; Contributed by ARM Ltd.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
4
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
5 ;; This file is part of GCC.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
6
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
7 ;; GCC is free software; you can redistribute it and/or modify it
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
8 ;; under the terms of the GNU General Public License as published
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
9 ;; by the Free Software Foundation; either version 3, or (at your
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
10 ;; option) any later version.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
11
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
12 ;; GCC is distributed in the hope that it will be useful, but WITHOUT
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
13 ;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
14 ;; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
15 ;; License for more details.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
16
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
17 ;; 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
18 ;; along with GCC; see the file COPYING3. If not see
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
19 ;; <http://www.gnu.org/licenses/>.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
20
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
21 (define_predicate "s_register_operand"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
22 (match_code "reg,subreg")
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 if (GET_CODE (op) == SUBREG)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
25 op = SUBREG_REG (op);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
26 /* We don't consider registers whose class is NO_REGS
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
27 to be a register operand. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
28 /* XXX might have to check for lo regs only for thumb ??? */
111
kono
parents: 67
diff changeset
29 return (REG_P (op)
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
30 && (REGNO (op) >= FIRST_PSEUDO_REGISTER
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
31 || REGNO_REG_CLASS (REGNO (op)) != NO_REGS));
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
32 })
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
33
111
kono
parents: 67
diff changeset
34 (define_predicate "imm_for_neon_inv_logic_operand"
kono
parents: 67
diff changeset
35 (match_code "const_vector")
kono
parents: 67
diff changeset
36 {
kono
parents: 67
diff changeset
37 return (TARGET_NEON
kono
parents: 67
diff changeset
38 && neon_immediate_valid_for_logic (op, mode, 1, NULL, NULL));
kono
parents: 67
diff changeset
39 })
kono
parents: 67
diff changeset
40
kono
parents: 67
diff changeset
41 (define_predicate "neon_inv_logic_op2"
kono
parents: 67
diff changeset
42 (ior (match_operand 0 "imm_for_neon_inv_logic_operand")
kono
parents: 67
diff changeset
43 (match_operand 0 "s_register_operand")))
kono
parents: 67
diff changeset
44
kono
parents: 67
diff changeset
45 (define_predicate "imm_for_neon_logic_operand"
kono
parents: 67
diff changeset
46 (match_code "const_vector")
kono
parents: 67
diff changeset
47 {
kono
parents: 67
diff changeset
48 return (TARGET_NEON
kono
parents: 67
diff changeset
49 && neon_immediate_valid_for_logic (op, mode, 0, NULL, NULL));
kono
parents: 67
diff changeset
50 })
kono
parents: 67
diff changeset
51
kono
parents: 67
diff changeset
52 (define_predicate "neon_logic_op2"
kono
parents: 67
diff changeset
53 (ior (match_operand 0 "imm_for_neon_logic_operand")
kono
parents: 67
diff changeset
54 (match_operand 0 "s_register_operand")))
kono
parents: 67
diff changeset
55
kono
parents: 67
diff changeset
56 ;; Any general register.
kono
parents: 67
diff changeset
57 (define_predicate "arm_hard_general_register_operand"
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
58 (match_code "reg")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
59 {
111
kono
parents: 67
diff changeset
60 return REGNO (op) <= LAST_ARM_REGNUM;
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
61 })
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
62
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
63 ;; A low register.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
64 (define_predicate "low_register_operand"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
65 (and (match_code "reg")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
66 (match_test "REGNO (op) <= LAST_LO_REGNUM")))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
67
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
68 ;; A low register or const_int.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
69 (define_predicate "low_reg_or_int_operand"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
70 (ior (match_code "const_int")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
71 (match_operand 0 "low_register_operand")))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
72
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
73 ;; Any core register, or any pseudo. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
74 (define_predicate "arm_general_register_operand"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
75 (match_code "reg,subreg")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
76 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
77 if (GET_CODE (op) == SUBREG)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
78 op = SUBREG_REG (op);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
79
111
kono
parents: 67
diff changeset
80 return (REG_P (op)
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
81 && (REGNO (op) <= LAST_ARM_REGNUM
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
82 || REGNO (op) >= FIRST_PSEUDO_REGISTER));
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
83 })
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
84
111
kono
parents: 67
diff changeset
85 (define_predicate "arm_general_adddi_operand"
kono
parents: 67
diff changeset
86 (ior (match_operand 0 "arm_general_register_operand")
kono
parents: 67
diff changeset
87 (and (match_code "const_int")
kono
parents: 67
diff changeset
88 (match_test "const_ok_for_dimode_op (INTVAL (op), PLUS)"))))
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
89
67
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
90 (define_predicate "vfp_register_operand"
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
91 (match_code "reg,subreg")
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
92 {
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
93 if (GET_CODE (op) == SUBREG)
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
94 op = SUBREG_REG (op);
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
95
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
96 /* We don't consider registers whose class is NO_REGS
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
97 to be a register operand. */
111
kono
parents: 67
diff changeset
98 return (REG_P (op)
67
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
99 && (REGNO (op) >= FIRST_PSEUDO_REGISTER
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
100 || REGNO_REG_CLASS (REGNO (op)) == VFP_D0_D7_REGS
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
101 || REGNO_REG_CLASS (REGNO (op)) == VFP_LO_REGS
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
102 || (TARGET_VFPD32
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
103 && REGNO_REG_CLASS (REGNO (op)) == VFP_REGS)));
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
104 })
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
105
111
kono
parents: 67
diff changeset
106 (define_predicate "vfp_hard_register_operand"
kono
parents: 67
diff changeset
107 (match_code "reg")
kono
parents: 67
diff changeset
108 {
kono
parents: 67
diff changeset
109 return (IS_VFP_REGNUM (REGNO (op)));
kono
parents: 67
diff changeset
110 })
kono
parents: 67
diff changeset
111
kono
parents: 67
diff changeset
112 (define_predicate "zero_operand"
kono
parents: 67
diff changeset
113 (and (match_code "const_int,const_double,const_vector")
kono
parents: 67
diff changeset
114 (match_test "op == CONST0_RTX (mode)")))
kono
parents: 67
diff changeset
115
kono
parents: 67
diff changeset
116 ;; Match a register, or zero in the appropriate mode.
kono
parents: 67
diff changeset
117 (define_predicate "reg_or_zero_operand"
kono
parents: 67
diff changeset
118 (ior (match_operand 0 "s_register_operand")
kono
parents: 67
diff changeset
119 (match_operand 0 "zero_operand")))
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 (define_special_predicate "subreg_lowpart_operator"
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
122 (and (match_code "subreg")
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
123 (match_test "subreg_lowpart_p (op)")))
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
124
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
125 ;; Reg, subreg(reg) or const_int.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
126 (define_predicate "reg_or_int_operand"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
127 (ior (match_code "const_int")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
128 (match_operand 0 "s_register_operand")))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
129
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
130 (define_predicate "arm_immediate_operand"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
131 (and (match_code "const_int")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
132 (match_test "const_ok_for_arm (INTVAL (op))")))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
133
67
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
134 ;; A constant value which fits into two instructions, each taking
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
135 ;; an arithmetic constant operand for one of the words.
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
136 (define_predicate "arm_immediate_di_operand"
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
137 (and (match_code "const_int,const_double")
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
138 (match_test "arm_const_double_by_immediates (op)")))
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
139
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
140 (define_predicate "arm_neg_immediate_operand"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
141 (and (match_code "const_int")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
142 (match_test "const_ok_for_arm (-INTVAL (op))")))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
143
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
144 (define_predicate "arm_not_immediate_operand"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
145 (and (match_code "const_int")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
146 (match_test "const_ok_for_arm (~INTVAL (op))")))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
147
63
b7f97abdc517 update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
148 (define_predicate "const0_operand"
111
kono
parents: 67
diff changeset
149 (match_test "op == CONST0_RTX (mode)"))
63
b7f97abdc517 update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
150
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
151 ;; Something valid on the RHS of an ARM data-processing instruction
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
152 (define_predicate "arm_rhs_operand"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
153 (ior (match_operand 0 "s_register_operand")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
154 (match_operand 0 "arm_immediate_operand")))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
155
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
156 (define_predicate "arm_rhsm_operand"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
157 (ior (match_operand 0 "arm_rhs_operand")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
158 (match_operand 0 "memory_operand")))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
159
111
kono
parents: 67
diff changeset
160 (define_predicate "const_int_I_operand"
kono
parents: 67
diff changeset
161 (and (match_operand 0 "const_int_operand")
kono
parents: 67
diff changeset
162 (match_test "satisfies_constraint_I (op)")))
kono
parents: 67
diff changeset
163
kono
parents: 67
diff changeset
164 (define_predicate "const_int_M_operand"
kono
parents: 67
diff changeset
165 (and (match_operand 0 "const_int_operand")
kono
parents: 67
diff changeset
166 (match_test "satisfies_constraint_M (op)")))
kono
parents: 67
diff changeset
167
kono
parents: 67
diff changeset
168 ;; This doesn't have to do much because the constant is already checked
kono
parents: 67
diff changeset
169 ;; in the shift_operator predicate.
67
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
170 (define_predicate "shift_amount_operand"
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
171 (ior (and (match_test "TARGET_ARM")
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
172 (match_operand 0 "s_register_operand"))
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
173 (match_operand 0 "const_int_operand")))
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
174
111
kono
parents: 67
diff changeset
175 (define_predicate "const_neon_scalar_shift_amount_operand"
kono
parents: 67
diff changeset
176 (and (match_code "const_int")
kono
parents: 67
diff changeset
177 (match_test "IN_RANGE (UINTVAL (op), 1, GET_MODE_BITSIZE (mode))")))
kono
parents: 67
diff changeset
178
kono
parents: 67
diff changeset
179 (define_predicate "ldrd_strd_offset_operand"
kono
parents: 67
diff changeset
180 (and (match_operand 0 "const_int_operand")
kono
parents: 67
diff changeset
181 (match_test "TARGET_LDRD && offset_ok_for_ldrd_strd (INTVAL (op))")))
kono
parents: 67
diff changeset
182
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
183 (define_predicate "arm_add_operand"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
184 (ior (match_operand 0 "arm_rhs_operand")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
185 (match_operand 0 "arm_neg_immediate_operand")))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
186
111
kono
parents: 67
diff changeset
187 (define_predicate "arm_anddi_operand_neon"
kono
parents: 67
diff changeset
188 (ior (match_operand 0 "s_register_operand")
kono
parents: 67
diff changeset
189 (and (match_code "const_int")
kono
parents: 67
diff changeset
190 (match_test "const_ok_for_dimode_op (INTVAL (op), AND)"))
kono
parents: 67
diff changeset
191 (match_operand 0 "neon_inv_logic_op2")))
kono
parents: 67
diff changeset
192
kono
parents: 67
diff changeset
193 (define_predicate "arm_iordi_operand_neon"
kono
parents: 67
diff changeset
194 (ior (match_operand 0 "s_register_operand")
kono
parents: 67
diff changeset
195 (and (match_code "const_int")
kono
parents: 67
diff changeset
196 (match_test "const_ok_for_dimode_op (INTVAL (op), IOR)"))
kono
parents: 67
diff changeset
197 (match_operand 0 "neon_logic_op2")))
kono
parents: 67
diff changeset
198
kono
parents: 67
diff changeset
199 (define_predicate "arm_xordi_operand"
kono
parents: 67
diff changeset
200 (ior (match_operand 0 "s_register_operand")
kono
parents: 67
diff changeset
201 (and (match_code "const_int")
kono
parents: 67
diff changeset
202 (match_test "const_ok_for_dimode_op (INTVAL (op), XOR)"))))
kono
parents: 67
diff changeset
203
kono
parents: 67
diff changeset
204 (define_predicate "arm_adddi_operand"
kono
parents: 67
diff changeset
205 (ior (match_operand 0 "s_register_operand")
kono
parents: 67
diff changeset
206 (and (match_code "const_int")
kono
parents: 67
diff changeset
207 (match_test "const_ok_for_dimode_op (INTVAL (op), PLUS)"))))
kono
parents: 67
diff changeset
208
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
209 (define_predicate "arm_addimm_operand"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
210 (ior (match_operand 0 "arm_immediate_operand")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
211 (match_operand 0 "arm_neg_immediate_operand")))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
212
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
213 (define_predicate "arm_not_operand"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
214 (ior (match_operand 0 "arm_rhs_operand")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
215 (match_operand 0 "arm_not_immediate_operand")))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
216
67
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
217 (define_predicate "arm_di_operand"
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
218 (ior (match_operand 0 "s_register_operand")
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
219 (match_operand 0 "arm_immediate_di_operand")))
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
220
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
221 ;; True if the operand is a memory reference which contains an
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
222 ;; offsettable address.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
223 (define_predicate "offsettable_memory_operand"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
224 (and (match_code "mem")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
225 (match_test
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
226 "offsettable_address_p (reload_completed | reload_in_progress,
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
227 mode, XEXP (op, 0))")))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
228
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
229 ;; True if the operand is a memory operand that does not have an
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
230 ;; automodified base register (and thus will not generate output reloads).
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
231 (define_predicate "call_memory_operand"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
232 (and (match_code "mem")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
233 (and (match_test "GET_RTX_CLASS (GET_CODE (XEXP (op, 0)))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
234 != RTX_AUTOINC")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
235 (match_operand 0 "memory_operand"))))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
236
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
237 (define_predicate "arm_reload_memory_operand"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
238 (and (match_code "mem,reg,subreg")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
239 (match_test "(!CONSTANT_P (op)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
240 && (true_regnum(op) == -1
111
kono
parents: 67
diff changeset
241 || (REG_P (op)
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
242 && REGNO (op) >= FIRST_PSEUDO_REGISTER)))")))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
243
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
244 (define_predicate "vfp_compare_operand"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
245 (ior (match_operand 0 "s_register_operand")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
246 (and (match_code "const_double")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
247 (match_test "arm_const_double_rtx (op)"))))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
248
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
249 ;; True for valid index operands.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
250 (define_predicate "index_operand"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
251 (ior (match_operand 0 "s_register_operand")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
252 (and (match_operand 0 "immediate_operand")
111
kono
parents: 67
diff changeset
253 (match_test "(!CONST_INT_P (op)
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
254 || (INTVAL (op) < 4096 && INTVAL (op) > -4096))"))))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
255
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
256 ;; True for operators that can be combined with a shift in ARM state.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
257 (define_special_predicate "shiftable_operator"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
258 (and (match_code "plus,minus,ior,xor,and")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
259 (match_test "mode == GET_MODE (op)")))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
260
111
kono
parents: 67
diff changeset
261 (define_special_predicate "shiftable_operator_strict_it"
kono
parents: 67
diff changeset
262 (and (match_code "plus,and")
kono
parents: 67
diff changeset
263 (match_test "mode == GET_MODE (op)")))
kono
parents: 67
diff changeset
264
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
265 ;; True for logical binary operators.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
266 (define_special_predicate "logical_binary_operator"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
267 (and (match_code "ior,xor,and")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
268 (match_test "mode == GET_MODE (op)")))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
269
67
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
270 ;; True for commutative operators
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
271 (define_special_predicate "commutative_binary_operator"
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
272 (and (match_code "ior,xor,and,plus")
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
273 (match_test "mode == GET_MODE (op)")))
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
274
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
275 ;; True for shift operators.
111
kono
parents: 67
diff changeset
276 ;; Notes:
kono
parents: 67
diff changeset
277 ;; * mult is only permitted with a constant shift amount
kono
parents: 67
diff changeset
278 ;; * patterns that permit register shift amounts only in ARM mode use
kono
parents: 67
diff changeset
279 ;; shift_amount_operand, patterns that always allow registers do not,
kono
parents: 67
diff changeset
280 ;; so we don't have to worry about that sort of thing here.
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
281 (define_special_predicate "shift_operator"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
282 (and (ior (ior (and (match_code "mult")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
283 (match_test "power_of_two_operand (XEXP (op, 1), mode)"))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
284 (and (match_code "rotate")
111
kono
parents: 67
diff changeset
285 (match_test "CONST_INT_P (XEXP (op, 1))
kono
parents: 67
diff changeset
286 && (UINTVAL (XEXP (op, 1))) < 32")))
kono
parents: 67
diff changeset
287 (and (match_code "ashift,ashiftrt,lshiftrt,rotatert")
kono
parents: 67
diff changeset
288 (match_test "!CONST_INT_P (XEXP (op, 1))
kono
parents: 67
diff changeset
289 || (UINTVAL (XEXP (op, 1))) < 32")))
kono
parents: 67
diff changeset
290 (match_test "mode == GET_MODE (op)")))
kono
parents: 67
diff changeset
291
kono
parents: 67
diff changeset
292 (define_special_predicate "shift_nomul_operator"
kono
parents: 67
diff changeset
293 (and (ior (and (match_code "rotate")
kono
parents: 67
diff changeset
294 (match_test "CONST_INT_P (XEXP (op, 1))
kono
parents: 67
diff changeset
295 && (UINTVAL (XEXP (op, 1))) < 32"))
kono
parents: 67
diff changeset
296 (and (match_code "ashift,ashiftrt,lshiftrt,rotatert")
kono
parents: 67
diff changeset
297 (match_test "!CONST_INT_P (XEXP (op, 1))
kono
parents: 67
diff changeset
298 || (UINTVAL (XEXP (op, 1))) < 32")))
kono
parents: 67
diff changeset
299 (match_test "mode == GET_MODE (op)")))
kono
parents: 67
diff changeset
300
kono
parents: 67
diff changeset
301 ;; True for shift operators which can be used with saturation instructions.
kono
parents: 67
diff changeset
302 (define_special_predicate "sat_shift_operator"
kono
parents: 67
diff changeset
303 (and (ior (and (match_code "mult")
kono
parents: 67
diff changeset
304 (match_test "power_of_two_operand (XEXP (op, 1), mode)"))
kono
parents: 67
diff changeset
305 (and (match_code "ashift,ashiftrt")
kono
parents: 67
diff changeset
306 (match_test "CONST_INT_P (XEXP (op, 1))
kono
parents: 67
diff changeset
307 && (UINTVAL (XEXP (op, 1)) < 32)")))
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
308 (match_test "mode == GET_MODE (op)")))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
309
67
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
310 ;; True for MULT, to identify which variant of shift_operator is in use.
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
311 (define_special_predicate "mult_operator"
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
312 (match_code "mult"))
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
313
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
314 ;; True for operators that have 16-bit thumb variants. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
315 (define_special_predicate "thumb_16bit_operator"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
316 (match_code "plus,minus,and,ior,xor"))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
317
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
318 ;; True for EQ & NE
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
319 (define_special_predicate "equality_operator"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
320 (match_code "eq,ne"))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
321
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
322 ;; True for integer comparisons and, if FP is active, for comparisons
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
323 ;; other than LTGT or UNEQ.
111
kono
parents: 67
diff changeset
324 (define_special_predicate "expandable_comparison_operator"
kono
parents: 67
diff changeset
325 (match_code "eq,ne,le,lt,ge,gt,geu,gtu,leu,ltu,
kono
parents: 67
diff changeset
326 unordered,ordered,unlt,unle,unge,ungt"))
kono
parents: 67
diff changeset
327
kono
parents: 67
diff changeset
328 ;; Likewise, but only accept comparisons that are directly supported
kono
parents: 67
diff changeset
329 ;; by ARM condition codes.
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
330 (define_special_predicate "arm_comparison_operator"
111
kono
parents: 67
diff changeset
331 (and (match_operand 0 "expandable_comparison_operator")
kono
parents: 67
diff changeset
332 (match_test "maybe_get_arm_condition_code (op) != ARM_NV")))
kono
parents: 67
diff changeset
333
kono
parents: 67
diff changeset
334 ;; Likewise, but don't ignore the mode.
kono
parents: 67
diff changeset
335 ;; RTL SET operations require their operands source and destination have
kono
parents: 67
diff changeset
336 ;; the same modes, so we can't ignore the modes there. See PR target/69161.
kono
parents: 67
diff changeset
337 (define_predicate "arm_comparison_operator_mode"
kono
parents: 67
diff changeset
338 (and (match_operand 0 "expandable_comparison_operator")
kono
parents: 67
diff changeset
339 (match_test "maybe_get_arm_condition_code (op) != ARM_NV")))
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
340
63
b7f97abdc517 update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
341 (define_special_predicate "lt_ge_comparison_operator"
b7f97abdc517 update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
342 (match_code "lt,ge"))
b7f97abdc517 update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
343
111
kono
parents: 67
diff changeset
344 ;; The vsel instruction only accepts the ARM condition codes listed below.
kono
parents: 67
diff changeset
345 (define_special_predicate "arm_vsel_comparison_operator"
kono
parents: 67
diff changeset
346 (and (match_operand 0 "expandable_comparison_operator")
kono
parents: 67
diff changeset
347 (match_test "maybe_get_arm_condition_code (op) == ARM_GE
kono
parents: 67
diff changeset
348 || maybe_get_arm_condition_code (op) == ARM_GT
kono
parents: 67
diff changeset
349 || maybe_get_arm_condition_code (op) == ARM_EQ
kono
parents: 67
diff changeset
350 || maybe_get_arm_condition_code (op) == ARM_VS
kono
parents: 67
diff changeset
351 || maybe_get_arm_condition_code (op) == ARM_LT
kono
parents: 67
diff changeset
352 || maybe_get_arm_condition_code (op) == ARM_LE
kono
parents: 67
diff changeset
353 || maybe_get_arm_condition_code (op) == ARM_NE
kono
parents: 67
diff changeset
354 || maybe_get_arm_condition_code (op) == ARM_VC")))
kono
parents: 67
diff changeset
355
kono
parents: 67
diff changeset
356 (define_special_predicate "arm_cond_move_operator"
kono
parents: 67
diff changeset
357 (if_then_else (match_test "arm_restrict_it")
kono
parents: 67
diff changeset
358 (and (match_test "TARGET_VFP5")
kono
parents: 67
diff changeset
359 (match_operand 0 "arm_vsel_comparison_operator"))
kono
parents: 67
diff changeset
360 (match_operand 0 "expandable_comparison_operator")))
kono
parents: 67
diff changeset
361
67
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
362 (define_special_predicate "noov_comparison_operator"
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
363 (match_code "lt,ge,eq,ne"))
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
364
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
365 (define_special_predicate "minmax_operator"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
366 (and (match_code "smin,smax,umin,umax")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
367 (match_test "mode == GET_MODE (op)")))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
368
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
369 (define_special_predicate "cc_register"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
370 (and (match_code "reg")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
371 (and (match_test "REGNO (op) == CC_REGNUM")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
372 (ior (match_test "mode == GET_MODE (op)")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
373 (match_test "mode == VOIDmode && GET_MODE_CLASS (GET_MODE (op)) == MODE_CC")))))
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 (define_special_predicate "dominant_cc_register"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
376 (match_code "reg")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
377 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
378 if (mode == VOIDmode)
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 mode = GET_MODE (op);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
381
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
382 if (GET_MODE_CLASS (mode) != MODE_CC)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
383 return false;
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
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
386 return (cc_register (op, mode)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
387 && (mode == CC_DNEmode
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
388 || mode == CC_DEQmode
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
389 || mode == CC_DLEmode
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
390 || mode == CC_DLTmode
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
391 || mode == CC_DGEmode
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
392 || mode == CC_DGTmode
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
393 || mode == CC_DLEUmode
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
394 || mode == CC_DLTUmode
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
395 || mode == CC_DGEUmode
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
396 || mode == CC_DGTUmode));
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
111
kono
parents: 67
diff changeset
399 ;; Any register, including CC
kono
parents: 67
diff changeset
400 (define_predicate "cc_register_operand"
kono
parents: 67
diff changeset
401 (and (match_code "reg")
kono
parents: 67
diff changeset
402 (ior (match_operand 0 "s_register_operand")
kono
parents: 67
diff changeset
403 (match_operand 0 "cc_register"))))
kono
parents: 67
diff changeset
404
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
405 (define_special_predicate "arm_extendqisi_mem_op"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
406 (and (match_operand 0 "memory_operand")
111
kono
parents: 67
diff changeset
407 (match_test "TARGET_ARM ? arm_legitimate_address_outer_p (mode,
kono
parents: 67
diff changeset
408 XEXP (op, 0),
kono
parents: 67
diff changeset
409 SIGN_EXTEND,
kono
parents: 67
diff changeset
410 0)
kono
parents: 67
diff changeset
411 : memory_address_p (QImode, XEXP (op, 0))")))
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
412
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
413 (define_special_predicate "arm_reg_or_extendqisi_mem_op"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
414 (ior (match_operand 0 "arm_extendqisi_mem_op")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
415 (match_operand 0 "s_register_operand")))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
416
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
417 (define_predicate "power_of_two_operand"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
418 (match_code "const_int")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
419 {
67
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
420 unsigned HOST_WIDE_INT value = INTVAL (op) & 0xffffffff;
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
421
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
422 return value != 0 && (value & (value - 1)) == 0;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
423 })
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
424
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
425 (define_predicate "nonimmediate_di_operand"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
426 (match_code "reg,subreg,mem")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
427 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
428 if (s_register_operand (op, mode))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
429 return true;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
430
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
431 if (GET_CODE (op) == SUBREG)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
432 op = SUBREG_REG (op);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
433
111
kono
parents: 67
diff changeset
434 return MEM_P (op) && memory_address_p (DImode, XEXP (op, 0));
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
435 })
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 (define_predicate "di_operand"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
438 (ior (match_code "const_int,const_double")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
439 (and (match_code "reg,subreg,mem")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
440 (match_operand 0 "nonimmediate_di_operand"))))
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 (define_predicate "nonimmediate_soft_df_operand"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
443 (match_code "reg,subreg,mem")
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 if (s_register_operand (op, mode))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
446 return true;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
447
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
448 if (GET_CODE (op) == SUBREG)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
449 op = SUBREG_REG (op);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
450
111
kono
parents: 67
diff changeset
451 return MEM_P (op) && memory_address_p (DFmode, XEXP (op, 0));
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
452 })
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
453
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
454 (define_predicate "soft_df_operand"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
455 (ior (match_code "const_double")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
456 (and (match_code "reg,subreg,mem")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
457 (match_operand 0 "nonimmediate_soft_df_operand"))))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
458
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
459 (define_special_predicate "load_multiple_operation"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
460 (match_code "parallel")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
461 {
111
kono
parents: 67
diff changeset
462 return ldm_stm_operation_p (op, /*load=*/true, SImode,
kono
parents: 67
diff changeset
463 /*consecutive=*/false,
kono
parents: 67
diff changeset
464 /*return_pc=*/false);
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
465 })
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
466
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
467 (define_special_predicate "store_multiple_operation"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
468 (match_code "parallel")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
469 {
111
kono
parents: 67
diff changeset
470 return ldm_stm_operation_p (op, /*load=*/false, SImode,
kono
parents: 67
diff changeset
471 /*consecutive=*/false,
kono
parents: 67
diff changeset
472 /*return_pc=*/false);
kono
parents: 67
diff changeset
473 })
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
474
111
kono
parents: 67
diff changeset
475 (define_special_predicate "pop_multiple_return"
kono
parents: 67
diff changeset
476 (match_code "parallel")
kono
parents: 67
diff changeset
477 {
kono
parents: 67
diff changeset
478 return ldm_stm_operation_p (op, /*load=*/true, SImode,
kono
parents: 67
diff changeset
479 /*consecutive=*/false,
kono
parents: 67
diff changeset
480 /*return_pc=*/true);
kono
parents: 67
diff changeset
481 })
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
482
111
kono
parents: 67
diff changeset
483 (define_special_predicate "pop_multiple_fp"
kono
parents: 67
diff changeset
484 (match_code "parallel")
kono
parents: 67
diff changeset
485 {
kono
parents: 67
diff changeset
486 return ldm_stm_operation_p (op, /*load=*/true, DFmode,
kono
parents: 67
diff changeset
487 /*consecutive=*/true,
kono
parents: 67
diff changeset
488 /*return_pc=*/false);
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
489 })
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
490
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
491 (define_special_predicate "multi_register_push"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
492 (match_code "parallel")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
493 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
494 if ((GET_CODE (XVECEXP (op, 0, 0)) != SET)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
495 || (GET_CODE (SET_SRC (XVECEXP (op, 0, 0))) != UNSPEC)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
496 || (XINT (SET_SRC (XVECEXP (op, 0, 0)), 1) != UNSPEC_PUSH_MULT))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
497 return false;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
498
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
499 return true;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
500 })
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
501
111
kono
parents: 67
diff changeset
502 (define_predicate "push_mult_memory_operand"
kono
parents: 67
diff changeset
503 (match_code "mem")
kono
parents: 67
diff changeset
504 {
kono
parents: 67
diff changeset
505 /* ??? Given how PUSH_MULT is generated in the prologues, is there
kono
parents: 67
diff changeset
506 any point in testing for thumb1 specially? All of the variants
kono
parents: 67
diff changeset
507 use the same form. */
kono
parents: 67
diff changeset
508 if (TARGET_THUMB1)
kono
parents: 67
diff changeset
509 {
kono
parents: 67
diff changeset
510 /* ??? No attempt is made to represent STMIA, or validate that
kono
parents: 67
diff changeset
511 the stack adjustment matches the register count. This is
kono
parents: 67
diff changeset
512 true of the ARM/Thumb2 path as well. */
kono
parents: 67
diff changeset
513 rtx x = XEXP (op, 0);
kono
parents: 67
diff changeset
514 if (GET_CODE (x) != PRE_MODIFY)
kono
parents: 67
diff changeset
515 return false;
kono
parents: 67
diff changeset
516 if (XEXP (x, 0) != stack_pointer_rtx)
kono
parents: 67
diff changeset
517 return false;
kono
parents: 67
diff changeset
518 x = XEXP (x, 1);
kono
parents: 67
diff changeset
519 if (GET_CODE (x) != PLUS)
kono
parents: 67
diff changeset
520 return false;
kono
parents: 67
diff changeset
521 if (XEXP (x, 0) != stack_pointer_rtx)
kono
parents: 67
diff changeset
522 return false;
kono
parents: 67
diff changeset
523 return CONST_INT_P (XEXP (x, 1));
kono
parents: 67
diff changeset
524 }
kono
parents: 67
diff changeset
525
kono
parents: 67
diff changeset
526 /* ARM and Thumb2 handle pre-modify in their legitimate_address. */
kono
parents: 67
diff changeset
527 return memory_operand (op, mode);
kono
parents: 67
diff changeset
528 })
kono
parents: 67
diff changeset
529
0
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 ;; Thumb predicates
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
533 ;;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
534
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
535 (define_predicate "thumb1_cmp_operand"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
536 (ior (and (match_code "reg,subreg")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
537 (match_operand 0 "s_register_operand"))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
538 (and (match_code "const_int")
111
kono
parents: 67
diff changeset
539 (match_test "(UINTVAL (op)) < 256"))))
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
540
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
541 (define_predicate "thumb1_cmpneg_operand"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
542 (and (match_code "const_int")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
543 (match_test "INTVAL (op) < 0 && INTVAL (op) > -256")))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
544
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
545 ;; Return TRUE if a result can be stored in OP without clobbering the
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
546 ;; condition code register. Prior to reload we only accept a
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
547 ;; register. After reload we have to be able to handle memory as
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
548 ;; well, since a pseudo may not get a hard reg and reload cannot
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
549 ;; handle output-reloads on jump insns.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
550
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
551 ;; We could possibly handle mem before reload as well, but that might
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
552 ;; complicate things with the need to handle increment
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
553 ;; side-effects.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
554 (define_predicate "thumb_cbrch_target_operand"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
555 (and (match_code "reg,subreg,mem")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
556 (ior (match_operand 0 "s_register_operand")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
557 (and (match_test "reload_in_progress || reload_completed")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
558 (match_operand 0 "memory_operand")))))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
559
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
560 ;;-------------------------------------------------------------------------
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
561 ;;
111
kono
parents: 67
diff changeset
562 ;; iWMMXt predicates
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
563 ;;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
564
111
kono
parents: 67
diff changeset
565 (define_predicate "imm_or_reg_operand"
kono
parents: 67
diff changeset
566 (ior (match_operand 0 "immediate_operand")
kono
parents: 67
diff changeset
567 (match_operand 0 "register_operand")))
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
568
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
569 ;; Neon predicates
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
570
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
571 (define_predicate "const_multiple_of_8_operand"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
572 (match_code "const_int")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
573 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
574 unsigned HOST_WIDE_INT val = INTVAL (op);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
575 return (val & 7) == 0;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
576 })
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 (define_predicate "imm_for_neon_mov_operand"
111
kono
parents: 67
diff changeset
579 (match_code "const_vector,const_int")
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
580 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
581 return neon_immediate_valid_for_move (op, mode, NULL, NULL);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
582 })
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
583
111
kono
parents: 67
diff changeset
584 (define_predicate "imm_for_neon_lshift_operand"
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
585 (match_code "const_vector")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
586 {
111
kono
parents: 67
diff changeset
587 return neon_immediate_valid_for_shift (op, mode, NULL, NULL, true);
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
588 })
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
589
111
kono
parents: 67
diff changeset
590 (define_predicate "imm_for_neon_rshift_operand"
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
591 (match_code "const_vector")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
592 {
111
kono
parents: 67
diff changeset
593 return neon_immediate_valid_for_shift (op, mode, NULL, NULL, false);
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
594 })
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
595
111
kono
parents: 67
diff changeset
596 (define_predicate "imm_lshift_or_reg_neon"
kono
parents: 67
diff changeset
597 (ior (match_operand 0 "s_register_operand")
kono
parents: 67
diff changeset
598 (match_operand 0 "imm_for_neon_lshift_operand")))
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
599
111
kono
parents: 67
diff changeset
600 (define_predicate "imm_rshift_or_reg_neon"
kono
parents: 67
diff changeset
601 (ior (match_operand 0 "s_register_operand")
kono
parents: 67
diff changeset
602 (match_operand 0 "imm_for_neon_rshift_operand")))
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
603
67
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
604 ;; Predicates for named expanders that overlap multiple ISAs.
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
605
67
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
606 (define_predicate "cmpdi_operand"
111
kono
parents: 67
diff changeset
607 (and (match_test "TARGET_32BIT")
kono
parents: 67
diff changeset
608 (match_operand 0 "arm_di_operand")))
67
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
609
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
610 ;; True if the operand is memory reference suitable for a ldrex/strex.
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
611 (define_predicate "arm_sync_memory_operand"
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
612 (and (match_operand 0 "memory_operand")
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
613 (match_code "reg" "0")))
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
614
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
615 ;; Predicates for parallel expanders based on mode.
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
616 (define_special_predicate "vect_par_constant_high"
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
617 (match_code "parallel")
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
618 {
111
kono
parents: 67
diff changeset
619 return arm_simd_check_vect_par_cnst_half_p (op, mode, true);
67
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
620 })
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
621
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
622 (define_special_predicate "vect_par_constant_low"
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
623 (match_code "parallel")
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
624 {
111
kono
parents: 67
diff changeset
625 return arm_simd_check_vect_par_cnst_half_p (op, mode, false);
kono
parents: 67
diff changeset
626 })
kono
parents: 67
diff changeset
627
kono
parents: 67
diff changeset
628 (define_predicate "const_double_vcvt_power_of_two_reciprocal"
kono
parents: 67
diff changeset
629 (and (match_code "const_double")
kono
parents: 67
diff changeset
630 (match_test "TARGET_32BIT
kono
parents: 67
diff changeset
631 && vfp3_const_double_for_fract_bits (op)")))
67
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
632
111
kono
parents: 67
diff changeset
633 (define_predicate "const_double_vcvt_power_of_two"
kono
parents: 67
diff changeset
634 (and (match_code "const_double")
kono
parents: 67
diff changeset
635 (match_test "TARGET_32BIT
kono
parents: 67
diff changeset
636 && vfp3_const_double_for_bits (op) > 0")))
kono
parents: 67
diff changeset
637
kono
parents: 67
diff changeset
638 (define_predicate "neon_struct_operand"
kono
parents: 67
diff changeset
639 (and (match_code "mem")
kono
parents: 67
diff changeset
640 (match_test "TARGET_32BIT && neon_vector_mem_operand (op, 2, true)")))
67
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
641
111
kono
parents: 67
diff changeset
642 (define_predicate "neon_permissive_struct_operand"
kono
parents: 67
diff changeset
643 (and (match_code "mem")
kono
parents: 67
diff changeset
644 (match_test "TARGET_32BIT && neon_vector_mem_operand (op, 2, false)")))
kono
parents: 67
diff changeset
645
kono
parents: 67
diff changeset
646 (define_predicate "neon_perm_struct_or_reg_operand"
kono
parents: 67
diff changeset
647 (ior (match_operand 0 "neon_permissive_struct_operand")
kono
parents: 67
diff changeset
648 (match_operand 0 "s_register_operand")))
67
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
649
111
kono
parents: 67
diff changeset
650 (define_special_predicate "add_operator"
kono
parents: 67
diff changeset
651 (match_code "plus"))
67
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 63
diff changeset
652
111
kono
parents: 67
diff changeset
653 (define_predicate "mem_noofs_operand"
kono
parents: 67
diff changeset
654 (and (match_code "mem")
kono
parents: 67
diff changeset
655 (match_code "reg" "0")))
kono
parents: 67
diff changeset
656
kono
parents: 67
diff changeset
657 (define_predicate "call_insn_operand"
kono
parents: 67
diff changeset
658 (ior (and (match_code "symbol_ref")
kono
parents: 67
diff changeset
659 (match_test "!arm_is_long_call_p (SYMBOL_REF_DECL (op))"))
kono
parents: 67
diff changeset
660 (match_operand 0 "s_register_operand")))