]>
Commit | Line | Data |
---|---|---|
c88c0d42 | 1 | /* Declarations for rtx-reader support for gen* routines. |
d652f226 | 2 | Copyright (C) 2000, 2002, 2003, 2004, 2007, 2008, 2010 |
66647d44 | 3 | Free Software Foundation, Inc. |
c88c0d42 | 4 | |
1322177d | 5 | This file is part of GCC. |
c88c0d42 | 6 | |
1322177d LB |
7 | GCC is free software; you can redistribute it and/or modify it under |
8 | the terms of the GNU General Public License as published by the Free | |
9dcd6f09 | 9 | Software Foundation; either version 3, or (at your option) any later |
1322177d | 10 | version. |
c88c0d42 | 11 | |
1322177d LB |
12 | GCC is distributed in the hope that it will be useful, but WITHOUT ANY |
13 | WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
14 | FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
15 | for more details. | |
c88c0d42 CP |
16 | |
17 | You should have received a copy of the GNU General Public License | |
9dcd6f09 NC |
18 | along with GCC; see the file COPYING3. If not see |
19 | <http://www.gnu.org/licenses/>. */ | |
c88c0d42 | 20 | |
2199e5fa ZW |
21 | #ifndef GCC_GENSUPPORT_H |
22 | #define GCC_GENSUPPORT_H | |
23 | ||
3916d6d8 RH |
24 | struct obstack; |
25 | extern struct obstack *rtl_obstack; | |
26 | ||
600ab3fc RS |
27 | extern bool init_rtx_reader_args_cb (int, char **, bool (*)(const char *)); |
28 | extern bool init_rtx_reader_args (int, char **); | |
3d7aafde | 29 | extern rtx read_md_rtx (int *, int *); |
c88c0d42 | 30 | |
2199e5fa ZW |
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; | |
35 | ||
2199e5fa ZW |
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 | |
39 | was run. */ | |
3d7aafde | 40 | extern int maybe_eval_c_test (const char *); |
2199e5fa | 41 | |
1c7352cd ZW |
42 | /* Add an entry to the table of conditions. Used by genconditions and |
43 | by read-rtl.c. */ | |
44 | extern void add_c_test (const char *, int); | |
45 | ||
46 | /* This structure is used internally by gensupport.c and genconditions.c. */ | |
2199e5fa ZW |
47 | struct c_test |
48 | { | |
49 | const char *expr; | |
50 | int value; | |
51 | }; | |
52 | ||
2199e5fa | 53 | #ifdef __HASHTAB_H__ |
3d7aafde AJ |
54 | extern hashval_t hash_c_test (const void *); |
55 | extern int cmp_c_test (const void *, const void *); | |
1c7352cd | 56 | extern void traverse_c_tests (htab_trav, void *); |
2199e5fa ZW |
57 | #endif |
58 | ||
e543e219 ZW |
59 | /* Predicate handling: helper functions and data structures. */ |
60 | ||
61 | struct pred_data | |
62 | { | |
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? */ | |
66 | ||
67 | /* data used primarily by genpreds.c */ | |
68 | const char *c_block; /* C test block */ | |
69 | rtx exp; /* RTL test expression */ | |
70 | ||
71 | /* data used primarily by genrecog.c */ | |
72 | enum rtx_code singleton; /* if pred takes only one code, that code */ | |
e663da80 | 73 | int num_codes; /* number of codes accepted */ |
e543e219 ZW |
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 */ | |
77 | }; | |
78 | ||
79 | extern struct pred_data *first_predicate; | |
80 | extern struct pred_data *lookup_predicate (const char *); | |
e663da80 | 81 | extern void add_predicate_code (struct pred_data *, enum rtx_code); |
e543e219 ZW |
82 | extern void add_predicate (struct pred_data *); |
83 | ||
84 | #define FOR_ALL_PREDICATES(p) for (p = first_predicate; p; p = p->next) | |
85 | ||
2199e5fa | 86 | #endif /* GCC_GENSUPPORT_H */ |