GCC Middle and Back End API Reference
|
#include <wide-int.h>
Public Member Functions | |
generic_wide_int () | |
template<typename T > | |
generic_wide_int (const T &) | |
template<typename T > | |
generic_wide_int (const T &, unsigned int) | |
HOST_WIDE_INT | to_shwi (unsigned int) const |
HOST_WIDE_INT | to_shwi () const |
unsigned HOST_WIDE_INT | to_uhwi (unsigned int) const |
unsigned HOST_WIDE_INT | to_uhwi () const |
HOST_WIDE_INT | to_short_addr () const |
HOST_WIDE_INT | sign_mask () const |
HOST_WIDE_INT | elt (unsigned int) const |
HOST_WIDE_INT | sext_elt (unsigned int) const |
unsigned HOST_WIDE_INT | ulow () const |
unsigned HOST_WIDE_INT | uhigh () const |
HOST_WIDE_INT | slow () const |
HOST_WIDE_INT | shigh () const |
template<typename T > | |
generic_wide_int & | operator= (const T &) |
void | dump () const |
template<typename T > | |
generic_wide_int< storage > & | operator= (const T &x) |
Static Public Attributes | |
static const bool | is_sign_extended = wi::int_traits <generic_wide_int <storage> >::is_sign_extended |
static const bool | needs_write_val_arg = wi::int_traits <generic_wide_int <storage> >::needs_write_val_arg |
This class defines an integer type using the storage provided by the template argument. The storage class must provide the following functions: unsigned int get_precision () const Return the number of bits in the integer. HOST_WIDE_INT *get_val () const Return a pointer to the array of blocks that encodes the integer. unsigned int get_len () const Return the number of blocks in get_val (). If this is smaller than the number of blocks implied by get_precision (), the remaining blocks are sign extensions of block get_len () - 1. Although not required by generic_wide_int itself, writable storage classes can also provide the following functions: HOST_WIDE_INT *write_val (unsigned int) Get a modifiable version of get_val (). The argument should be upper estimation for LEN (ignored by all storages but widest_int_storage). unsigned int set_len (unsigned int len) Set the value returned by get_len () to LEN.
|
inline |
|
inline |
|
inline |
void generic_wide_int< storage >::dump | ( | ) | const |
Dump the contents of the integer to stderr, for debugging.
References ggc_alloc(), HOST_BITS_PER_WIDE_INT, HOST_WIDE_INT_PRINT_HEX, and i.
|
inline |
Return block I, which might be implicitly or explicit encoded.
References i.
Referenced by immed_wide_int_const_1(), insert_wide_int(), real_from_integer(), and streamer_write_wide_int().
generic_wide_int & generic_wide_int< storage >::operator= | ( | const T & | ) |
|
inline |
|
inline |
Like elt, but sign-extend beyond the upper bit, instead of returning the raw encoding.
References ggc_alloc(), HOST_BITS_PER_WIDE_INT, i, and sext_hwi().
Referenced by inchash::hash::add_wide_int().
|
inline |
Return the signed value of the most-significant explicitly-encoded block.
|
inline |
Return the implicit value of blocks above get_len ().
References gcc_assert, ggc_alloc(), and HOST_BITS_PER_WIDE_INT.
Referenced by wi::clz(), wi::exact_log2(), and wi::popcount().
|
inline |
Return the signed value of the least-significant explicitly-encoded block.
|
inline |
TODO: The compiler is half converted from using HOST_WIDE_INT to represent addresses to using offset_int to represent addresses. We use to_short_addr at the interface from new code to old, unconverted code.
|
inline |
Return THIS as a signed HOST_WIDE_INT, in its natural precision.
|
inline |
Return THIS as a signed HOST_WIDE_INT, sign-extending from PRECISION. If THIS does not fit in PRECISION, the information is lost.
References HOST_BITS_PER_WIDE_INT, and sext_hwi().
Referenced by analyze_subscript_affine_affine(), wi::divmod_internal(), field_byte_offset(), maybe_flat_loop_profile(), most_expensive_mult_to_index(), and wi::mul_internal().
|
inline |
Return THIS as an signed HOST_WIDE_INT, in its natural precision.
|
inline |
Return THIS as an unsigned HOST_WIDE_INT, zero-extending from PRECISION. If THIS does not fit in PRECISION, the information is lost.
References HOST_BITS_PER_WIDE_INT, and zext_hwi().
Referenced by bit_value_assume_aligned(), ccp_finalize(), strlen_pass::count_nonzero_bytes_addr(), wi::divmod_internal(), ccp_folder::fold_stmt(), ipcp_update_vr(), and wi::mul_internal().
|
inline |
Return the unsigned value of the most-significant explicitly-encoded block.
Referenced by wi::clrsb(), wi::clz(), and wi::popcount().
|
inline |
Return the unsigned value of the least-significant explicitly-encoded block.
Referenced by wi::ctz(), and wi::mul_internal().
|
static |
|
static |