GCC Middle and Back End API 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_desc * | find_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_value * | find_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_value * | get_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_desc * | find_attr () |
static void | make_internal_attr () |
static struct attr_value * | find_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_desc * | find_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 obstack * | hash_obstack = &obstack1 |
static struct obstack * | temp_obstack = &obstack2 |
static struct attr_desc * | attrs [MAX_ATTRS_INDEX] |
static struct insn_def * | defs |
static struct delay_desc * | delays |
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_hash * | attr_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_reserv * | all_insn_reservs = 0 |
static struct insn_reserv ** | last_insn_reserv_p = &all_insn_reservs |
static size_t | n_insn_reservs |
static struct bypass_list * | all_bypasses |
static size_t | n_bypasses |
|
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 |
Return EQ_ATTR_ALT expression representing complement of S.
Referenced by simplify_test_exp().
|
static |
Return EQ_ATTR_ALT expression representing intersection of S1 and S2.
Referenced by simplify_test_exp().
Referenced by simplify_and_tree().
|
static |
Returns true if S1 is a subset of complement of S2.
Referenced by simplify_and_tree().
|
static |
Returns true if S1 is a subset of S2.
|
static |
Return EQ_ATTR_ALT expression representing union of S1 and S2.
Referenced by simplify_test_exp().
|
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 |
References attr_rtx().
Referenced by check_attr_test(), and convert_set_attr_alternative().
|
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 |
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 |
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 |
References make_numeric_value().
Referenced by convert_set_attr_alternative().
|
static |
Referenced by expand_delays(), and make_numeric_value().
|
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 |
References attr_rtx_1().
Referenced by add_attr_value(), attr_eq(), check_attr_test(), check_attr_value(), convert_set_attr(), convert_set_attr_alternative(), copy_boolean(), evaluate_eq_attr(), expand_delays(), insert_right_side(), make_automaton_attrs(), make_numeric_value(), simplify_and_tree(), simplify_or_tree(), simplify_test_exp(), substitute_address(), and write_attr_set().
|
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 |
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 |
Forward declarations of functions used before their definitions, only.
Referenced by gen_bypass_1(), and next_comma_elt().
|
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 |
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 |
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 |
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 |
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 |
Referenced by clear_struct_flag(), and optimize_attrs().
|
static |
Clear the ATTR_CURR_SIMPLIFIED_P flag in EXP and its subexpressions.
References clear_struct_flag().
|
static |
Referenced by compares_alternatives_p(), and get_attr_value().
|
static |
Returns nonzero if the given expression contains an EQ_ATTR with the `alternative' attribute.
References alternative_name, and compares_alternatives_p().
|
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 |
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 |
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().
Referenced by copy_boolean(), and make_canonical().
|
static |
References attr_rtx(), copy_boolean(), and exp().
Referenced by evaluate_eq_attr(), and simplify_test_exp().
|
static |
|
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 |
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 |
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 |
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 |
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().
|
staticread |
Referenced by check_attr_test(), check_attr_value(), check_defs(), evaluate_eq_attr(), find_attrs_to_cache(), find_tune_attr(), gen_attr(), make_internal_attr(), make_length_attrs(), simplify_test_exp(), write_attr_get(), write_attr_value(), write_const_num_delay_slots(), write_eligible_delay(), write_length_unit_log(), and write_test_expr().
|
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 |
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().
|
staticread |
Referenced by write_attr_get(), and write_eligible_delay().
|
staticread |
Find the most used value of an attribute.
References attr_desc::first_value, attr_value::next, and attr_value::num_insns.
|
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 |
Create table entries for DEFINE_ATTR or DEFINE_ENUM_ATTR.
References add_attr_value(), check_attr_value(), attr_desc::default_val, attr_desc::enum_name, error_with_line(), find_attr(), get_attr_value(), attr_desc::is_const, attr_desc::is_numeric, length_str, attr_desc::lineno, lookup_enum_type(), enum_type::md_p, message_with_line(), enum_value::name, attr_desc::name, enum_value::next, next_comma_elt(), and enum_type::values.
Referenced by main().
|
static |
References gen_bypass_1().
Referenced by main().
|
static |
References all_bypasses, attr_string(), bypass_list::next, and bypass_list::pattern.
Referenced by gen_bypass().
|
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 |
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 |
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 |
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().
|
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 |
Referenced by main().
Referenced by make_length_attrs().
|
static |
Referenced by fill_attr(), make_length_attrs(), and optimize_attrs().
|
static |
Insert an insn entry in an attribute value list.
References insn_ent::def, attr_value::first_insn, attr_value::has_asm_insn, insn_def::insn_code, insn_ent::next, num_insn_ents, and attr_value::num_insns.
Referenced by check_attr_test(), evaluate_eq_attr(), insert_right_side(), simplify_cond(), and write_attr_set().
|
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.
int main | ( | ) |
References alternative_name, attr_file, check_attr_value(), check_defs(), attr_desc::default_val, delay_1_0_str, delay_type_str, dfa_file, errno, expand_delays(), false_rtx, fatal(), fill_attr(), gen_attr(), gen_bypass(), gen_delay(), gen_insn(), gen_insn_reserv(), got_define_asm_attributes, handle_arg(), hash_obstack, have_annul_false, have_annul_true, have_error, init_rtx_reader_args_cb(), insn_alternatives, insn_def::insn_code, insn_code_number, insn_index_number, insn_n_alternatives, attr_desc::is_const, attr_desc::is_special, latency_file, length_str, insn_def::lineno, make_automaton_attrs(), make_length_attrs(), insn_def::next, attr_desc::next, num_delay_slots_str, num_delays, open_outfile(), optimize_attrs(), progname, read_md_rtx(), rtvec_alloc(), temp_obstack, true_rtx, attr_value::value, write_attr_get(), write_const_num_delay_slots(), write_eligible_delay(), and write_length_unit_log().
|
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 |
Create all of the attributes that describe automaton properties. Write the DFA and latency function prototypes to the files that need to have them, and write the init_sched_attrs().
References attr_rtx(), insn_reserv::bypassed, insn_reserv::condexp, insn_reserv::default_latency, attr_desc::default_val, false_rtx, find_tune_attr(), first, attr_desc::first_value, insn_reserv::insn_num, attr_desc::is_const, attr_desc::is_numeric, attr_desc::is_special, make_internal_attr(), make_numeric_value(), attr_desc::name, attr_value::next, insn_reserv::next, process_bypasses(), rtvec_alloc(), simplify_and_tree(), strlen(), true_rtx, attr_value::value, and write_test_expr().
Referenced by main().
|
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 |
Referenced by expand_delays(), make_automaton_attrs(), and make_length_attrs().
|
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 |
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 |
Referenced by attr_numeral(), expand_delays(), make_automaton_attrs(), make_canonical(), max_fn(), min_fn(), one_fn(), and zero_fn().
|
static |
Return (attr_value "n")
References attr_printf(), attr_rtx(), and exp().
|
static |
Referenced by max_attr_value(), and max_fn().
|
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().
Referenced by make_length_attrs().
|
static |
References make_numeric_value(), max_attr_value(), and unknown.
|
static |
Referenced by min_attr_value(), and min_fn().
|
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().
Referenced by make_length_attrs().
|
static |
References make_numeric_value(), min_attr_value(), and unknown.
|
static |
Referenced by check_attr_test(), make_alternative_compare(), and simplify_test_exp().
|
static |
Return EQ_ATTR_ALT expression representing set containing elements set in E.
|
static |
Referenced by check_attr_test(), convert_set_attr(), and gen_attr().
|
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().
Referenced by make_length_attrs().
|
static |
References make_numeric_value().
|
static |
References errno, fatal(), and write_header().
Referenced by main().
|
static |
Optimize the attribute lists by seeing if we can determine conditional values from the known values of other attributes. This will save subroutine calls during the compilation.
References attr_value_list::attr, attr_copy_rtx(), attr_rtx_cost(), attr_value_list::av, clear_struct_flag(), insn_ent::def, attr_value::first_insn, attr_desc::first_value, free(), get_attr_order(), get_attr_value(), attr_value_list::ie, insert_insn_ent(), insn_def::insn_code, insn_code_number, insn_def::insn_index, insn_ent::next, attr_value::next, attr_value_list::next, num_insn_ents, obstack, remove_insn_ent(), rtl_obstack, simplify_cond(), temp_obstack, and attr_value::value.
Referenced by main().
|
static |
Referenced by or_attr_value(), and write_length_unit_log().
|
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 |
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 |
Remove an insn entry from an attribute value.
References insn_ent::def, attr_value::first_insn, attr_value::has_asm_insn, insn_def::insn_code, insn_ent::next, num_insn_ents, and attr_value::num_insns.
Referenced by optimize_attrs().
|
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 |
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 |
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().
Referenced by simplify_test_exp(), and simplify_test_exp_in_temp().
|
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.
Referenced by evaluate_eq_attr(), insert_right_side(), simplify_and_tree(), simplify_cond(), and simplify_or_tree().
|
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.
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 |
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 |
Referenced by evaluate_eq_attr(), substitute_address(), walk_attr_value(), write_attr_case(), and write_const_num_delay_slots().
|
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 |
Write out the computation for one attribute value.
References address_used, insn_ent::def, attr_value::first_insn, attr_value::has_asm_insn, insn_def::insn_code, insn_def::insn_index, must_constrain, must_extract, attr_value::num_insns, attr_value::value, walk_attr_value(), write_attr_set(), write_indent(), and write_insn_cases().
Referenced by write_attr_get(), and write_eligible_delay().
|
static |
Write out a function to obtain the attribute for a given INSN.
References cached_attr_count, insn_ent::def, attr_desc::enum_name, find_attr(), find_attrs_to_cache(), find_most_used(), attr_value::first_insn, attr_desc::first_value, insn_def::insn_code, insn_def::insn_index, attr_desc::is_const, attr_desc::is_numeric, attr_desc::name, attr_value::next, attr_value::num_insns, true_rtx, attr_value::value, write_attr_case(), and write_attr_set().
Referenced by main().
|
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().
Referenced by write_attr_set(), and write_attr_value().
|
static |
|
static |
Referenced by write_attr_value(), and write_test_expr().
|
static |
Utilities to write in various forms.
References attr_desc::enum_name, attr_desc::is_numeric, attr_desc::name, and write_upcase().
|
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 |
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 |
Referenced by open_outfile().
|
static |
Referenced by write_attr_case(), write_attr_set(), and write_insn_cases().
|
static |
References indent.
|
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 |
References attr_desc::default_val, find_attr(), attr_value::first_insn, attr_desc::first_value, length_str, length_unit_log, insn_ent::next, attr_value::next, or_attr_value(), unknown, and attr_value::value.
Referenced by main().
|
static |
References alternative_name, cached_attr_count, comparison_operator(), attr_desc::default_val, evaluate_eq_attr(), fatal(), find_attr(), fprint_c_condition(), HOST_WIDE_INT_PRINT_DEC, attr_desc::is_const, attr_desc::name, attr_value::value, and write_attr_valueq().
Referenced by make_automaton_attrs(), and write_attr_set().
|
static |
|
static |
Referenced by make_length_attrs().
|
static |
References make_numeric_value().
|
static |
Referenced by evaluate_eq_attr(), substitute_address(), walk_attr_value(), and write_attr_case().
|
static |
Referenced by gen_bypass_1().
|
static |
|
static |
Used to reduce calls to `strcmp'
Referenced by attr_rtx_cost(), compares_alternatives_p(), compute_alternative_mask(), convert_set_attr_alternative(), find_attr(), find_attrs_to_cache(), find_tune_attr(), main(), simplify_test_exp(), walk_attr_value(), and write_test_expr().
|
static |
Referenced by main().
|
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.
|
static |
|
static |
Referenced by write_attr_set().
|
static |
|
static |
Referenced by write_attr_set().
|
static |
Bitmasks of possibly cached attributes.
|
static |
|
static |
Number of such attributes.
Referenced by find_attrs_to_cache(), write_attr_get(), and write_test_expr().
|
static |
Names of attributes that could be possibly cached.
|
static |
|
static |
Referenced by main(), and write_eligible_delay().
|
static |
Referenced by expand_delays(), main(), and write_eligible_delay().
|
static |
Referenced by gen_delay().
|
static |
Referenced by main().
|
static |
|
static |
Referenced by attr_rtx_1(), check_attr_test(), combine_simplify_rtx(), evaluate_eq_attr(), expand_delays(), fold_rtx(), insert_right_side(), main(), make_automaton_attrs(), prepare_float_lib_cmp(), simplify_and_tree(), simplify_cond(), simplify_if_then_else(), simplify_or_tree(), simplify_set(), simplify_test_exp(), and write_attr_set().
|
static |
Referenced by gen_insn(), and main().
|
static |
Referenced by attr_hash_add_rtx(), attr_hash_add_string(), attr_rtx_1(), attr_string(), and main().
|
static |
Referenced by expand_delays(), gen_delay(), and main().
|
static |
Referenced by expand_delays(), gen_delay(), and main().
|
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().
|
static |
Other variables.
Referenced by final_scan_insn(), find_reloads(), gen_insn(), main(), optimize_attrs(), recog_for_combine(), and try_combine().
struct attr_value_list** insn_code_values |
|
static |
Referenced by gen_insn(), and main().
|
static |
Stores, for each insn code, the number of constraint alternatives.
Referenced by main().
|
static |
|
static |
Referenced by main().
|
static |
|
static |
Referenced by gen_attr(), main(), make_length_attrs(), walk_attr_value(), and write_length_unit_log().
|
static |
Referenced by walk_attr_value(), and write_const_num_delay_slots().
|
static |
Referenced by walk_attr_value(), and write_attr_case().
|
static |
Referenced by walk_attr_value(), and write_attr_case().
|
static |
|
static |
Referenced by gen_insn_reserv().
|
static |
Referenced by expand_delays(), main(), and write_const_num_delay_slots().
|
static |
Referenced by expand_delays(), gen_delay(), main(), and write_eligible_delay().
|
static |
Referenced by insert_insn_ent(), optimize_attrs(), and remove_insn_ent().
|
static |
Referenced by main(), optimize_attrs(), and simplify_test_exp_in_temp().
|
static |
Used to simplify expressions.
Referenced by attr_rtx_1(), check_attr_test(), combine_simplify_rtx(), evaluate_eq_attr(), fold_rtx(), insert_right_side(), main(), make_automaton_attrs(), prepare_float_lib_cmp(), simplify_and_tree(), simplify_cond(), simplify_if_then_else(), simplify_or_tree(), simplify_set(), simplify_test_exp(), write_attr_get(), write_attr_set(), and write_eligible_delay().