GCC Middle and Back End API Reference
pieces_addr Class Reference
Collaboration diagram for pieces_addr:

Public Member Functions

 pieces_addr (rtx, bool, by_pieces_constfn, void *)
 
rtx adjust (fixed_size_mode, HOST_WIDE_INT, by_pieces_prev *=nullptr)
 
void increment_address (HOST_WIDE_INT)
 
void maybe_predec (HOST_WIDE_INT)
 
void maybe_postinc (HOST_WIDE_INT)
 
void decide_autoinc (machine_mode, bool, HOST_WIDE_INT)
 
int get_addr_inc ()
 

Private Attributes

rtx m_obj
 
rtx m_addr
 
signed char m_addr_inc
 
signed char m_explicit_inc
 
bool m_auto
 
bool m_is_load
 
by_pieces_constfn m_constfn
 
voidm_cfndata
 

Detailed Description

Used when performing piecewise block operations, holds information
about one of the memory objects involved.  The member functions
can be used to generate code for loading from the object and
updating the address when iterating.   

Constructor & Destructor Documentation

◆ pieces_addr()

pieces_addr::pieces_addr ( rtx obj,
bool is_load,
by_pieces_constfn constfn,
void * cfndata )
Initialize a pieces_addr structure from an object OBJ.  IS_LOAD is
true if the operation to be performed on this object is a load
rather than a store.  For stores, OBJ can be NULL, in which case we
assume the operation is a stack push.  For loads, the optional
CONSTFN and its associated CFNDATA can be used in place of the
memory load.   

References gcc_assert, GET_CODE, ggc_alloc(), m_addr, m_addr_inc, m_auto, m_explicit_inc, NULL, NULL_RTX, STACK_GROWS_DOWNWARD, and XEXP.

Member Function Documentation

◆ adjust()

rtx pieces_addr::adjust ( fixed_size_mode mode,
HOST_WIDE_INT offset,
by_pieces_prev * prev = nullptr )
Adjust the address to refer to the data at OFFSET in MODE.  If we
are using autoincrement for this address, we don't add the offset,
but we still modify the MEM's properties.   

References adjust_address, adjust_automodify_address, m_addr, m_auto, m_cfndata, m_constfn, m_obj, NULL_RTX, and offset.

Referenced by move_by_pieces_d::finish_retmode(), store_by_pieces_d::finish_retmode(), and op_by_pieces_d::run().

◆ decide_autoinc()

void pieces_addr::decide_autoinc ( machine_mode ,
bool ,
HOST_WIDE_INT  )
Decide whether to use autoinc for an address involved in a memory op.
MODE is the mode of the accesses, REVERSE is true if we've decided to
perform the operation starting from the end, and LEN is the length of
the operation.  Don't override an earlier decision to set m_auto.   

References CONSTANT_P, copy_to_mode_reg(), get_address_mode(), ggc_alloc(), m_addr, m_auto, m_explicit_inc, m_is_load, m_obj, NULL_RTX, plus_constant(), USE_LOAD_POST_INCREMENT, USE_LOAD_PRE_DECREMENT, USE_STORE_POST_INCREMENT, and USE_STORE_PRE_DECREMENT.

Referenced by op_by_pieces_d::op_by_pieces_d().

◆ get_addr_inc()

int pieces_addr::get_addr_inc ( )
inline

References m_addr_inc.

Referenced by op_by_pieces_d::op_by_pieces_d().

◆ increment_address()

void pieces_addr::increment_address ( HOST_WIDE_INT size)
Emit an add instruction to increment the address by SIZE.   

References emit_insn(), gen_add2_insn(), gen_int_mode(), GET_MODE, ggc_alloc(), and m_addr.

Referenced by maybe_postinc(), and maybe_predec().

◆ maybe_postinc()

void pieces_addr::maybe_postinc ( HOST_WIDE_INT size)
If we are supposed to decrement the address after each access, emit code
to do so now.  Increment by SIZE.   

References gcc_assert, HAVE_POST_INCREMENT, increment_address(), and m_explicit_inc.

Referenced by move_by_pieces_d::finish_retmode(), store_by_pieces_d::finish_retmode(), and op_by_pieces_d::run().

◆ maybe_predec()

void pieces_addr::maybe_predec ( HOST_WIDE_INT size)
If we are supposed to decrement the address after each access, emit code
to do so now.  Increment by SIZE (which has should have the correct sign
already).   

References gcc_assert, HAVE_PRE_DECREMENT, increment_address(), and m_explicit_inc.

Referenced by op_by_pieces_d::run().

Field Documentation

◆ m_addr

rtx pieces_addr::m_addr
private

◆ m_addr_inc

signed char pieces_addr::m_addr_inc
private

Referenced by get_addr_inc(), and pieces_addr().

◆ m_auto

bool pieces_addr::m_auto
private

Referenced by adjust(), decide_autoinc(), and pieces_addr().

◆ m_cfndata

void* pieces_addr::m_cfndata
private

Referenced by adjust().

◆ m_constfn

by_pieces_constfn pieces_addr::m_constfn
private

Referenced by adjust().

◆ m_explicit_inc

signed char pieces_addr::m_explicit_inc
private

◆ m_is_load

bool pieces_addr::m_is_load
private

Referenced by decide_autoinc().

◆ m_obj

rtx pieces_addr::m_obj
private

Referenced by adjust(), and decide_autoinc().


The documentation for this class was generated from the following file: