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 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 build_new_int_cst(), const_binop(), fixed_convert_from_real(), fixed_from_string(), immed_wide_int_const_1(), insert_wide_int(), native_encode_rtx(), real_from_integer(), streamer_write_wide_int(), streamer_write_widest_int(), wide_int_to_tree_1(), and 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 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, and HOST_BITS_PER_WIDE_INT.
Referenced by wi::clz(), wi::exact_log2(), wi::popcount(), and operator_mult::wi_op_overflows().
|
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(), tree_switch_conversion::switch_conversion::build_one_array(), wi::divmod_internal(), do_mpfr_arg2(), estimated_loop_iterations_int(), field_byte_offset(), fold_const_builtin_load_exponent(), fold_const_call_sss(), fold_const_call_sss(), get_computation_cost(), get_estimated_loop_iterations_int(), get_likely_max_loop_iterations_int(), get_max_loop_iterations_int(), ipa_odr_read_section(), likely_max_loop_iterations_int(), max_loop_iterations_int(), maybe_flat_loop_profile(), most_expensive_mult_to_index(), wi::mul_internal(), predict_loops(), split_loop(), vect_truncate_gather_scatter_offset(), operator_lshift::wi_fold(), and wide_int_to_tree_1().
|
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 add_ref_to_chain(), bit_value_assume_aligned(), tree_switch_conversion::switch_conversion::build_one_array(), ccp_finalize(), choose_multiplier(), strlen_pass::count_nonzero_bytes_addr(), wi::divmod_internal(), expand_divmod(), extract_bit_test_mask(), operator_lshift::fold_range(), ccp_folder::fold_stmt(), tree_switch_conversion::cluster::get_range(), ipcp_update_vr(), wi::mul_internal(), predict_iv_comparison(), print_decu(), vect_create_loop_vinfo(), vect_determine_precisions_from_range(), and wide_int_to_tree_1().
|
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 const_binop(), wi::ctz(), fixed_convert_from_real(), fixed_from_string(), and wi::mul_internal().
|
static |
|
static |