GCC Middle and Back End API Reference
bit_field_mode_iterator Class Reference

#include <machmode.h>

Collaboration diagram for bit_field_mode_iterator:

Public Member Functions

 bit_field_mode_iterator (HOST_WIDE_INT, HOST_WIDE_INT, poly_int64, poly_int64, unsigned int, bool)
 
bool next_mode (scalar_int_mode *)
 
bool prefer_smaller_modes ()
 

Private Attributes

opt_scalar_int_mode m_mode
 
HOST_WIDE_INT m_bitsize
 
HOST_WIDE_INT m_bitpos
 
poly_int64 m_bitregion_start
 
poly_int64 m_bitregion_end
 
unsigned int m_align
 
bool m_volatilep
 
int m_count
 

Detailed Description

A class for iterating through possible bitfield modes.   

Constructor & Destructor Documentation

◆ bit_field_mode_iterator()

bit_field_mode_iterator::bit_field_mode_iterator ( HOST_WIDE_INT bitsize,
HOST_WIDE_INT bitpos,
poly_int64 bitregion_start,
poly_int64 bitregion_end,
unsigned int align,
bool volatilep )
Construct an iterator for a bitfield that spans BITSIZE bits,
starting at BITPOS.

BITREGION_START is the bit position of the first bit in this
sequence of bit fields.  BITREGION_END is the last bit in this
sequence.  If these two fields are non-zero, we should restrict the
memory access to that range.  Otherwise, we are allowed to touch
any adjacent non bit-fields.

ALIGN is the alignment of the underlying object in bits.
VOLATILEP says whether the bitfield is volatile.   

References BITS_PER_WORD, end(), known_eq, m_bitregion_end, MAX, and MIN.

Member Function Documentation

◆ next_mode()

bool bit_field_mode_iterator::next_mode ( scalar_int_mode * out_mode)
Calls to this function return successively larger modes that can be used
to represent the bitfield.  Return true if another bitfield mode is
available, storing it in *OUT_MODE if so.   

References BITS_PER_WORD, end(), opt_mode< T >::exists(), GET_MODE_ALIGNMENT, GET_MODE_BITSIZE(), GET_MODE_PRECISION(), GET_MODE_WIDER_MODE(), m_align, m_bitpos, m_bitregion_end, m_bitregion_start, m_bitsize, m_count, m_mode, MAX_FIXED_MODE_SIZE, maybe_gt, and targetm.

Referenced by adjust_bit_field_mem_for_reg(), and get_best_mode().

◆ prefer_smaller_modes()

bool bit_field_mode_iterator::prefer_smaller_modes ( )
Return true if smaller modes are generally preferred for this kind
of bitfield.   

References m_volatilep, and targetm.

Referenced by adjust_bit_field_mem_for_reg(), and get_best_mode().

Field Documentation

◆ m_align

unsigned int bit_field_mode_iterator::m_align
private

Referenced by next_mode().

◆ m_bitpos

HOST_WIDE_INT bit_field_mode_iterator::m_bitpos
private

Referenced by next_mode().

◆ m_bitregion_end

poly_int64 bit_field_mode_iterator::m_bitregion_end
private

◆ m_bitregion_start

poly_int64 bit_field_mode_iterator::m_bitregion_start
private

Referenced by next_mode().

◆ m_bitsize

HOST_WIDE_INT bit_field_mode_iterator::m_bitsize
private

Referenced by next_mode().

◆ m_count

int bit_field_mode_iterator::m_count
private

Referenced by next_mode().

◆ m_mode

opt_scalar_int_mode bit_field_mode_iterator::m_mode
private

Referenced by next_mode().

◆ m_volatilep

bool bit_field_mode_iterator::m_volatilep
private

Referenced by prefer_smaller_modes().


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