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

Public Member Functions

 compare_by_pieces_d (rtx op0, rtx op1, by_pieces_constfn op1_cfn, void *op1_cfn_data, HOST_WIDE_INT len, int align, rtx_code_label *fail_label)
 
void run ()
 

Protected Attributes

pieces_addr m_to
 
pieces_addr m_from
 
const unsigned HOST_WIDE_INT m_len
 
HOST_WIDE_INT m_offset
 
unsigned int m_align
 
unsigned int m_max_size
 
bool m_reverse
 
bool m_push
 
bool m_overlap_op_by_pieces
 
by_pieces_operation m_op
 

Private Member Functions

void generate (rtx, rtx, machine_mode) final override
 
bool prepare_mode (machine_mode, unsigned int) final override
 
void finish_mode (machine_mode) final override
 
fixed_size_mode get_usable_mode (fixed_size_mode, unsigned int)
 
fixed_size_mode smallest_fixed_size_mode_for_size (unsigned int)
 

Private Attributes

rtx_code_labelm_fail_label
 
rtx m_accumulator
 
int m_count
 
int m_batch
 

Detailed Description

Context used by compare_by_pieces_genfn.  It stores the fail label
to jump to in case of miscomparison, and for branch ratios greater than 1,
it stores an accumulator and the current and maximum counts before
emitting another branch.   

Constructor & Destructor Documentation

◆ compare_by_pieces_d()

compare_by_pieces_d::compare_by_pieces_d ( rtx op0,
rtx op1,
by_pieces_constfn op1_cfn,
void * op1_cfn_data,
HOST_WIDE_INT len,
int align,
rtx_code_label * fail_label )
inline

References fail_label, and m_fail_label.

Member Function Documentation

◆ finish_mode()

void compare_by_pieces_d::finish_mode ( machine_mode mode)
finaloverrideprivatevirtual
Called after expanding a series of comparisons in MODE.  If we have
accumulated results for which we haven't emitted a branch yet, do
so now.   

Reimplemented from op_by_pieces_d.

References const0_rtx, do_compare_rtx_and_jump(), m_accumulator, m_fail_label, NULL, NULL_RTX, and profile_probability::uninitialized().

◆ generate()

void compare_by_pieces_d::generate ( rtx op0,
rtx op1,
machine_mode mode )
finaloverrideprivatevirtual
A callback used when iterating for a compare_by_pieces_operation.
OP0 and OP1 are the values that have been loaded and should be
compared in MODE.  DATA holds a pointer to the compare_by_pieces_data
context structure.   

Implements op_by_pieces_d.

References const0_rtx, do_compare_rtx_and_jump(), expand_binop(), m_accumulator, m_batch, m_count, m_fail_label, NULL, NULL_RTX, OPTAB_LIB_WIDEN, and profile_probability::uninitialized().

◆ get_usable_mode()

fixed_size_mode op_by_pieces_d::get_usable_mode ( fixed_size_mode mode,
unsigned int len )
privateinherited
This function returns the largest usable integer mode for LEN bytes
whose size is no bigger than size of MODE.   

References GET_MODE_SIZE(), op_by_pieces_d::m_align, op_by_pieces_d::m_op, op_by_pieces_d::prepare_mode(), and widest_fixed_size_mode_for_size().

Referenced by op_by_pieces_d::run().

◆ prepare_mode()

bool compare_by_pieces_d::prepare_mode ( machine_mode mode,
unsigned int align )
finaloverrideprivatevirtual
Return true if MODE can be used for a set of moves and comparisons,
given an alignment ALIGN.  Prepare whatever data is necessary for
later calls to generate.   

Implements op_by_pieces_d.

References can_compare_p(), ccp_jump, GET_MODE_ALIGNMENT, m_accumulator, m_batch, m_count, NULL_RTX, optab_handler(), and targetm.

◆ run()

◆ smallest_fixed_size_mode_for_size()

fixed_size_mode op_by_pieces_d::smallest_fixed_size_mode_for_size ( unsigned int size)
privateinherited

Field Documentation

◆ m_accumulator

rtx compare_by_pieces_d::m_accumulator
private

Referenced by finish_mode(), generate(), and prepare_mode().

◆ m_align

unsigned int op_by_pieces_d::m_align
protectedinherited

◆ m_batch

int compare_by_pieces_d::m_batch
private

Referenced by generate(), and prepare_mode().

◆ m_count

int compare_by_pieces_d::m_count
private

Referenced by generate(), and prepare_mode().

◆ m_fail_label

rtx_code_label* compare_by_pieces_d::m_fail_label
private

◆ m_from

pieces_addr op_by_pieces_d::m_from
protectedinherited

◆ m_len

const unsigned HOST_WIDE_INT op_by_pieces_d::m_len
protectedinherited

◆ m_max_size

unsigned int op_by_pieces_d::m_max_size
protectedinherited

◆ m_offset

HOST_WIDE_INT op_by_pieces_d::m_offset
protectedinherited

◆ m_op

◆ m_overlap_op_by_pieces

bool op_by_pieces_d::m_overlap_op_by_pieces
protectedinherited

◆ m_push

bool op_by_pieces_d::m_push
protectedinherited

Referenced by op_by_pieces_d::run().

◆ m_reverse

◆ m_to


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