diff options
author | rsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-10-26 06:41:53 +0000 |
---|---|---|
committer | rsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-10-26 06:41:53 +0000 |
commit | 1efe9e9de4b6cf7c1f3b32ff67387e0888afb462 (patch) | |
tree | 14915af2d40b8cb97045fa32be1ed0f4df090f74 /gcc/rtl.h | |
parent | 1dbb0e2e7e679a2c252fdaf9685adfa8cb1c99bd (diff) | |
download | gcc-1efe9e9de4b6cf7c1f3b32ff67387e0888afb462.tar.gz |
gcc/
PR bootstrap/55049
* Makefile.in (rtlanal.o): Add dependency on addresses.h.
* rtl.h (address_info): New structure.
(strip_address_mutations, decompose_address, decompose_lea_address)
(decompose_mem_address, update_address, get_index_scale)
(get_index_code): Declare.
* rtlanal.c: Include addresses.h.
(strip_address_mutations, must_be_base_p, must_be_index_p)
(set_address_segment, set_address_base, set_address_index)
(set_address_disp, decompose_incdec_address, decompose_automod_address)
(extract_plus_operands, baseness, decompose_normal_address)
(decompose_address, decompose_lea_address, decompose_mem_address)
(update_address, get_index_scale, get_index_code): New functions.
* lra-constraints.c (strip_subreg): New function.
(address, extract_loc_address_regs, extract_address_regs)
(get_index_scale): Delete.
(process_addr_reg): Apply strip_subreg to the location.
(uses_hard_regs_p): Use decompose_mem_address.
(valid_address_p, base_plus_disp_to_reg, can_add_disp_p)
(equiv_address_substitution): Take an address_info rather
than an address. Remove other arguments. Avoid using Pmode.
(process_address): Use decompose_mem_address and decompose_lea_address.
Update calls to above functions.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@192837 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/rtl.h')
-rw-r--r-- | gcc/rtl.h | 79 |
1 files changed, 79 insertions, 0 deletions
diff --git a/gcc/rtl.h b/gcc/rtl.h index 361669ac191..43a49c44ed7 100644 --- a/gcc/rtl.h +++ b/gcc/rtl.h @@ -1237,6 +1237,77 @@ costs_add_n_insns (struct full_rtx_costs *c, int n) c->size += COSTS_N_INSNS (n); } +/* Information about an address. This structure is supposed to be able + to represent all supported target addresses. Please extend it if it + is not yet general enough. */ +struct address_info { + /* The mode of the value being addressed, or VOIDmode if this is + a load-address operation with no known address mode. */ + enum machine_mode mode; + + /* The address space. */ + addr_space_t as; + + /* A pointer to the top-level address. */ + rtx *outer; + + /* A pointer to the inner address, after all address mutations + have been stripped from the top-level address. It can be one + of the following: + + - A {PRE,POST}_{INC,DEC} of *BASE. SEGMENT, INDEX and DISP are null. + + - A {PRE,POST}_MODIFY of *BASE. In this case either INDEX or DISP + points to the step value, depending on whether the step is variable + or constant respectively. SEGMENT is null. + + - A plain sum of the form SEGMENT + BASE + INDEX + DISP, + with null fields evaluating to 0. */ + rtx *inner; + + /* Components that make up *INNER. Each one may be null or nonnull. + When nonnull, their meanings are as follows: + + - *SEGMENT is the "segment" of memory to which the address refers. + This value is entirely target-specific and is only called a "segment" + because that's its most typical use. It contains exactly one UNSPEC, + pointed to by SEGMENT_TERM. The contents of *SEGMENT do not need + reloading. + + - *BASE is a variable expression representing a base address. + It contains exactly one REG, SUBREG or MEM, pointed to by BASE_TERM. + + - *INDEX is a variable expression representing an index value. + It may be a scaled expression, such as a MULT. It has exactly + one REG, SUBREG or MEM, pointed to by INDEX_TERM. + + - *DISP is a constant, possibly mutated. DISP_TERM points to the + unmutated RTX_CONST_OBJ. */ + rtx *segment; + rtx *base; + rtx *index; + rtx *disp; + + rtx *segment_term; + rtx *base_term; + rtx *index_term; + rtx *disp_term; + + /* In a {PRE,POST}_MODIFY address, this points to a second copy + of BASE_TERM, otherwise it is null. */ + rtx *base_term2; + + /* ADDRESS if this structure describes an address operand, MEM if + it describes a MEM address. */ + enum rtx_code addr_outer_code; + + /* If BASE is nonnull, this is the code of the rtx that contains it. */ + enum rtx_code base_outer_code; + + /* True if this is an RTX_AUTOINC address. */ + bool autoinc_p; +}; + extern void init_rtlanal (void); extern int rtx_cost (rtx, enum rtx_code, int, bool); extern int address_cost (rtx, enum machine_mode, addr_space_t, bool); @@ -1260,6 +1331,14 @@ extern bool constant_pool_constant_p (rtx); extern bool truncated_to_mode (enum machine_mode, const_rtx); extern int low_bitmask_len (enum machine_mode, unsigned HOST_WIDE_INT); extern void split_double (rtx, rtx *, rtx *); +extern rtx *strip_address_mutations (rtx *, enum rtx_code * = 0); +extern void decompose_address (struct address_info *, rtx *, + enum machine_mode, addr_space_t, enum rtx_code); +extern void decompose_lea_address (struct address_info *, rtx *); +extern void decompose_mem_address (struct address_info *, rtx); +extern void update_address (struct address_info *); +extern HOST_WIDE_INT get_index_scale (const struct address_info *); +extern enum rtx_code get_index_code (const struct address_info *); #ifndef GENERATOR_FILE /* Return the cost of SET X. SPEED_P is true if optimizing for speed |