GCC Middle and Back End API Reference
wide-int.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  wi::binary_traits< T1, T2, FLEXIBLE_PRECISION, FLEXIBLE_PRECISION >
 
struct  wi::binary_traits< T1, T2, FLEXIBLE_PRECISION, VAR_PRECISION >
 
struct  wi::binary_traits< T1, T2, FLEXIBLE_PRECISION, INL_CONST_PRECISION >
 
struct  wi::binary_traits< T1, T2, FLEXIBLE_PRECISION, CONST_PRECISION >
 
struct  wi::binary_traits< T1, T2, VAR_PRECISION, FLEXIBLE_PRECISION >
 
struct  wi::binary_traits< T1, T2, INL_CONST_PRECISION, FLEXIBLE_PRECISION >
 
struct  wi::binary_traits< T1, T2, CONST_PRECISION, FLEXIBLE_PRECISION >
 
struct  wi::binary_traits< T1, T2, INL_CONST_PRECISION, INL_CONST_PRECISION >
 
struct  wi::binary_traits< T1, T2, CONST_PRECISION, CONST_PRECISION >
 
struct  wi::binary_traits< T1, T2, VAR_PRECISION, VAR_PRECISION >
 
class  wi::storage_ref
 
class  generic_wide_int< storage >
 
struct  wi::int_traits< generic_wide_int< storage > >
 
class  wide_int_ref_storage< SE, HDP >
 
struct  wi::int_traits< wide_int_ref_storage< SE, HDP > >
 
class  wide_int_storage
 
struct  wi::int_traits< wide_int_storage >
 
class  fixed_wide_int_storage< N >
 
struct  wi::int_traits< fixed_wide_int_storage< N > >
 
class  widest_int_storage< N >
 
struct  wi::int_traits< widest_int_storage< N > >
 
class  trailing_wide_int_storage
 
struct  wi::int_traits< trailing_wide_int_storage >
 
struct  trailing_wide_ints< N >
 
struct  wi::primitive_int_traits< T, signed_p >
 
struct  wi::int_traits< unsigned char >
 
struct  wi::int_traits< unsigned short >
 
struct  wi::int_traits< int >
 
struct  wi::int_traits< unsigned int >
 
struct  wi::int_traits< long >
 
struct  wi::int_traits< unsigned long >
 
class  wi::hwi_with_prec
 
struct  wi::ints_for< T, precision_type >
 
struct  wi::ints_for< T, VAR_PRECISION >
 
struct  wi::int_traits< wi::hwi_with_prec >
 
struct  wi::never_used1
 
struct  wi::never_used2
 

Namespaces

namespace  wi
 

Macros

#define WIDE_INT_MAX_INL_ELTS
 
#define WIDE_INT_MAX_INL_PRECISION    (WIDE_INT_MAX_INL_ELTS * HOST_BITS_PER_WIDE_INT)
 
#define WIDE_INT_MAX_ELTS   1024
 
#define WIDE_INT_MAX_PRECISION   (WIDE_INT_MAX_ELTS * HOST_BITS_PER_WIDE_INT)
 
#define WIDEST_INT_MAX_ELTS   2048
 
#define WIDEST_INT_MAX_PRECISION   (WIDEST_INT_MAX_ELTS * HOST_BITS_PER_WIDE_INT)
 
#define ADDR_MAX_BITSIZE   64
 
#define ADDR_MAX_PRECISION
 
#define OFFSET_INT_ELTS   (ADDR_MAX_PRECISION / HOST_BITS_PER_WIDE_INT)
 
#define WIDE_INT_MAX_HWIS(PRECISION)
 
#define WI_BINARY_RESULT(T1, T2)
 
#define WI_BINARY_OPERATOR_RESULT(T1, T2)
 
#define WI_SIGNED_SHIFT_RESULT(T1, T2)
 
#define WI_BINARY_PREDICATE_RESULT(T1, T2)
 
#define WI_SIGNED_BINARY_PREDICATE_RESULT(T1, T2)
 
#define WI_UNARY_RESULT(T)
 
#define WI_BINARY_RESULT_VAR(RESULT, VAL, T1, X, T2, Y)
 
#define WI_UNARY_RESULT_VAR(RESULT, VAL, T, X)
 
#define FIXED_WIDE_INT(N)
 
#define WIDE_INT_REF_FOR(T)
 
#define UNARY_PREDICATE    template <typename T> bool
 
#define UNARY_FUNCTION    template <typename T> WI_UNARY_RESULT (T)
 
#define BINARY_PREDICATE    template <typename T1, typename T2> bool
 
#define BINARY_FUNCTION    template <typename T1, typename T2> WI_BINARY_RESULT (T1, T2)
 
#define SHIFT_FUNCTION    template <typename T1, typename T2> WI_UNARY_RESULT (T1)
 
#define ASSIGNMENT_OPERATOR(OP, F)
 
#define SHIFT_ASSIGNMENT_OPERATOR(OP, OP2)
 
#define INCDEC_OPERATOR(OP, DELTA)
 
#define WIDEST_INT(N)
 
#define TRAILING_WIDE_INT_ACCESSOR(NAME, FIELD, I)
 
#define SIGNED_BINARY_PREDICATE(OP, F)
 
#define UNARY_OPERATOR(OP, F)
 
#define BINARY_PREDICATE(OP, F)
 
#define BINARY_OPERATOR(OP, F)
 
#define SHIFT_OPERATOR(OP, F)
 

Typedefs

typedef generic_wide_int< wide_int_storagewide_int
 
typedef generic_wide_int< widest_int_storage< WIDEST_INT_MAX_PRECISION > > widest_int
 
typedef generic_wide_int< widest_int_storage< WIDEST_INT_MAX_PRECISION *2 > > widest2_int
 
typedef generic_wide_int< wide_int_ref_storage< false > > wide_int_ref
 
typedef generic_wide_int< trailing_wide_int_storagetrailing_wide_int
 

Enumerations

enum  wi::overflow_type { wi::OVF_NONE = 0 , wi::OVF_UNDERFLOW = -1 , wi::OVF_OVERFLOW = 1 , wi::OVF_UNKNOWN = 2 }
 
enum  wi::precision_type { wi::FLEXIBLE_PRECISION , wi::VAR_PRECISION , wi::INL_CONST_PRECISION , wi::CONST_PRECISION }
 

Functions

 STATIC_ASSERT (WIDE_INT_MAX_INL_ELTS< WIDE_INT_MAX_ELTS)
 
typedef FIXED_WIDE_INT (ADDR_MAX_PRECISION) offset_int
 
template<typename T >
unsigned int wi::get_precision (const T &)
 
template<typename T1 , typename T2 >
unsigned int wi::get_binary_precision (const T1 &, const T2 &)
 
template<typename T1 , typename T2 >
void wi::copy (T1 &, const T2 &)
 
UNARY_PREDICATE wi::fits_shwi_p (const T &)
 
UNARY_PREDICATE wi::fits_uhwi_p (const T &)
 
UNARY_PREDICATE wi::neg_p (const T &, signop=SIGNED)
 
template<typename T >
HOST_WIDE_INT wi::sign_mask (const T &)
 
BINARY_PREDICATE wi::eq_p (const T1 &, const T2 &)
 
BINARY_PREDICATE wi::ne_p (const T1 &, const T2 &)
 
BINARY_PREDICATE wi::lt_p (const T1 &, const T2 &, signop)
 
BINARY_PREDICATE wi::lts_p (const T1 &, const T2 &)
 
BINARY_PREDICATE wi::ltu_p (const T1 &, const T2 &)
 
BINARY_PREDICATE wi::le_p (const T1 &, const T2 &, signop)
 
BINARY_PREDICATE wi::les_p (const T1 &, const T2 &)
 
BINARY_PREDICATE wi::leu_p (const T1 &, const T2 &)
 
BINARY_PREDICATE wi::gt_p (const T1 &, const T2 &, signop)
 
BINARY_PREDICATE wi::gts_p (const T1 &, const T2 &)
 
BINARY_PREDICATE wi::gtu_p (const T1 &, const T2 &)
 
BINARY_PREDICATE wi::ge_p (const T1 &, const T2 &, signop)
 
BINARY_PREDICATE wi::ges_p (const T1 &, const T2 &)
 
BINARY_PREDICATE wi::geu_p (const T1 &, const T2 &)
 
template<typename T1 , typename T2 >
int wi::cmp (const T1 &, const T2 &, signop)
 
template<typename T1 , typename T2 >
int wi::cmps (const T1 &, const T2 &)
 
template<typename T1 , typename T2 >
int wi::cmpu (const T1 &, const T2 &)
 
UNARY_FUNCTION wi::bit_not (const T &)
 
UNARY_FUNCTION wi::neg (const T &)
 
UNARY_FUNCTION wi::neg (const T &, overflow_type *)
 
UNARY_FUNCTION wi::abs (const T &)
 
UNARY_FUNCTION wi::ext (const T &, unsigned int, signop)
 
UNARY_FUNCTION wi::sext (const T &, unsigned int)
 
UNARY_FUNCTION wi::zext (const T &, unsigned int)
 
UNARY_FUNCTION wi::set_bit (const T &, unsigned int)
 
UNARY_FUNCTION wi::bswap (const T &)
 
UNARY_FUNCTION wi::bitreverse (const T &)
 
BINARY_FUNCTION wi::min (const T1 &, const T2 &, signop)
 
BINARY_FUNCTION wi::smin (const T1 &, const T2 &)
 
BINARY_FUNCTION wi::umin (const T1 &, const T2 &)
 
BINARY_FUNCTION wi::max (const T1 &, const T2 &, signop)
 
BINARY_FUNCTION wi::smax (const T1 &, const T2 &)
 
BINARY_FUNCTION wi::umax (const T1 &, const T2 &)
 
BINARY_FUNCTION wi::bit_and (const T1 &, const T2 &)
 
BINARY_FUNCTION wi::bit_and_not (const T1 &, const T2 &)
 
BINARY_FUNCTION wi::bit_or (const T1 &, const T2 &)
 
BINARY_FUNCTION wi::bit_or_not (const T1 &, const T2 &)
 
BINARY_FUNCTION wi::bit_xor (const T1 &, const T2 &)
 
BINARY_FUNCTION wi::add (const T1 &, const T2 &)
 
BINARY_FUNCTION wi::add (const T1 &, const T2 &, signop, overflow_type *)
 
BINARY_FUNCTION wi::sub (const T1 &, const T2 &)
 
BINARY_FUNCTION wi::sub (const T1 &, const T2 &, signop, overflow_type *)
 
BINARY_FUNCTION wi::mul (const T1 &, const T2 &)
 
BINARY_FUNCTION wi::mul (const T1 &, const T2 &, signop, overflow_type *)
 
BINARY_FUNCTION wi::smul (const T1 &, const T2 &, overflow_type *)
 
BINARY_FUNCTION wi::umul (const T1 &, const T2 &, overflow_type *)
 
BINARY_FUNCTION wi::mul_high (const T1 &, const T2 &, signop)
 
BINARY_FUNCTION wi::div_trunc (const T1 &, const T2 &, signop, overflow_type *=0)
 
BINARY_FUNCTION wi::sdiv_trunc (const T1 &, const T2 &)
 
BINARY_FUNCTION wi::udiv_trunc (const T1 &, const T2 &)
 
BINARY_FUNCTION wi::div_floor (const T1 &, const T2 &, signop, overflow_type *=0)
 
BINARY_FUNCTION wi::udiv_floor (const T1 &, const T2 &)
 
BINARY_FUNCTION wi::sdiv_floor (const T1 &, const T2 &)
 
BINARY_FUNCTION wi::div_ceil (const T1 &, const T2 &, signop, overflow_type *=0)
 
BINARY_FUNCTION wi::udiv_ceil (const T1 &, const T2 &)
 
BINARY_FUNCTION wi::div_round (const T1 &, const T2 &, signop, overflow_type *=0)
 
BINARY_FUNCTION wi::divmod_trunc (const T1 &, const T2 &, signop, WI_BINARY_RESULT(T1, T2) *)
 
BINARY_FUNCTION wi::gcd (const T1 &, const T2 &, signop=UNSIGNED)
 
BINARY_FUNCTION wi::mod_trunc (const T1 &, const T2 &, signop, overflow_type *=0)
 
BINARY_FUNCTION wi::smod_trunc (const T1 &, const T2 &)
 
BINARY_FUNCTION wi::umod_trunc (const T1 &, const T2 &)
 
BINARY_FUNCTION wi::mod_floor (const T1 &, const T2 &, signop, overflow_type *=0)
 
BINARY_FUNCTION wi::umod_floor (const T1 &, const T2 &)
 
BINARY_FUNCTION wi::mod_ceil (const T1 &, const T2 &, signop, overflow_type *=0)
 
BINARY_FUNCTION wi::mod_round (const T1 &, const T2 &, signop, overflow_type *=0)
 
template<typename T1 , typename T2 >
bool wi::multiple_of_p (const T1 &, const T2 &, signop)
 
template<typename T1 , typename T2 >
bool wi::multiple_of_p (const T1 &, const T2 &, signop, WI_BINARY_RESULT(T1, T2) *)
 
SHIFT_FUNCTION wi::lshift (const T1 &, const T2 &)
 
SHIFT_FUNCTION wi::lrshift (const T1 &, const T2 &)
 
SHIFT_FUNCTION wi::arshift (const T1 &, const T2 &)
 
SHIFT_FUNCTION wi::rshift (const T1 &, const T2 &, signop sgn)
 
SHIFT_FUNCTION wi::lrotate (const T1 &, const T2 &, unsigned int=0)
 
SHIFT_FUNCTION wi::rrotate (const T1 &, const T2 &, unsigned int=0)
 
bool wi::only_sign_bit_p (const wide_int_ref &, unsigned int)
 
bool wi::only_sign_bit_p (const wide_int_ref &)
 
int wi::clz (const wide_int_ref &)
 
int wi::clrsb (const wide_int_ref &)
 
int wi::ctz (const wide_int_ref &)
 
int wi::exact_log2 (const wide_int_ref &)
 
int wi::floor_log2 (const wide_int_ref &)
 
int wi::ffs (const wide_int_ref &)
 
int wi::popcount (const wide_int_ref &)
 
int wi::parity (const wide_int_ref &)
 
template<typename T >
unsigned HOST_WIDE_INT wi::extract_uhwi (const T &, unsigned int, unsigned int)
 
template<typename T >
unsigned int wi::min_precision (const T &, signop)
 
static void wi::accumulate_overflow (overflow_type &, overflow_type)
 
unsigned int wi::force_to_size (HOST_WIDE_INT *, const HOST_WIDE_INT *, unsigned int, unsigned int, unsigned int, signop sgn)
 
unsigned int wi::from_array (HOST_WIDE_INT *, const HOST_WIDE_INT *, unsigned int, unsigned int, bool=true)
 
template<int N>
 FIXED_WIDE_INT (N) fixed_wide_int_storage< N >
 
template<typename T1 , typename T2 >
 FIXED_WIDE_INT (N) wi
 
template<int N>
 WIDEST_INT (N) widest_int_storage< N >
 
template<typename T1 , typename T2 >
 WIDEST_INT (N) wi
 
hwi_with_prec wi::shwi (HOST_WIDE_INT, unsigned int)
 
hwi_with_prec wi::uhwi (unsigned HOST_WIDE_INT, unsigned int)
 
hwi_with_prec wi::minus_one (unsigned int)
 
hwi_with_prec wi::zero (unsigned int)
 
hwi_with_prec wi::one (unsigned int)
 
hwi_with_prec wi::two (unsigned int)
 
bool wi::eq_p_large (const HOST_WIDE_INT *, unsigned int, const HOST_WIDE_INT *, unsigned int, unsigned int)
 
bool wi::lts_p_large (const HOST_WIDE_INT *, unsigned int, unsigned int, const HOST_WIDE_INT *, unsigned int)
 
bool wi::ltu_p_large (const HOST_WIDE_INT *, unsigned int, unsigned int, const HOST_WIDE_INT *, unsigned int)
 
int wi::cmps_large (const HOST_WIDE_INT *, unsigned int, unsigned int, const HOST_WIDE_INT *, unsigned int)
 
int wi::cmpu_large (const HOST_WIDE_INT *, unsigned int, unsigned int, const HOST_WIDE_INT *, unsigned int)
 
unsigned int wi::sext_large (HOST_WIDE_INT *, const HOST_WIDE_INT *, unsigned int, unsigned int, unsigned int)
 
unsigned int wi::zext_large (HOST_WIDE_INT *, const HOST_WIDE_INT *, unsigned int, unsigned int, unsigned int)
 
unsigned int wi::set_bit_large (HOST_WIDE_INT *, const HOST_WIDE_INT *, unsigned int, unsigned int, unsigned int)
 
unsigned int wi::bswap_large (HOST_WIDE_INT *, const HOST_WIDE_INT *, unsigned int, unsigned int)
 
unsigned int wi::bitreverse_large (HOST_WIDE_INT *, const HOST_WIDE_INT *, unsigned int, unsigned int)
 
unsigned int wi::lshift_large (HOST_WIDE_INT *, const HOST_WIDE_INT *, unsigned int, unsigned int, unsigned int)
 
unsigned int wi::lrshift_large (HOST_WIDE_INT *, const HOST_WIDE_INT *, unsigned int, unsigned int, unsigned int, unsigned int)
 
unsigned int wi::arshift_large (HOST_WIDE_INT *, const HOST_WIDE_INT *, unsigned int, unsigned int, unsigned int, unsigned int)
 
unsigned int wi::and_large (HOST_WIDE_INT *, const HOST_WIDE_INT *, unsigned int, const HOST_WIDE_INT *, unsigned int, unsigned int)
 
unsigned int wi::and_not_large (HOST_WIDE_INT *, const HOST_WIDE_INT *, unsigned int, const HOST_WIDE_INT *, unsigned int, unsigned int)
 
unsigned int wi::or_large (HOST_WIDE_INT *, const HOST_WIDE_INT *, unsigned int, const HOST_WIDE_INT *, unsigned int, unsigned int)
 
unsigned int wi::or_not_large (HOST_WIDE_INT *, const HOST_WIDE_INT *, unsigned int, const HOST_WIDE_INT *, unsigned int, unsigned int)
 
unsigned int wi::xor_large (HOST_WIDE_INT *, const HOST_WIDE_INT *, unsigned int, const HOST_WIDE_INT *, unsigned int, unsigned int)
 
unsigned int wi::add_large (HOST_WIDE_INT *, const HOST_WIDE_INT *, unsigned int, const HOST_WIDE_INT *, unsigned int, unsigned int, signop, overflow_type *)
 
unsigned int wi::sub_large (HOST_WIDE_INT *, const HOST_WIDE_INT *, unsigned int, const HOST_WIDE_INT *, unsigned int, unsigned int, signop, overflow_type *)
 
unsigned int wi::mul_internal (HOST_WIDE_INT *, const HOST_WIDE_INT *, unsigned int, const HOST_WIDE_INT *, unsigned int, unsigned int, signop, overflow_type *, bool)
 
unsigned int wi::divmod_internal (HOST_WIDE_INT *, unsigned int *, HOST_WIDE_INT *, const HOST_WIDE_INT *, unsigned int, unsigned int, const HOST_WIDE_INT *, unsigned int, unsigned int, signop, overflow_type *)
 
template<typename T >
 WI_UNARY_RESULT (T) wi
 
template<typename T1 , typename T2 >
 WI_BINARY_RESULT (T1, T2) wi
 
template<typename T1 , typename T2 >
 WI_UNARY_RESULT (T1) wi
 
template<typename T1 , typename T2 >
 WI_SIGNED_SHIFT_RESULT (T1, T2) operator>>(const T1 &x
 
void gt_ggc_mx (generic_wide_int< wide_int_storage > *)=delete
 
void gt_pch_nx (generic_wide_int< wide_int_storage > *)=delete
 
void gt_pch_nx (generic_wide_int< wide_int_storage > *, gt_pointer_operator, void *)=delete
 
template<int N>
void gt_ggc_mx (generic_wide_int< fixed_wide_int_storage< N > > *)
 
template<int N>
void gt_pch_nx (generic_wide_int< fixed_wide_int_storage< N > > *)
 
template<int N>
void gt_pch_nx (generic_wide_int< fixed_wide_int_storage< N > > *, gt_pointer_operator, void *)
 
template<int N>
void gt_ggc_mx (generic_wide_int< widest_int_storage< N > > *)=delete
 
template<int N>
void gt_pch_nx (generic_wide_int< widest_int_storage< N > > *)=delete
 
template<int N>
void gt_pch_nx (generic_wide_int< widest_int_storage< N > > *, gt_pointer_operator, void *)=delete
 
template<int N>
void gt_ggc_mx (trailing_wide_ints< N > *)
 
template<int N>
void gt_pch_nx (trailing_wide_ints< N > *)
 
template<int N>
void gt_pch_nx (trailing_wide_ints< N > *, gt_pointer_operator, void *)
 
wide_int wi::min_value (unsigned int, signop)
 
wide_int wi::min_value (never_used1 *)
 
wide_int wi::min_value (never_used2 *)
 
wide_int wi::max_value (unsigned int, signop)
 
wide_int wi::max_value (never_used1 *)
 
wide_int wi::max_value (never_used2 *)
 
wide_int wi::from_buffer (const unsigned char *, unsigned int)
 
void wi::to_mpz (const wide_int_ref &, mpz_t, signop)
 
wide_int wi::mask (unsigned int, bool, unsigned int)
 
wide_int wi::shifted_mask (unsigned int, unsigned int, bool, unsigned int)
 
wide_int wi::set_bit_in_zero (unsigned int, unsigned int)
 
wide_int wi::insert (const wide_int &x, const wide_int &y, unsigned int, unsigned int)
 
wide_int wi::round_down_for_mask (const wide_int &, const wide_int &)
 
wide_int wi::round_up_for_mask (const wide_int &, const wide_int &)
 
wide_int wi::mod_inv (const wide_int &a, const wide_int &b)
 
template<typename T >
T wi::mask (unsigned int, bool)
 
template<typename T >
T wi::shifted_mask (unsigned int, unsigned int, bool)
 
template<typename T >
T wi::set_bit_in_zero (unsigned int)
 
unsigned int wi::mask (HOST_WIDE_INT *, unsigned int, bool, unsigned int)
 
unsigned int wi::shifted_mask (HOST_WIDE_INT *, unsigned int, unsigned int, bool, unsigned int)
 

Variables

const T2 & y
 

Macro Definition Documentation

◆ ADDR_MAX_BITSIZE

#define ADDR_MAX_BITSIZE   64
This is the max size of any pointer on any machine.  It does not
seem to be as easy to sniff this out of the machine description as
it is for MAX_BITSIZE_MODE_ANY_INT since targets may support
multiple address sizes and may have different address sizes for
different address spaces.  However, currently the largest pointer
on any platform is 64 bits.  When that changes, then it is likely
that a target hook should be defined so that targets can make this
value larger for those targets.   

Referenced by get_ref_base_and_extent().

◆ ADDR_MAX_PRECISION

#define ADDR_MAX_PRECISION
Value:
#define HOST_BITS_PER_WIDE_INT
Definition hwint.h:53
#define ADDR_MAX_BITSIZE
Definition wide-int.h:269
This is the internal precision used when doing any address
arithmetic.  The '4' is really 3 + 1.  Three of the bits are for
the number of extra bits needed to do bit addresses and the other bit
is to allow everything to be signed without loosing any precision.
Then everything is rounded up to the next HWI for efficiency.   

Referenced by wi::extended_tree< N >::get_len(), and gimple_call_alloc_size().

◆ ASSIGNMENT_OPERATOR

#define ASSIGNMENT_OPERATOR ( OP,
F )
Value:
template <typename T> \
generic_wide_int &OP (const T &c) { return (*this = wi::F (*this, c)); }
Definition wide-int.h:776

◆ BINARY_FUNCTION

#define BINARY_FUNCTION    template <typename T1, typename T2> WI_BINARY_RESULT (T1, T2)

◆ BINARY_OPERATOR

#define BINARY_OPERATOR ( OP,
F )
Value:
template<typename T1, typename T2> \
WI_BINARY_OPERATOR_RESULT (T1, T2) \
OP (const T1 &x, const T2 &y) \
{ \
return wi::F (x, y); \
}
const T2 & y
Definition wide-int.h:3870

◆ BINARY_PREDICATE [1/2]

#define BINARY_PREDICATE    template <typename T1, typename T2> bool

◆ BINARY_PREDICATE [2/2]

#define BINARY_PREDICATE ( OP,
F )
Value:
template<typename T1, typename T2> \
WI_BINARY_PREDICATE_RESULT (T1, T2) \
OP (const T1 &x, const T2 &y) \
{ \
return wi::F (x, y); \
}

◆ FIXED_WIDE_INT

#define FIXED_WIDE_INT ( N)
Value:
generic_wide_int < fixed_wide_int_storage <N> >
An N-bit integer.  Until we can use typedef templates, use this instead.   

Referenced by FIXED_WIDE_INT(), FIXED_WIDE_INT(), fixed_wide_int_storage< N >::fixed_wide_int_storage(), and slow_safe_scale_64bit().

◆ INCDEC_OPERATOR

#define INCDEC_OPERATOR ( OP,
DELTA )
Value:
generic_wide_int &OP () { *this += DELTA; return *this; }

◆ OFFSET_INT_ELTS

#define OFFSET_INT_ELTS   (ADDR_MAX_PRECISION / HOST_BITS_PER_WIDE_INT)
The number of HWIs needed to store an offset_int.   

Referenced by wi::extended_tree< N >::get_len().

◆ SHIFT_ASSIGNMENT_OPERATOR

#define SHIFT_ASSIGNMENT_OPERATOR ( OP,
OP2 )
Value:
template <typename T> \
generic_wide_int &OP (const T &c) { return (*this = *this OP2 c); }
Restrict these to cases where the shift operator is defined.   

◆ SHIFT_FUNCTION

#define SHIFT_FUNCTION    template <typename T1, typename T2> WI_UNARY_RESULT (T1)

◆ SHIFT_OPERATOR

#define SHIFT_OPERATOR ( OP,
F )
Value:
template<typename T1, typename T2> \
WI_BINARY_OPERATOR_RESULT (T1, T1) \
OP (const T1 &x, const T2 &y) \
{ \
return wi::F (x, y); \
}

◆ SIGNED_BINARY_PREDICATE

#define SIGNED_BINARY_PREDICATE ( OP,
F )
Value:
template <typename T1, typename T2> \
OP (const T1 &x, const T2 &y) \
{ \
return wi::F (x, y); \
}
#define WI_SIGNED_BINARY_PREDICATE_RESULT(T1, T2)
Definition wide-int.h:311

◆ TRAILING_WIDE_INT_ACCESSOR

#define TRAILING_WIDE_INT_ACCESSOR ( NAME,
FIELD,
I )
Value:
trailing_wide_int get_##NAME () { return FIELD[I]; } \
template <typename T> void set_##NAME (const T &x) { FIELD[I] = x; }
#define I
Definition gensupport.cc:204
@ NAME
Definition tree-ssa-pre.cc:242
This macro is used in structures that end with a trailing_wide_ints field
called FIELD.  It declares get_NAME() and set_NAME() methods to access
element I of FIELD.   

◆ UNARY_FUNCTION

#define UNARY_FUNCTION    template <typename T> WI_UNARY_RESULT (T)

◆ UNARY_OPERATOR

#define UNARY_OPERATOR ( OP,
F )
Value:
template<typename T> \
WI_UNARY_RESULT (generic_wide_int<T>) \
OP (const generic_wide_int<T> &x) \
{ \
return wi::F (x); \
}

◆ UNARY_PREDICATE

#define UNARY_PREDICATE    template <typename T> bool

◆ WI_BINARY_OPERATOR_RESULT

#define WI_BINARY_OPERATOR_RESULT ( T1,
T2 )
Value:
typename wi::binary_traits <T1, T2>::operator_result
Likewise for binary operators, which excludes the case in which neither
T1 nor T2 is a wide-int-based type.   

◆ WI_BINARY_PREDICATE_RESULT

#define WI_BINARY_PREDICATE_RESULT ( T1,
T2 )
Value:
typename wi::binary_traits <T1, T2>::predicate_result
The type of result produced by a sign-agnostic binary predicate on
types T1 and T2.  This is bool if wide-int operations make sense for
T1 and T2 and leads to substitution failure otherwise.   

◆ WI_BINARY_RESULT

#define WI_BINARY_RESULT ( T1,
T2 )
Value:
typename wi::binary_traits <T1, T2>::result_type
The type of result produced by a binary operation on types T1 and T2.
Defined purely for brevity.   

Referenced by fixed_wide_int_storage< N >::fixed_wide_int_storage(), wi::get_binary_precision(), wi::multiple_of_p(), widest_int_storage< N >::operator=(), and widest_int_storage< N >::widest_int_storage().

◆ WI_BINARY_RESULT_VAR

#define WI_BINARY_RESULT_VAR ( RESULT,
VAL,
T1,
X,
T2,
Y )
Value:
WI_BINARY_RESULT (T1, T2) RESULT = \
wi::int_traits <WI_BINARY_RESULT (T1, T2)>::get_binary_result (X, Y); \
HOST_WIDE_INT *VAL = RESULT.write_val (0)
#define Y
Definition gensupport.cc:203
Definition wide-int.h:427
#define WI_BINARY_RESULT(T1, T2)
Definition wide-int.h:289
Define a variable RESULT to hold the result of a binary operation on
X and Y, which have types T1 and T2 respectively.  Define VAL to
point to the blocks of RESULT.  Once the user of the macro has
filled in VAL, it should call RESULT.set_len to set the number
of initialized blocks.   

Referenced by WI_BINARY_RESULT().

◆ WI_SIGNED_BINARY_PREDICATE_RESULT

#define WI_SIGNED_BINARY_PREDICATE_RESULT ( T1,
T2 )
Value:
typename wi::binary_traits <T1, T2>::signed_predicate_result
The type of result produced by a signed binary predicate on types T1 and T2.
This is bool if signed comparisons make sense for T1 and T2 and leads to
substitution failure otherwise.   

◆ WI_SIGNED_SHIFT_RESULT

#define WI_SIGNED_SHIFT_RESULT ( T1,
T2 )
Value:
typename wi::binary_traits <T1, T2>::signed_shift_result_type
The type of result produced by T1 << T2.  Leads to substitution failure
if the operation isn't supported.  Defined purely for brevity.   

◆ WI_UNARY_RESULT

#define WI_UNARY_RESULT ( T)
Value:
typename wi::binary_traits <T, T>::result_type
The type of result produced by a unary operation on type T.   

◆ WI_UNARY_RESULT_VAR

#define WI_UNARY_RESULT_VAR ( RESULT,
VAL,
T,
X )
Value:
WI_UNARY_RESULT (T) RESULT = \
wi::int_traits <WI_UNARY_RESULT (T)>::get_binary_result (X, X); \
HOST_WIDE_INT *VAL = RESULT.write_val (0)
#define WI_UNARY_RESULT(T)
Definition wide-int.h:315
Similar for the result of a unary operation on X, which has type T.   

Referenced by WI_UNARY_RESULT(), and WI_UNARY_RESULT().

◆ WIDE_INT_MAX_ELTS

#define WIDE_INT_MAX_ELTS   1024
Precision of wide_int and largest _BitInt precision + 1 we can
support.   

◆ WIDE_INT_MAX_HWIS

◆ WIDE_INT_MAX_INL_ELTS

#define WIDE_INT_MAX_INL_ELTS
Value:
((MAX_BITSIZE_MODE_ANY_INT + HOST_BITS_PER_WIDE_INT) \
Operations with very long integers.  -*- C++ -*-
   Copyright (C) 2012-2024 Free Software Foundation, Inc.

This file is part of GCC.

GCC is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 3, or (at your option) any
later version.

GCC is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
for more details.

You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3.  If not see
<http://www.gnu.org/licenses/>.   
wide-int.[cc|h] implements a class that efficiently performs
mathematical operations on finite precision integers.  wide_ints
are designed to be transient - they are not for long term storage
of values.  There is tight integration between wide_ints and the
other longer storage GCC representations (rtl and tree).

The actual precision of a wide_int depends on the flavor.  There
are three predefined flavors:

  1) wide_int (the default).  This flavor does the math in the
  precision of its input arguments.  It is assumed (and checked)
  that the precisions of the operands and results are consistent.
  This is the most efficient flavor.  It is not possible to examine
  bits above the precision that has been specified.  Because of
  this, the default flavor has semantics that are simple to
  understand and in general model the underlying hardware that the
  compiler is targetted for.

  This flavor must be used at the RTL level of gcc because there
  is, in general, not enough information in the RTL representation
  to extend a value beyond the precision specified in the mode.

  This flavor should also be used at the TREE and GIMPLE levels of
  the compiler except for the circumstances described in the
  descriptions of the other two flavors.

  The default wide_int representation does not contain any
  information inherent about signedness of the represented value,
  so it can be used to represent both signed and unsigned numbers.
  For operations where the results depend on signedness (full width
  multiply, division, shifts, comparisons, and operations that need
  overflow detected), the signedness must be specified separately.

  For precisions up to WIDE_INT_MAX_INL_PRECISION, it uses an inline
  buffer in the type, for larger precisions up to WIDEST_INT_MAX_PRECISION
  it uses a pointer to heap allocated buffer.

  2) offset_int.  This is a fixed-precision integer that can hold
  any address offset, measured in either bits or bytes, with at
  least one extra sign bit.  At the moment the maximum address
  size GCC supports is 64 bits.  With 8-bit bytes and an extra
  sign bit, offset_int therefore needs to have at least 68 bits
  of precision.  We round this up to 128 bits for efficiency.
  Values of type T are converted to this precision by sign- or
  zero-extending them based on the signedness of T.

  The extra sign bit means that offset_int is effectively a signed
  128-bit integer, i.e. it behaves like int128_t.

  Since the values are logically signed, there is no need to
  distinguish between signed and unsigned operations.  Sign-sensitive
  comparison operators <, <=, > and >= are therefore supported.
  Shift operators << and >> are also supported, with >> being
  an _arithmetic_ right shift.

  [ Note that, even though offset_int is effectively int128_t,
    it can still be useful to use unsigned comparisons like
    wi::leu_p (a, b) as a more efficient short-hand for
    "a >= 0 && a <= b". ]

  3) widest_int.  This representation is an approximation of
  infinite precision math.  However, it is not really infinite
  precision math as in the GMP library.  It is really finite
  precision math where the precision is WIDEST_INT_MAX_PRECISION.

  Like offset_int, widest_int is wider than all the values that
  it needs to represent, so the integers are logically signed.
  Sign-sensitive comparison operators <, <=, > and >= are supported,
  as are << and >>.

  There are several places in the GCC where this should/must be used:

  * Code that does induction variable optimizations.  This code
    works with induction variables of many different types at the
    same time.  Because of this, it ends up doing many different
    calculations where the operands are not compatible types.  The
    widest_int makes this easy, because it provides a field where
    nothing is lost when converting from any variable,

  * There are a small number of passes that currently use the
    widest_int that should use the default.  These should be
    changed.

There are surprising features of offset_int and widest_int
that the users should be careful about:

  1) Shifts and rotations are just weird.  You have to specify a
  precision in which the shift or rotate is to happen in.  The bits
  above this precision are zeroed.  While this is what you
  want, it is clearly non obvious.

  2) Larger precision math sometimes does not produce the same
  answer as would be expected for doing the math at the proper
  precision.  In particular, a multiply followed by a divide will
  produce a different answer if the first product is larger than
  what can be represented in the input precision.

The offset_int and the widest_int flavors are more expensive
than the default wide int, so in addition to the caveats with these
two, the default is the prefered representation.

All three flavors of wide_int are represented as a vector of
HOST_WIDE_INTs.  The default and widest_int vectors contain enough elements
to hold a value of MAX_BITSIZE_MODE_ANY_INT bits.  offset_int contains only
enough elements to hold ADDR_MAX_PRECISION bits.  The values are stored
in the vector with the least significant HOST_BITS_PER_WIDE_INT bits
in element 0.

The default wide_int contains three fields: the vector (VAL),
the precision and a length (LEN).  The length is the number of HWIs
needed to represent the value.  widest_int and offset_int have a
constant precision that cannot be changed, so they only store the
VAL and LEN fields.

Since most integers used in a compiler are small values, it is
generally profitable to use a representation of the value that is
as small as possible.  LEN is used to indicate the number of
elements of the vector that are in use.  The numbers are stored as
sign extended numbers as a means of compression.  Leading
HOST_WIDE_INTs that contain strings of either -1 or 0 are removed
as long as they can be reconstructed from the top bit that is being
represented.

The precision and length of a wide_int are always greater than 0.
Any bits in a wide_int above the precision are sign-extended from the
most significant bit.  For example, a 4-bit value 0x8 is represented as
VAL = { 0xf...fff8 }.  However, as an optimization, we allow other integer
constants to be represented with undefined bits above the precision.
This allows INTEGER_CSTs to be pre-extended according to TYPE_SIGN,
so that the INTEGER_CST representation can be used both in TYPE_PRECISION
and in wider precisions.

There are constructors to create the various forms of wide_int from
trees, rtl and constants.  For trees the options are:

          tree t = ...;
          wi::to_wide (t)     // Treat T as a wide_int
          wi::to_offset (t)   // Treat T as an offset_int
          wi::to_widest (t)   // Treat T as a widest_int

All three are light-weight accessors that should have no overhead
in release builds.  If it is useful for readability reasons to
store the result in a temporary variable, the preferred method is:

          wi::tree_to_wide_ref twide = wi::to_wide (t);
          wi::tree_to_offset_ref toffset = wi::to_offset (t);
          wi::tree_to_widest_ref twidest = wi::to_widest (t);

To make an rtx into a wide_int, you have to pair it with a mode.
The canonical way to do this is with rtx_mode_t as in:

          rtx r = ...
          wide_int x = rtx_mode_t (r, mode);

Similarly, a wide_int can only be constructed from a host value if
the target precision is given explicitly, such as in:

          wide_int x = wi::shwi (c, prec); // sign-extend C if necessary
          wide_int y = wi::uhwi (c, prec); // zero-extend C if necessary

However, offset_int and widest_int have an inherent precision and so
can be initialized directly from a host value:

          offset_int x = (int) c;          // sign-extend C
          widest_int x = (unsigned int) c; // zero-extend C

It is also possible to do arithmetic directly on rtx_mode_ts and
constants.  For example:

          wi::add (r1, r2);    // add equal-sized rtx_mode_ts r1 and r2
          wi::add (r1, 1);     // add 1 to rtx_mode_t r1
          wi::lshift (1, 100); // 1 << 100 as a widest_int

Many binary operations place restrictions on the combinations of inputs,
using the following rules:

- {rtx, wide_int} op {rtx, wide_int} -> wide_int
    The inputs must be the same precision.  The result is a wide_int
    of the same precision

- {rtx, wide_int} op (un)signed HOST_WIDE_INT -> wide_int
  (un)signed HOST_WIDE_INT op {rtx, wide_int} -> wide_int
    The HOST_WIDE_INT is extended or truncated to the precision of
    the other input.  The result is a wide_int of the same precision
    as that input.

- (un)signed HOST_WIDE_INT op (un)signed HOST_WIDE_INT -> widest_int
    The inputs are extended to widest_int precision and produce a
    widest_int result.

- offset_int op offset_int -> offset_int
  offset_int op (un)signed HOST_WIDE_INT -> offset_int
  (un)signed HOST_WIDE_INT op offset_int -> offset_int

- widest_int op widest_int -> widest_int
  widest_int op (un)signed HOST_WIDE_INT -> widest_int
  (un)signed HOST_WIDE_INT op widest_int -> widest_int

Other combinations like:

- widest_int op offset_int and
- wide_int op offset_int

are not allowed.  The inputs should instead be extended or truncated
so that they match.

The inputs to comparison functions like wi::eq_p and wi::lts_p
follow the same compatibility rules, although their return types
are different.  Unary functions on X produce the same result as
a binary operation X + X.  Shift functions X op Y also produce
the same result as X + X; the precision of the shift amount Y
can be arbitrarily different from X.   
The MAX_BITSIZE_MODE_ANY_INT is automatically generated by a very
early examination of the target's mode file.  The WIDE_INT_MAX_INL_ELTS
can accomodate at least 1 more bit so that unsigned numbers of that
mode can be represented as a signed value.  Note that it is still
possible to create fixed_wide_ints that have precisions greater than
MAX_BITSIZE_MODE_ANY_INT.  This can be useful when representing a
double-width multiplication result, for example.   

Referenced by build_replicated_int_cst(), pass_walloca::execute(), wi::from_mpz(), widest_int_storage< N >::get_val(), go_output_typedef(), lto_input_tree_1(), widest_int_storage< N >::operator=(), widest_int_storage< N >::operator=(), real_to_integer(), widest_int_storage< N >::set_len(), streamer_read_wide_int(), streamer_read_widest_int(), widest_int_storage< N >::widest_int_storage(), widest_int_storage< N >::write_val(), and widest_int_storage< N >::~widest_int_storage().

◆ WIDE_INT_MAX_INL_PRECISION

◆ WIDE_INT_MAX_PRECISION

◆ WIDE_INT_REF_FOR

#define WIDE_INT_REF_FOR ( T)
Value:
<wide_int_ref_storage <wi::int_traits <T>::is_sign_extended, \
wi::int_traits <T>::host_dependent_precision> >
This can be used instead of wide_int_ref if the referenced value is
known to have type T.  It carries across properties of T's representation,
such as whether excess upper bits in a HWI are defined, and can therefore
help avoid redundant work.

The macro could be replaced with a template typedef, once we're able
to use those.   

Referenced by wi::cmps(), wi::cmpu(), const_poly_int_value(), wi::extract_uhwi(), fixed_wide_int_storage< N >::fixed_wide_int_storage(), trailing_wide_int_storage::operator=(), wide_int_storage::operator=(), widest_int_storage< N >::operator=(), wi::sign_mask(), WI_BINARY_RESULT(), WI_UNARY_RESULT(), WI_UNARY_RESULT(), wide_int_storage::wide_int_storage(), and widest_int_storage< N >::widest_int_storage().

◆ WIDEST_INT

#define WIDEST_INT ( N)
Value:
generic_wide_int < widest_int_storage <N> >

Referenced by widest_int_storage< N >::operator=(), WIDEST_INT(), WIDEST_INT(), and widest_int_storage< N >::widest_int_storage().

◆ WIDEST_INT_MAX_ELTS

#define WIDEST_INT_MAX_ELTS   2048
Precision of widest_int.   

◆ WIDEST_INT_MAX_PRECISION

#define WIDEST_INT_MAX_PRECISION   (WIDEST_INT_MAX_ELTS * HOST_BITS_PER_WIDE_INT)

Typedef Documentation

◆ trailing_wide_int

◆ wide_int

◆ wide_int_ref

◆ widest2_int

◆ widest_int

Function Documentation

◆ FIXED_WIDE_INT() [1/3]

typedef FIXED_WIDE_INT ( ADDR_MAX_PRECISION )

◆ FIXED_WIDE_INT() [2/3]

template<int N>
FIXED_WIDE_INT ( N )
inline
Treat X as having signedness SGN and convert it to an N-bit number.   
Create a FIXED_WIDE_INT (N) from the explicit block encoding given by
VAL and LEN.  NEED_CANON_P is true if the encoding may have redundant
trailing blocks.   

References FIXED_WIDE_INT, wi::force_to_size(), and N.

◆ FIXED_WIDE_INT() [3/3]

template<typename T1 , typename T2 >
FIXED_WIDE_INT ( N )
inline

References FIXED_WIDE_INT, and N.

◆ gt_ggc_mx() [1/4]

template<int N>
void gt_ggc_mx ( generic_wide_int< fixed_wide_int_storage< N > > * )

◆ gt_ggc_mx() [2/4]

void gt_ggc_mx ( generic_wide_int< wide_int_storage > * )
delete

◆ gt_ggc_mx() [3/4]

template<int N>
void gt_ggc_mx ( generic_wide_int< widest_int_storage< N > > * )
delete

◆ gt_ggc_mx() [4/4]

template<int N>
void gt_ggc_mx ( trailing_wide_ints< N > * )

◆ gt_pch_nx() [1/8]

template<int N>
void gt_pch_nx ( generic_wide_int< fixed_wide_int_storage< N > > * )

◆ gt_pch_nx() [2/8]

template<int N>
void gt_pch_nx ( generic_wide_int< fixed_wide_int_storage< N > > * ,
gt_pointer_operator ,
void *  )

◆ gt_pch_nx() [3/8]

void gt_pch_nx ( generic_wide_int< wide_int_storage > * )
delete

◆ gt_pch_nx() [4/8]

void gt_pch_nx ( generic_wide_int< wide_int_storage > * ,
gt_pointer_operator ,
void *  )
delete

◆ gt_pch_nx() [5/8]

template<int N>
void gt_pch_nx ( generic_wide_int< widest_int_storage< N > > * )
delete

◆ gt_pch_nx() [6/8]

template<int N>
void gt_pch_nx ( generic_wide_int< widest_int_storage< N > > * ,
gt_pointer_operator ,
void *  )
delete

◆ gt_pch_nx() [7/8]

template<int N>
void gt_pch_nx ( trailing_wide_ints< N > * )

◆ gt_pch_nx() [8/8]

template<int N>
void gt_pch_nx ( trailing_wide_ints< N > * ,
gt_pointer_operator ,
void *  )

◆ STATIC_ASSERT()

◆ WI_BINARY_RESULT()

template<typename T1 , typename T2 >
WI_BINARY_RESULT ( T1 ,
T2  )
inline
Return the mininum of X and Y, treating them both as having
signedness SGN.   
Return the minimum of X and Y, treating both as signed values.   
Return the minimum of X and Y, treating both as unsigned values.   
Return the maxinum of X and Y, treating them both as having
signedness SGN.   
Return the maximum of X and Y, treating both as signed values.   
Return the maximum of X and Y, treating both as unsigned values.   
Return X & Y.   
Return X & ~Y.   
Return X | Y.   
Return X | ~Y.   
Return X ^ Y.   
Return X + Y.   
Return X + Y.  Treat X and Y as having the signednes given by SGN
and indicate in *OVERFLOW whether the operation overflowed.   
Return X - Y.   
Return X - Y.  Treat X and Y as having the signednes given by SGN
and indicate in *OVERFLOW whether the operation overflowed.   
Return X * Y.   
Return X * Y.  Treat X and Y as having the signednes given by SGN
and indicate in *OVERFLOW whether the operation overflowed.   
Return X * Y, treating both X and Y as signed values.  Indicate in
*OVERFLOW whether the operation overflowed.   
Return X * Y, treating both X and Y as unsigned values.  Indicate in
*OVERFLOW if the result overflows.   
Perform a widening multiplication of X and Y, extending the values
according to SGN, and return the high part of the result.   
Return X / Y, rouding towards 0.  Treat X and Y as having the
signedness given by SGN.  Indicate in *OVERFLOW if the result
overflows.   
Return X / Y, rouding towards 0.  Treat X and Y as signed values.   
Return X / Y, rouding towards 0.  Treat X and Y as unsigned values.   
Return X / Y, rouding towards -inf.  Treat X and Y as having the
signedness given by SGN.  Indicate in *OVERFLOW if the result
overflows.   
Return X / Y, rouding towards -inf.  Treat X and Y as signed values.   
Return X / Y, rouding towards -inf.  Treat X and Y as unsigned values.   
??? Why do we have both this and udiv_trunc.  Aren't they the same?   
Return X / Y, rouding towards +inf.  Treat X and Y as having the
signedness given by SGN.  Indicate in *OVERFLOW if the result
overflows.   
Return X / Y, rouding towards +inf.  Treat X and Y as unsigned values.   
Return X / Y, rouding towards nearest with ties away from zero.
Treat X and Y as having the signedness given by SGN.  Indicate
in *OVERFLOW if the result overflows.   
Return X / Y, rouding towards 0.  Treat X and Y as having the
signedness given by SGN.  Store the remainder in *REMAINDER_PTR.   
Compute the greatest common divisor of two numbers A and B using
Euclid's algorithm.   
Compute X / Y, rouding towards 0, and return the remainder.
Treat X and Y as having the signedness given by SGN.  Indicate
in *OVERFLOW if the division overflows.   
Compute X / Y, rouding towards 0, and return the remainder.
Treat X and Y as signed values.   
Compute X / Y, rouding towards 0, and return the remainder.
Treat X and Y as unsigned values.   
Compute X / Y, rouding towards -inf, and return the remainder.
Treat X and Y as having the signedness given by SGN.  Indicate
in *OVERFLOW if the division overflows.   
Compute X / Y, rouding towards -inf, and return the remainder.
Treat X and Y as unsigned values.   
??? Why do we have both this and umod_trunc.  Aren't they the same?   
Compute X / Y, rouding towards +inf, and return the remainder.
Treat X and Y as having the signedness given by SGN.  Indicate
in *OVERFLOW if the division overflows.   
Compute X / Y, rouding towards nearest with ties away from zero,
and return the remainder.  Treat X and Y as having the signedness
given by SGN.  Indicate in *OVERFLOW if the division overflows.   

References wi::copy(), wi::get_precision(), wi::le_p(), wi::precision, WI_BINARY_RESULT_VAR, WIDE_INT_REF_FOR, and y.

◆ WI_SIGNED_SHIFT_RESULT()

template<typename T1 , typename T2 >
WI_SIGNED_SHIFT_RESULT ( T1 ,
T2  ) const &
inline

◆ WI_UNARY_RESULT() [1/2]

template<typename T >
WI_UNARY_RESULT ( T )
inline
Return ~x.   
Return -x.   
Return -x.  Indicate in *OVERFLOW if performing the negation would
cause an overflow.   
Return the absolute value of x.   
Return the result of sign-extending the low OFFSET bits of X.   
Return the result of zero-extending the low OFFSET bits of X.   
Return the result of extending the low OFFSET bits of X according to
signedness SGN.   
Return an integer that represents X | (1 << bit).   
Byte swap the integer X.
??? This always swaps 8-bit octets, regardless of BITS_PER_UNIT.
This function requires X's precision to be a multiple of 16 bits,
so care needs to be taken for targets where BITS_PER_UNIT != 8.   
Bitreverse the integer X.   

References wi::get_precision(), wi::i, WI_UNARY_RESULT_VAR, and WIDE_INT_REF_FOR.

◆ WI_UNARY_RESULT() [2/2]

template<typename T1 , typename T2 >
WI_UNARY_RESULT ( T1 )
inline
Return X << Y.  Return 0 if Y is greater than or equal to
the precision of X.   
Return X >> Y, using a logical shift.  Return 0 if Y is greater than
or equal to the precision of X.   
Return X >> Y, using an arithmetic shift.  Return a sign mask if
Y is greater than or equal to the precision of X.   
Return X >> Y, using an arithmetic shift if SGN is SIGNED and a
logical shift otherwise.   

References wi::get_precision(), wi::geu_p(), HOST_BITS_PER_WIDE_INT, HOST_WIDE_INT_MAX, IN_RANGE, wi::lshift_large(), wi::precision, STATIC_CONSTANT_P, WI_UNARY_RESULT_VAR, WIDE_INT_REF_FOR, and y.

◆ WIDEST_INT() [1/2]

template<typename T1 , typename T2 >
WIDEST_INT ( N )
inline

References N, and WIDEST_INT.

◆ WIDEST_INT() [2/2]

template<int N>
WIDEST_INT ( N )
inline
Treat X as having signedness SGN and convert it to an N-bit number.   
Create a WIDEST_INT (N) from the explicit block encoding given by
VAL and LEN.  NEED_CANON_P is true if the encoding may have redundant
trailing blocks.   

References CEIL, wi::force_to_size(), HOST_BITS_PER_WIDE_INT, widest_int_storage< N >::len, N, UNSIGNED, widest_int_storage< N >::val, and WIDEST_INT.

Variable Documentation

◆ y

const T2 & y
Initial value:
{
return wi::arshift (x, y)
SHIFT_FUNCTION arshift(const T1 &, const T2 &)

Referenced by add_stack_var_conflict(), alter_subreg(), attempt_coalesce(), attr_equal_p(), base_alias_check(), bb_top_order_cmp_r(), bbitmap_element_and(), bbitmap_element_or(), bbitmap_element_xor(), bbitmap_operators< M >::binary(), bound_difference(), bound_difference_of_offsetted_base(), canonicalize_insn(), fibonacci_heap< K, V >::cascading_cut(), change_zero_ext(), wi::cmp(), cmp_c_test(), wi::cmps(), wi::cmpu(), coalesce_partitions(), compare_address_parts(), compare_candidates(), compare_reg_or_pc(), compress_float_constant(), fibonacci_heap< K, V >::consolidate(), wi::copy(), copy_replacements(), copy_replacements_1(), coverage_checksum_string(), cse_insn(), debug_ter(), determine_dominators_for_sons(), range_def_chain::dump(), dump_location_info(), dump_part_var_map(), dump_var_map(), elim_graph_remove_succ_edge(), emit_add2_insn(), emit_add3_insn(), emit_block_cmp_hints(), emit_block_cmp_via_cmpmem(), emit_block_cmp_via_loop(), emit_block_move(), emit_block_move_hints(), emit_block_move_via_loop(), emit_block_move_via_oriented_loop(), emit_block_move_via_pattern(), emit_block_move_via_sized_loop(), emit_cmp_and_jump_insns(), emit_cmp_and_jump_insns(), emit_cstore(), emit_move_ccmode(), emit_move_complex(), emit_move_complex_parts(), emit_move_complex_push(), emit_move_insn(), emit_move_insn_1(), emit_move_multi_word(), emit_move_via_integer(), bbitmap_operators< M >::equal(), cgraph_edge_hasher::equal(), cl_option_hasher::equal(), const_double_hasher::equal(), const_fixed_hasher::equal(), const_int_hasher::equal(), const_poly_int_hasher::equal(), const_rtx_data_hasher::equal(), const_rtx_desc_hasher::equal(), decl_die_hasher::equal(), decl_loc_hasher::equal(), dw_loc_list_hasher::equal(), inline_entry_data_hasher::equal(), insn_hasher::equal(), int_cst_hasher::equal(), int_hash_base< Type >::equal(), omp_declare_variant_alt_hasher::equal(), omp_declare_variant_hasher::equal(), pair_hash< T1, T2 >::equal(), reg_attr_hasher::equal(), variable_hasher::equal(), vec_hash_base< Type >::equal(), unbounded_hashmap_traits< Key, Value >::equal_keys(), equiv_constant(), exp_equiv_p(), expr_equiv_p(), ext_dce_process_uses(), fibonacci_heap< K, V >::extract_minimum_node(), fail_abnormal_edge_coalesce(), finalize_nesting_tree_1(), find_replacement(), find_sets_in_insn(), range_operator::fold_range(), fold_rtx(), fold_to_nonsharp_ineq_using_bound(), force_int_to_mode(), form_sum(), form_sum(), gcd(), gen_add2_insn(), gen_addptr3_insn(), gen_extend_insn(), gen_move_insn(), gen_sub2_insn(), general_operand(), wi::get_binary_precision(), wi::int_traits< wide_int_storage >::get_binary_precision(), wi::int_traits< wide_int_storage >::get_binary_result(), hard_reg_set_intersect_p(), hard_reg_set_subset_p(), have_add2_insn(), have_addptr3_insn(), have_sub2_insn(), histogram_eq(), immune_p(), wi::insert(), invalidate_from_clobbers(), invalidate_from_sets_and_clobbers(), invert_mod2n(), iterate_fix_dominators(), lhd_types_compatible_p(), loc_cmp(), lower_omp_for_scan(), lower_rec_input_clauses(), lra_emit_add(), lra_emit_move(), lra_substitute_pseudo(), mask_with_tz(), maybe_trim_complex_store(), memory_address_addr_space(), memory_load_overlap(), memrefs_conflict_p(), merge_memattrs(), move_marked_base_types(), move_replacements(), mul_hwi(), mul_mod(), wi::multiple_of_p(), wi::multiple_of_p(), noce_convert_multiple_sets(), noce_emit_move_insn(), noce_try_move(), nonoverlapping_component_refs_p(), nonoverlapping_memrefs_p(), offsettable_address_addr_space_p(), operands_match_p(), operands_match_p(), output_object_block_compare(), permute_vec_elements(), plus_constant(), pos_mul_hwi(), prepare_cmp_insn(), prepare_float_lib_cmp(), propagate_bits(), propagate_nothrow(), propagate_pure_const(), real_nextafter(), const_and_copies::record_const_or_copy(), const_and_copies::record_const_or_copy(), const_and_copies::record_const_or_copy_raw(), record_equality(), fibonacci_heap< K, V >::replace_key_data(), rtl_verify_bb_layout(), rtx_equal_for_cselib_1(), rtx_equal_for_cselib_p(), rtx_equal_for_field_assignment_p(), rtx_equal_for_memref_p(), rtx_equal_p(), rtx_referenced_p(), rtx_renumbered_equal_p(), same_vector_encodings_p(), sbitmap_vector_alloc(), scratch_equal(), set_reg_attrs_for_decl_rtl(), simplify_context::simplify_binary_operation_1(), simplify_plus_minus_op_data_cmp(), single_pred_before_succ_order(), ssa_conflicts_add(), ssa_conflicts_add_one(), ssa_conflicts_merge(), ssa_conflicts_test_p(), stack_protect_epilogue(), stack_protect_prologue(), stack_var_conflict_p(), struct_ptr_eq(), swap_commutative_operands_p(), tm_alias_pair_cmp(), tree_nca(), try_eliminate_compare(), try_emit_cmove_seq(), union_static_var_sets(), values_equal_for_ipcp_p(), values_equal_for_ipcp_p(), WI_BINARY_RESULT(), and WI_UNARY_RESULT().