GCC Middle and Back End API Reference
|
Data Structures | |
struct | optab_def_d |
struct | pattern_d |
Typedefs | |
typedef enum optab_tag | optab |
typedef struct optab_def_d | optab_def |
typedef struct pattern_d | pattern |
Enumerations | |
enum | optab_tag { unknown_optab, NUM_OPTABS } |
Functions | |
static bool | match_pattern () |
static void | gen_insn () |
static int | pattern_cmp () |
static int | optab_kind_cmp () |
static int | optab_rcode_cmp () |
static bool | handle_arg () |
static FILE * | open_outfile () |
int | main () |
Variables | |
static const char *const | rtx_upname [] |
static optab_def | optabs [] |
static vec< pattern > | patterns |
static const char * | header_file_name = "init-opinit.h" |
static const char * | source_file_name = "init-opinit.c" |
typedef struct optab_def_d optab_def |
enum optab_tag |
|
static |
Don't mention "unnamed" instructions.
See if NAME matches one of the patterns we have for the optabs we know about.
|
static |
int main | ( | ) |
Read the machine description.
Sort the collected patterns.
Now that we've handled the "extra" patterns, eliminate them from the optabs array. That way they don't get in the way below.
Sort the (real) optabs. Better than forcing the optabs.def file to remain sorted by kind. We also scrogged any real ordering with the purging of the X patterns above.
Emit the optab enumeration for the header file.
Perform a binary search on a pre-encoded optab+mode*2.
??? Perhaps even better to generate a minimal perfect hash. Using gperf directly is awkward since it's so geared to working with strings. Plus we have no visibility into the ordering of the hash entries, which complicates the pat_enable array.
C++ (even G++) does not support (non-trivial) designated initializers. To work around that, generate these arrays programatically rather than by our traditional multiple inclusion of def files.
|
static |
This loop will stop at the first prefix match, so look through the modes in reverse order, in case there are extra CC modes and CC is a prefix of the CC modes (as it should be).
References pattern_d::m1, pattern_d::m2, and strlen().
|
static |
|
static |
|
static |
|
static |
References optab_def_d::kind.
|
static |
|
static |
|
static |
|
static |