annotate gcc/config/arm/predicates.md @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents 84e7813d76e9
children
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
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
2 ;; Copyright (C) 2004-2020 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
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
34 ; Predicate for stack protector guard's address in
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
35 ; stack_protect_combined_set_insn and stack_protect_combined_test_insn patterns
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
36 (define_predicate "guard_addr_operand"
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
37 (match_test "true")
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
38 {
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
39 return (CONSTANT_ADDRESS_P (op)
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
40 || !targetm.cannot_force_const_mem (mode, op));
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
41 })
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
42
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
43 ; Predicate for stack protector guard in stack_protect_combined_set and
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
44 ; stack_protect_combined_test patterns
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
45 (define_predicate "guard_operand"
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
46 (match_code "mem")
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
47 {
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
48 return guard_addr_operand (XEXP (op, 0), mode);
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
49 })
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
50
111
kono
parents: 67
diff changeset
51 (define_predicate "imm_for_neon_inv_logic_operand"
kono
parents: 67
diff changeset
52 (match_code "const_vector")
kono
parents: 67
diff changeset
53 {
kono
parents: 67
diff changeset
54 return (TARGET_NEON
kono
parents: 67
diff changeset
55 && neon_immediate_valid_for_logic (op, mode, 1, NULL, NULL));
kono
parents: 67
diff changeset
56 })
kono
parents: 67
diff changeset
57
kono
parents: 67
diff changeset
58 (define_predicate "neon_inv_logic_op2"
kono
parents: 67
diff changeset
59 (ior (match_operand 0 "imm_for_neon_inv_logic_operand")
kono
parents: 67
diff changeset
60 (match_operand 0 "s_register_operand")))
kono
parents: 67
diff changeset
61
kono
parents: 67
diff changeset
62 (define_predicate "imm_for_neon_logic_operand"
kono
parents: 67
diff changeset
63 (match_code "const_vector")
kono
parents: 67
diff changeset
64 {
kono
parents: 67
diff changeset
65 return (TARGET_NEON
kono
parents: 67
diff changeset
66 && neon_immediate_valid_for_logic (op, mode, 0, NULL, NULL));
kono
parents: 67
diff changeset
67 })
kono
parents: 67
diff changeset
68
kono
parents: 67
diff changeset
69 (define_predicate "neon_logic_op2"
kono
parents: 67
diff changeset
70 (ior (match_operand 0 "imm_for_neon_logic_operand")
kono
parents: 67
diff changeset
71 (match_operand 0 "s_register_operand")))
kono
parents: 67
diff changeset
72
kono
parents: 67
diff changeset
73 ;; Any general register.
kono
parents: 67
diff changeset
74 (define_predicate "arm_hard_general_register_operand"
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
75 (match_code "reg")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
76 {
111
kono
parents: 67
diff changeset
77 return REGNO (op) <= LAST_ARM_REGNUM;
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
78 })
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
79
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
80 ;; A low register.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
81 (define_predicate "low_register_operand"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
82 (and (match_code "reg")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
83 (match_test "REGNO (op) <= LAST_LO_REGNUM")))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
84
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
85 ;; A low register or const_int.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
86 (define_predicate "low_reg_or_int_operand"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
87 (ior (match_code "const_int")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
88 (match_operand 0 "low_register_operand")))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
89
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
90 ;; Any core register, or any pseudo. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
91 (define_predicate "arm_general_register_operand"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
92 (match_code "reg,subreg")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
93 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
94 if (GET_CODE (op) == SUBREG)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
95 op = SUBREG_REG (op);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
96
111
kono
parents: 67
diff changeset
97 return (REG_P (op)
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
98 && (REGNO (op) <= LAST_ARM_REGNUM
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
99 || REGNO (op) >= FIRST_PSEUDO_REGISTER));
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
100 })
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
101
111
kono
parents: 67
diff changeset
102 (define_predicate "arm_general_adddi_operand"
kono
parents: 67
diff changeset
103 (ior (match_operand 0 "arm_general_register_operand")
kono
parents: 67
diff changeset
104 (and (match_code "const_int")
kono
parents: 67
diff changeset
105 (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
106
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
107 (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
108 (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
109 {
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
110 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
111 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
112
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
113 /* 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
114 to be a register operand. */
111
kono
parents: 67
diff changeset
115 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
116 && (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
117 || 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
118 || 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
119 || (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
120 && 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
121 })
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
122
111
kono
parents: 67
diff changeset
123 (define_predicate "vfp_hard_register_operand"
kono
parents: 67
diff changeset
124 (match_code "reg")
kono
parents: 67
diff changeset
125 {
kono
parents: 67
diff changeset
126 return (IS_VFP_REGNUM (REGNO (op)));
kono
parents: 67
diff changeset
127 })
kono
parents: 67
diff changeset
128
kono
parents: 67
diff changeset
129 (define_predicate "zero_operand"
kono
parents: 67
diff changeset
130 (and (match_code "const_int,const_double,const_vector")
kono
parents: 67
diff changeset
131 (match_test "op == CONST0_RTX (mode)")))
kono
parents: 67
diff changeset
132
kono
parents: 67
diff changeset
133 ;; Match a register, or zero in the appropriate mode.
kono
parents: 67
diff changeset
134 (define_predicate "reg_or_zero_operand"
kono
parents: 67
diff changeset
135 (ior (match_operand 0 "s_register_operand")
kono
parents: 67
diff changeset
136 (match_operand 0 "zero_operand")))
kono
parents: 67
diff changeset
137
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
138 (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
139 (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
140 (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
141
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
142 ;; Reg, subreg(reg) or const_int.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
143 (define_predicate "reg_or_int_operand"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
144 (ior (match_code "const_int")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
145 (match_operand 0 "s_register_operand")))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
146
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
147 (define_predicate "arm_immediate_operand"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
148 (and (match_code "const_int")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
149 (match_test "const_ok_for_arm (INTVAL (op))")))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
150
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
151 ;; 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
152 ;; 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
153 (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
154 (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
155 (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
156
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
157 (define_predicate "arm_neg_immediate_operand"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
158 (and (match_code "const_int")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
159 (match_test "const_ok_for_arm (-INTVAL (op))")))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
160
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
161 (define_predicate "arm_not_immediate_operand"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
162 (and (match_code "const_int")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
163 (match_test "const_ok_for_arm (~INTVAL (op))")))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
164
63
b7f97abdc517 update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
165 (define_predicate "const0_operand"
111
kono
parents: 67
diff changeset
166 (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
167
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
168 ;; 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
169 (define_predicate "arm_rhs_operand"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
170 (ior (match_operand 0 "s_register_operand")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
171 (match_operand 0 "arm_immediate_operand")))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
172
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
173 (define_predicate "arm_rhsm_operand"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
174 (ior (match_operand 0 "arm_rhs_operand")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
175 (match_operand 0 "memory_operand")))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
176
111
kono
parents: 67
diff changeset
177 (define_predicate "const_int_I_operand"
kono
parents: 67
diff changeset
178 (and (match_operand 0 "const_int_operand")
kono
parents: 67
diff changeset
179 (match_test "satisfies_constraint_I (op)")))
kono
parents: 67
diff changeset
180
kono
parents: 67
diff changeset
181 (define_predicate "const_int_M_operand"
kono
parents: 67
diff changeset
182 (and (match_operand 0 "const_int_operand")
kono
parents: 67
diff changeset
183 (match_test "satisfies_constraint_M (op)")))
kono
parents: 67
diff changeset
184
kono
parents: 67
diff changeset
185 ;; This doesn't have to do much because the constant is already checked
kono
parents: 67
diff changeset
186 ;; 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
187 (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
188 (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
189 (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
190 (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
191
111
kono
parents: 67
diff changeset
192 (define_predicate "const_neon_scalar_shift_amount_operand"
kono
parents: 67
diff changeset
193 (and (match_code "const_int")
kono
parents: 67
diff changeset
194 (match_test "IN_RANGE (UINTVAL (op), 1, GET_MODE_BITSIZE (mode))")))
kono
parents: 67
diff changeset
195
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
196 (define_predicate "ssat16_imm"
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
197 (and (match_code "const_int")
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
198 (match_test "IN_RANGE (INTVAL (op), 1, 16)")))
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
199
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
200 (define_predicate "usat16_imm"
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
201 (and (match_code "const_int")
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
202 (match_test "IN_RANGE (INTVAL (op), 0, 15)")))
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
203
111
kono
parents: 67
diff changeset
204 (define_predicate "ldrd_strd_offset_operand"
kono
parents: 67
diff changeset
205 (and (match_operand 0 "const_int_operand")
kono
parents: 67
diff changeset
206 (match_test "TARGET_LDRD && offset_ok_for_ldrd_strd (INTVAL (op))")))
kono
parents: 67
diff changeset
207
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
208 (define_predicate "arm_add_operand"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
209 (ior (match_operand 0 "arm_rhs_operand")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
210 (match_operand 0 "arm_neg_immediate_operand")))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
211
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
212 (define_predicate "arm_adddi_operand"
111
kono
parents: 67
diff changeset
213 (ior (match_operand 0 "s_register_operand")
kono
parents: 67
diff changeset
214 (and (match_code "const_int")
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
215 (match_test "const_ok_for_dimode_op (INTVAL (op), PLUS)"))))
111
kono
parents: 67
diff changeset
216
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
217 (define_predicate "arm_anddi_operand"
111
kono
parents: 67
diff changeset
218 (ior (match_operand 0 "s_register_operand")
kono
parents: 67
diff changeset
219 (and (match_code "const_int")
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
220 (match_test "const_ok_for_dimode_op (INTVAL (op), AND)"))))
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
221
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
222 (define_predicate "arm_iordi_operand"
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
223 (ior (match_operand 0 "s_register_operand")
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
224 (and (match_code "const_int")
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
225 (match_test "const_ok_for_dimode_op (INTVAL (op), IOR)"))))
111
kono
parents: 67
diff changeset
226
kono
parents: 67
diff changeset
227 (define_predicate "arm_xordi_operand"
kono
parents: 67
diff changeset
228 (ior (match_operand 0 "s_register_operand")
kono
parents: 67
diff changeset
229 (and (match_code "const_int")
kono
parents: 67
diff changeset
230 (match_test "const_ok_for_dimode_op (INTVAL (op), XOR)"))))
kono
parents: 67
diff changeset
231
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
232 (define_predicate "arm_addimm_operand"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
233 (ior (match_operand 0 "arm_immediate_operand")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
234 (match_operand 0 "arm_neg_immediate_operand")))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
235
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
236 (define_predicate "arm_not_operand"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
237 (ior (match_operand 0 "arm_rhs_operand")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
238 (match_operand 0 "arm_not_immediate_operand")))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
239
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
240 ;; A constant that can be used with ADC(SBC) or SBC(ADC) when bit-wise
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
241 ;; inverted. Similar to arm_not_operand, but excludes registers.
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
242 (define_predicate "arm_adcimm_operand"
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
243 (ior (match_operand 0 "arm_immediate_operand")
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
244 (match_operand 0 "arm_not_immediate_operand")))
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
245
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
246 (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
247 (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
248 (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
249
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
250 ;; 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
251 ;; offsettable address.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
252 (define_predicate "offsettable_memory_operand"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
253 (and (match_code "mem")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
254 (match_test
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
255 "offsettable_address_p (reload_completed | reload_in_progress,
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
256 mode, XEXP (op, 0))")))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
257
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
258 ;; 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
259 ;; automodified base register (and thus will not generate output reloads).
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
260 (define_predicate "call_memory_operand"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
261 (and (match_code "mem")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
262 (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
263 != RTX_AUTOINC")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
264 (match_operand 0 "memory_operand"))))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
265
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
266 (define_predicate "arm_reload_memory_operand"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
267 (and (match_code "mem,reg,subreg")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
268 (match_test "(!CONSTANT_P (op)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
269 && (true_regnum(op) == -1
111
kono
parents: 67
diff changeset
270 || (REG_P (op)
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
271 && REGNO (op) >= FIRST_PSEUDO_REGISTER)))")))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
272
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
273 (define_predicate "vfp_compare_operand"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
274 (ior (match_operand 0 "s_register_operand")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
275 (and (match_code "const_double")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
276 (match_test "arm_const_double_rtx (op)"))))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
277
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
278 ;; True for valid index operands.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
279 (define_predicate "index_operand"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
280 (ior (match_operand 0 "s_register_operand")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
281 (and (match_operand 0 "immediate_operand")
111
kono
parents: 67
diff changeset
282 (match_test "(!CONST_INT_P (op)
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
283 || (INTVAL (op) < 4096 && INTVAL (op) > -4096))"))))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
284
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
285 ;; 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
286 (define_special_predicate "shiftable_operator"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
287 (and (match_code "plus,minus,ior,xor,and")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
288 (match_test "mode == GET_MODE (op)")))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
289
111
kono
parents: 67
diff changeset
290 (define_special_predicate "shiftable_operator_strict_it"
kono
parents: 67
diff changeset
291 (and (match_code "plus,and")
kono
parents: 67
diff changeset
292 (match_test "mode == GET_MODE (op)")))
kono
parents: 67
diff changeset
293
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
294 ;; True for logical binary operators.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
295 (define_special_predicate "logical_binary_operator"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
296 (and (match_code "ior,xor,and")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
297 (match_test "mode == GET_MODE (op)")))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
298
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
299 ;; 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
300 (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
301 (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
302 (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
303
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
304 ;; True for shift operators.
111
kono
parents: 67
diff changeset
305 ;; Notes:
kono
parents: 67
diff changeset
306 ;; * mult is only permitted with a constant shift amount
kono
parents: 67
diff changeset
307 ;; * patterns that permit register shift amounts only in ARM mode use
kono
parents: 67
diff changeset
308 ;; shift_amount_operand, patterns that always allow registers do not,
kono
parents: 67
diff changeset
309 ;; 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
310 (define_special_predicate "shift_operator"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
311 (and (ior (ior (and (match_code "mult")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
312 (match_test "power_of_two_operand (XEXP (op, 1), mode)"))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
313 (and (match_code "rotate")
111
kono
parents: 67
diff changeset
314 (match_test "CONST_INT_P (XEXP (op, 1))
kono
parents: 67
diff changeset
315 && (UINTVAL (XEXP (op, 1))) < 32")))
kono
parents: 67
diff changeset
316 (and (match_code "ashift,ashiftrt,lshiftrt,rotatert")
kono
parents: 67
diff changeset
317 (match_test "!CONST_INT_P (XEXP (op, 1))
kono
parents: 67
diff changeset
318 || (UINTVAL (XEXP (op, 1))) < 32")))
kono
parents: 67
diff changeset
319 (match_test "mode == GET_MODE (op)")))
kono
parents: 67
diff changeset
320
kono
parents: 67
diff changeset
321 (define_special_predicate "shift_nomul_operator"
kono
parents: 67
diff changeset
322 (and (ior (and (match_code "rotate")
kono
parents: 67
diff changeset
323 (match_test "CONST_INT_P (XEXP (op, 1))
kono
parents: 67
diff changeset
324 && (UINTVAL (XEXP (op, 1))) < 32"))
kono
parents: 67
diff changeset
325 (and (match_code "ashift,ashiftrt,lshiftrt,rotatert")
kono
parents: 67
diff changeset
326 (match_test "!CONST_INT_P (XEXP (op, 1))
kono
parents: 67
diff changeset
327 || (UINTVAL (XEXP (op, 1))) < 32")))
kono
parents: 67
diff changeset
328 (match_test "mode == GET_MODE (op)")))
kono
parents: 67
diff changeset
329
kono
parents: 67
diff changeset
330 ;; True for shift operators which can be used with saturation instructions.
kono
parents: 67
diff changeset
331 (define_special_predicate "sat_shift_operator"
kono
parents: 67
diff changeset
332 (and (ior (and (match_code "mult")
kono
parents: 67
diff changeset
333 (match_test "power_of_two_operand (XEXP (op, 1), mode)"))
kono
parents: 67
diff changeset
334 (and (match_code "ashift,ashiftrt")
kono
parents: 67
diff changeset
335 (match_test "CONST_INT_P (XEXP (op, 1))
kono
parents: 67
diff changeset
336 && (UINTVAL (XEXP (op, 1)) < 32)")))
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
337 (match_test "mode == GET_MODE (op)")))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
338
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
339 ;; True for Armv8.1-M Mainline long shift instructions.
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
340 (define_predicate "long_shift_imm"
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
341 (match_test "satisfies_constraint_Pg (op)"))
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
342
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
343 (define_predicate "arm_reg_or_long_shift_imm"
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
344 (ior (match_test "TARGET_THUMB2
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
345 && arm_general_register_operand (op, GET_MODE (op))")
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
346 (match_test "satisfies_constraint_Pg (op)")))
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
347
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
348 ;; 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
349 (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
350 (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
351
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
352 ;; True for operators that have 16-bit thumb variants. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
353 (define_special_predicate "thumb_16bit_operator"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
354 (match_code "plus,minus,and,ior,xor"))
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 ;; True for EQ & NE
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
357 (define_special_predicate "equality_operator"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
358 (match_code "eq,ne"))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
359
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
360 ;; 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
361 ;; other than LTGT or UNEQ.
111
kono
parents: 67
diff changeset
362 (define_special_predicate "expandable_comparison_operator"
kono
parents: 67
diff changeset
363 (match_code "eq,ne,le,lt,ge,gt,geu,gtu,leu,ltu,
kono
parents: 67
diff changeset
364 unordered,ordered,unlt,unle,unge,ungt"))
kono
parents: 67
diff changeset
365
kono
parents: 67
diff changeset
366 ;; Likewise, but only accept comparisons that are directly supported
kono
parents: 67
diff changeset
367 ;; by ARM condition codes.
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
368 (define_special_predicate "arm_comparison_operator"
111
kono
parents: 67
diff changeset
369 (and (match_operand 0 "expandable_comparison_operator")
kono
parents: 67
diff changeset
370 (match_test "maybe_get_arm_condition_code (op) != ARM_NV")))
kono
parents: 67
diff changeset
371
kono
parents: 67
diff changeset
372 ;; Likewise, but don't ignore the mode.
kono
parents: 67
diff changeset
373 ;; RTL SET operations require their operands source and destination have
kono
parents: 67
diff changeset
374 ;; the same modes, so we can't ignore the modes there. See PR target/69161.
kono
parents: 67
diff changeset
375 (define_predicate "arm_comparison_operator_mode"
kono
parents: 67
diff changeset
376 (and (match_operand 0 "expandable_comparison_operator")
kono
parents: 67
diff changeset
377 (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
378
63
b7f97abdc517 update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
379 (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
380 (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
381
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
382 (define_special_predicate "arm_carry_operation"
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
383 (match_code "geu,ltu")
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
384 {
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
385 if (XEXP (op, 1) != const0_rtx)
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
386 return false;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
387
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
388 rtx op0 = XEXP (op, 0);
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
389
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
390 if (!REG_P (op0) || REGNO (op0) != CC_REGNUM)
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
391 return false;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
392
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
393 machine_mode ccmode = GET_MODE (op0);
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
394 if (ccmode == CC_Cmode)
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
395 return GET_CODE (op) == LTU;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
396 else if (ccmode == CCmode || ccmode == CC_RSBmode || ccmode == CC_ADCmode)
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
397 return GET_CODE (op) == GEU;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
398
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
399 return false;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
400 }
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
401 )
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
402
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
403 ;; Match a "borrow" operation for use with SBC. The precise code will
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
404 ;; depend on the form of the comparison. This is generally the inverse of
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
405 ;; a carry operation, since the logic of SBC uses "not borrow" in it's
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
406 ;; calculation.
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
407 (define_special_predicate "arm_borrow_operation"
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
408 (match_code "geu,ltu")
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
409 {
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
410 if (XEXP (op, 1) != const0_rtx)
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
411 return false;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
412 rtx op0 = XEXP (op, 0);
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
413 if (!REG_P (op0) || REGNO (op0) != CC_REGNUM)
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
414 return false;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
415 machine_mode ccmode = GET_MODE (op0);
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
416 if (ccmode == CC_Cmode)
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
417 return GET_CODE (op) == GEU;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
418 else if (ccmode == CCmode || ccmode == CC_RSBmode || ccmode == CC_ADCmode)
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
419 return GET_CODE (op) == LTU;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
420 return false;
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
421 }
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
422 )
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
423
111
kono
parents: 67
diff changeset
424 ;; The vsel instruction only accepts the ARM condition codes listed below.
kono
parents: 67
diff changeset
425 (define_special_predicate "arm_vsel_comparison_operator"
kono
parents: 67
diff changeset
426 (and (match_operand 0 "expandable_comparison_operator")
kono
parents: 67
diff changeset
427 (match_test "maybe_get_arm_condition_code (op) == ARM_GE
kono
parents: 67
diff changeset
428 || maybe_get_arm_condition_code (op) == ARM_GT
kono
parents: 67
diff changeset
429 || maybe_get_arm_condition_code (op) == ARM_EQ
kono
parents: 67
diff changeset
430 || maybe_get_arm_condition_code (op) == ARM_VS
kono
parents: 67
diff changeset
431 || maybe_get_arm_condition_code (op) == ARM_LT
kono
parents: 67
diff changeset
432 || maybe_get_arm_condition_code (op) == ARM_LE
kono
parents: 67
diff changeset
433 || maybe_get_arm_condition_code (op) == ARM_NE
kono
parents: 67
diff changeset
434 || maybe_get_arm_condition_code (op) == ARM_VC")))
kono
parents: 67
diff changeset
435
kono
parents: 67
diff changeset
436 (define_special_predicate "arm_cond_move_operator"
kono
parents: 67
diff changeset
437 (if_then_else (match_test "arm_restrict_it")
kono
parents: 67
diff changeset
438 (and (match_test "TARGET_VFP5")
kono
parents: 67
diff changeset
439 (match_operand 0 "arm_vsel_comparison_operator"))
kono
parents: 67
diff changeset
440 (match_operand 0 "expandable_comparison_operator")))
kono
parents: 67
diff changeset
441
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
442 (define_special_predicate "nz_comparison_operator"
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
443 (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
444
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
445 (define_special_predicate "minmax_operator"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
446 (and (match_code "smin,smax,umin,umax")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
447 (match_test "mode == GET_MODE (op)")))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
448
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
449 (define_special_predicate "cc_register"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
450 (and (match_code "reg")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
451 (and (match_test "REGNO (op) == CC_REGNUM")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
452 (ior (match_test "mode == GET_MODE (op)")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
453 (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
454
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
455 (define_special_predicate "dominant_cc_register"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
456 (match_code "reg")
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 if (mode == VOIDmode)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
459 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
460 mode = GET_MODE (op);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
461
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
462 if (GET_MODE_CLASS (mode) != MODE_CC)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
463 return false;
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
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
466 return (cc_register (op, mode)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
467 && (mode == CC_DNEmode
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
468 || mode == CC_DEQmode
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
469 || mode == CC_DLEmode
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
470 || mode == CC_DLTmode
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
471 || mode == CC_DGEmode
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
472 || mode == CC_DGTmode
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
473 || mode == CC_DLEUmode
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
474 || mode == CC_DLTUmode
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
475 || mode == CC_DGEUmode
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
476 || mode == CC_DGTUmode));
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
477 })
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
478
111
kono
parents: 67
diff changeset
479 ;; Any register, including CC
kono
parents: 67
diff changeset
480 (define_predicate "cc_register_operand"
kono
parents: 67
diff changeset
481 (and (match_code "reg")
kono
parents: 67
diff changeset
482 (ior (match_operand 0 "s_register_operand")
kono
parents: 67
diff changeset
483 (match_operand 0 "cc_register"))))
kono
parents: 67
diff changeset
484
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
485 (define_special_predicate "arm_extendqisi_mem_op"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
486 (and (match_operand 0 "memory_operand")
111
kono
parents: 67
diff changeset
487 (match_test "TARGET_ARM ? arm_legitimate_address_outer_p (mode,
kono
parents: 67
diff changeset
488 XEXP (op, 0),
kono
parents: 67
diff changeset
489 SIGN_EXTEND,
kono
parents: 67
diff changeset
490 0)
kono
parents: 67
diff changeset
491 : memory_address_p (QImode, XEXP (op, 0))")))
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
492
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
493 (define_special_predicate "arm_reg_or_extendqisi_mem_op"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
494 (ior (match_operand 0 "arm_extendqisi_mem_op")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
495 (match_operand 0 "s_register_operand")))
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 "power_of_two_operand"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
498 (match_code "const_int")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
499 {
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
500 unsigned HOST_WIDE_INT value = INTVAL (op) & 0xffffffff;
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
501
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
502 return value != 0 && (value & (value - 1)) == 0;
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
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
505 (define_predicate "nonimmediate_di_operand"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
506 (match_code "reg,subreg,mem")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
507 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
508 if (s_register_operand (op, mode))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
509 return true;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
510
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
511 if (GET_CODE (op) == SUBREG)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
512 op = SUBREG_REG (op);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
513
111
kono
parents: 67
diff changeset
514 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
515 })
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
516
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
517 (define_predicate "di_operand"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
518 (ior (match_code "const_int,const_double")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
519 (and (match_code "reg,subreg,mem")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
520 (match_operand 0 "nonimmediate_di_operand"))))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
521
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
522 (define_predicate "nonimmediate_soft_df_operand"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
523 (match_code "reg,subreg,mem")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
524 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
525 if (s_register_operand (op, mode))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
526 return true;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
527
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
528 if (GET_CODE (op) == SUBREG)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
529 op = SUBREG_REG (op);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
530
111
kono
parents: 67
diff changeset
531 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
532 })
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 (define_predicate "soft_df_operand"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
535 (ior (match_code "const_double")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
536 (and (match_code "reg,subreg,mem")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
537 (match_operand 0 "nonimmediate_soft_df_operand"))))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
538
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
539 ;; Predicate for thumb2_movsf_vfp. Compared to general_operand, this
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
540 ;; forbids constant loaded via literal pool iff literal pools are disabled.
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
541 (define_predicate "hard_sf_operand"
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
542 (and (match_operand 0 "general_operand")
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
543 (ior (not (match_code "const_double"))
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
544 (not (match_test "arm_disable_literal_pool"))
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
545 (match_test "satisfies_constraint_Dv (op)"))))
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
546
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
547 ;; Predicate for thumb2_movdf_vfp. Compared to soft_df_operand used in
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
548 ;; movdf_soft_insn, this forbids constant loaded via literal pool iff
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
549 ;; literal pools are disabled.
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
550 (define_predicate "hard_df_operand"
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
551 (and (match_operand 0 "soft_df_operand")
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
552 (ior (not (match_code "const_double"))
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
553 (not (match_test "arm_disable_literal_pool"))
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
554 (match_test "satisfies_constraint_Dy (op)")
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
555 (match_test "satisfies_constraint_G (op)"))))
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
556
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
557 (define_special_predicate "clear_multiple_operation"
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
558 (match_code "parallel")
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
559 {
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
560 return clear_operation_p (op, /*vfp*/false);
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
561 })
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
562
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
563 (define_special_predicate "clear_vfp_multiple_operation"
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
564 (match_code "parallel")
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
565 {
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
566 return clear_operation_p (op, /*vfp*/true);
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
567 })
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
568
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
569 (define_special_predicate "load_multiple_operation"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
570 (match_code "parallel")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
571 {
111
kono
parents: 67
diff changeset
572 return ldm_stm_operation_p (op, /*load=*/true, SImode,
kono
parents: 67
diff changeset
573 /*consecutive=*/false,
kono
parents: 67
diff changeset
574 /*return_pc=*/false);
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
575 })
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 (define_special_predicate "store_multiple_operation"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
578 (match_code "parallel")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
579 {
111
kono
parents: 67
diff changeset
580 return ldm_stm_operation_p (op, /*load=*/false, SImode,
kono
parents: 67
diff changeset
581 /*consecutive=*/false,
kono
parents: 67
diff changeset
582 /*return_pc=*/false);
kono
parents: 67
diff changeset
583 })
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
584
111
kono
parents: 67
diff changeset
585 (define_special_predicate "pop_multiple_return"
kono
parents: 67
diff changeset
586 (match_code "parallel")
kono
parents: 67
diff changeset
587 {
kono
parents: 67
diff changeset
588 return ldm_stm_operation_p (op, /*load=*/true, SImode,
kono
parents: 67
diff changeset
589 /*consecutive=*/false,
kono
parents: 67
diff changeset
590 /*return_pc=*/true);
kono
parents: 67
diff changeset
591 })
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
592
111
kono
parents: 67
diff changeset
593 (define_special_predicate "pop_multiple_fp"
kono
parents: 67
diff changeset
594 (match_code "parallel")
kono
parents: 67
diff changeset
595 {
kono
parents: 67
diff changeset
596 return ldm_stm_operation_p (op, /*load=*/true, DFmode,
kono
parents: 67
diff changeset
597 /*consecutive=*/true,
kono
parents: 67
diff changeset
598 /*return_pc=*/false);
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
599 })
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
600
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
601 (define_special_predicate "multi_register_push"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
602 (match_code "parallel")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
603 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
604 if ((GET_CODE (XVECEXP (op, 0, 0)) != SET)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
605 || (GET_CODE (SET_SRC (XVECEXP (op, 0, 0))) != UNSPEC)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
606 || (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
607 return false;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
608
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
609 return true;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
610 })
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
611
111
kono
parents: 67
diff changeset
612 (define_predicate "push_mult_memory_operand"
kono
parents: 67
diff changeset
613 (match_code "mem")
kono
parents: 67
diff changeset
614 {
kono
parents: 67
diff changeset
615 /* ??? Given how PUSH_MULT is generated in the prologues, is there
kono
parents: 67
diff changeset
616 any point in testing for thumb1 specially? All of the variants
kono
parents: 67
diff changeset
617 use the same form. */
kono
parents: 67
diff changeset
618 if (TARGET_THUMB1)
kono
parents: 67
diff changeset
619 {
kono
parents: 67
diff changeset
620 /* ??? No attempt is made to represent STMIA, or validate that
kono
parents: 67
diff changeset
621 the stack adjustment matches the register count. This is
kono
parents: 67
diff changeset
622 true of the ARM/Thumb2 path as well. */
kono
parents: 67
diff changeset
623 rtx x = XEXP (op, 0);
kono
parents: 67
diff changeset
624 if (GET_CODE (x) != PRE_MODIFY)
kono
parents: 67
diff changeset
625 return false;
kono
parents: 67
diff changeset
626 if (XEXP (x, 0) != stack_pointer_rtx)
kono
parents: 67
diff changeset
627 return false;
kono
parents: 67
diff changeset
628 x = XEXP (x, 1);
kono
parents: 67
diff changeset
629 if (GET_CODE (x) != PLUS)
kono
parents: 67
diff changeset
630 return false;
kono
parents: 67
diff changeset
631 if (XEXP (x, 0) != stack_pointer_rtx)
kono
parents: 67
diff changeset
632 return false;
kono
parents: 67
diff changeset
633 return CONST_INT_P (XEXP (x, 1));
kono
parents: 67
diff changeset
634 }
kono
parents: 67
diff changeset
635
kono
parents: 67
diff changeset
636 /* ARM and Thumb2 handle pre-modify in their legitimate_address. */
kono
parents: 67
diff changeset
637 return memory_operand (op, mode);
kono
parents: 67
diff changeset
638 })
kono
parents: 67
diff changeset
639
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
640 ;;-------------------------------------------------------------------------
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
641 ;;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
642 ;; Thumb predicates
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
643 ;;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
644
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
645 (define_predicate "thumb1_cmp_operand"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
646 (ior (and (match_code "reg,subreg")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
647 (match_operand 0 "s_register_operand"))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
648 (and (match_code "const_int")
111
kono
parents: 67
diff changeset
649 (match_test "(UINTVAL (op)) < 256"))))
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
650
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
651 (define_predicate "thumb1_cmpneg_operand"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
652 (and (match_code "const_int")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
653 (match_test "INTVAL (op) < 0 && INTVAL (op) > -256")))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
654
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
655 ;; 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
656 ;; condition code register. Prior to reload we only accept a
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
657 ;; 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
658 ;; 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
659 ;; handle output-reloads on jump insns.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
660
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
661 ;; 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
662 ;; complicate things with the need to handle increment
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
663 ;; side-effects.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
664 (define_predicate "thumb_cbrch_target_operand"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
665 (and (match_code "reg,subreg,mem")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
666 (ior (match_operand 0 "s_register_operand")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
667 (and (match_test "reload_in_progress || reload_completed")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
668 (match_operand 0 "memory_operand")))))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
669
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
670 ;;-------------------------------------------------------------------------
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
671 ;;
111
kono
parents: 67
diff changeset
672 ;; iWMMXt predicates
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
673 ;;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
674
111
kono
parents: 67
diff changeset
675 (define_predicate "imm_or_reg_operand"
kono
parents: 67
diff changeset
676 (ior (match_operand 0 "immediate_operand")
kono
parents: 67
diff changeset
677 (match_operand 0 "register_operand")))
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
678
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
679 ;; Neon predicates
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
680
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
681 (define_predicate "const_multiple_of_8_operand"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
682 (match_code "const_int")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
683 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
684 unsigned HOST_WIDE_INT val = INTVAL (op);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
685 return (val & 7) == 0;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
686 })
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
687
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
688 (define_predicate "imm_for_neon_mov_operand"
111
kono
parents: 67
diff changeset
689 (match_code "const_vector,const_int")
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
690 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
691 return neon_immediate_valid_for_move (op, mode, NULL, NULL);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
692 })
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
693
111
kono
parents: 67
diff changeset
694 (define_predicate "imm_for_neon_lshift_operand"
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
695 (match_code "const_vector")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
696 {
111
kono
parents: 67
diff changeset
697 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
698 })
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
699
111
kono
parents: 67
diff changeset
700 (define_predicate "imm_for_neon_rshift_operand"
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
701 (match_code "const_vector")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
702 {
111
kono
parents: 67
diff changeset
703 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
704 })
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
705
111
kono
parents: 67
diff changeset
706 (define_predicate "imm_lshift_or_reg_neon"
kono
parents: 67
diff changeset
707 (ior (match_operand 0 "s_register_operand")
kono
parents: 67
diff changeset
708 (match_operand 0 "imm_for_neon_lshift_operand")))
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
709
111
kono
parents: 67
diff changeset
710 (define_predicate "imm_rshift_or_reg_neon"
kono
parents: 67
diff changeset
711 (ior (match_operand 0 "s_register_operand")
kono
parents: 67
diff changeset
712 (match_operand 0 "imm_for_neon_rshift_operand")))
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
713
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
714 ;; Predicates for named expanders that overlap multiple ISAs.
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
715
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
716 (define_predicate "cmpdi_operand"
111
kono
parents: 67
diff changeset
717 (and (match_test "TARGET_32BIT")
kono
parents: 67
diff changeset
718 (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
719
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
720 ;; 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
721 (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
722 (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
723 (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
724
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
725 ;; 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
726 (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
727 (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
728 {
111
kono
parents: 67
diff changeset
729 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
730 })
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
731
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
732 (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
733 (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
734 {
111
kono
parents: 67
diff changeset
735 return arm_simd_check_vect_par_cnst_half_p (op, mode, false);
kono
parents: 67
diff changeset
736 })
kono
parents: 67
diff changeset
737
kono
parents: 67
diff changeset
738 (define_predicate "const_double_vcvt_power_of_two_reciprocal"
kono
parents: 67
diff changeset
739 (and (match_code "const_double")
kono
parents: 67
diff changeset
740 (match_test "TARGET_32BIT
kono
parents: 67
diff changeset
741 && 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
742
111
kono
parents: 67
diff changeset
743 (define_predicate "const_double_vcvt_power_of_two"
kono
parents: 67
diff changeset
744 (and (match_code "const_double")
kono
parents: 67
diff changeset
745 (match_test "TARGET_32BIT
kono
parents: 67
diff changeset
746 && vfp3_const_double_for_bits (op) > 0")))
kono
parents: 67
diff changeset
747
kono
parents: 67
diff changeset
748 (define_predicate "neon_struct_operand"
kono
parents: 67
diff changeset
749 (and (match_code "mem")
kono
parents: 67
diff changeset
750 (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
751
111
kono
parents: 67
diff changeset
752 (define_predicate "neon_permissive_struct_operand"
kono
parents: 67
diff changeset
753 (and (match_code "mem")
kono
parents: 67
diff changeset
754 (match_test "TARGET_32BIT && neon_vector_mem_operand (op, 2, false)")))
kono
parents: 67
diff changeset
755
kono
parents: 67
diff changeset
756 (define_predicate "neon_perm_struct_or_reg_operand"
kono
parents: 67
diff changeset
757 (ior (match_operand 0 "neon_permissive_struct_operand")
kono
parents: 67
diff changeset
758 (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
759
111
kono
parents: 67
diff changeset
760 (define_special_predicate "add_operator"
kono
parents: 67
diff changeset
761 (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
762
111
kono
parents: 67
diff changeset
763 (define_predicate "mem_noofs_operand"
kono
parents: 67
diff changeset
764 (and (match_code "mem")
kono
parents: 67
diff changeset
765 (match_code "reg" "0")))
kono
parents: 67
diff changeset
766
kono
parents: 67
diff changeset
767 (define_predicate "call_insn_operand"
kono
parents: 67
diff changeset
768 (ior (and (match_code "symbol_ref")
kono
parents: 67
diff changeset
769 (match_test "!arm_is_long_call_p (SYMBOL_REF_DECL (op))"))
kono
parents: 67
diff changeset
770 (match_operand 0 "s_register_operand")))
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
771
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
772 (define_special_predicate "aligned_operand"
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
773 (ior (not (match_code "mem"))
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
774 (match_test "MEM_ALIGN (op) >= GET_MODE_ALIGNMENT (mode)")))