1 /* Declarations for rtx-reader support for gen* routines.
2 Copyright (C) 2000-2015 Free Software Foundation, Inc.
4 This file is part of GCC.
6 GCC is free software; you can redistribute it and/or modify it under
7 the terms of the GNU General Public License as published by the Free
8 Software Foundation; either version 3, or (at your option) any later
11 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
12 WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
16 You should have received a copy of the GNU General Public License
17 along with GCC; see the file COPYING3. If not see
18 <http://www.gnu.org/licenses/>. */
20 #ifndef GCC_GENSUPPORT_H
21 #define GCC_GENSUPPORT_H
24 extern struct obstack
*rtl_obstack
;
26 extern rtx
add_implicit_parallel (rtvec
);
27 extern bool init_rtx_reader_args_cb (int, char **, bool (*)(const char *));
28 extern bool init_rtx_reader_args (int, char **);
29 extern rtx
read_md_rtx (int *, int *);
31 /* Set this to 0 to disable automatic elision of insn patterns which
32 can never be used in this configuration. See genconditions.c.
33 Must be set before calling init_md_reader. */
34 extern int insn_elision
;
36 /* If the C test passed as the argument can be evaluated at compile
37 time, return its truth value; else return -1. The test must have
38 appeared somewhere in the machine description when genconditions
40 extern int maybe_eval_c_test (const char *);
42 /* Add an entry to the table of conditions. Used by genconditions and
44 extern void add_c_test (const char *, int);
46 /* This structure is used internally by gensupport.c and genconditions.c. */
54 extern hashval_t
hash_c_test (const void *);
55 extern int cmp_c_test (const void *, const void *);
56 extern void traverse_c_tests (htab_trav
, void *);
59 /* Predicate handling: helper functions and data structures. */
63 struct pred_data
*next
; /* for iterating over the set of all preds */
64 const char *name
; /* predicate name */
65 bool special
; /* special handling of modes? */
67 /* data used primarily by genpreds.c */
68 const char *c_block
; /* C test block */
69 rtx exp
; /* RTL test expression */
71 /* data used primarily by genrecog.c */
72 enum rtx_code singleton
; /* if pred takes only one code, that code */
73 int num_codes
; /* number of codes accepted */
74 bool allows_non_lvalue
; /* if pred allows non-lvalue expressions */
75 bool allows_non_const
; /* if pred allows non-const expressions */
76 bool codes
[NUM_RTX_CODE
]; /* set of codes accepted */
79 extern struct pred_data
*first_predicate
;
80 extern struct pred_data
*lookup_predicate (const char *);
81 extern void add_predicate_code (struct pred_data
*, enum rtx_code
);
82 extern void add_predicate (struct pred_data
*);
84 #define FOR_ALL_PREDICATES(p) for (p = first_predicate; p; p = p->next)
88 /* The largest match_operand, match_operator or match_parallel
92 /* The largest match_dup, match_op_dup or match_par_dup number found. */
95 /* The largest match_scratch number found. */
98 /* The number of times match_dup, match_op_dup or match_par_dup appears
102 /* The number of rtx arguments to the generator function. */
103 int num_generator_args
;
105 /* The number of rtx operands in an insn. */
106 int num_insn_operands
;
108 /* The number of operand variables that are needed. */
109 int num_operand_vars
;
112 extern void get_pattern_stats (struct pattern_stats
*ranges
, rtvec vec
);
113 extern void compute_test_codes (rtx
, int, char *);
114 extern const char *get_emit_function (rtx
);
115 extern bool needs_barrier_p (rtx
);
117 #endif /* GCC_GENSUPPORT_H */