GCC Middle and Back End API Reference
gensupport.h File Reference
#include "hash-set.h"
#include "read-md.h"
#include "optabs.def"
Include dependency graph for gensupport.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

class  md_rtx_info
 
struct  optab_def
 
struct  optab_pattern
 
struct  c_test
 
struct  pred_data
 
struct  pattern_stats
 

Macros

#define OPTAB_CL(name, pat, c, b, l)   name,
 
#define OPTAB_CX(name, pat)
 
#define OPTAB_CD(name, pat)   name,
 
#define OPTAB_NL(name, pat, c, b, s, l)   name,
 
#define OPTAB_NC(name, pat, c)   name,
 
#define OPTAB_NX(name, pat)
 
#define OPTAB_VL(name, pat, c, b, s, l)   name,
 
#define OPTAB_VC(name, pat, c)   name,
 
#define OPTAB_VX(name, pat)
 
#define OPTAB_DC(name, pat, c)   name,
 
#define OPTAB_D(name, pat)   name,
 
#define FOR_ALL_PREDICATES(p)   for (p = first_predicate; p; p = p->next)
 

Typedefs

typedef enum optab_tag optab
 

Enumerations

enum  optab_tag { unknown_optab , NUM_OPTABS }
 

Functions

unsigned int get_register_filter_id (const char *)
 
rtx add_implicit_parallel (rtvec)
 
rtx_readerinit_rtx_reader_args_cb (int, const char **, bool(*)(const char *))
 
rtx_readerinit_rtx_reader_args (int, const char **)
 
int count_patterns ()
 
bool read_md_rtx (md_rtx_info *)
 
unsigned int get_num_insn_codes ()
 
const charget_c_test (rtx)
 
int maybe_eval_c_test (const char *)
 
void add_c_test (const char *, int)
 
struct pred_datalookup_predicate (const char *)
 
void add_predicate_code (struct pred_data *, enum rtx_code)
 
void add_predicate (struct pred_data *)
 
void get_pattern_stats (struct pattern_stats *ranges, rtvec vec)
 
void compute_test_codes (rtx, file_location, char *)
 
file_location get_file_location (rtx)
 
const charget_emit_function (rtx)
 
bool needs_barrier_p (rtx)
 
bool find_optab (optab_pattern *, const char *)
 

Variables

struct obstackrtl_obstack
 
optab_def optabs []
 
unsigned int num_optabs
 
vec< const char * > register_filters
 
int insn_elision
 
struct pred_datafirst_predicate
 
hash_set< rtxcompact_syntax
 

Macro Definition Documentation

◆ FOR_ALL_PREDICATES

#define FOR_ALL_PREDICATES ( p)    for (p = first_predicate; p; p = p->next)

◆ OPTAB_CD

#define OPTAB_CD ( name,
pat )   name,

◆ OPTAB_CL

#define OPTAB_CL ( name,
pat,
c,
b,
l )   name,

◆ OPTAB_CX

#define OPTAB_CX ( name,
pat )

◆ OPTAB_D

#define OPTAB_D ( name,
pat )   name,

◆ OPTAB_DC

#define OPTAB_DC ( name,
pat,
c )   name,

◆ OPTAB_NC

#define OPTAB_NC ( name,
pat,
c )   name,

◆ OPTAB_NL

#define OPTAB_NL ( name,
pat,
c,
b,
s,
l )   name,

◆ OPTAB_NX

#define OPTAB_NX ( name,
pat )

◆ OPTAB_VC

#define OPTAB_VC ( name,
pat,
c )   name,

◆ OPTAB_VL

#define OPTAB_VL ( name,
pat,
c,
b,
s,
l )   name,

◆ OPTAB_VX

#define OPTAB_VX ( name,
pat )

Typedef Documentation

◆ optab

Enumerates all optabs.   

Enumeration Type Documentation

◆ optab_tag

Enumerates all optabs.   
Enumerator
unknown_optab 
NUM_OPTABS 

Function Documentation

◆ add_c_test()

void add_c_test ( const char * expr,
int value )
extern
Add an entry to the table of conditions.  Used by genconditions and
by read-rtl.cc.   
Record the C test expression EXPR in the condition_table, with
value VAL.  Duplicates clobber previous entries.   

References condition_table, c_test::expr, expr, ggc_alloc(), and c_test::value.

Referenced by main().

◆ add_implicit_parallel()

rtx add_implicit_parallel ( rtvec vec)
extern
Return the rtx pattern specified by the list of rtxes in a
define_insn or define_split.   

References GET_NUM_ELEM, ggc_alloc(), RTVEC_ELT, rtx_alloc(), and XVEC.

Referenced by gen_insn(), gen_rewrite_sequence(), main(), and process_one_cond_exec().

◆ add_predicate()

◆ add_predicate_code()

◆ compute_test_codes()

void compute_test_codes ( rtx exp,
file_location loc,
char * codes )
extern
Recursively calculate the set of rtx codes accepted by the
predicate expression EXP, writing the result to CODES.  LOC is
the .md file location of the directive containing EXP.   

References pred_data::codes, compute_test_codes(), did_you_mean_codes, error_at(), exp(), GET_CODE, GET_RTX_NAME, ggc_alloc(), I, i, queue_elem::loc, lookup_predicate(), message_at(), N, NUM_RTX_CODE, scan_comma_elt(), TRISTATE_AND, TRISTATE_NOT, TRISTATE_OR, XEXP, XSTR, and Y.

Referenced by add_constraint(), compute_test_codes(), and process_define_predicate().

◆ count_patterns()

int count_patterns ( )
extern
Count the number of patterns in all queues and return the count.   

References count, queue_elem::data, define_attr_queue, define_insn_queue, define_pred_queue, get_c_test(), ggc_alloc(), insn_elision, maybe_eval_c_test(), queue_elem::next, and other_queue.

Referenced by main().

◆ find_optab()

bool find_optab ( optab_pattern * p,
const char * name )
extern
Return true if NAME is the name of an optab, describing it in P if so.   

References ggc_alloc(), optab_pattern::m1, optab_pattern::m2, match_pattern(), optab_pattern::name, pred_data::name, optab_def::op, optab_pattern::op, optabs, and optab_pattern::sort_num.

Referenced by gen_expand(), and gen_insn().

◆ get_c_test()

const char * get_c_test ( rtx x)
extern
Return the C test that says whether a definition rtx can be used,
or "" if it can be used unconditionally.   
Return the C test that says whether definition rtx DEF can be used,
or "" if it can be used unconditionally.   

References GET_CODE, ggc_alloc(), and XSTR.

Referenced by count_patterns(), main(), match_pattern_1(), read_md_rtx(), and validate_pattern().

◆ get_emit_function()

const char * get_emit_function ( rtx x)
extern
Return the emit_* function that should be used for pattern X, or NULL
if we can't pick a particular type at compile time and should instead
fall back to "emit".   

References classify_insn(), gcc_unreachable, ggc_alloc(), and NULL.

Referenced by gen_emit_seq().

◆ get_file_location()

file_location get_file_location ( rtx x)
extern
Return the file location of DEFINE_* rtx X, which was previously
returned by read_md_rtx.   

References gcc_assert, and rtx_locs.

Referenced by def_target_insn().

◆ get_num_insn_codes()

unsigned int get_num_insn_codes ( )
extern
Return the number of possible INSN_CODEs.  Only meaningful once the
whole file has been processed.   

References insn_sequence_num.

Referenced by main().

◆ get_pattern_stats()

void get_pattern_stats ( struct pattern_stats * stats,
rtvec pattern )
extern
Make STATS describe the operands that appear in instruction pattern
PATTERN.   

References GET_NUM_ELEM, get_pattern_stats_1(), i, MAX, and RTVEC_ELT.

Referenced by def_target_insn(), gen_expand(), gen_expand(), gen_insn(), gen_insn(), gen_peephole(), gen_split(), handle_overloaded_gen(), and handle_overloaded_gen().

◆ get_register_filter_id()

unsigned int get_register_filter_id ( const char * filter)
extern
Return the unique identifier for filter condition FILTER.  Identifiers
are assigned automatically when the define_register_constraint is
parsed.   

References gcc_assert, and register_filter_map.

Referenced by preprocess_constraints(), write_get_register_filter(), and write_get_register_filter_id().

◆ init_rtx_reader_args()

rtx_reader * init_rtx_reader_args ( int argc,
const char ** argv )
extern
Programs that don't have their own options can use this entry point
instead.   

References init_rtx_reader_args_cb().

Referenced by main(), and main().

◆ init_rtx_reader_args_cb()

◆ lookup_predicate()

◆ maybe_eval_c_test()

int maybe_eval_c_test ( const char * expr)
extern
If the C test passed as the argument can be evaluated at compile
time, return its truth value; else return -1.  The test must have
appeared somewhere in the machine description when genconditions
was run.   
Given a string representing a C test expression, look it up in the
condition_table and report whether or not its value is known
at compile time.  Returns a tristate: 1 for known true, 0 for
known false, -1 for unknown.   

References condition_table, c_test::expr, expr, ggc_alloc(), and c_test::value.

Referenced by count_patterns(), def_target_insn(), gen_insn(), gen_insn(), gen_proto(), match_pattern_1(), and read_md_rtx().

◆ needs_barrier_p()

bool needs_barrier_p ( rtx x)
extern
Return true if we must emit a barrier after pattern X.   

References GET_CODE, ggc_alloc(), SET, SET_DEST, and SET_SRC.

Referenced by gen_emit_seq().

◆ read_md_rtx()

Variable Documentation

◆ compact_syntax

hash_set<rtx> compact_syntax
extern
List of entries which are part of the new syntax.   

Referenced by convert_syntax(), and gen_insn().

◆ first_predicate

struct pred_data* first_predicate
extern

◆ insn_elision

int insn_elision
extern
Set this to 0 to disable automatic elision of insn patterns which
can never be used in this configuration.  See genconditions.cc.
Must be set before calling init_md_reader.   

Referenced by count_patterns(), main(), and read_md_rtx().

◆ num_optabs

unsigned int num_optabs
extern
The number of entries in optabs[].   

Referenced by main().

◆ optabs

optab_def optabs[]
extern
An array of all optabs.  Note that the same optab can appear more
than once, with a different pattern.   

Referenced by find_optab(), and main().

◆ register_filters

◆ rtl_obstack