GCC Middle and Back End API Reference
|
Data Structures | |
struct | queue_elem |
struct | std_pred_table |
Typedefs | |
typedef const char *(* | constraints_handler_t )(const char *, int) |
typedef const char*(* constraints_handler_t)(const char *, int) |
void add_c_test | ( | ) |
Record the C test expression EXPR in the condition_table, with value VAL. Duplicates clobber previous entries.
References condition_table, c_test::expr, and c_test::value.
Referenced by main(), and read_conditions().
|
static |
Build a define_attr for an binary attribute with name NAME and possible values "yes" and "no", and queue it.
References queue_elem::data, define_attr_queue, queue_elem::filename, queue_elem::lineno, and queue_elem::next.
Referenced by alter_attrs_for_insn().
|
static |
Add mnemonic STR with length LEN to the mnemonic hash table MNEMONIC_HTAB. A trailing zero end character is appendend to STR and a permanent heap copy of STR is created.
Referenced by gen_mnemonic_attr(), and gen_mnemonic_setattr().
void add_predicate | ( | ) |
References error(), pred_data::name, and pred_data::next.
Referenced by init_predicate_table(), and process_define_predicate().
void add_predicate_code | ( | ) |
Record that predicate PRED can accept CODE.
References pred_data::allows_non_const, pred_data::allows_non_lvalue, pred_data::codes, pred_data::num_codes, RTX_CONST_OBJ, and pred_data::singleton.
Referenced by init_predicate_table(), and process_define_predicate().
Referenced by process_substs_on_one_elem().
|
static |
If output pattern of define_subst contains MATCH_DUP, then this expression would be replaced with the pattern, matched with MATCH_OPERAND from input pattern. This pattern could contain any number of MATCH_OPERANDs, MATCH_OPERATORs etc., so it's possible that a MATCH_OPERAND from output_pattern (if any) would have the same number, as MATCH_OPERAND from copied pattern. To avoid such indexes overlapping, we assign new indexes to MATCH_OPERANDs, laying in the output pattern outside of MATCH_DUPs.
References mark_operands_used_in_match_dup(), and renumerate_operands_in_pattern().
|
static |
Alter the attribute vector of INSN, which is a COND_EXEC variant created from a define_insn pattern. We must modify the "predicable" attribute to be named "ce_enabled", and also change any "enabled" attribute that's present so that it takes ce_enabled into account. We rely on the fact that INSN was created with copy_rtx, and modify data in-place.
References add_define_attr(), queue_elem::data, modify_attr_enabled_ce(), queue_elem::next, rtvec_alloc(), and SET.
Referenced by process_one_cond_exec().
|
static |
Referenced by process_substs_on_one_elem().
|
static |
As number of constraints is changed after define_subst, we need to process attributes as well - we need to duplicate them the same way that we duplicated constraints in original pattern ELEM is a queue element, containing our rtl-template, N_DUP - multiplication factor.
References queue_elem::data, duplicate_alternatives(), error_with_line(), queue_elem::lineno, and SET.
|
static |
Referenced by alter_constraints(), process_substs_on_one_elem(), and subst_dup().
|
static |
Duplicate constraints in PATTERN. If pattern is from original rtl-template, we need to duplicate each alternative - for that we need to use duplicate_each_alternative () as a functor ALTER. If pattern is from output-pattern of define_subst, we need to duplicate constraints in another way - with duplicate_alternatives (). N_DUP is multiplication factor.
References alter_constraints(), and len.
|
static |
References queue_elem::data, len, memcpy(), shift_output_template(), and strlen().
Referenced by process_one_cond_exec().
|
static |
Referenced by process_substs_on_one_elem().
|
static |
Alter the output of INSN whose pattern was modified by DEFINE_SUBST. We must replicate output strings according to the new number of alternatives ALT in substituted pattern. If ALT equals 1, output has one alternative or defined by C code, then output is returned without any changes.
Referenced by alter_predicate_for_insn(), and process_one_cond_exec().
|
static |
References alter_predicate_for_insn(), error_with_line(), len, memcpy(), n_alternatives(), and strlen().
|
static |
References queue_elem::data, and join_c_conditions().
Referenced by process_one_cond_exec().
|
static |
Find attribute SUBST in ELEM and assign NEW_VALUE to it.
References queue_elem::data.
Referenced by process_substs_on_one_elem().
|
static |
Check if there are DEFINE_ATTRs with the same name.
References queue_elem::data, error_with_line(), htab_eq_string(), queue_elem::lineno, and queue_elem::next.
Referenced by init_rtx_reader_args_cb().
int cmp_c_test | ( | ) |
Compare two c_test expression structures.
References c_test::expr.
Referenced by init_rtx_reader_args_cb().
|
static |
Referenced by collect_insn_data(), and process_one_cond_exec().
|
static |
Determine how many alternatives there are in INSN, and how many operands.
References collect_insn_data(), len, and n_alternatives().
|
static |
Recursively calculate the set of rtx codes accepted by the predicate expression EXP, writing the result to CODES. LINENO is the line number on which the directive containing EXP appeared.
References pred_data::codes, error_with_line(), lookup_predicate(), memset(), message_with_line(), NUM_RTX_CODE, and scan_comma_elt().
Referenced by process_define_predicate().
|
static |
Referenced by alter_attrs_for_subst_insn(), and subst_dup().
|
static |
|
static |
Referenced by process_substs_on_one_elem().
|
static |
|
static |
References pred_data::name.
Referenced by init_predicate_table().
|
static |
This is subroutine of renumerate_operands_in_pattern. It finds first not-occupied operand-index.
References used_operands_numbers.
Referenced by renumerate_operands_in_pattern().
|
static |
Generate (set_attr "mnemonic" "..") RTXs and append them to every insn definition in case the back end requests it by defining the mnemonic attribute. The values for the attribute will be extracted from the output patterns of the insn definitions as far as possible.
References add_mnemonic_string(), queue_elem::data, define_attr_tail, free(), gen_mnemonic_setattr(), have_error, htab_eq_string(), mnemonic_htab_callback(), queue_elem::next, scan_comma_elt(), and string_obstack.
Referenced by init_rtx_reader_args_cb().
|
static |
Scan INSN for mnemonic strings and add them to the mnemonic hash table in MNEMONIC_HTAB. The mnemonics cannot be found if they are emitted using C code. If a mnemonic string contains ';' or a newline the string assumed to consist of more than a single instruction. The attribute value will then be set to the user defined default value.
References add_mnemonic_string(), rtvec_alloc(), string_obstack, and strlen().
Referenced by gen_mnemonic_attr().
rtx gen_rtx_CONST_INT | ( | enum machine_mode | ARG_UNUSEDmode, |
HOST_WIDE_INT | arg | ||
) |
Make a version of gen_rtx_CONST_INT so that GEN_INT can be used in the gensupport programs.
|
static |
Generate RTL expression (match_dup OPNO)
Referenced by replace_duplicating_operands_in_pattern().
|
static |
Referenced by get_alternatives_number(), and process_substs_on_one_elem().
|
static |
The routine scans rtl PATTERN, find match_operand in it and counts number of alternatives. If PATTERN contains several match_operands with different number of alternatives, error is emitted, and the routine returns 0. If all match_operands in PATTERN have the same number of alternatives, it's stored in N_ALT, and the routine returns 1. Argument LINENO is used in when the error is emitted.
References error_with_line(), get_alternatives_number(), len, and n_alternatives().
const char* get_insn_name | ( | ) |
Referenced by curr_insn_transform(), main(), merge_accept_insn(), print_rtx(), and write_action().
void get_pattern_stats | ( | ) |
Make STATS describe the operands that appear in instruction pattern PATTERN.
References get_pattern_stats_1(), len, pattern_stats::max_dup_opno, pattern_stats::max_opno, pattern_stats::max_scratch_opno, pattern_stats::num_dups, pattern_stats::num_generator_args, pattern_stats::num_insn_operands, and pattern_stats::num_operand_vars.
Referenced by gen_expand(), gen_insn(), gen_peephole(), and gen_split().
|
static |
Make STATS describe the operands that appear in rtx X.
References len, pattern_stats::max_dup_opno, pattern_stats::max_opno, pattern_stats::max_scratch_opno, and pattern_stats::num_dups.
Referenced by get_pattern_stats().
|
static |
Referenced by process_substs_on_one_elem().
|
static |
Return true if ELEM has the attribute with the name of DEFINE_SUBST represented by SUBST_ELEM and this attribute has value SUBST_TRUE. DEFINE_SUBST isn't applied to patterns without such attribute. In other words, we suppose the default value of the attribute to be 'no' since it is always generated automaticaly in read-rtl.c.
References queue_elem::data, error_with_line(), queue_elem::lineno, SET, subst_false, and subst_true.
hashval_t hash_c_test | ( | ) |
Helper functions for insn elision.
Compute a hash function of a c_test structure, which is keyed by its ->expr field.
References c_test::expr, and len.
Referenced by init_rtx_reader_args_cb().
|
static |
References pred_data::name.
Referenced by init_predicate_table().
|
static |
Comparison function for the mnemonic hash table.
Referenced by check_define_attr_duplicates(), and gen_mnemonic_attr().
|
static |
Examine the attribute "predicable"; discover its boolean values and its default.
References queue_elem::data, error_with_line(), free(), queue_elem::lineno, queue_elem::next, predicable_default, predicable_false, and predicable_true.
Referenced by process_define_cond_exec().
|
static |
Initialize the table of predicate definitions, starting with the information we have on generic predicates.
References add_predicate(), add_predicate_code(), pred_data::codes, std_pred_table::codes, eq_struct_pred_data(), free(), hash_struct_pred_data(), pred_data::name, std_pred_table::name, NUM_RTX_CODE, RTX_CONST_OBJ, pred_data::special, and std_pred_table::special.
Referenced by init_rtx_reader_args_cb().
bool init_rtx_reader_args | ( | ) |
Programs that don't have their own options can use this entry point instead.
References init_rtx_reader_args_cb().
Referenced by main().
bool init_rtx_reader_args_cb | ( | int | argc, |
char ** | argv, | ||
bool(*)(const char *) | parse_opt | ||
) |
The entry point for initializing the reader.
References check_define_attr_duplicates(), cmp_c_test(), condition_table, gen_mnemonic_attr(), hash_c_test(), have_error, init_predicate_table(), process_define_cond_exec(), process_define_subst(), read_md_files(), rtl_obstack, rtx_handle_directive(), and sequence_num.
Referenced by init_rtx_reader_args(), and main().
|
static |
Referenced by process_one_cond_exec().
|
static |
Return true if attribute PREDICABLE is true for ELEM, which holds a DEFINE_INSN.
References queue_elem::data, error_with_line(), queue_elem::lineno, predicable_default, predicable_false, predicable_true, and SET.
|
read |
References pred_data::name.
Referenced by add_to_sequence(), compute_predicate_codes(), mark_mode_tests(), output_operand_data(), subst_pattern_match(), and validate_pattern().
|
static |
This is a subroutine of mark_operands_used_in_match_dup. This routine is marks all MATCH_OPERANDs inside PATTERN as occupied.
References len, and used_operands_numbers.
Referenced by mark_operands_used_in_match_dup().
|
static |
This is a subroutine of adjust_operands_numbers. It goes through all expressions in PATTERN and when MATCH_DUP is met, all MATCH_OPERANDs inside it is marked as occupied. The process of marking is done by routin mark_operands_from_match_dup.
References len, and mark_operands_from_match_dup().
Referenced by adjust_operands_numbers().
int maybe_eval_c_test | ( | ) |
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, and c_test::value.
Referenced by gen_insn(), gen_proto(), make_insn_sequence(), and read_md_rtx().
|
static |
This function is called for the elements in the mnemonic hashtable and generates a comma separated list of the mnemonics.
References string_obstack, and strlen().
Referenced by gen_mnemonic_attr().
|
static |
Modify VAL, which is an attribute expression for the "enabled" attribute, to take "ce_enabled" into account. Return the new expression.
Referenced by alter_attrs_for_insn().
|
static |
|
static |
Return the number of alternatives in constraint S.
|
static |
If we have any DEFINE_COND_EXEC patterns, expand the DEFINE_INSN patterns appropriately.
References have_error, identify_predicable_attribute(), queue_elem::next, and process_one_cond_exec().
Referenced by init_rtx_reader_args_cb().
|
static |
Process define_predicate directive DESC, which appears on line number LINENO. Compute the set of codes that can be matched, and record this as a known predicate.
References add_predicate(), add_predicate_code(), pred_data::c_block, pred_data::codes, compute_predicate_codes(), error_with_line(), pred_data::exp, pred_data::name, NUM_RTX_CODE, pred_data::special, and valid_predicate_name_p().
Referenced by process_rtx().
|
static |
If we have any DEFINE_SUBST patterns, expand DEFINE_INSN and DEFINE_EXPAND patterns appropriately.
References queue_elem::data, error_with_line(), queue_elem::lineno, queue_elem::next, and process_substs_on_one_elem().
Referenced by init_rtx_reader_args_cb().
|
static |
Referenced by process_define_cond_exec().
|
static |
Replicate insns as appropriate for the given DEFINE_COND_EXEC.
References alter_attrs_for_insn(), alter_output_for_insn(), alter_predicate_for_insn(), alter_test_for_insn(), collect_insn_data(), copy_rtx(), queue_elem::data, error_with_line(), queue_elem::filename, is_predicable(), queue_elem::lineno, queue_elem::next, queue_pattern(), read_md_filename, rtvec_alloc(), queue_elem::split, and strlen().
|
static |
Referenced by rtx_handle_directive().
|
static |
Process a top level rtx in some way, queuing as appropriate.
References copy_md_ptr_loc(), copy_rtx(), join_c_conditions(), process_define_predicate(), queue_pattern(), read_md_filename, remove_constraints(), rtvec_alloc(), and queue_elem::split.
|
static |
Try to apply define_substs to the given ELEM. Only define_substs, specified via attributes would be applied. If attribute, requiring define_subst, is set, but no define_subst was applied, ELEM would be deleted.
References adjust_operands_numbers(), alter_attrs_for_subst_insn(), alter_constraints(), alter_output_for_subst_insn(), change_subst_attribute(), copy_rtx(), queue_elem::data, duplicate_each_alternative(), get_alternatives_number(), has_subst_attribute(), join_c_conditions(), queue_elem::lineno, match_operand_entries_in_pattern, memset(), queue_elem::next, remove_constraints(), remove_from_queue(), replace_duplicating_operands_in_pattern(), rtvec_alloc(), subst_dup(), subst_false, subst_pattern_match(), and used_operands_numbers.
Referenced by process_define_subst().
|
staticread |
Queue PATTERN on LIST_TAIL. Return the address of the new queue element.
References queue_elem::data, queue_elem::filename, queue_elem::lineno, queue_elem::next, and queue_elem::split.
Referenced by process_one_cond_exec(), and process_rtx().
rtx read_md_rtx | ( | ) |
The entry point for reading a single rtx from an md file. Return the rtx, or NULL if the md file has been fully processed. Return the line where the rtx was found in LINENO. Return the number of code generating rtx'en read since the start of the md file in SEQNR.
References queue_elem::data, define_attr_queue, define_insn_queue, define_pred_queue, queue_elem::filename, free(), insn_elision, queue_elem::lineno, maybe_eval_c_test(), queue_elem::next, other_queue, queue, read_md_filename, record_insn_name(), and sequence_num.
Referenced by main().
|
static |
Referenced by read_md_rtx().
|
static |
Referenced by process_rtx(), process_substs_on_one_elem(), and remove_constraints().
|
static |
Recursively remove constraints from an rtx.
References remove_constraints().
|
static |
Remove element ELEM from QUEUE.
References queue_elem::next.
Referenced by process_substs_on_one_elem().
|
static |
This is subroutine of adjust_operands_numbers. It visits all expressions in PATTERN and assigns not-occupied operand indexes to MATCH_OPERANDs and MATCH_OPERATORs of this PATTERN.
References find_first_unused_number_of_operand(), len, and used_operands_numbers.
Referenced by adjust_operands_numbers().
Referenced by process_substs_on_one_elem(), and replace_duplicating_operands_in_pattern().
|
static |
This routine checks all match_operands in PATTERN and if some of have the same index, it replaces all of them except the first one to match_dup. Usually, match_operands with the same indexes are forbidden, but after define_subst copy an RTL-expression from original template, indexes of existed and just-copied match_operands could coincide. To fix it, we replace one of them with match_dup.
References error(), generate_match_dup(), len, match_operand_entries_in_pattern, and replace_duplicating_operands_in_pattern().
|
static |
A read_md_files callback for reading an rtx.
References queue_elem::lineno, process_rtx(), queue, and read_rtx().
Referenced by init_rtx_reader_args_cb().
|
static |
Referenced by alter_output_for_insn().
|
static |
Adjust all of the operand numbers in SRC to match the shift they'll get from an operand displacement of DISP. Return a pointer after the adjusted string.
Referenced by process_substs_on_one_elem(), and subst_dup().
|
static |
The routine modifies given input PATTERN of define_subst, replacing MATCH_DUP and MATCH_OP_DUP with operands from define_insn original pattern, whose operands are stored in OPERAND_DATA array. It also duplicates constraints in operands - constraints from define_insn operands are duplicated N_SUBST_ALT times, constraints from define_subst operands are duplicated N_ALT times. After the duplication, returned output rtl-pattern contains every combination of input constraints Vs constraints from define_subst output.
References alter_constraints(), copy_rtx(), duplicate_alternatives(), len, and subst_dup().
Referenced by process_substs_on_one_elem(), and subst_pattern_match().
|
static |
Compare RTL-template of original define_insn X to input RTL-template of define_subst PT. Return 1 if the templates match, 0 otherwise. During the comparison, the routine also fills global_array OPERAND_DATA.
References error_with_line(), len, lookup_predicate(), and subst_pattern_match().
void traverse_c_tests | ( | ) |
For every C test, call CALLBACK with two arguments: a pointer to the condition structure and INFO. Stops when CALLBACK returns zero.
References condition_table.
Referenced by write_conditions().
|
static |
Return true if NAME is a valid predicate name.
Referenced by process_define_predicate().
|
static |
Referenced by add_c_test(), init_rtx_reader_args_cb(), maybe_eval_c_test(), and traverse_c_tests().
|
static |
Referenced by add_define_attr(), and read_md_rtx().
|
static |
Referenced by gen_mnemonic_attr().
|
static |
|
static |
|
static |
Referenced by read_md_rtx().
|
static |
|
static |
Referenced by read_md_rtx().
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
0 means no warning about that code yet, 1 means warned.
struct pred_data* first_predicate |
int insn_elision = 1 |
Set this to 0 to disable automatic elision of insn patterns which can never be used in this configuration. See genconditions.c. Must be set before calling init_md_reader.
Referenced by main(), and read_md_rtx().
|
static |
These functions allow linkage with print-rtl.c. Also, some generators like to annotate their output with insn names.
Holds an array of names indexed by insn_code_number.
|
static |
|
static |
|
static |
Referenced by process_substs_on_one_elem(), and replace_duplicating_operands_in_pattern().
|
static |
|
static |
|
static |
Referenced by read_md_rtx().
|
static |
|
static |
Referenced by identify_predicable_attribute(), and is_predicable().
|
static |
Referenced by identify_predicable_attribute(), and is_predicable().
|
static |
Referenced by identify_predicable_attribute(), and is_predicable().
|
static |
Helper functions for define_predicate and define_special_predicate processing. Shared between genrecog.c and genpreds.c.
|
static |
Counter for patterns that generate code: define_insn, define_expand, define_split, define_peephole, and define_peephole2. See read_md_rtx(). Any define_insn_and_splits are already in separate queues so that the insn and the splitter get a unique number also.
Referenced by init_rtx_reader_args_cb(), and read_md_rtx().
|
static |
|
static |
Referenced by has_subst_attribute(), and process_substs_on_one_elem().
|
static |
Referenced by has_subst_attribute().
int target_flags |
In case some macros used by files we include need it, define this here.
Referenced by default_get_pch_validity(), default_pch_valid_p(), and option_affects_pch_p().
|
static |