GCC Middle and Back End API Reference
|
#include "bconfig.h"
#include "system.h"
#include "coretypes.h"
#include "tm.h"
#include "rtl.h"
#include "obstack.h"
#include "errors.h"
#include "read-md.h"
#include "gensupport.h"
#include "fnmatch.h"
Data Structures | |
class | insn_def |
struct | insn_ent |
struct | attr_value |
class | attr_desc |
class | delay_desc |
struct | attr_value_list |
struct | attr_hash |
struct | insn_reserv |
struct | bypass_list |
Macros | |
#define | ATTR_IND_SIMPLIFIED_P(RTX) |
#define | ATTR_CURR_SIMPLIFIED_P(RTX) |
#define | ATTR_PERMANENT_P(RTX) |
#define | strcmp_check(S1, S2) |
#define | DEBUG 0 |
#define | ATTR_NONE 0 |
#define | ATTR_SPECIAL (1 << 0) |
#define | MAX_DIGITS (HOST_BITS_PER_INT * 3 / 10 + 3) |
#define | MAX_ATTRS_INDEX 256 |
#define | SIMPLIFY_TEST_EXP(EXP, INSN_CODE, INSN_INDEX) |
#define | DEF_ATTR_STRING(S) |
#define | oballoc(T) |
#define | oballocvec(T, N) |
#define | RTL_HASH_SIZE 4093 |
#define | RTL_HASH(RTL) |
#define | FLG_BITWISE 1 |
#define | FLG_AFTER 2 |
#define | FLG_INSIDE 4 |
#define | FLG_OUTSIDE_AND 8 |
Typedefs | |
typedef uint64_t | alternative_mask |
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 class attr_desc * | find_attr (const char **, int) |
static rtx | mk_attr_alt (alternative_mask) |
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) |
static int | min_attr_value (rtx) |
static unsigned int | attr_value_alignment (rtx) |
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 *, class attr_desc *, const char *) |
static struct attr_value * | find_most_used (class attr_desc *) |
static void | write_attr_set (FILE *, class attr_desc *, int, rtx, const char *, const char *, rtx, int, int, unsigned int) |
static void | write_attr_case (FILE *, class attr_desc *, struct attr_value *, int, const char *, const char *, int, rtx) |
static void | write_attr_value (FILE *, class 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 (unsigned int hashcode, rtx rtl) |
static void | attr_hash_add_string (unsigned int hashcode, char *str) |
static rtx | attr_rtx_1 (enum rtx_code code, va_list p) |
static rtx | attr_rtx (enum rtx_code code,...) |
static rtx | attr_eq (const char *name, const char *value) |
static const char * | attr_numeral (int n) |
static int | attr_equal_p (rtx x, rtx y) |
static rtx | check_attr_test (file_location loc, rtx exp, attr_desc *attr) |
static rtx | check_attr_value (file_location loc, rtx exp, class attr_desc *attr) |
static rtx | convert_set_attr_alternative (rtx exp, class insn_def *id) |
static rtx | convert_set_attr (rtx exp, class insn_def *id) |
static void | check_defs (void) |
static rtx | make_canonical (file_location loc, class attr_desc *attr, rtx exp) |
static struct attr_value * | get_attr_value (file_location loc, rtx value, class attr_desc *attr, int insn_code) |
static void | expand_delays (void) |
static void | fill_attr (class attr_desc *attr) |
static rtx | substitute_address (rtx exp, rtx(*no_address_fn)(rtx), rtx(*address_fn)(rtx)) |
static void | make_length_attrs (void) |
static void | write_length_unit_log (FILE *outf) |
static int | attr_rtx_cost (rtx x) |
static rtx | simplify_cond (rtx exp, int insn_code, int insn_index) |
static void | remove_insn_ent (struct attr_value *av, struct insn_ent *ie) |
static alternative_mask | compute_alternative_mask (rtx exp, enum rtx_code code) |
static rtx | make_alternative_compare (alternative_mask mask) |
static rtx | evaluate_eq_attr (rtx exp, class attr_desc *attr, rtx value, int insn_code, int insn_index) |
static rtx | simplify_and_tree (rtx exp, rtx *pterm, int insn_code, int insn_index) |
static rtx | simplify_or_tree (rtx exp, rtx *pterm, int insn_code, int insn_index) |
static rtx | attr_alt_intersection (rtx s1, rtx s2) |
static rtx | attr_alt_union (rtx s1, rtx s2) |
static rtx | attr_alt_complement (rtx s) |
static int | tests_attr_p (rtx p, class attr_desc *attr) |
static int | get_attr_order (class attr_desc ***ret) |
static void | optimize_attrs (int num_insn_codes) |
static void | add_attr_value (class attr_desc *attr, const char *name) |
static void | gen_attr (md_rtx_info *info) |
static int | count_alternatives (rtx exp) |
static void | gen_insn (md_rtx_info *info) |
static void | gen_delay (md_rtx_info *info) |
static void | find_attrs_to_cache (rtx exp, bool create) |
static unsigned int | write_test_expr (FILE *outf, rtx exp, unsigned int attrs_cached, int flags, bool emit_parens=true) |
static void | write_attr_get (FILE *outf, class attr_desc *attr) |
static rtx | eliminate_known_true (rtx known_true, rtx exp, int insn_code, int insn_index) |
static void | write_insn_cases (FILE *outf, struct insn_ent *ie, int indent) |
static void | write_dummy_eligible_delay (FILE *outf, const char *kind) |
static void | write_eligible_delay (FILE *outf, const char *kind) |
static void | write_const_num_delay_slots (FILE *outf) |
static void | gen_insn_reserv (md_rtx_info *info) |
static void | gen_bypass_1 (const char *s, size_t len) |
static void | gen_bypass (md_rtx_info *info) |
static void | process_bypasses (void) |
static bool | check_tune_attr (const char *name, rtx exp) |
static class attr_desc * | find_tune_attr (rtx exp) |
static void | make_automaton_attrs (void) |
static void | write_header (FILE *outf) |
static FILE * | open_outfile (const char *file_name) |
static bool | handle_arg (const char *arg) |
int | main (int argc, const char **argv) |
#define ATTR_CURR_SIMPLIFIED_P | ( | RTX | ) |
Referenced by attr_rtx_1(), clear_struct_flag(), copy_rtx_unchanging(), and simplify_test_exp().
#define ATTR_IND_SIMPLIFIED_P | ( | RTX | ) |
Generate code from machine description to compute values of attributes. Copyright (C) 1991-2024 Free Software Foundation, Inc. Contributed by Richard Kenner (kenner@vlsi1.ultra.nyu.edu) This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GCC; see the file COPYING3. If not see <http://www.gnu.org/licenses/>.
This program handles insn attributes and the DEFINE_DELAY and DEFINE_INSN_RESERVATION definitions. It produces a series of functions named `get_attr_...', one for each insn attribute. Each of these is given the rtx for an insn and returns a member of the enum for the attribute. These subroutines have the form of a `switch' on the INSN_CODE (via `recog_memoized'). Each case either returns a constant attribute value or a value that depends on tests on other attributes, the form of operands, or some random C expression (encoded with a SYMBOL_REF expression). If the attribute `alternative', or a random C expression is present, `constrain_operands' is called. If either of these cases of a reference to an operand is found, `extract_insn' is called. The special attribute `length' is also recognized. For this operand, expressions involving the address of an operand or the current insn, (address (pc)), are valid. In this case, an initial pass is made to set all lengths that do not depend on address. Those that do are set to the maximum length. Then each insn that depends on an address is checked and possibly has its length changed. The process repeats until no further changed are made. The resulting lengths are saved for use by `get_attr_length'. A special form of DEFINE_ATTR, where the expression for default value is a CONST expression, indicates an attribute that is constant for a given run of the compiler. The subroutine generated for these attributes has no parameters as it does not depend on any particular insn. Constant attributes are typically used to specify which variety of processor is used. Internal attributes are defined to handle DEFINE_DELAY and DEFINE_INSN_RESERVATION. Special routines are output for these cases. This program works by keeping a list of possible values for each attribute. These include the basic attribute choices, default values for attribute, and all derived quantities. As the description file is read, the definition for each insn is saved in a `struct insn_def'. When the file reading is complete, a `struct insn_ent' is created for each insn and chained to the corresponding attribute value, either that specified, or the default. An optimization phase is then run. This simplifies expressions for each insn. EQ_ATTR tests are resolved, whenever possible, to a test that indicates when the attribute has the specified value for the insn. This avoids recursive calls during compilation. The strategy used when processing DEFINE_DELAY definitions is to create arbitrarily complex expressions and have the optimization simplify them. Once optimization is complete, any required routines and definitions will be written. An optimization that is not yet implemented is to hoist the constant expressions entirely out of the routines and definitions that are written. A way to do this is to iterate over all possible combinations of values for constant attributes and generate a set of functions for that given combination. An initialization function would be written that evaluates the attributes and installs the corresponding set of routines and definitions (each would be accessed through a pointer). We use the flags in an RTX as follows: `unchanging' (ATTR_IND_SIMPLIFIED_P): This rtx is fully simplified independent of the insn code. `in_struct' (ATTR_CURR_SIMPLIFIED_P): This rtx is fully simplified for the insn code currently being processed (see optimize_attrs). `return_val' (ATTR_PERMANENT_P): This rtx is permanent and unique (see attr_rtx).
Referenced by check_attr_test(), clear_struct_flag(), copy_rtx_unchanging(), evaluate_eq_attr(), main(), make_canonical(), simplify_test_exp(), simplify_test_exp_in_temp(), and walk_attr_value().
#define ATTR_NONE 0 |
Flags for make_internal_attr's `special' parameter.
Referenced by expand_delays(), make_automaton_attrs(), and make_length_attrs().
#define ATTR_PERMANENT_P | ( | RTX | ) |
Referenced by attr_equal_p(), attr_rtx_1(), and main().
#define ATTR_SPECIAL (1 << 0) |
Referenced by expand_delays(), and make_internal_attr().
#define DEBUG 0 |
Referenced by get_attr_order().
#define DEF_ATTR_STRING | ( | S | ) |
Referenced by attr_printf(), attr_rtx_1(), copy_boolean(), evaluate_eq_attr(), find_attr(), gen_insn_reserv(), main(), and make_canonical().
#define FLG_AFTER 2 |
Set if cached attribute will be known initialized in else block after this condition. This is true for LHS of toplevel && and || and even for RHS of ||, but not for RHS of &&.
Referenced by write_attr_set(), and write_test_expr().
#define FLG_BITWISE 1 |
Given a piece of RTX, print a C expression to test its truth value to OUTF. We use AND and IOR both for logical and bit-wise operations, so interpret them as logical unless they are inside a comparison expression. An outermost pair of parentheses is emitted around this C expression unless EMIT_PARENS is false.
Interpret AND/IOR as bit-wise operations instead of logical.
Referenced by write_test_expr().
#define FLG_INSIDE 4 |
Set if cached attribute will be known initialized in then block after this condition. This is true for LHS of toplevel && and || and even for RHS of &&, but not for RHS of ||.
Referenced by write_attr_set(), and write_test_expr().
#define FLG_OUTSIDE_AND 8 |
Cleared when an operand of &&.
Referenced by write_attr_set(), and write_test_expr().
#define MAX_ATTRS_INDEX 256 |
Listheads of above structures.
This one is indexed by the first character of the attribute name.
Referenced by find_attr(), get_attr_order(), and main().
#define MAX_DIGITS (HOST_BITS_PER_INT * 3 / 10 + 3) |
enough space to reserve for printing out ints
Referenced by expand_delays(), and make_numeric_value().
#define oballoc | ( | T | ) |
Referenced by add_attr_value(), fill_attr(), find_attr(), gen_bypass_1(), gen_delay(), gen_insn(), gen_insn_reserv(), get_attr_value(), and make_length_attrs().
Referenced by main().
#define RTL_HASH | ( | RTL | ) |
Here is how primitive or already-shared RTL's hash codes are made.
Referenced by attr_rtx_1().
#define RTL_HASH_SIZE 4093 |
Now here is the hash table. When recording an RTL, it is added to the slot whose index is the hash code mod the table size. Note that the hash table is used for several kinds of RTL (see attr_rtx) and for strings. While all these live in the same table, they are completely independent, and the hash code is computed differently for each.
Referenced by attr_hash_add_rtx(), attr_hash_add_string(), attr_rtx_1(), and attr_string().
#define SIMPLIFY_TEST_EXP | ( | EXP, | |
INSN_CODE, | |||
INSN_INDEX ) |
Simplify an expression. Only call the routine if there is something to simplify.
Referenced by eliminate_known_true(), and simplify_test_exp().
#define strcmp_check | ( | S1, | |
S2 ) |
Referenced by attr_rtx_cost(), evaluate_eq_attr(), fill_attr(), gen_attr(), simplify_and_tree(), and walk_attr_value().
typedef uint64_t alternative_mask |
Stores, for each insn code, a bitmap that has bits on for each possible alternative.
Keep this in sync with recog.h.
|
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, NULL, attr_value::num_insns, oballoc, and attr_value::value.
Referenced by gen_attr().
Return EQ_ATTR_ALT expression representing complement of S.
References attr_rtx(), HOST_WIDE_INT_1, and XWINT.
Referenced by simplify_test_exp().
Return EQ_ATTR_ALT expression representing intersection of S1 and S2.
References attr_rtx(), gcc_unreachable, and XWINT.
Referenced by simplify_test_exp().
Returns true if S1 is a subset of complement of S2.
References gcc_unreachable, and XWINT.
Referenced by simplify_and_tree().
Returns true if S1 is a subset of S2.
References gcc_unreachable, and XWINT.
Referenced by simplify_and_tree().
Return EQ_ATTR_ALT expression representing union of S1 and S2.
References attr_rtx(), gcc_unreachable, and XWINT.
Referenced by simplify_test_exp().
|
static |
References attr_rtx().
Referenced by check_attr_test(), convert_set_attr_alternative(), and make_automaton_attrs().
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 ATTR_PERMANENT_P, rtx_equal_p(), and y.
Referenced by get_attr_value(), insert_right_side(), make_canonical(), 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 attr_hash_table, hash_obstack, attr_hash::hashcode, attr_hash::next, attr_hash::rtl, RTL_HASH_SIZE, and attr_hash::u.
Referenced by attr_rtx_1().
|
static |
Add an entry to the hash table for STRING with hash code HASHCODE.
References attr_hash_table, hash_obstack, attr_hash::hashcode, attr_hash::next, RTL_HASH_SIZE, attr_hash::str, and attr_hash::u.
Referenced by attr_string().
|
static |
References make_numeric_value(), and XSTR.
Referenced by convert_set_attr_alternative().
|
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])
References DEF_ATTR_STRING, and gcc_assert.
Referenced by expand_delays(), and make_numeric_value().
References attr_rtx_1().
Referenced by add_attr_value(), attr_alt_complement(), attr_alt_intersection(), attr_alt_union(), 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_numeric_value(), mk_attr_alt(), simplify_and_tree(), simplify_or_tree(), simplify_test_exp(), substitute_address(), and write_attr_set().
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_CURR_SIMPLIFIED_P, attr_hash_add_rtx(), attr_hash_table, ATTR_PERMANENT_P, DEF_ATTR_STRING, false_rtx, gcc_unreachable, GET_CODE, GET_RTX_CLASS, GET_RTX_FORMAT, GET_RTX_LENGTH, hash_obstack, attr_hash::hashcode, i, attr_hash::next, NULL_RTX, obstack, attr_hash::rtl, RTL_HASH, RTL_HASH_SIZE, rtl_obstack, rtx_alloc(), RTX_BIN_ARITH, RTX_COMM_ARITH, RTX_COMM_COMPARE, RTX_COMPARE, RTX_UNARY, true_rtx, attr_hash::u, X0EXP, XEXP, XINT, XSTR, XVEC, and XWINT.
Referenced by attr_rtx().
|
static |
Compute approximate cost of the expression. Used to decide whether expression is cheap enough for inline.
References alternative_name, attr_rtx_cost(), GET_CODE, GET_RTX_FORMAT, GET_RTX_LENGTH, i, strcmp_check, XEXP, XSTR, XVECEXP, and XVECLEN.
Referenced by attr_rtx_cost(), optimize_attrs(), and simplify_test_exp().
|
static |
Forward declarations of functions used before their definitions, only.
Return a permanent (possibly shared) copy of a string STR (not assumed to be null terminated) with LEN bytes.
References attr_hash_add_string(), attr_hash_table, md_reader::copy_md_ptr_loc(), hash_obstack, attr_hash::hashcode, i, attr_hash::next, RTL_HASH_SIZE, rtx_reader_ptr, attr_hash::str, and attr_hash::u.
Referenced by gen_bypass_1(), and next_comma_elt().
|
static |
Given an attribute value expression, return the alignment of values. Return 0 if EXP is known to be zero, and 1 if the value can't be calculated by this function.
References attr_value_alignment(), exp(), GET_CODE, i, INTVAL, XEXP, XSTR, XVECEXP, and XVECLEN.
Referenced by attr_value_alignment(), and write_length_unit_log().
|
static |
Given a test expression EXP for attribute ATTR, ensure it is validly formed. LOC is the location of the .md construct that contains EXP. 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_IND_SIMPLIFIED_P, attr_rtx(), check_attr_test(), exp(), false_rtx, fatal_at(), find_attr(), attr_desc::first_value, GET_CODE, GET_RTX_NAME, insert_right_side(), attr_desc::is_const, attr_desc::is_numeric, mk_attr_alt(), n_comma_elts(), attr_desc::name, attr_value::next, next_comma_elt(), NULL, true_rtx, attr_value::value, XEXP, XSTR, and XWINT.
Referenced by check_attr_test(), check_attr_value(), and gen_insn_reserv().
|
static |
Given an expression EXP, ensure that it is validly formed and that all named attribute values are valid for ATTR. Issue an error if not. LOC is the location of the .md construct that contains EXP. Return a perhaps modified replacement expression for the value.
References attr_rtx(), check_attr_test(), check_attr_value(), error_at(), exp(), find_attr(), attr_desc::first_value, GET_CODE, GET_RTX_NAME, i, INTVAL, attr_desc::is_const, attr_desc::is_numeric, attr_desc::loc, attr_desc::name, attr_value::next, NULL, attr_value::value, XEXP, XSTR, XVECEXP, and XVECLEN.
Referenced by check_attr_value(), 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(), defs, error_at(), find_attr(), GET_CODE, GET_RTX_NAME, i, id::next, NULL, NULL_RTX, SET, XEXP, XSTR, XVEC, XVECEXP, and XVECLEN.
Referenced by main(), and maybe_warn_operand().
Check that attribute NAME is used in define_insn_reservation condition EXP. Return true if it is.
References check_tune_attr(), exp(), GET_CODE, insn_reserv::name, XEXP, and XSTR.
Referenced by check_tune_attr(), and find_tune_attr().
|
static |
Clear the ATTR_CURR_SIMPLIFIED_P flag in EXP and its subexpressions.
References ATTR_CURR_SIMPLIFIED_P, ATTR_IND_SIMPLIFIED_P, CASE_CONST_ANY, clear_struct_flag(), GET_CODE, GET_RTX_FORMAT, GET_RTX_LENGTH, i, XEXP, XVECEXP, and XVECLEN.
Referenced by clear_struct_flag(), and optimize_attrs().
|
static |
Returns nonzero if the given expression contains an EQ_ATTR with the `alternative' attribute.
References alternative_name, compares_alternatives_p(), exp(), GET_CODE, GET_RTX_FORMAT, GET_RTX_LENGTH, i, XEXP, XSTR, XVECEXP, and XVECLEN.
Referenced by compares_alternatives_p(), and get_attr_value().
|
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, compute_alternative_mask(), exp(), GET_CODE, XEXP, XSTR, and XWINT.
Referenced by compute_alternative_mask(), and simplify_test_exp().
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(), exp(), n_comma_elts(), next_comma_elt(), NULL, rtvec_alloc(), rtx_alloc(), SET, XSTR, XVEC, and XVECEXP.
Referenced by check_defs().
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_at(), exp(), i, NULL_RTX, rtvec_alloc(), rtx_alloc(), SET, XEXP, XSTR, XVEC, XVECEXP, and XVECLEN.
Referenced by check_defs(), and convert_set_attr().
References attr_rtx(), copy_boolean(), DEF_ATTR_STRING, exp(), GET_CODE, XEXP, and XSTR.
Referenced by copy_boolean(), and make_canonical().
References ATTR_CURR_SIMPLIFIED_P, and ATTR_IND_SIMPLIFIED_P.
Referenced by evaluate_eq_attr(), and simplify_test_exp().
|
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 count_alternatives(), exp(), GET_CODE, GET_RTX_FORMAT, GET_RTX_LENGTH, i, n_comma_elts(), NULL, XEXP, XSTR, XVEC, XVECEXP, and XVECLEN.
Referenced by count_alternatives(), and gen_insn().
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 eliminate_known_true(), exp(), GET_CODE, simplify_and_tree(), SIMPLIFY_TEST_EXP, and XEXP.
Referenced by eliminate_known_true(), and 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_IND_SIMPLIFIED_P, attr_rtx(), attr_value_list::av, copy_rtx_unchanging(), insn_ent::def, DEF_ATTR_STRING, attr_desc::enum_name, evaluate_eq_attr(), exp(), false_rtx, find_attr(), attr_value::first_insn, attr_desc::first_value, gcc_assert, gcc_unreachable, GET_CODE, i, insert_right_side(), insn_def::insn_code, insn_code_values, attr_desc::name, attr_value::next, insn_ent::next, NULL, simplify_test_exp_in_temp(), strcmp_check, true_rtx, attr_value::value, walk_attr_value(), XEXP, XSTR, XVECEXP, and XVECLEN.
Referenced by evaluate_eq_attr(), 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_NONE, attr_printf(), attr_rtx(), ATTR_SPECIAL, delay_desc::def, delay_type_str, delays, false_rtx, have_annul_false, have_annul_true, i, make_internal_attr(), make_numeric_value(), MAX_DIGITS, delay_desc::next, delay_desc::num, num_delay_slots_str, num_delays, rtvec_alloc(), rtx_alloc(), XEXP, XVEC, XVECEXP, and XVECLEN.
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_ent::def, attr_desc::default_val, defs, get_attr_value(), i, insert_insn_ent(), attr_desc::is_const, attr_desc::name, id::next, NULL, oballoc, strcmp_check, XEXP, XSTR, XVEC, XVECEXP, and XVECLEN.
Referenced by main().
|
static |
Return a `class 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::cxx_type, DEF_ATTR_STRING, attr_desc::default_val, attr_desc::enum_name, attr_desc::first_value, attr_desc::is_const, attr_desc::is_numeric, attr_desc::is_special, MAX_ATTRS_INDEX, attr_desc::name, attr_desc::next, NULL, and oballoc.
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().
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, attrs_seen_more_than_once, attrs_seen_once, cached_attr_count, cached_attrs, exp(), find_attr(), find_attrs_to_cache(), gcc_assert, GET_CODE, i, attr_desc::is_const, attr_desc::name, NULL, XEXP, XSTR, XVECEXP, and XVECLEN.
Referenced by find_attrs_to_cache(), write_attr_get(), and write_attr_set().
|
static |
Find the most used value of an attribute.
References attr_desc::first_value, attr_value::next, NULL, and attr_value::num_insns.
Referenced by write_attr_get(), and write_eligible_delay().
Try to find a const attribute (usually cpu or tune) that is used in all define_insn_reservation conditions.
References all_insn_reservs, alternative_name, check_tune_attr(), exp(), find_attr(), find_tune_attr(), gcc_assert, GET_CODE, attr_desc::is_const, attr_desc::is_special, attr_desc::name, NULL, XEXP, and XSTR.
Referenced by find_tune_attr(), and make_automaton_attrs().
|
static |
Create table entries for DEFINE_ATTR or DEFINE_ENUM_ATTR.
References add_attr_value(), check_attr_value(), attr_desc::cxx_type, md_rtx_info::def, attr_desc::default_val, attr_desc::enum_name, error_at(), find_attr(), get_attr_value(), GET_CODE, attr_desc::is_const, attr_desc::is_numeric, length_str, attr_desc::loc, md_rtx_info::loc, md_reader::lookup_enum_type(), enum_type::md_p, message_at(), attr_desc::name, enum_value::name, enum_value::next, next_comma_elt(), NULL, rtx_reader_ptr, strcmp_check, enum_type::values, XEXP, and XSTR.
Referenced by main().
|
static |
References md_rtx_info::def, gen_bypass_1(), and XSTR.
Referenced by main().
|
static |
References all_bypasses, attr_string(), b, n_bypasses, bypass_list::next, and oballoc.
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, md_rtx_info::def, delays, error_at(), have_annul_false, have_annul_true, i, delay_desc::loc, md_rtx_info::loc, delay_desc::next, delay_desc::num, num_delays, oballoc, XVECEXP, and XVECLEN.
Referenced by main().
|
static |
Process DEFINE_PEEPHOLE, DEFINE_INSN, and DEFINE_ASM_ATTRIBUTES.
References count_alternatives(), insn_def::def, md_rtx_info::def, defs, gcc_unreachable, GET_CODE, got_define_asm_attributes, md_rtx_info::index, insn_index_number, md_rtx_info::loc, and oballoc.
Referenced by main().
|
static |
Store information from a DEFINE_INSN_RESERVATION for future attribute generation.
References check_attr_test(), md_rtx_info::def, DEF_ATTR_STRING, last_insn_reserv_p, attr_desc::loc, md_rtx_info::loc, n_insn_reservs, attr_desc::name, oballoc, XEXP, XINT, and XSTR.
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 DEBUG, attr_desc::first_value, free(), i, attr_desc::is_const, MAX_ATTRS_INDEX, attr_desc::name, attr_desc::next, attr_value::next, attr_value::num_insns, tests_attr_p(), and attr_value::value.
Referenced by optimize_attrs().
|
static |
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. LOC is the location to use for error reporting.
References attr_equal_p(), compares_alternatives_p(), insn_ent::def, fatal_at(), attr_value::first_insn, attr_desc::first_value, attr_value::has_asm_insn, insn_alternatives, insn_def::insn_code, make_canonical(), attr_value::next, NULL, attr_value::num_insns, oballoc, and attr_value::value.
Referenced by fill_attr(), gen_attr(), make_internal_attr(), make_length_attrs(), and optimize_attrs().
|
static |
References attr_file_name, dfa_file_name, and latency_file_name.
Referenced by main().
|
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 fill_attr(), make_length_attrs(), and optimize_attrs().
|
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, GET_CODE, insert_right_side(), simplify_test_exp_in_temp(), true_rtx, and XEXP.
Referenced by check_attr_test(), evaluate_eq_attr(), insert_right_side(), simplify_cond(), and write_attr_set().
int main | ( | int | argc, |
const char ** | argv ) |
References alternative_name, attr_file, attr_file_name, ATTR_IND_SIMPLIFIED_P, ATTR_PERMANENT_P, check_attr_value(), check_defs(), md_rtx_info::def, DEF_ATTR_STRING, attr_desc::default_val, defs, delay_1_0_str, delay_type_str, dfa_file, dfa_file_name, errno, expand_delays(), false_rtx, fatal(), FATAL_EXIT_CODE, fill_attr(), gen_attr(), gen_bypass(), gen_delay(), gen_insn(), gen_insn_reserv(), GET_CODE, get_num_insn_codes(), got_define_asm_attributes, handle_arg(), hash_obstack, have_annul_false, have_annul_true, have_error, i, md_rtx_info::index, init_rtx_reader_args_cb(), insn_alternatives, insn_index_number, insn_n_alternatives, attr_desc::is_const, attr_desc::is_special, latency_file, latency_file_name, length_str, attr_desc::loc, md_rtx_info::loc, make_automaton_attrs(), make_length_attrs(), MAX_ATTRS_INDEX, attr_desc::name, attr_desc::next, id::next, num_delay_slots_str, oballocvec, open_outfile(), optimize_attrs(), progname, read_md_rtx(), rtvec_alloc(), rtx_alloc(), startswith(), SUCCESS_EXIT_CODE, temp_obstack, true_rtx, attr_value::value, write_attr_get(), write_const_num_delay_slots(), write_dummy_eligible_delay(), write_eligible_delay(), write_length_unit_log(), XVEC, and XWINT.
|
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 all_insn_reservs, attr_eq(), attr_file, ATTR_NONE, insn_reserv::condexp, attr_desc::default_val, dfa_file, false_rtx, find_tune_attr(), attr_desc::first_value, gcc_assert, GET_CODE, i, attr_desc::is_const, attr_desc::is_numeric, attr_desc::is_special, latency_file, make_internal_attr(), make_numeric_value(), n_bypassed, n_bypasses, n_insn_reservs, attr_desc::name, attr_value::next, NULL, process_bypasses(), rtvec_alloc(), rtx_alloc(), simplify_and_tree(), true_rtx, attr_value::value, write_test_expr(), XEXP, XSTR, XVEC, and XVECEXP.
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. LOC is the location to use for error reporting.
References attr_equal_p(), ATTR_IND_SIMPLIFIED_P, check_attr_value(), copy_boolean(), DEF_ATTR_STRING, attr_desc::default_val, exp(), fatal_at(), gcc_fallthrough, GET_CODE, i, INTVAL, attr_desc::is_const, attr_desc::loc, make_canonical(), make_numeric_value(), rtvec_alloc(), rtx_alloc(), attr_value::value, XEXP, XSTR, XVEC, XVECEXP, and XVECLEN.
Referenced by get_attr_value(), and make_canonical().
|
static |
Create internal attribute with the given default value.
References ATTR_SPECIAL, attr_desc::cxx_type, attr_desc::default_val, find_attr(), gcc_assert, get_attr_value(), attr_desc::is_const, attr_desc::is_numeric, attr_desc::is_special, and attr_desc::name.
Referenced by expand_delays(), make_automaton_attrs(), and 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 ATTR_NONE, insn_ent::def, attr_desc::default_val, fatal_at(), find_attr(), attr_value::first_insn, attr_desc::first_value, get_attr_value(), i, identity_fn(), insert_insn_ent(), insn_def::insn_code, attr_desc::is_const, attr_desc::is_numeric, attr_desc::is_special, length_str, attr_desc::loc, insn_def::loc, make_internal_attr(), max_fn(), min_fn(), attr_value::next, insn_ent::next, oballoc, one_fn(), substitute_address(), attr_value::value, and zero_fn().
Referenced by main().
|
static |
Return (attr_value "n")
References attr_printf(), attr_rtx(), exp(), gcc_assert, and MAX_DIGITS.
Referenced by attr_numeral(), expand_delays(), make_automaton_attrs(), make_canonical(), max_fn(), min_fn(), one_fn(), and zero_fn().
|
static |
Given an attribute value expression, return the maximum value that might be evaluated. Return INT_MAX if the value can't be calculated by this function.
References exp(), GET_CODE, i, INT_MAX, INTVAL, max_attr_value(), min_attr_value(), XEXP, XSTR, XVECEXP, and XVECLEN.
Referenced by max_attr_value(), max_fn(), and min_attr_value().
References exp(), make_numeric_value(), and max_attr_value().
Referenced by make_length_attrs().
|
static |
Given an attribute value expression, return the minimum value that might be evaluated. Return INT_MAX if the value can't be calculated by this function. Note that when this function can calculate one value inside IF_THEN_ELSE or some but not all values inside COND, then it returns the minimum among those values it can calculate.
References exp(), GET_CODE, i, INT_MAX, INTVAL, max_attr_value(), min_attr_value(), XEXP, XSTR, XVECEXP, and XVECLEN.
Referenced by max_attr_value(), min_attr_value(), and min_fn().
References exp(), make_numeric_value(), and min_attr_value().
Referenced by make_length_attrs().
|
static |
Return EQ_ATTR_ALT expression representing set containing elements set in E.
References attr_rtx(), and HOST_WIDE_INT_0.
Referenced by check_attr_test(), make_alternative_compare(), and simplify_test_exp().
|
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(), NULL, and scan_comma_elt().
Referenced by check_attr_test(), convert_set_attr(), and gen_attr().
References make_numeric_value().
Referenced by make_length_attrs().
|
static |
References errno, fatal(), fopen, 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. NUM_INSN_CODES is the number of unique instruction codes.
References attr_rtx_cost(), clear_struct_flag(), insn_ent::def, attr_value::first_insn, attr_desc::first_value, free(), gcc_assert, get_attr_order(), get_attr_value(), GET_CODE, i, insert_insn_ent(), insn_def::insn_code, insn_code_values, insn_def::insn_index, insn_def::loc, attr_value::next, insn_ent::next, NULL, num_insn_ents, obstack, remove_insn_ent(), rtl_obstack, simplify_cond(), temp_obstack, and attr_value::value.
Referenced by main().
|
static |
Find and mark all of the bypassed insns.
References all_bypasses, all_insn_reservs, b, n_bypassed, bypass_list::next, insn_reserv::next, and r.
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().
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, GET_CODE, simplify_and_tree(), simplify_test_exp_in_temp(), strcmp_check, true_rtx, XEXP, and XSTR.
Referenced by eliminate_known_true(), make_automaton_attrs(), simplify_and_tree(), and simplify_test_exp().
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(), GET_CODE, i, insert_right_side(), rtl_obstack, rtvec_alloc(), rtx_alloc(), simplify_cond(), simplify_test_exp_in_temp(), true_rtx, XEXP, XVEC, XVECEXP, and XVECLEN.
Referenced by optimize_attrs(), and simplify_cond().
Similar to `simplify_and_tree', but for IOR trees.
References attr_equal_p(), attr_rtx(), exp(), false_rtx, GET_CODE, simplify_or_tree(), simplify_test_exp_in_temp(), true_rtx, XEXP, and XSTR.
Referenced by simplify_or_tree(), and simplify_test_exp().
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_CURR_SIMPLIFIED_P, attr_equal_p(), ATTR_IND_SIMPLIFIED_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, GET_CODE, i, attr_value_list::ie, insn_alternatives, insn_def::insn_code, insn_code_values, make_alternative_compare(), mk_attr_alt(), attr_value::next, insn_ent::next, NULL, simplify_and_tree(), simplify_or_tree(), SIMPLIFY_TEST_EXP, simplify_test_exp(), true_rtx, attr_value::value, XEXP, XSTR, and XWINT.
Referenced by simplify_test_exp(), and simplify_test_exp_in_temp().
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_IND_SIMPLIFIED_P, exp(), obstack, rtl_obstack, simplify_test_exp(), and temp_obstack.
Referenced by evaluate_eq_attr(), insert_right_side(), simplify_and_tree(), simplify_cond(), and simplify_or_tree().
|
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(), GET_CODE, i, rtvec_alloc(), rtx_alloc(), substitute_address(), walk_attr_value(), XEXP, XVEC, XVECEXP, and XVECLEN.
Referenced by make_length_attrs(), and substitute_address().
Return 1 if any EQ_ATTR subexpression of P refers to ATTR, otherwise return 0.
References attr_value_list::attr, GET_CODE, GET_RTX_FORMAT, GET_RTX_LENGTH, i, attr_value_list::ie, attr_desc::name, tests_attr_p(), XEXP, XSTR, XVECEXP, and XVECLEN.
Referenced by get_attr_order(), and tests_attr_p().
|
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, ATTR_IND_SIMPLIFIED_P, exp(), GET_CODE, GET_RTX_FORMAT, GET_RTX_LENGTH, i, length_str, length_used, must_constrain, must_extract, NULL, RTX_CODE, strcmp_check, walk_attr_value(), XEXP, XSTR, XVEC, XVECEXP, and XVECLEN.
Referenced by evaluate_eq_attr(), substitute_address(), walk_attr_value(), write_attr_case(), and write_const_num_delay_slots().
|
static |
Write out the computation for one attribute value.
References address_used, attrs_to_cache, 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, startswith(), 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 attrs_seen_more_than_once, attrs_seen_once, cached_attr_count, cached_attrs, attr_desc::cxx_type, insn_ent::def, find_attr(), find_attrs_to_cache(), find_most_used(), attr_value::first_insn, attr_desc::first_value, gcc_assert, i, insn_def::insn_code, insn_def::insn_index, attr_desc::is_const, 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_cached_inside, attrs_seen_more_than_once, attrs_seen_once, attrs_to_cache, cached_attr_count, attr_desc::default_val, eliminate_known_true(), false_rtx, find_attrs_to_cache(), FLG_AFTER, FLG_INSIDE, FLG_OUTSIDE_AND, GET_CODE, i, insert_right_side(), true_rtx, write_attr_set(), write_attr_value(), write_indent(), write_test_expr(), XEXP, XVECEXP, and XVECLEN.
Referenced by write_attr_case(), write_attr_get(), and write_attr_set().
References attr_desc::cxx_type, find_attr(), md_reader::fprint_c_condition(), gcc_unreachable, GET_CODE, HOST_WIDE_INT_PRINT_DEC, INTVAL, attr_desc::is_const, attr_desc::name, rtx_reader_ptr, write_attr_value(), write_attr_valueq(), write_test_expr(), XEXP, and XSTR.
Referenced by write_attr_set(), and write_attr_value().
|
static |
Utilities to write in various forms.
References attr_desc::enum_name, attr_desc::is_numeric, attr_desc::name, and write_upcase().
Referenced by write_attr_value(), and write_test_expr().
|
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 |
If the target does not have annul-true or annul-false delay slots, this function will create a dummy eligible_for function on OUTF which always returns false. KIND will be annul_true or annul_false.
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, delays, find_attr(), find_most_used(), attr_desc::first_value, gcc_assert, i, attr_value::next, delay_desc::next, delay_desc::num, num_delays, true_rtx, write_attr_case(), and XVECLEN.
Referenced by main().
|
static |
|
static |
Referenced by write_attr_case(), write_attr_set(), and 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, file_location::filename, GET_CODE, insn_def::insn_code, file_location::lineno, insn_def::loc, insn_ent::next, write_indent(), and XSTR.
Referenced by write_attr_case(), and write_const_num_delay_slots().
|
static |
References attr_value_alignment(), attr_desc::default_val, find_attr(), attr_value::first_insn, attr_desc::first_value, length_str, length_unit_log, attr_value::next, insn_ent::next, and attr_value::value.
Referenced by main().
|
static |
References alternative_name, attrs_cached_after, attrs_cached_inside, attrs_to_cache, cached_attr_count, cached_attrs, comparison_operator(), attr_desc::default_val, evaluate_eq_attr(), exp(), fatal(), find_attr(), FLG_AFTER, FLG_BITWISE, FLG_INSIDE, FLG_OUTSIDE_AND, md_reader::fprint_c_condition(), gcc_assert, gcc_fallthrough, gcc_unreachable, GET_CODE, GET_MODE, GET_MODE_NAME, GET_RTX_NAME, HOST_WIDE_INT_PRINT_DEC, i, attr_desc::is_const, attr_desc::name, NULL, PRIx64, RTX_CODE, rtx_reader_ptr, attr_value::value, write_attr_valueq(), write_test_expr(), XEXP, XINT, XSTR, and XWINT.
Referenced by make_automaton_attrs(), write_attr_set(), write_attr_value(), and write_test_expr().
|
static |
References fputc().
Referenced by write_attr_valueq().
References make_numeric_value().
Referenced by make_length_attrs().
|
static |
Referenced by evaluate_eq_attr(), substitute_address(), walk_attr_value(), and write_attr_case().
|
static |
Referenced by gen_bypass_1(), and process_bypasses().
|
static |
Referenced by find_tune_attr(), make_automaton_attrs(), and process_bypasses().
|
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(), and make_automaton_attrs().
|
static |
This gen* file is unique, in that it writes out multiple files. Before GCC 4.8, insn-attrtab.cc was written out containing many large functions and tables. This made insn-attrtab.cc _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.
Referenced by handle_arg(), and main().
|
static |
Referenced by attr_hash_add_rtx(), attr_hash_add_string(), attr_rtx_1(), and attr_string().
|
static |
Referenced by attrs_list_copy(), attrs_list_insert(), change_address(), clear_mem_offset(), clear_mem_size(), die_checksum_ordered(), duplicate_one_attribute(), get_mem_attrs(), get_nonnull_args(), get_reg_attrs(), get_spill_slot_decl(), handle_ignored_attributes_option(), infer_nonnull_range_by_attribute(), init_emit_regs(), lookup_scoped_attribute_spec(), nonnull_arg_p(), offset_address(), remove_attributes_matching(), set_mem_addr_space(), set_mem_alias_set(), set_mem_align(), set_mem_attrs_for_spill(), set_mem_expr(), set_mem_offset(), set_mem_size(), and widen_memory_access().
|
static |
Referenced by write_attr_set(), and write_test_expr().
|
static |
Referenced by write_attr_set(), and write_test_expr().
|
static |
Referenced by find_attrs_to_cache(), write_attr_get(), and write_attr_set().
|
static |
Bitmasks of possibly cached attributes.
Referenced by find_attrs_to_cache(), write_attr_get(), and write_attr_set().
|
static |
Referenced by write_attr_case(), write_attr_set(), and write_test_expr().
|
static |
Number of such attributes.
Referenced by find_attrs_to_cache(), write_attr_get(), write_attr_set(), and write_test_expr().
|
static |
Names of attributes that could be possibly cached.
Referenced by find_attrs_to_cache(), write_attr_get(), and write_test_expr().
|
static |
Referenced by add_constant(), add_removable_extension(), store_change_builder::advance(), check_defs(), check_dependency(), combine_reaching_defs(), df_find_hard_reg_defs(), df_find_hard_reg_defs_1(), df_simulate_find_defs(), df_simulate_find_noclobber_defs(), df_single_def(), dse_classify_store(), fill_attr(), find_dfsnum_interval(), fixup_debug_uses(), fixup_debug_uses_trailing_add(), pair_fusion_bb_info::fuse_pair(), gen_insn(), md_reader::handle_constants(), invariant_for_use(), main(), mark_artificial_uses(), mark_reg_dependencies(), move_insn_for_shrink_wrap(), prepare_shrink_wrap(), prune_unused_phi_nodes(), reset_unmarked_insns_debug_uses(), sp_based_mem_offset(), pair_fusion_bb_info::try_fuse_pair(), and try_repurpose_store().
|
static |
Referenced by main(), and write_eligible_delay().
|
static |
Referenced by expand_delays(), main(), and write_eligible_delay().
|
static |
Referenced by expand_delays(), gen_delay(), and write_eligible_delay().
|
static |
Referenced by main(), and make_automaton_attrs().
|
static |
Referenced by handle_arg(), and main().
|
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(), simplify_context::simplify_unary_operation_1(), 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 |
Referenced by get_attr_value(), main(), and simplify_test_exp().
struct attr_value_list** insn_code_values |
Referenced by evaluate_eq_attr(), optimize_attrs(), and simplify_test_exp().
|
static |
Other variables.
Referenced by gen_insn(), and main().
|
static |
Stores, for each insn code, the number of constraint alternatives.
Referenced by main().
|
static |
Referenced by gen_insn_reserv().
|
static |
Referenced by main(), and make_automaton_attrs().
|
static |
Referenced by handle_arg(), and main().
|
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 |
Referenced by make_automaton_attrs(), and process_bypasses().
|
static |
Referenced by gen_bypass_1(), and make_automaton_attrs().
|
static |
Referenced by gen_insn_reserv(), and make_automaton_attrs().
|
static |
Referenced by expand_delays(), main(), and write_const_num_delay_slots().
|
static |
Referenced by expand_delays(), gen_delay(), 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(), simplify_context::simplify_unary_operation_1(), write_attr_get(), write_attr_set(), and write_eligible_delay().