GCC Middle and Back End API Reference
genattrtab.c File Reference

Data Structures

struct  insn_def
struct  insn_ent
struct  attr_value
struct  attr_desc
struct  delay_desc
struct  attr_value_list
struct  attr_hash
struct  insn_reserv
struct  bypass_list

Functions

static char * attr_string (const char *, int)
static char * attr_printf (unsigned int, const char *,...) ATTRIBUTE_PRINTF_2
static rtx make_numeric_value (int)
static struct attr_descfind_attr (const char **, int)
static rtx mk_attr_alt (int)
static char * next_comma_elt (const char **)
static rtx insert_right_side (enum rtx_code, rtx, rtx, int, int)
static rtx copy_boolean (rtx)
static int compares_alternatives_p (rtx)
static void make_internal_attr (const char *, rtx, int)
static void insert_insn_ent (struct attr_value *, struct insn_ent *)
static void walk_attr_value (rtx)
static int max_attr_value (rtx, int *)
static int min_attr_value (rtx, int *)
static int or_attr_value (rtx, int *)
static rtx simplify_test_exp (rtx, int, int)
static rtx simplify_test_exp_in_temp (rtx, int, int)
static rtx copy_rtx_unchanging (rtx)
static bool attr_alt_subset_p (rtx, rtx)
static bool attr_alt_subset_of_compl_p (rtx, rtx)
static void clear_struct_flag (rtx)
static void write_attr_valueq (FILE *, struct attr_desc *, const char *)
static struct attr_valuefind_most_used (struct attr_desc *)
static void write_attr_set (FILE *, struct attr_desc *, int, rtx, const char *, const char *, rtx, int, int, unsigned int)
static void write_attr_case (FILE *, struct attr_desc *, struct attr_value *, int, const char *, const char *, int, rtx)
static void write_attr_value (FILE *, struct attr_desc *, rtx)
static void write_upcase (FILE *, const char *)
static void write_indent (FILE *, int)
static rtx identity_fn (rtx)
static rtx zero_fn (rtx)
static rtx one_fn (rtx)
static rtx max_fn (rtx)
static rtx min_fn (rtx)
static void attr_hash_add_rtx ()
static void attr_hash_add_string ()
static rtx attr_rtx_1 ()
static rtx attr_rtx ()
static char * attr_printf ()
static rtx attr_eq ()
static const char * attr_numeral ()
static char * attr_string ()
static int attr_equal_p ()
static rtx attr_copy_rtx ()
static rtx check_attr_test ()
static rtx check_attr_value ()
static rtx convert_set_attr_alternative ()
static rtx convert_set_attr ()
static void check_defs ()
static rtx make_canonical ()
static rtx copy_boolean ()
static struct attr_valueget_attr_value ()
static void expand_delays ()
static void fill_attr ()
static rtx substitute_address (rtx exp, rtx(*no_address_fn)(rtx), rtx(*address_fn)(rtx))
static void make_length_attrs ()
static rtx identity_fn ()
static rtx zero_fn ()
static rtx one_fn ()
static rtx max_fn ()
static rtx min_fn ()
static void write_length_unit_log ()
static int attr_rtx_cost ()
static rtx simplify_cond ()
static void remove_insn_ent ()
static void insert_insn_ent ()
static rtx insert_right_side ()
static int compute_alternative_mask ()
static rtx make_alternative_compare ()
static rtx evaluate_eq_attr (rtx exp, struct attr_desc *attr, rtx value, int insn_code, int insn_index)
static rtx simplify_and_tree ()
static rtx simplify_or_tree ()
static rtx simplify_test_exp_in_temp ()
static bool attr_alt_subset_p ()
static bool attr_alt_subset_of_compl_p ()
static rtx attr_alt_intersection ()
static rtx attr_alt_union ()
static rtx attr_alt_complement ()
static rtx mk_attr_alt ()
static rtx simplify_test_exp ()
static int tests_attr_p ()
static int get_attr_order ()
static void optimize_attrs ()
static void clear_struct_flag ()
static void add_attr_value ()
static void gen_attr ()
static int count_alternatives ()
static int compares_alternatives_p ()
static void gen_insn ()
static void gen_delay ()
static void find_attrs_to_cache ()
static unsigned int write_test_expr ()
static int max_attr_value ()
static int min_attr_value ()
static int or_attr_value ()
static void walk_attr_value ()
static void write_attr_get ()
static rtx eliminate_known_true ()
static void write_insn_cases ()
static void write_attr_valueq ()
static void write_attr_value ()
static void write_upcase ()
static void write_indent ()
static void write_eligible_delay ()
static char * next_comma_elt ()
static struct attr_descfind_attr ()
static void make_internal_attr ()
static struct attr_valuefind_most_used ()
static rtx make_numeric_value ()
static rtx copy_rtx_unchanging ()
static void write_const_num_delay_slots ()
static void gen_insn_reserv ()
static void gen_bypass_1 ()
static void gen_bypass ()
static void process_bypasses ()
static bool check_tune_attr ()
static struct attr_descfind_tune_attr ()
static void make_automaton_attrs ()
static void write_header ()
static FILE * open_outfile ()
static bool handle_arg ()
int main ()

Variables

static struct obstack obstack1 obstack2
static struct obstackhash_obstack = &obstack1
static struct obstacktemp_obstack = &obstack2
static struct attr_descattrs [MAX_ATTRS_INDEX]
static struct insn_defdefs
static struct delay_descdelays
struct attr_value_list ** insn_code_values
static int insn_code_number
static int insn_index_number
static int got_define_asm_attributes
static int must_extract
static int must_constrain
static int address_used
static int length_used
static int num_delays
static int have_annul_true
static int have_annul_false
static int num_insn_ents
static int * insn_n_alternatives
static int * insn_alternatives
static rtx true_rtx
static rtx false_rtx
static const char * alternative_name
static const char * length_str
static const char * delay_type_str
static const char * delay_1_0_str
static const char * num_delay_slots_str
static const char * attr_file_name = NULL
static const char * dfa_file_name = NULL
static const char * latency_file_name = NULL
static FILE * attr_file
static FILE * dfa_file
static FILE * latency_file
static struct attr_hashattr_hash_table [RTL_HASH_SIZE]
static const char * cached_attrs [32]
static int cached_attr_count
static unsigned int attrs_seen_once
static unsigned int attrs_seen_more_than_once
static unsigned int attrs_to_cache
static unsigned int attrs_cached_inside
static unsigned int attrs_cached_after
static struct insn_reservall_insn_reservs = 0
static struct insn_reserv ** last_insn_reserv_p = &all_insn_reservs
static size_t n_insn_reservs
static struct bypass_listall_bypasses
static size_t n_bypasses

Function Documentation

static void add_attr_value ( )
static
Add attribute value NAME to the beginning of ATTR's list.   

References attr_rtx(), attr_value::first_insn, attr_desc::first_value, attr_value::has_asm_insn, attr_value::next, attr_value::num_insns, and attr_value::value.

Referenced by gen_attr().

static rtx attr_alt_complement ( )
static
Return EQ_ATTR_ALT expression representing complement of S.   

Referenced by simplify_test_exp().

static rtx attr_alt_intersection ( )
static
Return EQ_ATTR_ALT expression representing intersection of S1 and S2.   

Referenced by simplify_test_exp().

static bool attr_alt_subset_of_compl_p ( rtx  ,
rtx   
)
static

Referenced by simplify_and_tree().

static bool attr_alt_subset_of_compl_p ( )
static
Returns true if S1 is a subset of complement of S2.   
static bool attr_alt_subset_p ( rtx  ,
rtx   
)
static

Referenced by simplify_and_tree().

static bool attr_alt_subset_p ( )
static
Returns true if S1 is a subset of S2.   
static rtx attr_alt_union ( )
static
Return EQ_ATTR_ALT expression representing union of S1 and S2.   

Referenced by simplify_test_exp().

static rtx attr_copy_rtx ( )
static
Copy an attribute value expression,
   descending to all depths, but not copying any
   permanent hashed subexpressions.   

References copy(), and rtvec_alloc().

Referenced by optimize_attrs(), and simplify_test_exp_in_temp().

static rtx attr_eq ( )
static
static int attr_equal_p ( )
static
Check two rtx's for equality of contents,
   taking advantage of the fact that if both are hashed
   then they can't be equal unless they are the same object.   

References rtx_equal_p().

Referenced by insert_right_side(), simplify_and_tree(), simplify_cond(), simplify_or_tree(), and simplify_test_exp().

static void attr_hash_add_rtx ( )
static
Add an entry to the hash table for RTL with hash code HASHCODE.   

References hash_obstack, attr_hash::hashcode, attr_hash::next, attr_hash::rtl, and attr_hash::u.

Referenced by attr_rtx_1().

static void attr_hash_add_string ( )
static
Add an entry to the hash table for STRING with hash code HASHCODE.   

References hash_obstack, attr_hash::hashcode, attr_hash::next, attr_hash::str, and attr_hash::u.

Referenced by attr_string().

static const char* attr_numeral ( )
static
static char* attr_printf ( unsigned  int,
const char *  ,
  ... 
)
static
static char* attr_printf ( )
static
Create a new string printed with the printf line arguments into a space
   of at most LEN bytes:

   rtx attr_printf (len, format, [arg1, ..., argn])   
static rtx attr_rtx_1 ( )
static
Generate an RTL expression, but avoid duplicates.
   Set the ATTR_PERMANENT_P flag for these permanent objects.

   In some cases we cannot uniquify; then we return an ordinary
   impermanent rtx with ATTR_PERMANENT_P clear.

   Args are as follows:

   rtx attr_rtx (code, [element1, ..., elementn])   

References attr_hash_add_rtx(), false_rtx, hash_obstack, attr_hash::hashcode, HOST_WIDE_INT, attr_hash::next, obstack, attr_hash::rtl, rtl_obstack, RTX_BIN_ARITH, RTX_COMM_ARITH, RTX_COMM_COMPARE, RTX_COMPARE, RTX_UNARY, true_rtx, and attr_hash::u.

Referenced by attr_rtx().

static int attr_rtx_cost ( )
static
Compute approximate cost of the expression.  Used to decide whether
   expression is cheap enough for inline.   

References alternative_name.

Referenced by optimize_attrs(), and simplify_test_exp().

static char* attr_string ( const char *  ,
int   
)
static
Forward declarations of functions used before their definitions, only.   

Referenced by gen_bypass_1(), and next_comma_elt().

static char* attr_string ( )
static
Return a permanent (possibly shared) copy of a string STR (not assumed
   to be null terminated) with LEN bytes.   

References attr_hash_add_string(), copy_md_ptr_loc(), hash_obstack, attr_hash::hashcode, len, memcpy(), attr_hash::next, attr_hash::str, and attr_hash::u.

static rtx check_attr_test ( )
static
Given a test expression for an attribute, ensure it is validly formed.
   IS_CONST indicates whether the expression is constant for each compiler
   run (a constant expression may not test any particular insn).

   Convert (eq_attr "att" "a1,a2") to (ior (eq_attr ... ) (eq_attrq ..))
   and (eq_attr "att" "!a1") to (not (eq_attr "att" "a1")).  Do the latter
   test first so that (eq_attr "att" "!a1,a2,a3") works as expected.

   Update the string address in EQ_ATTR expression to be the same used
   in the attribute (or `alternative_name') to speed up subsequent
   `find_attr' calls and eliminate most `strcmp' calls.

   Return the new expression, if any.   

References attr_eq(), attr_rtx(), exp(), false_rtx, fatal(), find_attr(), attr_desc::first_value, insert_right_side(), attr_desc::is_const, attr_desc::is_numeric, mk_attr_alt(), n_comma_elts(), attr_value::next, next_comma_elt(), true_rtx, and attr_value::value.

Referenced by check_attr_value(), and gen_insn_reserv().

static rtx check_attr_value ( )
static
Given an expression, ensure that it is validly formed and that all named
   attribute values are valid for the given attribute.  Issue a fatal error
   if not.  If no attribute is specified, assume a numeric attribute.

   Return a perhaps modified replacement expression for the value.   

References attr_rtx(), check_attr_test(), error_with_line(), exp(), find_attr(), attr_desc::first_value, attr_desc::is_const, attr_desc::is_numeric, attr_desc::lineno, attr_desc::name, attr_value::next, and attr_value::value.

Referenced by check_defs(), gen_attr(), main(), and make_canonical().

static void check_defs ( )
static
Scan all definitions, checking for validity.  Also, convert any SET_ATTR
   and SET_ATTR_ALTERNATIVE expressions to the corresponding SET
   expressions.   

References check_attr_value(), convert_set_attr(), convert_set_attr_alternative(), insn_def::def, error_with_line(), find_attr(), insn_def::lineno, insn_def::next, SET, and insn_def::vec_idx.

Referenced by main().

static bool check_tune_attr ( )
static
Check that attribute NAME is used in define_insn_reservation condition
   EXP.  Return true if it is.   

References insn_reserv::name.

Referenced by find_tune_attr().

static void clear_struct_flag ( rtx  )
static
static void clear_struct_flag ( )
static
Clear the ATTR_CURR_SIMPLIFIED_P flag in EXP and its subexpressions.   

References clear_struct_flag().

static int compares_alternatives_p ( rtx  )
static
static int compares_alternatives_p ( )
static
Returns nonzero if the given expression contains an EQ_ATTR with the
   `alternative' attribute.   

References alternative_name, and compares_alternatives_p().

static int compute_alternative_mask ( )
static
If we have an expression which AND's a bunch of
        (not (eq_attrq "alternative" "n"))
   terms, we may have covered all or all but one of the possible alternatives.
   If so, we can optimize.  Similarly for IOR's of EQ_ATTR.

   This routine is passed an expression and either AND or IOR.  It returns a
   bitmask indicating which alternatives are mentioned within EXP.   

References alternative_name.

Referenced by simplify_test_exp().

static rtx convert_set_attr ( )
static
Given a SET_ATTR, convert to the appropriate SET.  If a comma-separated
   list of values is given, convert to SET_ATTR_ALTERNATIVE first.   

References attr_rtx(), convert_set_attr_alternative(), n_comma_elts(), next_comma_elt(), rtvec_alloc(), and SET.

Referenced by check_defs().

static rtx convert_set_attr_alternative ( )
static
Given an SET_ATTR_ALTERNATIVE expression, convert to the canonical SET.
   It becomes a COND with each test being (eq_attr "alternative" "n")  

References alternative_name, attr_eq(), attr_numeral(), attr_rtx(), error_with_line(), insn_def::lineno, rtvec_alloc(), and SET.

Referenced by check_defs(), and convert_set_attr().

static rtx copy_boolean ( rtx  )
static

Referenced by copy_boolean(), and make_canonical().

static rtx copy_boolean ( )
static

References attr_rtx(), copy_boolean(), and exp().

static rtx copy_rtx_unchanging ( rtx  )
static
static rtx copy_rtx_unchanging ( )
static
static int count_alternatives ( )
static
Given a pattern for DEFINE_PEEPHOLE or DEFINE_INSN, return the number of
   alternatives in the constraints.  Assume all MATCH_OPERANDs have the same
   number of alternatives as this should be checked elsewhere.   

References n_comma_elts().

Referenced by gen_insn().

static rtx eliminate_known_true ( )
static
Given an AND tree of known true terms (because we are inside an `if' with
   that as the condition or are in an `else' clause) and an expression,
   replace any known true terms with TRUE.  Use `simplify_and_tree' to do
   the bulk of the work.   

References exp(), and simplify_and_tree().

Referenced by write_attr_set().

static rtx evaluate_eq_attr ( rtx  exp,
struct attr_desc attr,
rtx  value,
int  insn_code,
int  insn_index 
)
static
If we are processing an (eq_attr "attr" "value") test, we find the value
   of "attr" for this insn code.  From that value, we can compute a test
   showing when the EQ_ATTR will be true.  This routine performs that
   computation.  If a test condition involves an address, we leave the EQ_ATTR
   intact because addresses are only valid for the `length' attribute.

   EXP is the EQ_ATTR expression and ATTR is the attribute to which
   it refers.  VALUE is the value of that attribute for the insn
   corresponding to INSN_CODE and INSN_INDEX.   

References address_used, attr_value_list::attr, attr_rtx(), attr_value_list::av, copy_rtx_unchanging(), insn_ent::def, attr_desc::enum_name, exp(), false_rtx, find_attr(), attr_value::first_insn, attr_desc::first_value, insert_right_side(), insn_def::insn_code, attr_desc::name, insn_ent::next, attr_value::next, attr_value_list::next, simplify_test_exp_in_temp(), true_rtx, attr_value::value, and walk_attr_value().

Referenced by simplify_test_exp(), and write_test_expr().

static void expand_delays ( )
static
After all DEFINE_DELAYs have been read in, create internal attributes
   to generate the required routines.

   First, we compute the number of delay slots for each insn (as a COND of
   each of the test expressions in DEFINE_DELAYs).  Then, if more than one
   delay type is specified, we compute a similar function giving the
   DEFINE_DELAY ordinal for each insn.

   Finally, for each [DEFINE_DELAY, slot #] pair, we compute an attribute that
   tells whether a given insn can be in that delay slot.

   Normal attribute filling and optimization expands these to contain the
   information needed to handle delay slots.   

References attr_printf(), attr_rtx(), delay_desc::def, delay_type_str, false_rtx, have_annul_false, have_annul_true, make_internal_attr(), make_numeric_value(), delay_desc::next, delay_desc::num, num_delay_slots_str, num_delays, and rtvec_alloc().

Referenced by main().

static void fill_attr ( )
static
Once all attributes and insns have been read and checked, we construct for
   each attribute value a list of all the insns that have that value for
   the attribute.   

References insn_def::def, insn_ent::def, attr_desc::default_val, get_attr_value(), insert_insn_ent(), insn_def::insn_code, attr_desc::is_const, attr_desc::name, insn_def::next, and insn_def::vec_idx.

Referenced by main().

static struct attr_desc* find_attr ( )
staticread
Return a `struct attr_desc' pointer for a given named attribute.  If CREATE
   is nonzero, build a new attribute, if one does not exist.  *NAME_P is
   replaced by a pointer to a canonical copy of the string.   

References alternative_name, attr_desc::default_val, attr_desc::enum_name, attr_desc::first_value, attr_desc::is_const, attr_desc::is_numeric, attr_desc::is_special, attr_desc::name, and attr_desc::next.

static void find_attrs_to_cache ( )
static
Finds non-const attributes that could be possibly cached.
   When create is TRUE, fills in cached_attrs array.
   Computes ATTRS_SEEN_ONCE and ATTRS_SEEN_MORE_THAN_ONCE
   bitmasks.   

References alternative_name, cached_attr_count, find_attr(), and attr_desc::is_const.

Referenced by write_attr_get(), and write_attr_set().

static struct attr_value* find_most_used ( struct attr_desc )
staticread
static struct attr_value* find_most_used ( )
staticread
Find the most used value of an attribute.   

References attr_desc::first_value, attr_value::next, and attr_value::num_insns.

static struct attr_desc* find_tune_attr ( )
staticread
Try to find a const attribute (usually cpu or tune) that is used
   in all define_insn_reservation conditions.   

References alternative_name, check_tune_attr(), insn_reserv::condexp, find_attr(), attr_desc::is_const, attr_desc::is_special, attr_desc::name, and insn_reserv::next.

Referenced by make_automaton_attrs().

static void gen_bypass ( )
static

References gen_bypass_1().

Referenced by main().

static void gen_bypass_1 ( )
static
static void gen_delay ( )
static
Process a DEFINE_DELAY.  Validate the vector length, check if annul
   true or annul false is specified, and make a `struct delay_desc'.   

References delay_desc::def, delays, error_with_line(), have_annul_false, have_annul_true, delay_desc::lineno, delay_desc::next, delay_desc::num, and num_delays.

Referenced by main().

static void gen_insn ( )
static
Process DEFINE_PEEPHOLE, DEFINE_INSN, and DEFINE_ASM_ATTRIBUTES.   

References count_alternatives(), insn_def::def, defs, exp(), got_define_asm_attributes, insn_code_number, insn_index_number, insn_def::lineno, and insn_def::num_alternatives.

Referenced by main().

static void gen_insn_reserv ( )
static
Store information from a DEFINE_INSN_RESERVATION for future
   attribute generation.   

References insn_reserv::bypassed, check_attr_test(), insn_reserv::condexp, insn_reserv::default_latency, insn_reserv::insn_num, n_insn_reservs, insn_reserv::name, and insn_reserv::next.

Referenced by main().

static int get_attr_order ( )
static
Calculate a topological sorting of all attributes so that
   all attributes only depend on attributes in front of it.
   Place the result in *RET (which is a pointer to an array of
   attr_desc pointers), and return the size of that array.   

References attr_desc::first_value, free(), attr_desc::is_const, attr_desc::name, attr_value::next, attr_desc::next, attr_value::num_insns, tests_attr_p(), and attr_value::value.

Referenced by optimize_attrs().

static struct attr_value* get_attr_value ( )
staticread
Given a value and an attribute description, return a `struct attr_value *'
   that represents that value.  This is either an existing structure, if the
   value has been previously encountered, or a newly-created structure.

   `insn_code' is the code of an insn whose attribute has the specified
   value (-2 if not processing an insn).  We ensure that all insns for
   a given value have the same number of alternatives if the value checks
   alternatives.   

References compares_alternatives_p(), insn_ent::def, fatal(), attr_value::first_insn, attr_desc::first_value, attr_value::has_asm_insn, insn_alternatives, insn_def::insn_code, make_canonical(), attr_value::next, attr_value::num_insns, rtx_equal_p(), and attr_value::value.

Referenced by fill_attr(), gen_attr(), make_internal_attr(), make_length_attrs(), and optimize_attrs().

static bool handle_arg ( )
static

Referenced by main().

static rtx identity_fn ( rtx  )
static

Referenced by make_length_attrs().

static rtx identity_fn ( )
static
Utility functions called from above routine.   

References exp().

static void insert_insn_ent ( struct attr_value ,
struct insn_ent  
)
static
static void insert_insn_ent ( )
static
static rtx insert_right_side ( enum  rtx_code,
rtx  ,
rtx  ,
int  ,
int   
)
static
static rtx insert_right_side ( )
static
This is a utility routine to take an expression that is a tree of either
   AND or IOR expressions and insert a new term.  The new term will be
   inserted at the right side of the first node whose code does not match
   the root.  A new node will be created with the root's code.  Its left
   side will be the old right side and its right side will be the new
   term.

   If the `term' is itself a tree, all its leaves will be inserted.   

References attr_equal_p(), attr_rtx(), exp(), false_rtx, insert_right_side(), simplify_test_exp_in_temp(), and true_rtx.

static rtx make_alternative_compare ( )
static
Given I, a single-bit mask, return RTX to compare the `alternative'
   attribute with the value represented by that bit.   

References mk_attr_alt().

Referenced by simplify_test_exp().

static void make_automaton_attrs ( )
static
static rtx make_canonical ( )
static
Given a valid expression for an attribute value, remove any IF_THEN_ELSE
   expressions by converting them into a COND.  This removes cases from this
   program.  Also, replace an attribute value of "*" with the default attribute
   value.   

References check_attr_value(), copy_boolean(), attr_desc::default_val, exp(), fatal(), attr_desc::is_const, make_numeric_value(), rtvec_alloc(), rtx_equal_p(), and attr_value::value.

Referenced by get_attr_value().

static void make_internal_attr ( const char *  ,
rtx  ,
int   
)
static
static void make_internal_attr ( )
static
Create internal attribute with the given default value.   

References attr_desc::default_val, find_attr(), get_attr_value(), attr_desc::is_const, attr_desc::is_numeric, and attr_desc::is_special.

static void make_length_attrs ( )
static
Make new attributes from the `length' attribute.  The following are made,
   each corresponding to a function called from `shorten_branches' or
   `get_attr_length':

   *insn_default_length         This is the length of the insn to be returned
                                by `get_attr_length' before `shorten_branches'
                                has been called.  In each case where the length
                                depends on relative addresses, the largest
                                possible is used.  This routine is also used
                                to compute the initial size of the insn.

   *insn_variable_length_p      This returns 1 if the insn's length depends
                                on relative addresses, zero otherwise.

   *insn_current_length         This is only called when it is known that the
                                insn has a variable length and returns the
                                current length, based on relative addresses.

References insn_ent::def, attr_desc::default_val, fatal(), find_attr(), attr_value::first_insn, attr_desc::first_value, get_attr_value(), identity_fn(), insert_insn_ent(), insn_def::insn_code, attr_desc::is_const, attr_desc::is_numeric, attr_desc::is_special, length_str, make_internal_attr(), max_fn(), min_fn(), insn_ent::next, attr_value::next, one_fn(), substitute_address(), attr_value::value, and zero_fn().

Referenced by main().

static rtx make_numeric_value ( int  )
static
static rtx make_numeric_value ( )
static
Return (attr_value "n")  

References attr_printf(), attr_rtx(), and exp().

static int max_attr_value ( rtx  ,
int *   
)
static

Referenced by max_attr_value(), and max_fn().

static int max_attr_value ( )
static
Given an attribute value, return the maximum CONST_STRING argument
   encountered.  Set *UNKNOWNP and return INT_MAX if the value is unknown.   

References max_attr_value().

static rtx max_fn ( rtx  )
static

Referenced by make_length_attrs().

static rtx max_fn ( )
static
static int min_attr_value ( rtx  ,
int *   
)
static

Referenced by min_attr_value(), and min_fn().

static int min_attr_value ( )
static
Given an attribute value, return the minimum CONST_STRING argument
   encountered.  Set *UNKNOWNP and return 0 if the value is unknown.   

References min_attr_value().

static rtx min_fn ( rtx  )
static

Referenced by make_length_attrs().

static rtx min_fn ( )
static
static rtx mk_attr_alt ( int  )
static
static rtx mk_attr_alt ( )
static
Return EQ_ATTR_ALT expression representing set containing elements set
   in E.   
static char* next_comma_elt ( const char **  )
static
static char* next_comma_elt ( )
static
This page contains miscellaneous utility routines.   
Given a pointer to a (char *), return a malloc'ed string containing the
   next comma-separated element.  Advance the pointer to after the string
   scanned, or the end-of-string.  Return NULL if at end of string.   

References attr_string(), and scan_comma_elt().

static rtx one_fn ( rtx  )
static

Referenced by make_length_attrs().

static rtx one_fn ( )
static

References make_numeric_value().

static FILE* open_outfile ( )
static

References errno, fatal(), and write_header().

Referenced by main().

static void optimize_attrs ( )
static
static int or_attr_value ( rtx  ,
int *   
)
static
static int or_attr_value ( )
static
Given an attribute value, return the result of ORing together all
   CONST_STRING arguments encountered.  Set *UNKNOWNP and return -1
   if the numeric value is not known.   

References or_attr_value().

static void process_bypasses ( )
static
Find and mark all of the bypassed insns.   

References insn_reserv::bypassed, insn_reserv::name, insn_reserv::next, bypass_list::next, and bypass_list::pattern.

Referenced by make_automaton_attrs().

static void remove_insn_ent ( )
static
static rtx simplify_and_tree ( )
static
This routine is called when an AND of a term with a tree of AND's is
   encountered.  If the term or its complement is present in the tree, it
   can be replaced with TRUE or FALSE, respectively.

   Note that (eq_attr "att" "v1") and (eq_attr "att" "v2") cannot both
   be true and hence are complementary.

   There is one special case:  If we see
        (and (not (eq_attr "att" "v1"))
             (eq_attr "att" "v2"))
   this can be replaced by (eq_attr "att" "v2").  To do this we need to
   replace the term, not anything in the AND tree.  So we pass a pointer to
   the term.   

References attr_alt_subset_of_compl_p(), attr_alt_subset_p(), attr_equal_p(), attr_rtx(), exp(), false_rtx, simplify_test_exp_in_temp(), and true_rtx.

Referenced by eliminate_known_true(), make_automaton_attrs(), and simplify_test_exp().

static rtx simplify_cond ( )
static
Take a COND expression and see if any of the conditions in it can be
   simplified.  If any are known true or known false for the particular insn
   code, the COND can be further simplified.

   Also call ourselves on any COND operations that are values of this COND.

   We do not modify EXP; rather, we make and return a new rtx.   

References attr_equal_p(), exp(), false_rtx, free(), insert_right_side(), len, memcpy(), rtl_obstack, rtvec_alloc(), simplify_test_exp_in_temp(), and true_rtx.

Referenced by optimize_attrs().

static rtx simplify_or_tree ( )
static
Similar to `simplify_and_tree', but for IOR trees.   

References attr_equal_p(), attr_rtx(), exp(), false_rtx, simplify_test_exp_in_temp(), and true_rtx.

Referenced by simplify_test_exp().

static rtx simplify_test_exp ( rtx  ,
int  ,
int   
)
static
static rtx simplify_test_exp ( )
static
Given an expression, see if it can be simplified for a particular insn
   code based on the values of other attributes being tested.  This can
   eliminate nested get_attr_... calls.

   Note that if an endless recursion is specified in the patterns, the
   optimization will loop.  However, it will do so in precisely the cases where
   an infinite recursion loop could occur during compilation.  It's better that
   it occurs here!   

References alternative_name, attr_value_list::attr, attr_alt_complement(), attr_alt_intersection(), attr_alt_union(), attr_equal_p(), attr_rtx(), attr_rtx_cost(), attr_value_list::av, compute_alternative_mask(), copy_rtx_unchanging(), insn_ent::def, evaluate_eq_attr(), exp(), false_rtx, fatal(), find_attr(), attr_value::first_insn, attr_desc::first_value, insn_alternatives, insn_def::insn_code, make_alternative_compare(), mk_attr_alt(), insn_ent::next, attr_value::next, attr_value_list::next, simplify_and_tree(), simplify_or_tree(), simplify_test_exp(), true_rtx, and attr_value::value.

static rtx simplify_test_exp_in_temp ( rtx  ,
int  ,
int   
)
static
static rtx simplify_test_exp_in_temp ( )
static
Simplify test expression and use temporary obstack in order to avoid
   memory bloat.  Use ATTR_IND_SIMPLIFIED to avoid unnecessary simplifications
   and avoid unnecessary copying if possible.   

References attr_copy_rtx(), exp(), obstack, rtl_obstack, simplify_test_exp(), and temp_obstack.

static rtx substitute_address ( rtx  exp,
rtx(*)(rtx no_address_fn,
rtx(*)(rtx address_fn 
)
static
Given an expression EXP, see if it is a COND or IF_THEN_ELSE that has a
   test that checks relative positions of insns (uses MATCH_DUP or PC).
   If so, replace it with what is obtained by passing the expression to
   ADDRESS_FN.  If not but it is a COND or IF_THEN_ELSE, call this routine
   recursively on each value (including the default value).  Otherwise,
   return the value returned by NO_ADDRESS_FN applied to EXP.   

References address_used, attr_rtx(), exp(), rtvec_alloc(), and walk_attr_value().

Referenced by make_length_attrs().

static int tests_attr_p ( )
static
Return 1 if any EQ_ATTR subexpression of P refers to ATTR,
   otherwise return 0.   

References attr_value_list::ie, and attr_desc::name.

Referenced by get_attr_order().

static void walk_attr_value ( rtx  )
static
static void walk_attr_value ( )
static
Scan an attribute value, possibly a conditional, and record what actions
   will be required to do any conditional tests in it.

   Specifically, set
        `must_extract'    if we need to extract the insn operands
        `must_constrain'  if we must compute `which_alternative'
        `address_used'    if an address expression was used
        `length_used'     if an (eq_attr "length" ...) was used

References address_used, alternative_name, length_str, length_used, must_constrain, must_extract, and walk_attr_value().

static void write_attr_case ( FILE *  outf,
struct attr_desc attr,
struct attr_value av,
int  write_case_lines,
const char *  prefix,
const char *  suffix,
int  indent,
rtx  known_true 
)
static
static void write_attr_set ( FILE *  outf,
struct attr_desc attr,
int  indent,
rtx  value,
const char *  prefix,
const char *  suffix,
rtx  known_true,
int  insn_code,
int  insn_index,
unsigned int  attrs_cached 
)
static
Write out a series of tests and assignment statements to perform tests and
   sets of an attribute value.  We are passed an indentation amount and prefix
   and suffix strings to write around each attribute value (e.g., "return"
   and ";").   

References attr_rtx(), attrs_cached_after, attrs_seen_more_than_once, attr_desc::default_val, eliminate_known_true(), false_rtx, find_attrs_to_cache(), insert_right_side(), true_rtx, write_attr_value(), write_indent(), and write_test_expr().

Referenced by write_attr_case(), and write_attr_get().

static void write_attr_value ( FILE *  ,
struct attr_desc ,
rtx   
)
static

Referenced by write_attr_set(), and write_attr_value().

static void write_attr_valueq ( FILE *  ,
struct attr_desc ,
const char *   
)
static
static void write_attr_valueq ( )
static
Utilities to write in various forms.   

References attr_desc::enum_name, attr_desc::is_numeric, attr_desc::name, and write_upcase().

static void write_const_num_delay_slots ( )
static
Determine if an insn has a constant number of delay slots, i.e., the
   number of delay slots is not a function of the length of the insn.   

References find_attr(), attr_value::first_insn, attr_desc::first_value, length_used, attr_value::next, num_delay_slots_str, attr_value::value, walk_attr_value(), and write_insn_cases().

Referenced by main().

static void write_eligible_delay ( )
static
Write a subroutine that is given an insn that requires a delay slot, a
   delay slot ordinal, and a candidate insn.  It returns nonzero if the
   candidate can be placed in the specified delay slot of the insn.

   We can write as many as three subroutines.  `eligible_for_delay'
   handles normal delay slots, `eligible_for_annul_true' indicates that
   the specified insn can be annulled if the branch is true, and likewise
   for `eligible_for_annul_false'.

   KIND is a string distinguishing these three cases ("delay", "annul_true",
   or "annul_false").   

References delay_desc::def, delay_1_0_str, delay_type_str, find_attr(), find_most_used(), attr_desc::first_value, attr_value::next, delay_desc::next, delay_desc::num, num_delays, true_rtx, and write_attr_case().

Referenced by main().

static void write_header ( void  )
static

Referenced by open_outfile().

static void write_indent ( FILE *  ,
int   
)
static
static void write_indent ( )
static

References indent.

static void write_insn_cases ( )
static
Write a series of case statements for every instruction in list IE.
   INDENT is the amount of indentation to write before each case.   

References insn_def::def, insn_ent::def, insn_def::insn_code, insn_def::lineno, insn_ent::next, and write_indent().

Referenced by write_attr_case(), and write_const_num_delay_slots().

static void write_upcase ( FILE *  ,
const char *   
)
static
static void write_upcase ( )
static
static rtx zero_fn ( rtx  )
static

Referenced by make_length_attrs().

static rtx zero_fn ( )
static

References make_numeric_value().


Variable Documentation

int address_used
static
struct bypass_list* all_bypasses
static

Referenced by gen_bypass_1().

struct insn_reserv* all_insn_reservs = 0
static
FILE* attr_file
static

Referenced by main().

const char* attr_file_name = NULL
static
This gen* file is unique, in that it writes out multiple files.

   Before GCC 4.8, insn-attrtab.c was written out containing many large
   functions and tables.  This made insn-attrtab.c _the_ bottle-neck in
   a parallel build, and even made it impossible to build GCC on machines
   with relatively small RAM space (PR other/29442).  Therefore, the
   atrribute functions/tables are now written out to three separate
   files: all "*insn_default_latency" functions go to LATENCY_FILE_NAME,
   all "*internal_dfa_insn_code" functions go to DFA_FILE_NAME, and the
   rest goes to ATTR_FILE_NAME.   
struct attr_hash* attr_hash_table[RTL_HASH_SIZE]
static
struct attr_desc* attrs[MAX_ATTRS_INDEX]
static
unsigned int attrs_cached_after
static

Referenced by write_attr_set().

unsigned int attrs_cached_inside
static
unsigned int attrs_seen_more_than_once
static

Referenced by write_attr_set().

unsigned int attrs_seen_once
static
Bitmasks of possibly cached attributes.   
unsigned int attrs_to_cache
static
int cached_attr_count
static
Number of such attributes.   

Referenced by find_attrs_to_cache(), write_attr_get(), and write_test_expr().

const char* cached_attrs[32]
static
Names of attributes that could be possibly cached.   
const char* delay_1_0_str
static

Referenced by main(), and write_eligible_delay().

const char* delay_type_str
static
struct delay_desc* delays
static

Referenced by gen_delay().

FILE * dfa_file
static

Referenced by main().

const char* dfa_file_name = NULL
static
int got_define_asm_attributes
static

Referenced by gen_insn(), and main().

struct obstack* hash_obstack = &obstack1
static
int have_annul_false
static

Referenced by expand_delays(), gen_delay(), and main().

int have_annul_true
static

Referenced by expand_delays(), gen_delay(), and main().

int* insn_alternatives
static
Stores, for each insn code, a bitmap that has bits on for each possible
   alternative.   

Referenced by get_attr_value(), main(), and simplify_test_exp().

int insn_code_number
static
struct attr_value_list** insn_code_values
int insn_index_number
static

Referenced by gen_insn(), and main().

int* insn_n_alternatives
static
Stores, for each insn code, the number of constraint alternatives.   

Referenced by main().

struct insn_reserv** last_insn_reserv_p = &all_insn_reservs
static
FILE * latency_file
static

Referenced by main().

const char* latency_file_name = NULL
static
const char* length_str
static
int length_used
static
int must_constrain
static

Referenced by walk_attr_value(), and write_attr_case().

int must_extract
static

Referenced by walk_attr_value(), and write_attr_case().

size_t n_bypasses
static
size_t n_insn_reservs
static

Referenced by gen_insn_reserv().

const char* num_delay_slots_str
static
int num_delays
static
int num_insn_ents
static
struct obstack obstack1 obstack2
static
struct obstack* temp_obstack = &obstack2
static