annotate gcc/optabs.h @ 158:494b0b89df80 default tip

...
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 25 May 2020 18:13:55 +0900
parents 1830386684a0
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 /* Definitions for code generation pass of GNU compiler.
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
2 Copyright (C) 2001-2020 Free Software Foundation, Inc.
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
3
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
4 This file is part of GCC.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
5
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
6 GCC is free software; you can redistribute it and/or modify
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
7 it under the terms of the GNU General Public License as published by
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
8 the Free Software Foundation; either version 3, or (at your option)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
9 any later version.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
10
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
11 GCC is distributed in the hope that it will be useful,
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
14 GNU General Public License for more details.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
15
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
16 You should have received a copy of the GNU General Public License
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
17 along with GCC; see the file COPYING3. If not see
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
18 <http://www.gnu.org/licenses/>. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
19
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
20 #ifndef GCC_OPTABS_H
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
21 #define GCC_OPTABS_H
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
22
111
kono
parents: 67
diff changeset
23 #include "optabs-query.h"
kono
parents: 67
diff changeset
24 #include "optabs-libfuncs.h"
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
25 #include "vec-perm-indices.h"
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
26
111
kono
parents: 67
diff changeset
27 /* Generate code for a widening multiply. */
kono
parents: 67
diff changeset
28 extern rtx expand_widening_mult (machine_mode, rtx, rtx, rtx, int, optab);
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
29
111
kono
parents: 67
diff changeset
30 /* Describes the type of an expand_operand. Each value is associated
kono
parents: 67
diff changeset
31 with a create_*_operand function; see the comments above those
kono
parents: 67
diff changeset
32 functions for details. */
kono
parents: 67
diff changeset
33 enum expand_operand_type {
kono
parents: 67
diff changeset
34 EXPAND_FIXED,
kono
parents: 67
diff changeset
35 EXPAND_OUTPUT,
kono
parents: 67
diff changeset
36 EXPAND_INPUT,
kono
parents: 67
diff changeset
37 EXPAND_CONVERT_TO,
kono
parents: 67
diff changeset
38 EXPAND_CONVERT_FROM,
kono
parents: 67
diff changeset
39 EXPAND_ADDRESS,
kono
parents: 67
diff changeset
40 EXPAND_INTEGER
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
41 };
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
42
111
kono
parents: 67
diff changeset
43 /* Information about an operand for instruction expansion. */
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
44 class expand_operand {
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
45 public:
111
kono
parents: 67
diff changeset
46 /* The type of operand. */
kono
parents: 67
diff changeset
47 ENUM_BITFIELD (expand_operand_type) type : 8;
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
48
111
kono
parents: 67
diff changeset
49 /* True if any conversion should treat VALUE as being unsigned
kono
parents: 67
diff changeset
50 rather than signed. Only meaningful for certain types. */
kono
parents: 67
diff changeset
51 unsigned int unsigned_p : 1;
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
52
111
kono
parents: 67
diff changeset
53 /* Is the target operand. */
kono
parents: 67
diff changeset
54 unsigned int target : 1;
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
55
111
kono
parents: 67
diff changeset
56 /* Unused; available for future use. */
kono
parents: 67
diff changeset
57 unsigned int unused : 6;
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
58
111
kono
parents: 67
diff changeset
59 /* The mode passed to the convert_*_operand function. It has a
kono
parents: 67
diff changeset
60 type-dependent meaning. */
kono
parents: 67
diff changeset
61 ENUM_BITFIELD (machine_mode) mode : 16;
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
62
111
kono
parents: 67
diff changeset
63 /* The value of the operand. */
kono
parents: 67
diff changeset
64 rtx value;
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
65
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
66 /* The value of an EXPAND_INTEGER operand. */
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
67 poly_int64 int_value;
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
68 };
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
69
111
kono
parents: 67
diff changeset
70 /* Initialize OP with the given fields. Initialise the other fields
kono
parents: 67
diff changeset
71 to their default values. */
kono
parents: 67
diff changeset
72
kono
parents: 67
diff changeset
73 static inline void
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
74 create_expand_operand (class expand_operand *op,
111
kono
parents: 67
diff changeset
75 enum expand_operand_type type,
kono
parents: 67
diff changeset
76 rtx value, machine_mode mode,
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
77 bool unsigned_p, poly_int64 int_value = 0)
111
kono
parents: 67
diff changeset
78 {
kono
parents: 67
diff changeset
79 op->type = type;
kono
parents: 67
diff changeset
80 op->unsigned_p = unsigned_p;
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
81 op->target = 0;
111
kono
parents: 67
diff changeset
82 op->unused = 0;
kono
parents: 67
diff changeset
83 op->mode = mode;
kono
parents: 67
diff changeset
84 op->value = value;
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
85 op->int_value = int_value;
111
kono
parents: 67
diff changeset
86 }
kono
parents: 67
diff changeset
87
kono
parents: 67
diff changeset
88 /* Make OP describe an operand that must use rtx X, even if X is volatile. */
kono
parents: 67
diff changeset
89
kono
parents: 67
diff changeset
90 static inline void
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
91 create_fixed_operand (class expand_operand *op, rtx x)
111
kono
parents: 67
diff changeset
92 {
kono
parents: 67
diff changeset
93 create_expand_operand (op, EXPAND_FIXED, x, VOIDmode, false);
kono
parents: 67
diff changeset
94 }
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
95
111
kono
parents: 67
diff changeset
96 /* Make OP describe an output operand that must have mode MODE.
kono
parents: 67
diff changeset
97 X, if nonnull, is a suggestion for where the output should be stored.
kono
parents: 67
diff changeset
98 It is OK for VALUE to be inconsistent with MODE, although it will just
kono
parents: 67
diff changeset
99 be ignored in that case. */
kono
parents: 67
diff changeset
100
kono
parents: 67
diff changeset
101 static inline void
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
102 create_output_operand (class expand_operand *op, rtx x,
111
kono
parents: 67
diff changeset
103 machine_mode mode)
kono
parents: 67
diff changeset
104 {
kono
parents: 67
diff changeset
105 create_expand_operand (op, EXPAND_OUTPUT, x, mode, false);
kono
parents: 67
diff changeset
106 }
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
107
111
kono
parents: 67
diff changeset
108 /* Make OP describe an input operand that must have mode MODE and
kono
parents: 67
diff changeset
109 value VALUE; MODE cannot be VOIDmode. The backend may request that
kono
parents: 67
diff changeset
110 VALUE be copied into a different kind of rtx before being passed
kono
parents: 67
diff changeset
111 as an operand. */
kono
parents: 67
diff changeset
112
kono
parents: 67
diff changeset
113 static inline void
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
114 create_input_operand (class expand_operand *op, rtx value,
111
kono
parents: 67
diff changeset
115 machine_mode mode)
kono
parents: 67
diff changeset
116 {
kono
parents: 67
diff changeset
117 create_expand_operand (op, EXPAND_INPUT, value, mode, false);
kono
parents: 67
diff changeset
118 }
kono
parents: 67
diff changeset
119
kono
parents: 67
diff changeset
120 /* Like create_input_operand, except that VALUE must first be converted
kono
parents: 67
diff changeset
121 to mode MODE. UNSIGNED_P says whether VALUE is unsigned. */
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
122
111
kono
parents: 67
diff changeset
123 static inline void
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
124 create_convert_operand_to (class expand_operand *op, rtx value,
111
kono
parents: 67
diff changeset
125 machine_mode mode, bool unsigned_p)
kono
parents: 67
diff changeset
126 {
kono
parents: 67
diff changeset
127 create_expand_operand (op, EXPAND_CONVERT_TO, value, mode, unsigned_p);
kono
parents: 67
diff changeset
128 }
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
129
111
kono
parents: 67
diff changeset
130 /* Make OP describe an input operand that should have the same value
kono
parents: 67
diff changeset
131 as VALUE, after any mode conversion that the backend might request.
kono
parents: 67
diff changeset
132 If VALUE is a CONST_INT, it should be treated as having mode MODE.
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
133 UNSIGNED_P says whether VALUE is unsigned.
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
134
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
135 The conversion of VALUE can include a combination of numerical
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
136 conversion (as for convert_modes) and duplicating a scalar to fill
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
137 a vector (if VALUE is a scalar but the operand is a vector). */
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
138
111
kono
parents: 67
diff changeset
139 static inline void
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
140 create_convert_operand_from (class expand_operand *op, rtx value,
111
kono
parents: 67
diff changeset
141 machine_mode mode, bool unsigned_p)
kono
parents: 67
diff changeset
142 {
kono
parents: 67
diff changeset
143 create_expand_operand (op, EXPAND_CONVERT_FROM, value, mode, unsigned_p);
kono
parents: 67
diff changeset
144 }
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
145
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
146
111
kono
parents: 67
diff changeset
147 /* Make OP describe an input Pmode address operand. VALUE is the value
kono
parents: 67
diff changeset
148 of the address, but it may need to be converted to Pmode first. */
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
149
111
kono
parents: 67
diff changeset
150 static inline void
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
151 create_address_operand (class expand_operand *op, rtx value)
111
kono
parents: 67
diff changeset
152 {
kono
parents: 67
diff changeset
153 create_expand_operand (op, EXPAND_ADDRESS, value, Pmode, false);
kono
parents: 67
diff changeset
154 }
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
155
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
156 extern void create_integer_operand (class expand_operand *, poly_int64);
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
157
111
kono
parents: 67
diff changeset
158 /* Passed to expand_simple_binop and expand_binop to say which options
kono
parents: 67
diff changeset
159 to try to use if the requested operation can't be open-coded on the
kono
parents: 67
diff changeset
160 requisite mode. Either OPTAB_LIB or OPTAB_LIB_WIDEN says try using
kono
parents: 67
diff changeset
161 a library call. Either OPTAB_WIDEN or OPTAB_LIB_WIDEN says try
kono
parents: 67
diff changeset
162 using a wider mode. OPTAB_MUST_WIDEN says try widening and don't
kono
parents: 67
diff changeset
163 try anything else. */
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
164
111
kono
parents: 67
diff changeset
165 enum optab_methods
kono
parents: 67
diff changeset
166 {
kono
parents: 67
diff changeset
167 OPTAB_DIRECT,
kono
parents: 67
diff changeset
168 OPTAB_LIB,
kono
parents: 67
diff changeset
169 OPTAB_WIDEN,
kono
parents: 67
diff changeset
170 OPTAB_LIB_WIDEN,
kono
parents: 67
diff changeset
171 OPTAB_MUST_WIDEN
0
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
111
kono
parents: 67
diff changeset
174 extern rtx expand_widen_pattern_expr (struct separate_ops *, rtx , rtx , rtx,
kono
parents: 67
diff changeset
175 rtx, int);
kono
parents: 67
diff changeset
176 extern rtx expand_ternary_op (machine_mode mode, optab ternary_optab,
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
177 rtx op0, rtx op1, rtx op2, rtx target,
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
178 int unsignedp);
111
kono
parents: 67
diff changeset
179 extern rtx simplify_expand_binop (machine_mode mode, optab binoptab,
kono
parents: 67
diff changeset
180 rtx op0, rtx op1, rtx target, int unsignedp,
kono
parents: 67
diff changeset
181 enum optab_methods methods);
kono
parents: 67
diff changeset
182 extern bool force_expand_binop (machine_mode, optab, rtx, rtx, rtx, int,
kono
parents: 67
diff changeset
183 enum optab_methods);
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
184 extern rtx expand_vector_broadcast (machine_mode, rtx);
111
kono
parents: 67
diff changeset
185
kono
parents: 67
diff changeset
186 /* Generate code for a simple binary or unary operation. "Simple" in
kono
parents: 67
diff changeset
187 this case means "can be unambiguously described by a (mode, code)
kono
parents: 67
diff changeset
188 pair and mapped to a single optab." */
kono
parents: 67
diff changeset
189 extern rtx expand_simple_binop (machine_mode, enum rtx_code, rtx,
kono
parents: 67
diff changeset
190 rtx, rtx, int, enum optab_methods);
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
191
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
192 /* Expand a binary operation given optab and rtx operands. */
111
kono
parents: 67
diff changeset
193 extern rtx expand_binop (machine_mode, optab, rtx, rtx, rtx, int,
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
194 enum optab_methods);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
195
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
196 /* Expand a binary operation with both signed and unsigned forms. */
111
kono
parents: 67
diff changeset
197 extern rtx sign_expand_binop (machine_mode, optab, optab, rtx, rtx,
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
198 rtx, int, enum optab_methods);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
199
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
200 /* Generate code to perform an operation on one operand with two results. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
201 extern int expand_twoval_unop (optab, rtx, rtx, rtx, int);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
202
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
203 /* Generate code to perform an operation on two operands with two results. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
204 extern int expand_twoval_binop (optab, rtx, rtx, rtx, rtx, int);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
205
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
206 /* Generate code to perform an operation on two operands with two
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
207 results, using a library function. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
208 extern bool expand_twoval_binop_libfunc (optab, rtx, rtx, rtx, rtx,
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
209 enum rtx_code);
111
kono
parents: 67
diff changeset
210 extern rtx expand_simple_unop (machine_mode, enum rtx_code, rtx, rtx,
kono
parents: 67
diff changeset
211 int);
0
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 /* Expand a unary arithmetic operation given optab rtx operand. */
111
kono
parents: 67
diff changeset
214 extern rtx expand_unop (machine_mode, optab, rtx, rtx, int);
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
215
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
216 /* Expand the absolute value operation. */
111
kono
parents: 67
diff changeset
217 extern rtx expand_abs_nojump (machine_mode, rtx, rtx, int);
kono
parents: 67
diff changeset
218 extern rtx expand_abs (machine_mode, rtx, rtx, int, int);
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
219
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
220 /* Expand the one's complement absolute value operation. */
111
kono
parents: 67
diff changeset
221 extern rtx expand_one_cmpl_abs_nojump (machine_mode, rtx, rtx);
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
222
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
223 /* Expand the copysign operation. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
224 extern rtx expand_copysign (rtx, rtx, rtx);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
225 /* Generate an instruction with a given INSN_CODE with an output and
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
226 an input. */
111
kono
parents: 67
diff changeset
227 extern bool maybe_emit_unop_insn (enum insn_code, rtx, rtx, enum rtx_code);
kono
parents: 67
diff changeset
228 extern void emit_unop_insn (enum insn_code, rtx, rtx, enum rtx_code);
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
229
111
kono
parents: 67
diff changeset
230 /* Emit code to make a call to a constant function or a library call. */
kono
parents: 67
diff changeset
231 extern void emit_libcall_block (rtx_insn *, rtx, rtx, rtx);
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
232
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
233 /* The various uses that a comparison can have; used by can_compare_p:
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
234 jumps, conditional moves, store flag operations. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
235 enum can_compare_purpose
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 ccp_jump,
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
238 ccp_cmov,
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
239 ccp_store_flag
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
240 };
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
241
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
242 /* Nonzero if a compare of mode MODE can be done straightforwardly
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
243 (without splitting it into pieces). */
111
kono
parents: 67
diff changeset
244 extern int can_compare_p (enum rtx_code, machine_mode,
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
245 enum can_compare_purpose);
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
246
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
247 /* Return whether the backend can emit a vector comparison for code CODE,
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
248 comparing operands of mode CMP_OP_MODE and producing a result with
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
249 VALUE_MODE. */
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
250 extern bool can_vcond_compare_p (enum rtx_code, machine_mode, machine_mode);
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
251
111
kono
parents: 67
diff changeset
252 extern rtx prepare_operand (enum insn_code, rtx, int, machine_mode,
kono
parents: 67
diff changeset
253 machine_mode, int);
kono
parents: 67
diff changeset
254 /* Emit a pair of rtl insns to compare two rtx's and to jump
kono
parents: 67
diff changeset
255 to a label if the comparison is true. */
kono
parents: 67
diff changeset
256 extern void emit_cmp_and_jump_insns (rtx, rtx, enum rtx_code, rtx,
kono
parents: 67
diff changeset
257 machine_mode, int, rtx,
kono
parents: 67
diff changeset
258 profile_probability prob
kono
parents: 67
diff changeset
259 = profile_probability::uninitialized ());
kono
parents: 67
diff changeset
260
kono
parents: 67
diff changeset
261 /* Generate code to indirectly jump to a location given in the rtx LOC. */
kono
parents: 67
diff changeset
262 extern void emit_indirect_jump (rtx);
kono
parents: 67
diff changeset
263
kono
parents: 67
diff changeset
264 #include "insn-config.h"
kono
parents: 67
diff changeset
265
kono
parents: 67
diff changeset
266 #ifndef GCC_INSN_CONFIG_H
kono
parents: 67
diff changeset
267 #error "insn-config.h must be included before optabs.h"
kono
parents: 67
diff changeset
268 #endif
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
269
111
kono
parents: 67
diff changeset
270 /* Emit a conditional move operation. */
kono
parents: 67
diff changeset
271 rtx emit_conditional_move (rtx, enum rtx_code, rtx, rtx, machine_mode,
kono
parents: 67
diff changeset
272 rtx, rtx, machine_mode, int);
kono
parents: 67
diff changeset
273
kono
parents: 67
diff changeset
274 /* Emit a conditional negate or bitwise complement operation. */
kono
parents: 67
diff changeset
275 rtx emit_conditional_neg_or_complement (rtx, rtx_code, machine_mode, rtx,
kono
parents: 67
diff changeset
276 rtx, rtx);
kono
parents: 67
diff changeset
277
kono
parents: 67
diff changeset
278 rtx emit_conditional_add (rtx, enum rtx_code, rtx, rtx, machine_mode,
kono
parents: 67
diff changeset
279 rtx, rtx, machine_mode, int);
kono
parents: 67
diff changeset
280
kono
parents: 67
diff changeset
281 /* Create but don't emit one rtl instruction to perform certain operations.
kono
parents: 67
diff changeset
282 Modes must match; operands must meet the operation's predicates.
kono
parents: 67
diff changeset
283 Likewise for subtraction and for just copying. */
kono
parents: 67
diff changeset
284 extern rtx_insn *gen_add2_insn (rtx, rtx);
kono
parents: 67
diff changeset
285 extern rtx_insn *gen_add3_insn (rtx, rtx, rtx);
kono
parents: 67
diff changeset
286 extern int have_add2_insn (rtx, rtx);
kono
parents: 67
diff changeset
287 extern rtx_insn *gen_addptr3_insn (rtx, rtx, rtx);
kono
parents: 67
diff changeset
288 extern int have_addptr3_insn (rtx, rtx, rtx);
kono
parents: 67
diff changeset
289 extern rtx_insn *gen_sub2_insn (rtx, rtx);
kono
parents: 67
diff changeset
290 extern rtx_insn *gen_sub3_insn (rtx, rtx, rtx);
kono
parents: 67
diff changeset
291 extern int have_sub2_insn (rtx, rtx);
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
292
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
293 /* Generate the body of an insn to extend Y (with mode MFROM)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
294 into X (with mode MTO). Do zero-extension if UNSIGNEDP is nonzero. */
111
kono
parents: 67
diff changeset
295 extern rtx_insn *gen_extend_insn (rtx, rtx, machine_mode, machine_mode, int);
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
296
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
297 /* Generate code for a FLOAT_EXPR. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
298 extern void expand_float (rtx, rtx, int);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
299
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
300 /* Generate code for a FIX_EXPR. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
301 extern void expand_fix (rtx, rtx, int);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
302
111
kono
parents: 67
diff changeset
303 /* Generate code for a FIXED_CONVERT_EXPR. */
kono
parents: 67
diff changeset
304 extern void expand_fixed_convert (rtx, rtx, int, int);
kono
parents: 67
diff changeset
305
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
306 /* Generate code for float to integral conversion. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
307 extern bool expand_sfix_optab (rtx, rtx, convert_optab);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
308
111
kono
parents: 67
diff changeset
309 /* Report whether the machine description contains an insn which can
kono
parents: 67
diff changeset
310 perform the operation described by CODE and MODE. */
kono
parents: 67
diff changeset
311 extern int have_insn_for (enum rtx_code, machine_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
312
111
kono
parents: 67
diff changeset
313 /* Generate a conditional trap instruction. */
kono
parents: 67
diff changeset
314 extern rtx_insn *gen_cond_trap (enum rtx_code, rtx, rtx, rtx);
kono
parents: 67
diff changeset
315
kono
parents: 67
diff changeset
316 /* Generate code for VEC_PERM_EXPR. */
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
317 extern rtx expand_vec_perm_var (machine_mode, rtx, rtx, rtx, rtx);
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
318 extern rtx expand_vec_perm_const (machine_mode, rtx, rtx,
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
319 const vec_perm_builder &, machine_mode, rtx);
111
kono
parents: 67
diff changeset
320
kono
parents: 67
diff changeset
321 /* Generate code for vector comparison. */
kono
parents: 67
diff changeset
322 extern rtx expand_vec_cmp_expr (tree, tree, rtx);
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
323
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
324 /* Generate code for VEC_COND_EXPR. */
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
325 extern rtx expand_vec_cond_expr (tree, tree, tree, tree, rtx);
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
326
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
327 /* Generate code for VEC_SERIES_EXPR. */
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
328 extern rtx expand_vec_series_expr (machine_mode, rtx, rtx, rtx);
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
329
111
kono
parents: 67
diff changeset
330 /* Generate code for MULT_HIGHPART_EXPR. */
kono
parents: 67
diff changeset
331 extern rtx expand_mult_highpart (machine_mode, rtx, rtx, rtx, bool);
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
332
111
kono
parents: 67
diff changeset
333 extern rtx expand_sync_lock_test_and_set (rtx, rtx, rtx);
kono
parents: 67
diff changeset
334 extern rtx expand_atomic_test_and_set (rtx, rtx, enum memmodel);
kono
parents: 67
diff changeset
335 extern rtx expand_atomic_exchange (rtx, rtx, rtx, enum memmodel);
kono
parents: 67
diff changeset
336 extern bool expand_atomic_compare_and_swap (rtx *, rtx *, rtx, rtx, rtx, bool,
kono
parents: 67
diff changeset
337 enum memmodel, enum memmodel);
kono
parents: 67
diff changeset
338 /* Generate memory barriers. */
kono
parents: 67
diff changeset
339 extern void expand_mem_thread_fence (enum memmodel);
kono
parents: 67
diff changeset
340 extern void expand_mem_signal_fence (enum memmodel);
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
341
111
kono
parents: 67
diff changeset
342 rtx expand_atomic_load (rtx, rtx, enum memmodel);
kono
parents: 67
diff changeset
343 rtx expand_atomic_store (rtx, rtx, enum memmodel, bool);
kono
parents: 67
diff changeset
344 rtx expand_atomic_fetch_op (rtx, rtx, rtx, enum rtx_code, enum memmodel,
kono
parents: 67
diff changeset
345 bool);
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
346
111
kono
parents: 67
diff changeset
347 extern bool insn_operand_matches (enum insn_code icode, unsigned int opno,
kono
parents: 67
diff changeset
348 rtx operand);
kono
parents: 67
diff changeset
349 extern bool valid_multiword_target_p (rtx);
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
350 extern void create_convert_operand_from_type (class expand_operand *op,
111
kono
parents: 67
diff changeset
351 rtx value, tree type);
kono
parents: 67
diff changeset
352 extern bool maybe_legitimize_operands (enum insn_code icode,
kono
parents: 67
diff changeset
353 unsigned int opno, unsigned int nops,
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
354 class expand_operand *ops);
111
kono
parents: 67
diff changeset
355 extern rtx_insn *maybe_gen_insn (enum insn_code icode, unsigned int nops,
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
356 class expand_operand *ops);
111
kono
parents: 67
diff changeset
357 extern bool maybe_expand_insn (enum insn_code icode, unsigned int nops,
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
358 class expand_operand *ops);
111
kono
parents: 67
diff changeset
359 extern bool maybe_expand_jump_insn (enum insn_code icode, unsigned int nops,
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
360 class expand_operand *ops);
111
kono
parents: 67
diff changeset
361 extern void expand_insn (enum insn_code icode, unsigned int nops,
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
362 class expand_operand *ops);
111
kono
parents: 67
diff changeset
363 extern void expand_jump_insn (enum insn_code icode, unsigned int nops,
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
364 class expand_operand *ops);
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
365
111
kono
parents: 67
diff changeset
366 extern enum rtx_code get_rtx_code (enum tree_code tcode, bool unsignedp);
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
367
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
368 #endif /* GCC_OPTABS_H */