GCC Middle and Back End API Reference
recog.h
Go to the documentation of this file.
1/* Declarations for interface to insn recognizer and insn-output.cc.
2 Copyright (C) 1987-2026 Free Software Foundation, Inc.
3
4This file is part of GCC.
5
6GCC is free software; you can redistribute it and/or modify it under
7the terms of the GNU General Public License as published by the Free
8Software Foundation; either version 3, or (at your option) any later
9version.
10
11GCC is distributed in the hope that it will be useful, but WITHOUT ANY
12WARRANTY; without even the implied warranty of MERCHANTABILITY or
13FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14for more details.
15
16You should have received a copy of the GNU General Public License
17along with GCC; see the file COPYING3. If not see
18<http://www.gnu.org/licenses/>. */
19
20#ifndef GCC_RECOG_H
21#define GCC_RECOG_H
22
23/* For enum tree_code ERROR_MARK. */
24#include "tree.h"
25
26/* An operand reference of the form %[N] or %[MODIFIER:N[,N...]]. */
32
33extern bool parse_bracketed_operand (const char **, bracketed_operand &);
34
35/* Random number that should be large enough for all purposes. Also define
36 a type that has at least MAX_RECOG_ALTERNATIVES + 1 bits, with the extra
37 bit giving an invalid value that can be used to mean "uninitialized". */
38#define MAX_RECOG_ALTERNATIVES 35
39typedef uint64_t alternative_mask; /* Keep in sync with genattrtab.cc. */
40
41/* A mask of all alternatives. */
42#define ALL_ALTERNATIVES ((alternative_mask) -1)
43
44/* A mask containing just alternative X. */
45#define ALTERNATIVE_BIT(X) ((alternative_mask) 1 << (X))
46
47/* Types of operands. */
53
54#ifndef GENERATOR_FILE
56{
57 /* Pointer to the beginning of the constraint string for this alternative,
58 for easier access by alternative number. */
59 const char *constraint;
60
61 /* The register class valid for this alternative (possibly NO_REGS). */
62 enum reg_class cl : 16;
63
64 /* "Badness" of this alternative, computed from number of '?' and '!'
65 characters in the constraint string. */
66 unsigned int reject : 16;
67
68 /* -1 if no matching constraint was found, or an operand number. */
69 int matches : 8;
70 /* The same information, but reversed: -1 if this operand is not
71 matched by any other, or the operand number of the operand that
72 matches this one. */
73 int matched : 8;
74
75 /* Bit ID is set if the constraint string includes a register constraint with
76 register filter ID. Use test_register_filters (REGISTER_FILTERS, REGNO)
77 to test whether REGNO is a valid start register for the operand. */
78 unsigned int register_filters : MAX (NUM_REGISTER_FILTERS, 1);
79
80 /* Bit ID is set if the constraint string includes a dependent
81 register constraint with dependent-filter id ID. */
82 unsigned int dependent_filters : MAX (NUM_DEPENDENT_FILTERS, 1);
83
84 /* Nonzero if '&' was found in the constraint string. */
85 unsigned int earlyclobber : 1;
86 /* Nonzero if TARGET_MEM_CONSTRAINT was found in the constraint
87 string. */
88 unsigned int memory_ok : 1;
89 /* Nonzero if 'p' was found in the constraint string. */
90 unsigned int is_address : 1;
91 /* Nonzero if 'X' was found in the constraint string, or if the constraint
92 string for this alternative was empty. */
93 unsigned int anything_ok : 1;
94};
95
96/* Return the class for operand I of alternative ALT, taking matching
97 constraints into account. */
98
99inline enum reg_class
101{
102 return alt[i].matches >= 0 ? alt[alt[i].matches].cl : alt[i].cl;
103}
104
105/* Return the mask of register filters that should be applied to operand I
106 of alternative ALT, taking matching constraints into account. */
107
108inline unsigned int
110{
111 return (alt[i].matches >= 0
112 ? alt[alt[i].matches].register_filters
113 : alt[i].register_filters);
114}
115
116/* Return the mask of dynamic register filters that should be applied to
117 operand I of alternative ALT, taking matching constraints into
118 account. */
119
120inline unsigned int
122{
123 return (alt[i].matches >= 0
124 ? alt[alt[i].matches].dependent_filters
125 : alt[i].dependent_filters);
126}
127#endif
128
129/* A class for substituting one rtx for another within an instruction,
130 or for recursively simplifying the instruction as-is. Derived classes
131 can record or filter certain decisions. */
132
134{
135public:
136 /* Assignments for RESULT_FLAGS.
137
138 UNSIMPLIFIED is true if a substitution has been made inside an rtx
139 X and if neither X nor its parent expressions could be simplified.
140
141 FIRST_SPARE_RESULT is the first flag available for derived classes. */
142 static const uint16_t UNSIMPLIFIED = 1U << 0;
143 static const uint16_t FIRST_SPARE_RESULT = 1U << 1;
144
146 insn_propagation (rtx_insn *, rtx, rtx, bool = true);
147 bool apply_to_pattern (rtx *);
148 bool apply_to_rvalue (rtx *);
149 bool apply_to_note (rtx *);
150
151 /* Return true if we should accept a substitution into the address of
152 memory expression MEM. Undoing changes OLD_NUM_CHANGES and up restores
153 MEM's original address. */
154 virtual bool check_mem (int /*old_num_changes*/,
155 rtx /*mem*/) { return true; }
156
157 /* Note that we've simplified OLD_RTX into NEW_RTX. When substituting,
158 this only happens if a substitution occurred within OLD_RTX.
159 Undoing OLD_NUM_CHANGES and up will restore the old form of OLD_RTX.
160 OLD_RESULT_FLAGS is the value that RESULT_FLAGS had before processing
161 OLD_RTX. */
162 virtual void note_simplification (int /*old_num_changes*/,
163 uint16_t /*old_result_flags*/,
164 rtx /*old_rtx*/, rtx /*new_rtx*/) {}
165
166private:
167 bool apply_to_mem_1 (rtx);
168 bool apply_to_lvalue_1 (rtx);
169 bool apply_to_rvalue_1 (rtx *);
170 bool apply_to_pattern_1 (rtx *);
171
172public:
173 /* The instruction that we are simplifying or propagating into. */
175
176 /* If FROM is nonnull, we're replacing FROM with TO, otherwise we're
177 just doing a recursive simplification. */
180
181 /* The number of times that we have replaced FROM with TO. */
182 unsigned int num_replacements;
183
184 /* A bitmask of flags that describe the result of the simplificiation;
185 see above for details. */
186 uint16_t result_flags : 16;
187
188 /* True if we should unshare TO when making the next substitution,
189 false if we can use TO itself. */
190 uint16_t should_unshare : 1;
191
192 /* True if we should call check_mem after substituting into a memory. */
193 uint16_t should_check_mems : 1;
194
195 /* True if we should call note_simplification after each simplification. */
197
198 /* For future expansion. */
199 uint16_t spare : 13;
200
201 /* Gives the reason that a substitution failed, for debug purposes. */
202 const char *failure_reason;
203};
204
205/* Try to replace FROM with TO in INSN. SHARED_P is true if TO is shared
206 with other instructions, false if INSN can use TO directly. */
207
209 bool shared_p)
210 : insn (insn),
211 from (from),
212 to (to),
214 result_flags (0),
215 should_unshare (shared_p),
218 spare (0),
219 failure_reason (nullptr)
220{
221}
222
223/* Try to simplify INSN without performing a substitution. */
224
229
230/* An RAII class that temporarily undoes part of the current change group.
231 The sequence:
232
233 {
234 ...;
235 undo_recog_changes undo (NUM);
236 STMTS;
237 }
238
239 executes STMTS with all the changes numbered NUM and up temporarily
240 reverted. STMTS must not try to add to the current change group.
241
242 Nested uses are supported, but each nested NUM must be no greater than
243 outer NUMs. */
244
246{
247public:
248 undo_recog_changes (int);
250
251 static bool is_active () { return s_num_changes != 0; }
252
253private:
255
256 static int s_num_changes;
257};
258
259extern void init_recog (void);
260extern void init_recog_no_volatile (void);
261extern bool check_asm_operands (rtx);
262extern int asm_operand_ok (rtx, const char *, const char **);
263extern bool validate_change (rtx, rtx *, rtx, bool);
264extern bool validate_unshare_change (rtx, rtx *, rtx, bool);
265extern bool validate_change_xveclen (rtx, rtx *, int, bool);
266extern bool canonicalize_change_group (rtx_insn *insn, rtx x);
267extern bool insn_invalid_p (rtx_insn *, bool);
268extern bool verify_changes (int);
269extern void confirm_change_group (void);
270extern bool apply_change_group (void);
271extern int num_validated_changes (void);
272extern void cancel_changes (int);
273extern bool constrain_operands (int, alternative_mask);
274extern bool constrain_operands_cached (rtx_insn *, int);
275extern bool memory_address_addr_space_p (machine_mode, rtx, addr_space_t,
276 code_helper = ERROR_MARK);
277#define memory_address_p(mode,addr) \
278 memory_address_addr_space_p ((mode), (addr), ADDR_SPACE_GENERIC)
279extern bool strict_memory_address_addr_space_p (machine_mode, rtx, addr_space_t,
280 code_helper = ERROR_MARK);
281#define strict_memory_address_p(mode,addr) \
282 strict_memory_address_addr_space_p ((mode), (addr), ADDR_SPACE_GENERIC)
283extern bool validate_replace_rtx_subexp (rtx, rtx, rtx_insn *, rtx *);
284extern bool validate_replace_rtx (rtx, rtx, rtx_insn *);
285extern bool validate_replace_rtx_part (rtx, rtx, rtx *, rtx_insn *);
289extern bool validate_simplify_insn (rtx_insn *insn);
290extern int num_changes_pending (void);
291extern bool reg_fits_class_p (const_rtx, reg_class_t, int, machine_mode);
292extern bool valid_insn_p (rtx_insn *);
293
294extern bool offsettable_memref_p (rtx);
296extern bool offsettable_address_addr_space_p (int, machine_mode, rtx,
298#define offsettable_address_p(strict,mode,addr) \
299 offsettable_address_addr_space_p ((strict), (mode), (addr), \
300 ADDR_SPACE_GENERIC)
302
303extern int recog (rtx, rtx_insn *, int *);
304#ifndef GENERATOR_FILE
305inline int recog_memoized (rtx_insn *insn);
306#endif
307extern void add_clobbers (rtx, int);
309extern void insn_extract (rtx_insn *);
310extern void extract_insn (rtx_insn *);
311extern void extract_constrain_insn (rtx_insn *insn);
313extern void extract_insn_cached (rtx_insn *);
314#ifndef GENERATOR_FILE
315extern void preprocess_constraints (int, int, const char **,
317extern const operand_alternative *preprocess_insn_constraints (unsigned int);
318#endif
319extern void preprocess_constraints (rtx_insn *);
320extern rtx_insn *peep2_next_insn (int);
321extern bool peep2_regno_dead_p (int, int);
322extern bool peep2_reg_dead_p (int, rtx);
323#ifdef HARD_CONST
324extern rtx peep2_find_free_register (int, int, const char *,
325 machine_mode, HARD_REG_SET *);
326#endif
328
329extern bool store_data_bypass_p (rtx_insn *, rtx_insn *);
330extern bool if_test_bypass_p (rtx_insn *, rtx_insn *);
331
333
334#ifndef GENERATOR_FILE
335/* Try recognizing the instruction INSN,
336 and return the code number that results.
337 Remember the code so that repeated calls do not
338 need to spend the time for actual rerecognition.
339
340 This function is the normal interface to instruction recognition.
341 The automatically-generated function `recog' is normally called
342 through this one. */
343
344inline int
346{
347 if (INSN_CODE (insn) < 0)
348 INSN_CODE (insn) = recog (PATTERN (insn), insn, 0);
349 return INSN_CODE (insn);
350}
351#endif
352
353/* Skip chars until the next ',' or the end of the string. This is
354 useful to skip alternatives in a constraint string. */
355inline const char *
356skip_alternative (const char *p)
357{
358 const char *r = p;
359 while (*r != '\0' && *r != ',')
360 r++;
361 if (*r == ',')
362 r++;
363 return r;
364}
365
366/* Nonzero means volatile operands are recognized. */
367extern int volatile_ok;
368
369/* RAII class for temporarily setting volatile_ok. */
370
385
386/* Set by constrain_operands to the number of the alternative that
387 matched. */
388extern int which_alternative;
389
390/* True for inline asm operands with - constraint modifier. */
391extern bool raw_constraint_p;
392
393/* The following vectors hold the results from insn_extract. */
394
396{
397 recog_data_d () = default;
398 recog_data_d (const recog_data_d &) = delete;
399 recog_data_d (const recog_data_d &&) = delete;
400
401 /* It is very tempting to make the 5 operand related arrays into a
402 structure and index on that. However, to be source compatible
403 with all of the existing md file insn constraints and output
404 templates, we need `operand' as a flat array. Without that
405 member, making an array for the rest seems pointless. */
406
407 /* Gives value of operand N. */
408 rtx operand[MAX_RECOG_OPERANDS];
409
410 /* Gives location where operand N was found. */
411 rtx *operand_loc[MAX_RECOG_OPERANDS];
412
413 /* Gives the constraint string for operand N. */
414 const char *constraints[MAX_RECOG_OPERANDS];
415
416 /* Nonzero if operand N is a match_operator or a match_parallel. */
417 char is_operator[MAX_RECOG_OPERANDS];
418
419 /* Gives the mode of operand N. */
420 machine_mode operand_mode[MAX_RECOG_OPERANDS];
421
422 /* Gives the type (in, out, inout) for operand N. */
423 enum op_type operand_type[MAX_RECOG_OPERANDS];
424
425 /* Gives location where the Nth duplicate-appearance of an operand
426 was found. This is something that matched MATCH_DUP. */
427 rtx *dup_loc[MAX_DUP_OPERANDS];
428
429 /* Gives the operand number that was duplicated in the Nth
430 duplicate-appearance of an operand. */
431 char dup_num[MAX_DUP_OPERANDS];
432
433 /* ??? Note that these are `char' instead of `unsigned char' to (try to)
434 avoid certain lossage from K&R C, wherein `unsigned char' default
435 promotes to `unsigned int' instead of `int' as in ISO C. As of 1999,
436 the most common places to bootstrap from K&R C are SunOS and HPUX,
437 both of which have signed characters by default. The only other
438 supported natives that have both K&R C and unsigned characters are
439 ROMP and Irix 3, and neither have been seen for a while, but do
440 continue to consider unsignedness when performing arithmetic inside
441 a comparison. */
442
443 /* The number of operands of the insn. */
445
446 /* The number of MATCH_DUPs in the insn. */
447 char n_dups;
448
449 /* The number of alternatives in the constraints for the insn. */
451
452 /* True if insn is ASM_OPERANDS. */
453 bool is_asm;
454
455 /* In case we are caching, hold insn data was generated for. */
457};
458
459extern struct recog_data_d *recog_data_ptr;
460#define recog_data (*recog_data_ptr)
461
462#ifndef GENERATOR_FILE
463/* RAII class for saving/restoring recog_data. */
464
475
483
489
491
492/* Return a pointer to an array in which index OP describes the constraints
493 on operand OP of the current instruction alternative (which_alternative).
494 Only valid after calling preprocess_constraints and constrain_operands. */
495
496inline const operand_alternative *
498{
500 recog_data.n_alternatives - 1));
501 return &recog_op_alt[which_alternative * recog_data.n_operands];
502}
503#endif
504
505/* A table defined in insn-output.cc that give information about
506 each insn-code value. */
507
508typedef bool (*insn_operand_predicate_fn) (rtx, machine_mode);
509typedef const char * (*insn_output_fn) (rtx *, rtx_insn *);
510
512{
513 typedef void (*stored_funcptr) (void);
514
515 template<typename ...Ts>
516 rtx_insn *operator() (Ts... args) const
517 {
518 typedef rtx_insn *(*funcptr) (decltype ((void) args, NULL_RTX)...);
519 return ((funcptr) func) (args...);
520 }
521
522 // This is for compatibility of code that invokes functions like
523 // (*funcptr) (arg)
524 insn_gen_fn operator * (void) const { return *this; }
525
526 // The wrapped function pointer must be public and there must not be any
527 // constructors. Otherwise the insn_data_d struct initializers generated
528 // by genoutput.cc will result in static initializer functions, which defeats
529 // the purpose of the generated insn_data_d array.
531};
532
534{
536
537 const char *const constraint;
538
539 machine_mode const mode : 16;
540
541 const char strict_low;
542
543 const char is_operator;
544
545 const char eliminable;
546
547 const char allows_mem;
548};
549
550/* Legal values for insn_data.output_format. Indicate what type of data
551 is stored in insn_data.output. */
552#define INSN_OUTPUT_FORMAT_NONE 0 /* abort */
553#define INSN_OUTPUT_FORMAT_SINGLE 1 /* const char * */
554#define INSN_OUTPUT_FORMAT_MULTI 2 /* const char * const * */
555#define INSN_OUTPUT_FORMAT_FUNCTION 3 /* const char * (*)(...) */
556
558{
559 const char *const name;
560
561 /* How to print the insn. OUTPUT_FORMAT says which member is live. The
562 constructors let genoutput write the member's value directly, and pick
563 the member from its type. */
565 {
566 const char *single;
567 const char *const *multi;
569
570 constexpr insn_output_u () : single (nullptr) {}
571 constexpr insn_output_u (const char *s) : single (s) {}
572 constexpr insn_output_u (const char *const *m) : multi (m) {}
573 constexpr insn_output_u (insn_output_fn f) : function (f) {}
576 const struct insn_operand_data *const operand;
577
579 const char n_operands;
580 const char n_dups;
581 const char n_alternatives;
582 const char output_format;
583};
584
585extern const struct insn_data_d insn_data[];
586extern int peep2_current_count;
587
588#ifndef GENERATOR_FILE
589#include "insn-codes.h"
590
591/* An enum of boolean attributes that may only depend on the current
592 subtarget, not on things like operands or compiler phase. */
599
600/* Target-dependent globals. */
606
608#if SWITCHABLE_TARGET
609extern struct target_recog *this_target_recog;
610#else
611#define this_target_recog (&default_target_recog)
612#endif
613
618
619void recog_init ();
620
621/* This RAII class can help to undo tentative insn changes on failure.
622 When an object of the class goes out of scope, it undoes all group
623 changes that have been made via the validate_change machinery and
624 not yet confirmed via confirm_change_group.
625
626 For example:
627
628 insn_change_watermark watermark;
629 validate_change (..., true); // A
630 ...
631 if (test)
632 // Undoes change A.
633 return false;
634 ...
635 validate_change (..., true); // B
636 ...
637 if (test)
638 // Undoes changes A and B.
639 return false;
640 ...
641 confirm_change_group ();
642
643 Code that wants to avoid this behavior can use keep ():
644
645 insn_change_watermark watermark;
646 validate_change (..., true); // A
647 ...
648 if (test)
649 // Undoes change A.
650 return false;
651 ...
652 watermark.keep ();
653 validate_change (..., true); // B
654 ...
655 if (test)
656 // Undoes change B, but not A.
657 return false;
658 ...
659 confirm_change_group (); */
670
676
677#endif
678
679#endif /* GCC_RECOG_H */
Definition vec.h:1667
Definition tree.h:84
Definition recog.h:661
int m_old_num_changes
Definition recog.h:668
void keep()
Definition recog.h:665
insn_change_watermark()
Definition recog.h:663
~insn_change_watermark()
Definition recog.h:671
rtx from
Definition recog.h:178
bool apply_to_rvalue(rtx *)
Definition recog.cc:1461
virtual bool check_mem(int, rtx)
Definition recog.h:154
bool apply_to_mem_1(rtx)
Definition recog.cc:1034
rtx_insn * insn
Definition recog.h:174
bool apply_to_rvalue_1(rtx *)
Definition recog.cc:1055
rtx to
Definition recog.h:179
bool apply_to_note(rtx *)
Definition recog.cc:1474
uint16_t result_flags
Definition recog.h:186
unsigned int num_replacements
Definition recog.h:182
static const uint16_t FIRST_SPARE_RESULT
Definition recog.h:143
bool apply_to_lvalue_1(rtx)
Definition recog.cc:1350
static const uint16_t UNSIMPLIFIED
Definition recog.h:142
uint16_t should_check_mems
Definition recog.h:193
bool apply_to_pattern(rtx *)
Definition recog.cc:1448
const char * failure_reason
Definition recog.h:202
uint16_t should_unshare
Definition recog.h:190
uint16_t should_note_simplifications
Definition recog.h:196
bool apply_to_pattern_1(rtx *)
Definition recog.cc:1387
insn_propagation(rtx_insn *)
Definition recog.h:225
uint16_t spare
Definition recog.h:199
virtual void note_simplification(int, uint16_t, rtx, rtx)
Definition recog.h:162
int saved_alternative
Definition recog.h:473
recog_state_saver()
Definition recog.h:476
~recog_state_saver()
Definition recog.h:484
recog_data_d * saved_recog_data_ptr
Definition recog.h:472
recog_data_d m_tmp_recog_data
Definition recog.h:467
Definition rtl.h:3557
Definition vec.h:2502
temporary_volatile_ok(const temporary_volatile_ok &)
int save_volatile_ok
Definition recog.h:383
temporary_volatile_ok(int value)
Definition recog.h:374
~temporary_volatile_ok()
Definition recog.h:379
undo_recog_changes(int)
Definition recog.cc:641
static int s_num_changes
Definition recog.h:256
static bool is_active()
Definition recog.h:251
int m_old_num_changes
Definition recog.h:254
struct basic_block_def * basic_block
Definition coretypes.h:359
struct rtx_def * rtx
Definition coretypes.h:57
unsigned char addr_space_t
Definition coretypes.h:191
const struct rtx_def * const_rtx
Definition coretypes.h:58
int reg_class_t
Definition coretypes.h:380
uint64_t alternative_mask
Definition genattrtab.cc:246
vec< const char * > register_filters
Definition gensupport.cc:408
HARD_REG_ELT_TYPE HARD_REG_SET
Definition hard-reg-set.h:47
poly_int< N, C > r
Definition poly-int.h:774
i
Definition poly-int.h:776
bool peep2_regno_dead_p(int ofs, int regno)
Definition recog.cc:3812
bool validate_change_xveclen(rtx object, rtx *loc, int new_len, bool in_group)
Definition recog.cc:318
rtx_insn * peep2_next_insn(int n)
Definition recog.cc:3799
const operand_alternative * recog_op_alt
Definition recog.cc:80
int which_alternative
Definition recog.cc:89
const operand_alternative * preprocess_insn_constraints(unsigned int icode)
Definition recog.cc:3122
bool parse_bracketed_operand(const char **p, bracketed_operand &operand)
Definition recog.cc:2242
bool canonicalize_change_group(rtx_insn *insn, rtx x)
Definition recog.cc:329
bool offsettable_nonstrict_memref_p(rtx op)
Definition recog.cc:2571
alternative_mask get_preferred_alternatives(rtx_insn *insn)
Definition recog.cc:2792
void preprocess_constraints(int n_operands, int n_alternatives, const char **constraints, operand_alternative *op_alt_base, rtx **oploc)
Definition recog.cc:2995
bool validate_replace_rtx_part_nosimplify(rtx from, rtx to, rtx *where, rtx_insn *insn)
Definition recog.cc:937
bool validate_unshare_change(rtx object, rtx *loc, rtx new_rtx, bool in_group)
Definition recog.cc:309
bool validate_simplify_insn(rtx_insn *insn)
Definition recog.cc:995
void validate_replace_rtx_group(rtx from, rtx to, rtx_insn *insn)
Definition recog.cc:949
void recog_init()
Definition recog.cc:4852
bool check_bool_attrs(rtx_insn *insn)
Definition recog.cc:2821
bool validate_change(rtx object, rtx *loc, rtx new_rtx, bool in_group)
Definition recog.cc:300
void copy_frame_info_to_split_insn(rtx_insn *old_insn, rtx_insn *new_insn)
Definition recog.cc:3998
void confirm_change_group(void)
Definition recog.cc:541
bool offsettable_address_addr_space_p(int strictp, machine_mode mode, rtx y, addr_space_t as)
Definition recog.cc:2589
void extract_constrain_insn(rtx_insn *insn)
Definition recog.cc:2852
struct recog_data_d * recog_data_ptr
Definition recog.cc:75
bool offsettable_memref_p(rtx op)
Definition recog.cc:2560
bool reg_fits_class_p(const_rtx operand, reg_class_t cl, int offset, machine_mode mode)
Definition recog.cc:3565
bool store_data_bypass_p(rtx_insn *out_insn, rtx_insn *in_insn)
Definition recog.cc:4462
void init_recog(void)
Definition recog.cc:116
int asm_operand_ok(rtx op, const char *constraint, const char **constraints)
Definition recog.cc:2344
void extract_constrain_insn_cached(rtx_insn *insn)
Definition recog.cc:2862
int num_validated_changes(void)
Definition recog.cc:592
bool constrain_operands(int strict, alternative_mask alternatives)
Definition recog.cc:3230
int num_changes_pending(void)
Definition recog.cc:430
bool if_test_bypass_p(rtx_insn *out_insn, rtx_insn *in_insn)
Definition recog.cc:4494
bool insn_invalid_p(rtx_insn *insn, bool in_group)
Definition recog.cc:365
void extract_insn(rtx_insn *insn)
Definition recog.cc:2884
int peep2_current_count
Definition recog.cc:3778
bool check_asm_operands(rtx x)
Definition recog.cc:145
bool validate_replace_rtx_subexp(rtx from, rtx to, rtx_insn *insn, rtx *loc)
Definition recog.cc:906
bool mode_dependent_address_p(rtx addr, addr_space_t addrspace)
Definition recog.cc:2682
alternative_mask get_enabled_alternatives(rtx_insn *insn)
Definition recog.cc:2782
bool validate_replace_rtx(rtx from, rtx to, rtx_insn *insn)
Definition recog.cc:916
bool memory_address_addr_space_p(machine_mode mode, rtx addr, addr_space_t as, code_helper ch)
Definition recog.cc:1891
int volatile_ok
Definition recog.cc:72
bool apply_change_group(void)
Definition recog.cc:574
bool constrain_operands_cached(rtx_insn *insn, int strict)
Definition recog.cc:2873
void init_recog_no_volatile(void)
Definition recog.cc:110
bool valid_insn_p(rtx_insn *insn)
Definition recog.cc:1486
bool raw_constraint_p
Definition recog.cc:92
void validate_replace_src_group(rtx from, rtx to, rtx_insn *insn)
Definition recog.cc:980
void cancel_changes(int num)
Definition recog.cc:600
bool validate_replace_rtx_part(rtx from, rtx to, rtx *where, rtx_insn *insn)
Definition recog.cc:929
bool verify_changes(int num)
Definition recog.cc:439
void extract_insn_cached(rtx_insn *insn)
Definition recog.cc:2840
bool peep2_reg_dead_p(int ofs, rtx reg)
Definition recog.cc:3826
struct target_recog default_target_recog
Definition recog.cc:59
rtx peep2_find_free_register(int from, int to, const char *class_str, machine_mode mode, HARD_REG_SET *reg_set)
Definition recog.cc:3856
const struct insn_data_d insn_data[]
unsigned int alternative_dependent_filters(const operand_alternative *alt, int i)
Definition recog.h:121
bool(*) insn_operand_predicate_fn(rtx, machine_mode)
Definition recog.h:508
int recog_memoized(rtx_insn *insn)
Definition recog.h:345
int which_alternative
Definition recog.cc:89
rtx_insn * peephole2_insns(rtx, rtx_insn *, int *)
#define recog_data
Definition recog.h:460
op_type
Definition recog.h:48
@ OP_IN
Definition recog.h:49
@ OP_INOUT
Definition recog.h:51
@ OP_OUT
Definition recog.h:50
void cancel_changes(int)
Definition recog.cc:600
bool strict_memory_address_addr_space_p(machine_mode, rtx, addr_space_t, code_helper=ERROR_MARK)
Definition reload.cc:2162
unsigned int alternative_register_filters(const operand_alternative *alt, int i)
Definition recog.h:109
#define this_target_recog
Definition recog.h:611
const char *(*) insn_output_fn(rtx *, rtx_insn *)
Definition recog.h:509
const operand_alternative * which_op_alt()
Definition recog.h:497
struct recog_data_d * recog_data_ptr
Definition recog.cc:75
enum reg_class alternative_class(const operand_alternative *alt, int i)
Definition recog.h:100
bool added_clobbers_hard_reg_p(int)
int recog(rtx, rtx_insn *, int *)
int num_validated_changes(void)
Definition recog.cc:592
bool_attr
Definition recog.h:593
@ BA_PREFERRED_FOR_SPEED
Definition recog.h:595
@ BA_PREFERRED_FOR_SIZE
Definition recog.h:596
@ BA_ENABLED
Definition recog.h:594
@ BA_LAST
Definition recog.h:597
void insn_extract(rtx_insn *)
int volatile_ok
Definition recog.cc:72
const char * skip_alternative(const char *p)
Definition recog.h:356
void add_clobbers(rtx, int)
#define INSN_CODE(INSN)
Definition rtl.h:1551
#define NULL_RTX
Definition rtl.h:711
rtx PATTERN(const_rtx insn)
Definition rtl.h:1519
Definition recog.h:28
auto_vec< unsigned long, 2 > opnums
Definition recog.h:30
string_slice modifier
Definition recog.h:29
Definition recog.h:558
const struct insn_operand_data *const operand
Definition recog.h:576
const char n_alternatives
Definition recog.h:581
const char n_generator_args
Definition recog.h:578
const char n_operands
Definition recog.h:579
const insn_gen_fn genfun
Definition recog.h:575
const char n_dups
Definition recog.h:580
const char *const name
Definition recog.h:559
const char output_format
Definition recog.h:582
union insn_data_d::insn_output_u output
Definition recog.h:512
void(*) stored_funcptr(void)
Definition recog.h:513
stored_funcptr func
Definition recog.h:530
rtx_insn * operator()(Ts... args) const
Definition recog.h:516
insn_gen_fn operator*(void) const
Definition recog.h:524
Definition recog.h:534
const char eliminable
Definition recog.h:545
const insn_operand_predicate_fn predicate
Definition recog.h:535
const char strict_low
Definition recog.h:541
const char *const constraint
Definition recog.h:537
const char allows_mem
Definition recog.h:547
machine_mode const mode
Definition recog.h:539
const char is_operator
Definition recog.h:543
Definition recog.h:56
const char * constraint
Definition recog.h:59
unsigned int register_filters
Definition recog.h:78
unsigned int memory_ok
Definition recog.h:88
enum reg_class cl
Definition recog.h:62
int matched
Definition recog.h:73
unsigned int unsigned int dependent_filters
Definition recog.h:82
int matches
Definition recog.h:69
unsigned int unsigned int unsigned int earlyclobber
Definition recog.h:85
unsigned int anything_ok
Definition recog.h:93
unsigned int reject
Definition recog.h:66
unsigned int is_address
Definition recog.h:90
Definition recog.h:396
char dup_num[MAX_DUP_OPERANDS]
Definition recog.h:431
rtx * operand_loc[MAX_RECOG_OPERANDS]
Definition recog.h:411
machine_mode operand_mode[MAX_RECOG_OPERANDS]
Definition recog.h:420
char is_operator[MAX_RECOG_OPERANDS]
Definition recog.h:417
rtx_insn * insn
Definition recog.h:456
recog_data_d()=default
char n_dups
Definition recog.h:447
char n_alternatives
Definition recog.h:450
enum op_type operand_type[MAX_RECOG_OPERANDS]
Definition recog.h:423
bool is_asm
Definition recog.h:453
const char * constraints[MAX_RECOG_OPERANDS]
Definition recog.h:414
recog_data_d(const recog_data_d &&)=delete
rtx operand[MAX_RECOG_OPERANDS]
Definition recog.h:408
rtx * dup_loc[MAX_DUP_OPERANDS]
Definition recog.h:427
char n_operands
Definition recog.h:444
recog_data_d(const recog_data_d &)=delete
Definition rtl.h:551
Definition recog.h:601
operand_alternative * x_op_alt[NUM_INSN_CODES]
Definition recog.h:604
alternative_mask x_bool_attr_masks[NUM_INSN_CODES][BA_LAST+1]
Definition recog.h:603
bool x_initialized
Definition recog.h:602
#define false
Definition system.h:846
#define IN_RANGE(VALUE, LOWER, UPPER)
Definition system.h:327
#define bool
Definition system.h:844
#define gcc_checking_assert(EXPR)
Definition system.h:779
#define MAX(X, Y)
Definition system.h:400
const char * single
Definition recog.h:566
constexpr insn_output_u(const char *const *m)
Definition recog.h:572
constexpr insn_output_u()
Definition recog.h:570
const char *const * multi
Definition recog.h:567
constexpr insn_output_u(const char *s)
Definition recog.h:571
constexpr insn_output_u(insn_output_fn f)
Definition recog.h:573
insn_output_fn function
Definition recog.h:568