GCC Middle and Back End API Reference
genopinit.c File 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< patternpatterns
static const char * header_file_name = "init-opinit.h"
static const char * source_file_name = "init-opinit.c"

Typedef Documentation

typedef enum optab_tag optab
typedef struct optab_def_d optab_def
typedef struct pattern_d pattern
   Vector in which to collect insns that match.  

Enumeration Type Documentation

enum optab_tag
Enumerator:
unknown_optab 
NUM_OPTABS 

Function Documentation

static void gen_insn ( )
static
     Don't mention "unnamed" instructions.  
     See if NAME matches one of the patterns we have for the optabs
     we know about.  
static bool handle_arg ( )
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 bool match_pattern ( )
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 FILE* open_outfile ( )
static
static int optab_kind_cmp ( )
static
static int optab_rcode_cmp ( )
static
static int pattern_cmp ( )
static

References optab_def_d::kind.


Variable Documentation

const char* header_file_name = "init-opinit.h"
static
optab_def optabs[]
static
Initial value:
{
{ "unknown_optab", NULL, NS, ZS, NS, unknown_optab, UNKNOWN, UNKNOWN, 0 },
#include "optabs.def"
}
vec<pattern> patterns
static
const char* const rtx_upname[]
static
Initial value:
{
#include "rtl.def"
}
const char* source_file_name = "init-opinit.c"
static