243#define WIDE_INT_MAX_INL_ELTS \
244 ((MAX_BITSIZE_MODE_ANY_INT + HOST_BITS_PER_WIDE_INT) \
245 / HOST_BITS_PER_WIDE_INT)
247#define WIDE_INT_MAX_INL_PRECISION \
248 (WIDE_INT_MAX_INL_ELTS * HOST_BITS_PER_WIDE_INT)
252#define WIDE_INT_MAX_ELTS 1024
253#define WIDE_INT_MAX_PRECISION (WIDE_INT_MAX_ELTS * HOST_BITS_PER_WIDE_INT)
256#define WIDEST_INT_MAX_ELTS 2048
257#define WIDEST_INT_MAX_PRECISION (WIDEST_INT_MAX_ELTS * HOST_BITS_PER_WIDE_INT)
269#define ADDR_MAX_BITSIZE 64
276#define ADDR_MAX_PRECISION \
277 ((ADDR_MAX_BITSIZE + 4 + HOST_BITS_PER_WIDE_INT - 1) \
278 & ~(HOST_BITS_PER_WIDE_INT - 1))
281#define OFFSET_INT_ELTS (ADDR_MAX_PRECISION / HOST_BITS_PER_WIDE_INT)
284#define WIDE_INT_MAX_HWIS(PRECISION) \
285 ((PRECISION + HOST_BITS_PER_WIDE_INT - 1) / HOST_BITS_PER_WIDE_INT)
289#define WI_BINARY_RESULT(T1, T2) \
290 typename wi::binary_traits <T1, T2>::result_type
294#define WI_BINARY_OPERATOR_RESULT(T1, T2) \
295 typename wi::binary_traits <T1, T2>::operator_result
299#define WI_SIGNED_SHIFT_RESULT(T1, T2) \
300 typename wi::binary_traits <T1, T2>::signed_shift_result_type
305#define WI_BINARY_PREDICATE_RESULT(T1, T2) \
306 typename wi::binary_traits <T1, T2>::predicate_result
311#define WI_SIGNED_BINARY_PREDICATE_RESULT(T1, T2) \
312 typename wi::binary_traits <T1, T2>::signed_predicate_result
315#define WI_UNARY_RESULT(T) \
316 typename wi::binary_traits <T, T>::result_type
323#define WI_BINARY_RESULT_VAR(RESULT, VAL, T1, X, T2, Y) \
324 WI_BINARY_RESULT (T1, T2) RESULT = \
325 wi::int_traits <WI_BINARY_RESULT (T1, T2)>::get_binary_result (X, Y); \
326 HOST_WIDE_INT *VAL = RESULT.write_val (0)
329#define WI_UNARY_RESULT_VAR(RESULT, VAL, T, X) \
330 WI_UNARY_RESULT (T) RESULT = \
331 wi::int_traits <WI_UNARY_RESULT (T)>::get_binary_result (X, X); \
332 HOST_WIDE_INT *VAL = RESULT.write_val (0)
340#define FIXED_WIDE_INT(N) \
341 generic_wide_int < fixed_wide_int_storage <N> >
343typedef generic_wide_int <wide_int_storage>
wide_int;
345typedef generic_wide_int <widest_int_storage <WIDEST_INT_MAX_PRECISION> >
widest_int;
346typedef generic_wide_int <widest_int_storage <WIDEST_INT_MAX_PRECISION * 2> >
widest2_int;
350template <
bool SE,
bool HDP = true>
362#define WIDE_INT_REF_FOR(T) \
364 <wide_int_ref_storage <wi::int_traits <T>::is_sign_extended, \
365 wi::int_traits <T>::host_dependent_precision> >
432 template <
typename T1,
typename T2,
442 template <
typename T1,
typename T2>
449 template <
typename T1,
typename T2>
457 template <
typename T1,
typename T2>
470 template <
typename T1,
typename T2>
481 template <
typename T1,
typename T2>
489 template <
typename T1,
typename T2>
502 template <
typename T1,
typename T2>
513 template <
typename T1,
typename T2>
527 template <
typename T1,
typename T2>
539 template <
typename T1,
typename T2>
551 template <
typename T>
554 template <
typename T1,
typename T2>
557 template <
typename T1,
typename T2>
558 void copy (T1 &,
const T2 &);
560#define UNARY_PREDICATE \
561 template <typename T> bool
562#define UNARY_FUNCTION \
563 template <typename T> WI_UNARY_RESULT (T)
564#define BINARY_PREDICATE \
565 template <typename T1, typename T2> bool
566#define BINARY_FUNCTION \
567 template <typename T1, typename T2> WI_BINARY_RESULT (T1, T2)
568#define SHIFT_FUNCTION \
569 template <typename T1, typename T2> WI_UNARY_RESULT (T1)
575 template <
typename T>
593 template <
typename T1,
typename T2>
594 int cmp (
const T1 &,
const T2 &,
signop);
596 template <
typename T1,
typename T2>
597 int cmps (
const T1 &,
const T2 &);
599 template <
typename T1,
typename T2>
600 int cmpu (
const T1 &,
const T2 &);
662 template <
typename T1,
typename T2>
665 template <
typename T1,
typename T2>
677#undef BINARY_PREDICATE
678#undef BINARY_FUNCTION
679#undef UNARY_PREDICATE
693 template <
typename T>
694 unsigned HOST_WIDE_INT
extract_uhwi (
const T &,
unsigned int,
unsigned int);
696 template <
typename T>
720 const HOST_WIDE_INT *
get_val ()
const;
724inline::wi::storage_ref::storage_ref (
const HOST_WIDE_INT *val_in,
726 unsigned int precision_in)
727 : val (val_in), len (len_in), precision (precision_in)
743inline const HOST_WIDE_INT *
774template <
typename storage>
780 template <
typename T>
783 template <
typename T>
789 unsigned HOST_WIDE_INT
to_uhwi (
unsigned int)
const;
795 HOST_WIDE_INT
elt (
unsigned int)
const;
797 unsigned HOST_WIDE_INT
ulow ()
const;
798 unsigned HOST_WIDE_INT
uhigh ()
const;
802 template <
typename T>
805#define ASSIGNMENT_OPERATOR(OP, F) \
806 template <typename T> \
807 generic_wide_int &OP (const T &c) { return (*this = wi::F (*this, c)); }
810#define SHIFT_ASSIGNMENT_OPERATOR(OP, OP2) \
811 template <typename T> \
812 generic_wide_int &OP (const T &c) { return (*this = *this OP2 c); }
814#define INCDEC_OPERATOR(OP, DELTA) \
815 generic_wide_int &OP () { *this += DELTA; return *this; }
828#undef SHIFT_ASSIGNMENT_OPERATOR
829#undef ASSIGNMENT_OPERATOR
830#undef INCDEC_OPERATOR
835 static const bool is_sign_extended
836 = wi::int_traits <generic_wide_int <storage> >::is_sign_extended;
837 static const bool needs_write_val_arg
838 = wi::int_traits <generic_wide_int <storage> >::needs_write_val_arg;
841template <
typename storage>
844template <
typename storage>
851template <
typename storage>
854 unsigned int precision)
855 : storage (x, precision)
861template <
typename storage>
866 return sext_hwi (this->get_val ()[0], precision);
868 return this->get_val ()[0];
872template <
typename storage>
876 if (is_sign_extended)
877 return this->get_val ()[0];
879 return to_shwi (this->get_precision ());
885template <
typename storage>
886inline unsigned HOST_WIDE_INT
890 return zext_hwi (this->get_val ()[0], precision);
892 return this->get_val ()[0];
896template <
typename storage>
897inline unsigned HOST_WIDE_INT
900 return to_uhwi (this->get_precision ());
907template <
typename storage>
911 return this->get_val ()[0];
915template <
typename storage>
919 unsigned int len = this->get_len ();
922 unsigned HOST_WIDE_INT high = this->get_val ()[len - 1];
923 if (!is_sign_extended)
925 unsigned int precision = this->get_precision ();
930 return (HOST_WIDE_INT) (high) < 0 ? -1 : 0;
935template <
typename storage>
939 return this->get_val ()[0];
944template <
typename storage>
948 return this->get_val ()[this->get_len () - 1];
953template <
typename storage>
954inline unsigned HOST_WIDE_INT
957 return this->get_val ()[0];
962template <
typename storage>
963inline unsigned HOST_WIDE_INT
966 return this->get_val ()[this->get_len () - 1];
970template <
typename storage>
974 if (
i >= this->get_len ())
977 return this->get_val ()[
i];
982template <
typename storage>
986 HOST_WIDE_INT elt_i = elt (
i);
987 if (!is_sign_extended)
989 unsigned int precision = this->get_precision ();
992 elt_i =
sext_hwi (elt_i, precision - lsb);
997template <
typename storage>
999inline generic_wide_int <storage> &
1000generic_wide_int <storage>::operator = (
const T &x)
1002 storage::operator = (x);
1007template <
typename storage>
1011 unsigned int len = this->get_len ();
1012 const HOST_WIDE_INT *val = this->get_val ();
1013 unsigned int precision = this->get_precision ();
1014 fprintf (stderr,
"[");
1016 fprintf (stderr,
"...,");
1017 for (
unsigned int i = 0;
i < len - 1; ++
i)
1025 template <
typename storage>
1029 static unsigned int get_precision (
const generic_wide_int <storage> &);
1031 const generic_wide_int <storage> &);
1035template <
typename storage>
1037wi::int_traits < generic_wide_int <storage> >::
1038get_precision (
const generic_wide_int <storage> &x)
1040 return x.get_precision ();
1043template <
typename storage>
1045wi::int_traits < generic_wide_int <storage> >
::
1046decompose (HOST_WIDE_INT *,
unsigned int precision,
1047 const generic_wide_int <storage> &x)
1056template <
bool SE,
bool HDP>
1069 template <
typename T>
1072 template <
typename T>
1077template <
bool SE,
bool HDP>
1078inline wide_int_ref_storage <SE, HDP>::
1086template <
bool SE,
bool HDP>
1087template <
typename T>
1089 : storage_ref (wi::int_traits <T>::decompose (
scratch,
1095template <
bool SE,
bool HDP>
1096template <
typename T>
1097inline wide_int_ref_storage <SE, HDP>::
1098wide_int_ref_storage (
const T &x,
unsigned int precision)
1105 template <
bool SE,
bool HDP>
1109 static const bool host_dependent_precision = HDP;
1110 static const bool is_sign_extended = SE;
1111 static const bool needs_write_val_arg =
false;
1117 unsigned int force_to_size (HOST_WIDE_INT *,
const HOST_WIDE_INT *,
1118 unsigned int,
unsigned int,
unsigned int,
1120 unsigned int from_array (HOST_WIDE_INT *,
const HOST_WIDE_INT *,
1121 unsigned int,
unsigned int,
bool =
true);
1138 template <
typename T>
1144 unsigned int get_precision ()
const;
1145 const HOST_WIDE_INT *get_val ()
const;
1146 unsigned int get_len ()
const;
1147 HOST_WIDE_INT *write_val (
unsigned int);
1148 void set_len (
unsigned int,
bool =
false);
1151 template <
typename T>
1155 static wide_int from_array (
const HOST_WIDE_INT *,
unsigned int,
1156 unsigned int,
bool =
true);
1157 static wide_int create (
unsigned int);
1167 static const bool host_dependent_precision =
false;
1168 static const bool is_sign_extended =
true;
1169 static const bool needs_write_val_arg =
false;
1170 template <
typename T1,
typename T2>
1171 static wide_int get_binary_result (
const T1 &,
const T2 &);
1172 template <
typename T1,
typename T2>
1183template <
typename T>
1202 memcpy (
u.valp, x.
u.
valp,
len * sizeof (HOST_WIDE_INT));
1209 XDELETEVEC (
u.valp);
1219 XDELETEVEC (
u.valp);
1225 memcpy (
u.valp, x.
u.
valp,
len * sizeof (HOST_WIDE_INT));
1230template <
typename T>
1241 XDELETEVEC (
u.valp);
1244 u.valp = XNEWVEC (HOST_WIDE_INT,
1257inline const HOST_WIDE_INT *
1269inline HOST_WIDE_INT *
1303 unsigned int precision,
bool need_canon_p)
1318 x.
u.
valp = XNEWVEC (HOST_WIDE_INT,
1323template <
typename T1,
typename T2>
1325wi::int_traits <wide_int_storage>::get_binary_result (
const T1 &x,
const T2 &
y)
1336template <
typename T1,
typename T2>
1338wi::int_traits <wide_int_storage>::get_binary_precision (
const T1 &x,
1360 template <
typename T>
1381 static const bool host_dependent_precision =
false;
1382 static const bool is_sign_extended =
true;
1383 static const bool needs_write_val_arg =
false;
1385 template <
typename T1,
typename T2>
1387 template <
typename T1,
typename T2>
1394template <
typename T>
1411inline const HOST_WIDE_INT *
1425inline HOST_WIDE_INT *
1447 x.precision,
N, sgn));
1456fixed_wide_int_storage <N>::from_array (
const HOST_WIDE_INT *val,
1461 result.set_len (
wi::from_array (result.write_val (len), val, len,
1467template <
typename T1,
typename T2>
1469wi::int_traits < fixed_wide_int_storage <N> >::
1470get_binary_result (
const T1 &,
const T2 &)
1476template <
typename T1,
typename T2>
1478wi::int_traits < fixed_wide_int_storage <N> >::
1479get_binary_precision (
const T1 &,
const T2 &)
1484#define WIDEST_INT(N) generic_wide_int < widest_int_storage <N> >
1501 template <
typename T>
1505 template <
typename T>
1516 static WIDEST_INT (
N) from_array (
const HOST_WIDE_INT *,
unsigned int,
1526 static const bool host_dependent_precision =
false;
1527 static const bool is_sign_extended =
true;
1528 static const bool needs_write_val_arg =
true;
1530 template <
typename T1,
typename T2>
1532 template <
typename T1,
typename T2>
1542template <
typename T>
1558 u.valp = XNEWVEC (HOST_WIDE_INT, len);
1559 memcpy (u.valp, x.u.valp, len * sizeof (HOST_WIDE_INT));
1564inline widest_int_storage <N>::~widest_int_storage ()
1567 XDELETEVEC (u.valp);
1571inline widest_int_storage <N>&
1578 XDELETEVEC (u.valp);
1583 u.valp = XNEWVEC (HOST_WIDE_INT, len);
1584 memcpy (u.valp, x.u.valp, len * sizeof (HOST_WIDE_INT));
1590template <
typename T>
1591inline widest_int_storage <N>&
1592widest_int_storage <N>::operator = (
const T &x)
1598 XDELETEVEC (u.valp);
1612inline const HOST_WIDE_INT *
1626inline HOST_WIDE_INT *
1630 XDELETEVEC (u.valp);
1634 u.valp = XNEWVEC (HOST_WIDE_INT, l);
1650 HOST_WIDE_INT *valp = u.valp;
1651 memcpy (u.val, valp, l * sizeof (u.val[0]));
1668 unsigned int exp_len = x.
len;
1669 unsigned int prec = result.get_precision ();
1670 if (sgn ==
UNSIGNED && prec > x.precision && x.
val[x.
len - 1] < 0)
1673 x.precision, prec, sgn));
1682widest_int_storage <N>::from_array (
const HOST_WIDE_INT *val,
1687 result.set_len (
wi::from_array (result.write_val (len), val, len,
1688 result.get_precision (), need_canon_p));
1693template <
typename T1,
typename T2>
1695wi::int_traits < widest_int_storage <N> >::
1696get_binary_result (
const T1 &,
const T2 &)
1702template <
typename T1,
typename T2>
1704wi::int_traits < widest_int_storage <N> >::
1705get_binary_precision (
const T1 &,
const T2 &)
1729 unsigned int get_len ()
const;
1731 const HOST_WIDE_INT *
get_val ()
const;
1732 HOST_WIDE_INT *
write_val (
unsigned int);
1733 void set_len (
unsigned int,
bool =
false);
1735 template <
typename T>
1770 unsigned short m_len[
N];
1774 HOST_WIDE_INT m_val[1];
1783 const_reference operator [] (
unsigned int)
const;
1785 unsigned int num_elements =
N);
1793 : m_precision (precision), m_len (len), m_val (val)
1809inline const HOST_WIDE_INT *
1815inline HOST_WIDE_INT *
1830template <
typename T>
1844 unsigned int num_elements)
1847 m_num_elements = num_elements;
1848 m_precision = precision;
1855trailing_wide_ints <N>::operator [] (
unsigned int index)
1858 &m_val[index * m_max_len]);
1862inline typename trailing_wide_ints <N>::const_reference
1863trailing_wide_ints <N>::operator [] (
unsigned int index)
const
1866 m_len[index], m_precision);
1876 unsigned int num_elements)
1880 return (num_elements * max_len - 1) *
sizeof (HOST_WIDE_INT);
1886#define TRAILING_WIDE_INT_ACCESSOR(NAME, FIELD, I) \
1887 trailing_wide_int get_##NAME () { return FIELD[I]; } \
1888 template <typename T> void set_##NAME (const T &x) { FIELD[I] = x; }
1893 template <
typename T,
bool signed_p>
1905template <
typename T,
bool signed_p>
1912template <
typename T,
bool signed_p>
1951#if defined HAVE_LONG_LONG
1957 struct int_traits <unsigned long long>
1958 :
public primitive_int_traits <unsigned long long, false> {};
2041 template<typename T, precision_type = int_traits<T>::precision_type>
2044 static int zero (
const T &) {
return 0; }
2047 template<
typename T>
2069 static const bool host_dependent_precision =
false;
2070 static const bool is_sign_extended =
true;
2071 static const bool needs_write_val_arg =
false;
2085wi::int_traits <wi::hwi_with_prec>
::
2104 bool eq_p_large (
const HOST_WIDE_INT *,
unsigned int,
2105 const HOST_WIDE_INT *,
unsigned int,
unsigned int);
2106 bool lts_p_large (
const HOST_WIDE_INT *,
unsigned int,
unsigned int,
2107 const HOST_WIDE_INT *,
unsigned int);
2108 bool ltu_p_large (
const HOST_WIDE_INT *,
unsigned int,
unsigned int,
2109 const HOST_WIDE_INT *,
unsigned int);
2110 int cmps_large (
const HOST_WIDE_INT *,
unsigned int,
unsigned int,
2111 const HOST_WIDE_INT *,
unsigned int);
2112 int cmpu_large (
const HOST_WIDE_INT *,
unsigned int,
unsigned int,
2113 const HOST_WIDE_INT *,
unsigned int);
2114 unsigned int sext_large (HOST_WIDE_INT *,
const HOST_WIDE_INT *,
2115 unsigned int,
unsigned int,
unsigned int);
2116 unsigned int zext_large (HOST_WIDE_INT *,
const HOST_WIDE_INT *,
2117 unsigned int,
unsigned int,
unsigned int);
2118 unsigned int set_bit_large (HOST_WIDE_INT *,
const HOST_WIDE_INT *,
2119 unsigned int,
unsigned int,
unsigned int);
2120 unsigned int bswap_large (HOST_WIDE_INT *,
const HOST_WIDE_INT *,
2121 unsigned int,
unsigned int);
2123 unsigned int,
unsigned int);
2125 unsigned int lshift_large (HOST_WIDE_INT *,
const HOST_WIDE_INT *,
2126 unsigned int,
unsigned int,
unsigned int);
2127 unsigned int lrshift_large (HOST_WIDE_INT *,
const HOST_WIDE_INT *,
2128 unsigned int,
unsigned int,
unsigned int,
2130 unsigned int arshift_large (HOST_WIDE_INT *,
const HOST_WIDE_INT *,
2131 unsigned int,
unsigned int,
unsigned int,
2133 unsigned int and_large (HOST_WIDE_INT *,
const HOST_WIDE_INT *,
unsigned int,
2134 const HOST_WIDE_INT *,
unsigned int,
unsigned int);
2135 unsigned int and_not_large (HOST_WIDE_INT *,
const HOST_WIDE_INT *,
2136 unsigned int,
const HOST_WIDE_INT *,
2137 unsigned int,
unsigned int);
2138 unsigned int or_large (HOST_WIDE_INT *,
const HOST_WIDE_INT *,
unsigned int,
2139 const HOST_WIDE_INT *,
unsigned int,
unsigned int);
2140 unsigned int or_not_large (HOST_WIDE_INT *,
const HOST_WIDE_INT *,
2141 unsigned int,
const HOST_WIDE_INT *,
2142 unsigned int,
unsigned int);
2143 unsigned int xor_large (HOST_WIDE_INT *,
const HOST_WIDE_INT *,
unsigned int,
2144 const HOST_WIDE_INT *,
unsigned int,
unsigned int);
2145 unsigned int add_large (HOST_WIDE_INT *,
const HOST_WIDE_INT *,
unsigned int,
2146 const HOST_WIDE_INT *,
unsigned int,
unsigned int,
2148 unsigned int sub_large (HOST_WIDE_INT *,
const HOST_WIDE_INT *,
unsigned int,
2149 const HOST_WIDE_INT *,
unsigned int,
unsigned int,
2151 unsigned int mul_internal (HOST_WIDE_INT *,
const HOST_WIDE_INT *,
2152 unsigned int,
const HOST_WIDE_INT *,
2153 unsigned int,
unsigned int,
signop,
2156 HOST_WIDE_INT *,
const HOST_WIDE_INT *,
2157 unsigned int,
unsigned int,
2158 const HOST_WIDE_INT *,
2159 unsigned int,
unsigned int,
2164template <
typename T>
2168 return wi::int_traits <T>::get_precision (x);
2173template <
typename T1,
typename T2>
2178 return res_traits::get_binary_precision (x,
y);
2182template <
typename T1,
typename T2>
2186 unsigned int len =
y.get_len ();
2187 HOST_WIDE_INT *xval = x.write_val (len);
2188 const HOST_WIDE_INT *yval =
y.get_val ();
2195 if (!wi::int_traits <T1>::needs_write_val_arg)
2196 x.set_len (len,
y.is_sign_extended);
2200template <
typename T>
2210template <
typename T>
2218 return xi.slow () >= 0;
2219 return xi.len == 2 && xi.uhigh () == 0;
2224template <
typename T>
2231 return xi.sign_mask () < 0;
2235template <
typename T>
2240 return xi.sign_mask ();
2244template <
typename T1,
typename T2>
2251 if (xi.is_sign_extended && yi.is_sign_extended)
2254 if (xi.len != yi.len)
2258 if (xi.val[
i] != yi.val[
i])
2260 while (++
i != xi.len);
2263 if (
LIKELY (yi.len == 1))
2271 return xi.val[0] == 0;
2273 unsigned HOST_WIDE_INT
diff = xi.val[0] ^ yi.val[0];
2283template <
typename T1,
typename T2>
2287 return !
eq_p (x,
y);
2291template <
typename T1,
typename T2>
2306 return xi.to_shwi () < yi.to_shwi ();
2324template <
typename T1,
typename T2>
2333 return xi.len == 1 && xi.to_uhwi () < (
unsigned HOST_WIDE_INT) yi.val[0];
2335 return yi.len != 1 || yi.to_uhwi () > (
unsigned HOST_WIDE_INT) xi.val[0];
2339 if (
LIKELY (xi.len + yi.len == 2))
2341 unsigned HOST_WIDE_INT xl = xi.to_uhwi ();
2342 unsigned HOST_WIDE_INT yl = yi.to_uhwi ();
2349template <
typename T1,
typename T2>
2360template <
typename T1,
typename T2>
2368template <
typename T1,
typename T2>
2376template <
typename T1,
typename T2>
2387template <
typename T1,
typename T2>
2395template <
typename T1,
typename T2>
2403template <
typename T1,
typename T2>
2414template <
typename T1,
typename T2>
2422template <
typename T1,
typename T2>
2430template <
typename T1,
typename T2>
2442template <
typename T1,
typename T2>
2453 return neg_p (xi) ? -1 : !(xi.len == 1 && xi.val[0] == 0);
2457 HOST_WIDE_INT xl = xi.to_shwi ();
2458 HOST_WIDE_INT yl = yi.to_shwi ();
2459 return xl < yl ? -1 : xl > yl;
2473 return neg_p (yi) ? 1 : -1;
2479template <
typename T1,
typename T2>
2493 unsigned HOST_WIDE_INT xl = xi.to_uhwi ();
2494 unsigned HOST_WIDE_INT yl = yi.val[0];
2495 return xl < yl ? -1 : xl > yl;
2503 unsigned HOST_WIDE_INT xl = xi.val[0];
2504 unsigned HOST_WIDE_INT yl = yi.to_uhwi ();
2505 return xl < yl ? -1 : xl > yl;
2510 if (
LIKELY (xi.len + yi.len == 2))
2512 unsigned HOST_WIDE_INT xl = xi.to_uhwi ();
2513 unsigned HOST_WIDE_INT yl = yi.to_uhwi ();
2514 return xl < yl ? -1 : xl > yl;
2521template <
typename T1,
typename T2>
2532template <
typename T>
2538 if (result.needs_write_val_arg)
2539 val = result.write_val (xi.len);
2540 for (
unsigned int i = 0;
i < xi.len; ++
i)
2541 val[
i] = ~xi.val[
i];
2542 result.set_len (xi.len);
2547template <
typename T>
2556template <
typename T>
2565template <
typename T>
2573template <
typename T>
2581 if (result.needs_write_val_arg)
2582 val = result.write_val (
MAX (xi.len,
2587 result.set_len (1,
true);
2595template <
typename T>
2611 if (result.needs_write_val_arg)
2612 val = result.write_val (
MAX (xi.len,
2619 result.set_len (1,
true);
2628template <
typename T>
2636template <
typename T>
2643 if (result.needs_write_val_arg)
2644 val = result.write_val (
MAX (xi.len,
2660template <
typename T>
2667 static_assert (!result.needs_write_val_arg,
2668 "bswap on widest_int makes no sense");
2674template <
typename T>
2681 static_assert (!result.needs_write_val_arg,
2682 "bitreverse on widest_int makes no sense");
2689template <
typename T1,
typename T2>
2703template <
typename T1,
typename T2>
2711template <
typename T1,
typename T2>
2720template <
typename T1,
typename T2>
2734template <
typename T1,
typename T2>
2742template <
typename T1,
typename T2>
2750template <
typename T1,
typename T2>
2758 bool is_sign_extended = xi.is_sign_extended && yi.is_sign_extended;
2759 if (result.needs_write_val_arg)
2760 val = result.write_val (
MAX (xi.len, yi.len));
2761 if (
LIKELY (xi.len + yi.len == 2))
2763 val[0] = xi.ulow () & yi.ulow ();
2764 result.set_len (1, is_sign_extended);
2767 result.set_len (
and_large (val, xi.val, xi.len, yi.val, yi.len,
2773template <
typename T1,
typename T2>
2781 bool is_sign_extended = xi.is_sign_extended && yi.is_sign_extended;
2782 if (result.needs_write_val_arg)
2783 val = result.write_val (
MAX (xi.len, yi.len));
2784 if (
LIKELY (xi.len + yi.len == 2))
2786 val[0] = xi.ulow () & ~yi.ulow ();
2787 result.set_len (1, is_sign_extended);
2790 result.set_len (
and_not_large (val, xi.val, xi.len, yi.val, yi.len,
2796template <
typename T1,
typename T2>
2804 bool is_sign_extended = xi.is_sign_extended && yi.is_sign_extended;
2805 if (result.needs_write_val_arg)
2806 val = result.write_val (
MAX (xi.len, yi.len));
2807 if (
LIKELY (xi.len + yi.len == 2))
2809 val[0] = xi.ulow () | yi.ulow ();
2810 result.set_len (1, is_sign_extended);
2813 result.set_len (
or_large (val, xi.val, xi.len,
2814 yi.val, yi.len,
precision), is_sign_extended);
2819template <
typename T1,
typename T2>
2827 bool is_sign_extended = xi.is_sign_extended && yi.is_sign_extended;
2828 if (result.needs_write_val_arg)
2829 val = result.write_val (
MAX (xi.len, yi.len));
2830 if (
LIKELY (xi.len + yi.len == 2))
2832 val[0] = xi.ulow () | ~yi.ulow ();
2833 result.set_len (1, is_sign_extended);
2836 result.set_len (
or_not_large (val, xi.val, xi.len, yi.val, yi.len,
2842template <
typename T1,
typename T2>
2850 bool is_sign_extended = xi.is_sign_extended && yi.is_sign_extended;
2851 if (result.needs_write_val_arg)
2852 val = result.write_val (
MAX (xi.len, yi.len));
2853 if (
LIKELY (xi.len + yi.len == 2))
2855 val[0] = xi.ulow () ^ yi.ulow ();
2856 result.set_len (1, is_sign_extended);
2859 result.set_len (
xor_large (val, xi.val, xi.len,
2860 yi.val, yi.len,
precision), is_sign_extended);
2865template <
typename T1,
typename T2>
2873 if (result.needs_write_val_arg)
2874 val = result.write_val (
MAX (xi.len, yi.len) + 1);
2877 val[0] = xi.ulow () + yi.ulow ();
2891 &&
LIKELY (xi.len + yi.len == 2))
2893 unsigned HOST_WIDE_INT xl = xi.ulow ();
2894 unsigned HOST_WIDE_INT yl = yi.ulow ();
2895 unsigned HOST_WIDE_INT resultl = xl + yl;
2897 val[1] = (HOST_WIDE_INT) resultl < 0 ? 0 : -1;
2898 result.set_len (1 + (((resultl ^ xl) & (resultl ^ yl))
2902 result.set_len (
add_large (val, xi.val, xi.len,
2910template <
typename T1,
typename T2>
2918 if (result.needs_write_val_arg)
2919 val = result.write_val (
MAX (xi.len, yi.len) + 1);
2922 unsigned HOST_WIDE_INT xl = xi.ulow ();
2923 unsigned HOST_WIDE_INT yl = yi.ulow ();
2924 unsigned HOST_WIDE_INT resultl = xl + yl;
2927 if ((((resultl ^ xl) & (resultl ^ yl))
2932 else if (xl < resultl)
2948 result.set_len (
add_large (val, xi.val, xi.len,
2955template <
typename T1,
typename T2>
2963 if (result.needs_write_val_arg)
2964 val = result.write_val (
MAX (xi.len, yi.len) + 1);
2967 val[0] = xi.ulow () - yi.ulow ();
2981 &&
LIKELY (xi.len + yi.len == 2))
2983 unsigned HOST_WIDE_INT xl = xi.ulow ();
2984 unsigned HOST_WIDE_INT yl = yi.ulow ();
2985 unsigned HOST_WIDE_INT resultl = xl - yl;
2987 val[1] = (HOST_WIDE_INT) resultl < 0 ? 0 : -1;
2988 result.set_len (1 + (((resultl ^ xl) & (xl ^ yl))
2992 result.set_len (
sub_large (val, xi.val, xi.len,
3000template <
typename T1,
typename T2>
3008 if (result.needs_write_val_arg)
3009 val = result.write_val (
MAX (xi.len, yi.len) + 1);
3012 unsigned HOST_WIDE_INT xl = xi.ulow ();
3013 unsigned HOST_WIDE_INT yl = yi.ulow ();
3014 unsigned HOST_WIDE_INT resultl = xl - yl;
3017 if ((((xl ^ yl) & (resultl ^ xl)) >> (
precision - 1)) & 1)
3037 result.set_len (
sub_large (val, xi.val, xi.len,
3044template <
typename T1,
typename T2>
3052 if (result.needs_write_val_arg)
3053 val = result.write_val (xi.len + yi.len + 2);
3056 val[0] = xi.ulow () * yi.ulow ();
3060 result.set_len (
mul_internal (val, xi.val, xi.len, yi.val, yi.len,
3067template <
typename T1,
typename T2>
3075 if (result.needs_write_val_arg)
3076 val = result.write_val (xi.len + yi.len + 2);
3079 sgn, overflow,
false));
3085template <
typename T1,
typename T2>
3094template <
typename T1,
typename T2>
3103template <
typename T1,
typename T2>
3111 static_assert (!result.needs_write_val_arg,
3112 "mul_high on widest_int doesn't make sense");
3122template <
typename T1,
typename T2>
3131 if (quotient.needs_write_val_arg)
3132 quotient_val = quotient.write_val ((sgn ==
UNSIGNED
3133 && xi.val[xi.len - 1] < 0)
3137 quotient.set_len (
divmod_internal (quotient_val, 0, 0, xi.val, xi.len,
3139 yi.val, yi.len, yi.precision,
3145template <
typename T1,
typename T2>
3153template <
typename T1,
typename T2>
3163template <
typename T1,
typename T2>
3173 unsigned int remainder_len;
3174 if (quotient.needs_write_val_arg)
3176 unsigned int est_len;
3177 if (sgn ==
UNSIGNED && xi.val[xi.len - 1] < 0)
3180 est_len = xi.len + 1;
3181 quotient_val = quotient.write_val (est_len);
3182 remainder_val = remainder.write_val (est_len);
3185 &remainder_len, remainder_val,
3187 yi.val, yi.len, yi.precision, sgn,
3189 remainder.set_len (remainder_len);
3191 return quotient - 1;
3196template <
typename T1,
typename T2>
3205template <
typename T1,
typename T2>
3215template <
typename T1,
typename T2>
3225 unsigned int remainder_len;
3226 if (quotient.needs_write_val_arg)
3228 unsigned int est_len;
3229 if (sgn ==
UNSIGNED && xi.val[xi.len - 1] < 0)
3232 est_len = xi.len + 1;
3233 quotient_val = quotient.write_val (est_len);
3234 remainder_val = remainder.write_val (est_len);
3237 &remainder_len, remainder_val,
3239 yi.val, yi.len, yi.precision, sgn,
3241 remainder.set_len (remainder_len);
3243 return quotient + 1;
3248template <
typename T1,
typename T2>
3258template <
typename T1,
typename T2>
3268 unsigned int remainder_len;
3269 if (quotient.needs_write_val_arg)
3271 unsigned int est_len;
3272 if (sgn ==
UNSIGNED && xi.val[xi.len - 1] < 0)
3275 est_len = xi.len + 1;
3276 quotient_val = quotient.write_val (est_len);
3277 remainder_val = remainder.write_val (est_len);
3280 &remainder_len, remainder_val,
3282 yi.val, yi.len, yi.precision, sgn,
3284 remainder.set_len (remainder_len);
3294 return quotient - 1;
3296 return quotient + 1;
3302 return quotient + 1;
3310template <
typename T1,
typename T2>
3321 unsigned int remainder_len;
3322 if (quotient.needs_write_val_arg)
3324 unsigned int est_len;
3325 if (sgn ==
UNSIGNED && xi.val[xi.len - 1] < 0)
3328 est_len = xi.len + 1;
3329 quotient_val = quotient.write_val (est_len);
3330 remainder_val = remainder.write_val (est_len);
3333 &remainder_len, remainder_val,
3335 yi.val, yi.len, yi.precision, sgn, 0));
3336 remainder.set_len (remainder_len);
3338 *remainder_ptr = remainder;
3344template <
typename T1,
typename T2>
3353 while (
gt_p (x, 0, sgn))
3366template <
typename T1,
typename T2>
3375 unsigned int remainder_len;
3376 if (remainder.needs_write_val_arg)
3377 remainder_val = remainder.write_val ((sgn ==
UNSIGNED
3378 && xi.val[xi.len - 1] < 0)
3384 yi.val, yi.len, yi.precision, sgn, overflow);
3385 remainder.set_len (remainder_len);
3392template <
typename T1,
typename T2>
3401template <
typename T1,
typename T2>
3411template <
typename T1,
typename T2>
3421 unsigned int remainder_len;
3422 if (quotient.needs_write_val_arg)
3424 unsigned int est_len;
3425 if (sgn ==
UNSIGNED && xi.val[xi.len - 1] < 0)
3428 est_len = xi.len + 1;
3429 quotient_val = quotient.write_val (est_len);
3430 remainder_val = remainder.write_val (est_len);
3433 &remainder_len, remainder_val,
3435 yi.val, yi.len, yi.precision, sgn,
3437 remainder.set_len (remainder_len);
3440 return remainder +
y;
3447template <
typename T1,
typename T2>
3457template <
typename T1,
typename T2>
3467 unsigned int remainder_len;
3468 if (quotient.needs_write_val_arg)
3470 unsigned int est_len;
3471 if (sgn ==
UNSIGNED && xi.val[xi.len - 1] < 0)
3474 est_len = xi.len + 1;
3475 quotient_val = quotient.write_val (est_len);
3476 remainder_val = remainder.write_val (est_len);
3479 &remainder_len, remainder_val,
3481 yi.val, yi.len, yi.precision, sgn,
3483 remainder.set_len (remainder_len);
3486 return remainder -
y;
3493template <
typename T1,
typename T2>
3503 unsigned int remainder_len;
3504 if (quotient.needs_write_val_arg)
3506 unsigned int est_len;
3507 if (sgn ==
UNSIGNED && xi.val[xi.len - 1] < 0)
3510 est_len = xi.len + 1;
3511 quotient_val = quotient.write_val (est_len);
3512 remainder_val = remainder.write_val (est_len);
3515 &remainder_len, remainder_val,
3517 yi.val, yi.len, yi.precision, sgn,
3519 remainder.set_len (remainder_len);
3529 return remainder +
y;
3531 return remainder -
y;
3537 return remainder -
y;
3545template <
typename T1,
typename T2>
3554template <
typename T1,
typename T2>
3572template <
typename T1,
typename T2>
3583 if (result.needs_write_val_arg)
3584 val = result.write_val (1);
3590 unsigned int shift = yi.to_uhwi ();
3591 if (result.needs_write_val_arg)
3607 val[0] = xi.ulow () <<
shift;
3619template <
typename T1,
typename T2>
3629 if (
geu_p (yi, xi.precision))
3631 if (result.needs_write_val_arg)
3632 val = result.write_val (1);
3638 unsigned int shift = yi.to_uhwi ();
3639 if (result.needs_write_val_arg)
3641 unsigned int est_len = xi.len;
3642 if (xi.val[xi.len - 1] < 0 &&
shift)
3646 val = result.write_val (est_len);
3662 val[0] = xi.to_uhwi () >>
shift;
3666 result.set_len (
lrshift_large (val, xi.val, xi.len, xi.precision,
3674template <
typename T1,
typename T2>
3683 if (result.needs_write_val_arg)
3684 val = result.write_val (xi.len);
3686 if (
geu_p (yi, xi.precision))
3693 unsigned int shift = yi.to_uhwi ();
3697 result.set_len (1,
true);
3700 result.set_len (
arshift_large (val, xi.val, xi.len, xi.precision,
3708template <
typename T1,
typename T2>
3721template <
typename T1,
typename T2>
3723wi::lrotate (
const T1 &x,
const T2 &
y,
unsigned int width)
3734 return wi::zext (left, width) | right;
3735 return left | right;
3741template <
typename T1,
typename T2>
3743wi::rrotate (
const T1 &x,
const T2 &
y,
unsigned int width)
3753 return wi::zext (left, width) | right;
3754 return left | right;
3766template <
typename T>
3767inline unsigned HOST_WIDE_INT
3782 unsigned HOST_WIDE_INT res = xi.elt (start);
3786 unsigned HOST_WIDE_INT upper = xi.elt (start + 1);
3793template <
typename T>
3803#define SIGNED_BINARY_PREDICATE(OP, F) \
3804 template <typename T1, typename T2> \
3805 inline WI_SIGNED_BINARY_PREDICATE_RESULT (T1, T2) \
3806 OP (const T1 &x, const T2 &y) \
3808 return wi::F (x, y); \
3816#undef SIGNED_BINARY_PREDICATE
3818#define UNARY_OPERATOR(OP, F) \
3819 template<typename T> \
3820 WI_UNARY_RESULT (generic_wide_int<T>) \
3821 OP (const generic_wide_int<T> &x) \
3826#define BINARY_PREDICATE(OP, F) \
3827 template<typename T1, typename T2> \
3828 WI_BINARY_PREDICATE_RESULT (T1, T2) \
3829 OP (const T1 &x, const T2 &y) \
3831 return wi::F (x, y); \
3834#define BINARY_OPERATOR(OP, F) \
3835 template<typename T1, typename T2> \
3836 WI_BINARY_OPERATOR_RESULT (T1, T2) \
3837 OP (const T1 &x, const T2 &y) \
3839 return wi::F (x, y); \
3842#define SHIFT_OPERATOR(OP, F) \
3843 template<typename T1, typename T2> \
3844 WI_BINARY_OPERATOR_RESULT (T1, T1) \
3845 OP (const T1 &x, const T2 &y) \
3847 return wi::F (x, y); \
3862#undef UNARY_OPERATOR
3863#undef BINARY_PREDICATE
3864#undef BINARY_OPERATOR
3865#undef SHIFT_OPERATOR
3867template <
typename T1,
typename T2>
3869operator >> (const T1 &x, const T2 &
y)
3874template <
typename T1,
typename T2>
3876operator / (
const T1 &x,
const T2 &
y)
3881template <
typename T1,
typename T2>
3883operator % (
const T1 &x,
const T2 &
y)
3888void gt_ggc_mx (generic_wide_int <wide_int_storage> *) =
delete;
3889void gt_pch_nx (generic_wide_int <wide_int_storage> *) =
delete;
3959#ifndef GENERATOR_FILE
3973 template <
typename T>
3974 T
mask (
unsigned int,
bool);
3976 template <
typename T>
3979 template <
typename T>
3982 unsigned int mask (HOST_WIDE_INT *,
unsigned int,
bool,
unsigned int);
3983 unsigned int shifted_mask (HOST_WIDE_INT *,
unsigned int,
unsigned int,
3984 bool,
unsigned int);
3985 unsigned int from_array (HOST_WIDE_INT *,
const HOST_WIDE_INT *,
3986 unsigned int,
unsigned int,
bool);
4022template <
typename T>
4029 width, negate_p, wi::int_traits <T>::precision));
4036template <
typename T>
4042 unsigned int prec = wi::int_traits <T>::precision;
4043 unsigned int est_len
4044 = result.needs_write_val_arg
4045 ? ((start + (width > prec - start ? prec - start : width))
4047 result.set_len (
shifted_mask (result.write_val (est_len), start, width,
4054template <
typename T>
4070 overflow = suboverflow;
4071 else if (overflow != suboverflow)
void gt_pch_nx(bbitmap< N > *)
Definition bbitmap.h:226
void gt_ggc_mx(bbitmap< N > *)
Definition bbitmap.h:220
Definition edit-context.cc:52
Definition wide-int.h:1353
static FIXED_WIDE_INT(N) from(const wide_int_ref &
HOST_WIDE_INT * write_val(unsigned int)
Definition wide-int.h:1426
fixed_wide_int_storage()=default
const HOST_WIDE_INT * get_val() const
Definition wide-int.h:1412
unsigned int get_precision() const
Definition wide-int.h:1405
void set_len(unsigned int, bool=false)
Definition wide-int.h:1433
HOST_WIDE_INT val[WIDE_INT_MAX_HWIS(N)]
Definition wide-int.h:1355
static FIXED_WIDE_INT(N) from_array(const HOST_WIDE_INT *
unsigned int len
Definition wide-int.h:1356
unsigned int get_len() const
Definition wide-int.h:1419
fixed_wide_int_storage(const T &)
Definition wide-int.h:1395
Definition wide-int.h:776
HOST_WIDE_INT to_shwi() const
Definition wide-int.h:874
generic_wide_int()
Definition wide-int.h:842
HOST_WIDE_INT elt(unsigned int) const
Definition wide-int.h:972
void dump() const
Definition wide-int.h:1009
unsigned HOST_WIDE_INT to_uhwi() const
Definition wide-int.h:898
unsigned HOST_WIDE_INT ulow() const
Definition wide-int.h:955
unsigned HOST_WIDE_INT to_uhwi(unsigned int) const
Definition wide-int.h:887
HOST_WIDE_INT to_shwi(unsigned int) const
Definition wide-int.h:863
unsigned HOST_WIDE_INT uhigh() const
Definition wide-int.h:964
generic_wide_int(const T &)
Definition wide-int.h:846
HOST_WIDE_INT to_short_addr() const
Definition wide-int.h:909
HOST_WIDE_INT sext_elt(unsigned int) const
Definition wide-int.h:984
generic_wide_int(const T &, unsigned int)
Definition wide-int.h:853
HOST_WIDE_INT shigh() const
Definition wide-int.h:946
HOST_WIDE_INT sign_mask() const
Definition wide-int.h:917
HOST_WIDE_INT slow() const
Definition wide-int.h:937
Definition wide-int.h:1712
void set_len(unsigned int, bool=false)
Definition wide-int.h:1822
trailing_wide_int_storage(unsigned int, unsigned short *, HOST_WIDE_INT *)
Definition wide-int.h:1791
const HOST_WIDE_INT * get_val() const
Definition wide-int.h:1810
unsigned int m_precision
Definition wide-int.h:1716
trailing_wide_int_storage & operator=(const T &)
Definition wide-int.h:1832
unsigned int get_len() const
Definition wide-int.h:1798
unsigned int get_precision() const
Definition wide-int.h:1804
HOST_WIDE_INT * write_val(unsigned int)
Definition wide-int.h:1816
HOST_WIDE_INT * m_val
Definition wide-int.h:1723
unsigned short * m_len
Definition wide-int.h:1719
Definition wide-int.h:1967
signop sgn
Definition wide-int.h:1973
hwi_with_prec()
Definition wide-int.h:1969
unsigned int precision
Definition wide-int.h:1972
HOST_WIDE_INT val
Definition wide-int.h:1971
Definition wide-int.h:707
unsigned int precision
Definition wide-int.h:714
unsigned int len
Definition wide-int.h:713
storage_ref()
Definition wide-int.h:709
unsigned int get_len() const
Definition wide-int.h:732
const HOST_WIDE_INT * get_val() const
Definition wide-int.h:744
storage_ref(const HOST_WIDE_INT *, unsigned int, unsigned int)
const HOST_WIDE_INT * val
Definition wide-int.h:712
unsigned int get_precision() const
Definition wide-int.h:738
Definition wide-int.h:1058
HOST_WIDE_INT scratch[2]
Definition wide-int.h:1062
wide_int_ref_storage()
Definition wide-int.h:1065
Definition wide-int.h:1126
HOST_WIDE_INT val[WIDE_INT_MAX_INL_ELTS]
Definition wide-int.h:1130
static wide_int create(unsigned int)
Definition wide-int.h:1313
const HOST_WIDE_INT * get_val() const
Definition wide-int.h:1258
wide_int_storage()
Definition wide-int.h:1177
static wide_int from(const wide_int_ref &, unsigned int, signop)
Definition wide-int.h:1289
~wide_int_storage()
Definition wide-int.h:1206
unsigned int get_precision() const
Definition wide-int.h:1252
HOST_WIDE_INT * valp
Definition wide-int.h:1131
unsigned int len
Definition wide-int.h:1133
void set_len(unsigned int, bool=false)
Definition wide-int.h:1276
unsigned int get_len() const
Definition wide-int.h:1264
HOST_WIDE_INT * write_val(unsigned int)
Definition wide-int.h:1270
wide_int_storage & operator=(const wide_int_storage &)
Definition wide-int.h:1213
union wide_int_storage::@101 u
static wide_int from_array(const HOST_WIDE_INT *, unsigned int, unsigned int, bool=true)
Definition wide-int.h:1302
unsigned int precision
Definition wide-int.h:1134
Definition wide-int.h:1489
void set_len(unsigned int, bool=false)
Definition wide-int.h:1644
HOST_WIDE_INT val[WIDE_INT_MAX_INL_ELTS]
Definition wide-int.h:1493
const HOST_WIDE_INT * get_val() const
Definition wide-int.h:1613
widest_int_storage(const T &)
Definition wide-int.h:1543
widest_int_storage()
Definition wide-int.h:1538
union widest_int_storage::@102 u
widest_int_storage & operator=(const widest_int_storage &)
Definition wide-int.h:1572
widest_int_storage(const widest_int_storage &)
Definition wide-int.h:1553
~widest_int_storage()
Definition wide-int.h:1564
unsigned int get_precision() const
Definition wide-int.h:1606
unsigned int len
Definition wide-int.h:1496
unsigned int get_len() const
Definition wide-int.h:1620
HOST_WIDE_INT * write_val(unsigned int)
Definition wide-int.h:1627
HOST_WIDE_INT * valp
Definition wide-int.h:1494
#define GTY(x)
Definition coretypes.h:41
void(* gt_pointer_operator)(void *, void *, void *)
Definition coretypes.h:465
static bitmap scratch
Definition dse.cc:218
#define CHAR_BIT
Definition genautomata.cc:120
static struct token T
Definition gengtype-parse.cc:45
#define N
Definition gensupport.cc:202
unsigned int shift
Definition ggc-page.cc:233
#define HOST_WIDE_INT_1U
Definition hwint.h:70
#define HOST_WIDE_INT_PRINT_HEX
Definition hwint.h:113
HOST_WIDE_INT sext_hwi(HOST_WIDE_INT src, unsigned int prec)
Definition hwint.h:299
#define HOST_WIDE_INT_MAX
Definition hwint.h:279
#define HOST_BITS_PER_WIDE_INT
Definition hwint.h:53
unsigned HOST_WIDE_INT zext_hwi(unsigned HOST_WIDE_INT src, unsigned int prec)
Definition hwint.h:329
#define HOST_WIDE_INT_UC(X)
Definition hwint.h:66
Definition double-int.h:439
BINARY_FUNCTION udiv_ceil(const T1 &, const T2 &)
bool lts_p_large(const HOST_WIDE_INT *, unsigned int, unsigned int, const HOST_WIDE_INT *, unsigned int)
Definition wide-int.cc:479
unsigned int or_not_large(HOST_WIDE_INT *, const HOST_WIDE_INT *, unsigned int, const HOST_WIDE_INT *, unsigned int, unsigned int)
Definition wide-int.cc:1068
int ctz(const wide_int_ref &)
Definition wide-int.cc:2231
BINARY_FUNCTION umod_trunc(const T1 &, const T2 &)
BINARY_FUNCTION umul(const T1 &, const T2 &, overflow_type *)
bool multiple_of_p(const T1 &, const T2 &, signop)
Definition wide-int.h:3547
BINARY_FUNCTION udiv_floor(const T1 &, const T2 &)
wide_int shifted_mask(unsigned int, unsigned int, bool, unsigned int)
Definition wide-int.h:4003
unsigned int get_binary_precision(const T1 &, const T2 &)
Definition wide-int.h:2175
poly_int< N, hwi_with_prec > uhwi(const poly_int< N, unsigned HOST_WIDE_INT > &a, unsigned int precision)
Definition poly-int.h:733
UNARY_FUNCTION ext(const T &, unsigned int, signop)
precision_type
Definition wide-int.h:387
@ INL_CONST_PRECISION
Definition wide-int.h:398
@ VAR_PRECISION
Definition wide-int.h:394
@ CONST_PRECISION
Definition wide-int.h:402
@ FLEXIBLE_PRECISION
Definition wide-int.h:391
wide_int min_value(machine_mode, signop)
Definition rtl.h:2342
unsigned int or_large(HOST_WIDE_INT *, const HOST_WIDE_INT *, unsigned int, const HOST_WIDE_INT *, unsigned int, unsigned int)
Definition wide-int.cc:1010
wide_int mask(unsigned int, bool, unsigned int)
Definition wide-int.h:3992
unsigned int set_bit_large(HOST_WIDE_INT *, const HOST_WIDE_INT *, unsigned int, unsigned int, unsigned int)
Definition wide-int.cc:699
unsigned int bswap_large(HOST_WIDE_INT *, const HOST_WIDE_INT *, unsigned int, unsigned int)
Definition wide-int.cc:735
BINARY_FUNCTION div_trunc(const T1 &, const T2 &, signop, overflow_type *=0)
UNARY_PREDICATE neg_p(const T &, signop=SIGNED)
int cmps(const T1 &, const T2 &)
Definition wide-int.h:2444
BINARY_FUNCTION umod_floor(const T1 &, const T2 &)
BINARY_PREDICATE le_p(const T1 &, const T2 &, signop)
unsigned int lrshift_large(HOST_WIDE_INT *, const HOST_WIDE_INT *, unsigned int, unsigned int, unsigned int, unsigned int)
Definition wide-int.cc:2120
SHIFT_FUNCTION rrotate(const T1 &, const T2 &, unsigned int=0)
BINARY_FUNCTION div_ceil(const T1 &, const T2 &, signop, overflow_type *=0)
BINARY_FUNCTION sdiv_floor(const T1 &, const T2 &)
UNARY_PREDICATE fits_shwi_p(const T &)
HOST_WIDE_INT sign_mask(const T &)
Definition wide-int.h:2237
int clrsb(const wide_int_ref &)
Definition wide-int.cc:2203
UNARY_FUNCTION zext(const T &, unsigned int)
unsigned int xor_large(HOST_WIDE_INT *, const HOST_WIDE_INT *, unsigned int, const HOST_WIDE_INT *, unsigned int, unsigned int)
Definition wide-int.cc:1126
BINARY_FUNCTION div_floor(const T1 &, const T2 &, signop, overflow_type *=0)
wide_int round_up_for_mask(const wide_int &, const wide_int &)
Definition wide-int.cc:2342
SHIFT_FUNCTION rshift(const T1 &, const T2 &, signop sgn)
SHIFT_FUNCTION arshift(const T1 &, const T2 &)
unsigned HOST_WIDE_INT extract_uhwi(const T &, unsigned int, unsigned int)
Definition wide-int.h:3768
BINARY_FUNCTION div_round(const T1 &, const T2 &, signop, overflow_type *=0)
BINARY_FUNCTION umax(const T1 &, const T2 &)
BINARY_FUNCTION smin(const T1 &, const T2 &)
bool only_sign_bit_p(const wide_int_ref &, unsigned int)
Definition wide-int.cc:2295
bool eq_p_large(const HOST_WIDE_INT *, unsigned int, const HOST_WIDE_INT *, unsigned int, unsigned int)
Definition wide-int.cc:449
BINARY_FUNCTION bit_and_not(const T1 &, const T2 &)
unsigned int from_array(HOST_WIDE_INT *, const HOST_WIDE_INT *, unsigned int, unsigned int, bool=true)
Definition wide-int.cc:143
BINARY_FUNCTION sub(const T1 &, const T2 &)
BINARY_FUNCTION mod_round(const T1 &, const T2 &, signop, overflow_type *=0)
BINARY_FUNCTION smod_trunc(const T1 &, const T2 &)
UNARY_FUNCTION bitreverse(const T &)
UNARY_FUNCTION set_bit(const T &, unsigned int)
unsigned int min_precision(const T &, signop)
Definition wide-int.h:3795
int cmpu(const T1 &, const T2 &)
Definition wide-int.h:2481
BINARY_PREDICATE ges_p(const T1 &, const T2 &)
BINARY_FUNCTION mod_ceil(const T1 &, const T2 &, signop, overflow_type *=0)
UNARY_FUNCTION neg(const T &)
int exact_log2(const wide_int_ref &)
Definition wide-int.cc:2247
wide_int from_buffer(const unsigned char *, unsigned int)
Definition wide-int.cc:156
BINARY_FUNCTION mul_high(const T1 &, const T2 &, signop)
hwi_with_prec minus_one(unsigned int)
Definition wide-int.h:2011
unsigned int arshift_large(HOST_WIDE_INT *, const HOST_WIDE_INT *, unsigned int, unsigned int, unsigned int, unsigned int)
Definition wide-int.cc:2154
hwi_with_prec zero(unsigned int)
Definition wide-int.h:2018
SHIFT_FUNCTION lrotate(const T1 &, const T2 &, unsigned int=0)
unsigned int and_large(HOST_WIDE_INT *, const HOST_WIDE_INT *, unsigned int, const HOST_WIDE_INT *, unsigned int, unsigned int)
Definition wide-int.cc:895
int ffs(const wide_int_ref &)
Definition wide-int.cc:2287
int floor_log2(const wide_int_ref &)
Definition wide-int.cc:2279
BINARY_PREDICATE lt_p(const T1 &, const T2 &, signop)
unsigned int 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 *)
Definition wide-int.cc:1838
BINARY_FUNCTION bit_or(const T1 &, const T2 &)
BINARY_PREDICATE les_p(const T1 &, const T2 &)
unsigned int get_precision(const T &)
Definition wide-int.h:2166
unsigned int and_not_large(HOST_WIDE_INT *, const HOST_WIDE_INT *, unsigned int, const HOST_WIDE_INT *, unsigned int, unsigned int)
Definition wide-int.cc:952
BINARY_FUNCTION bit_xor(const T1 &, const T2 &)
int cmpu_large(const HOST_WIDE_INT *, unsigned int, unsigned int, const HOST_WIDE_INT *, unsigned int)
Definition wide-int.cc:581
unsigned int bitreverse_large(HOST_WIDE_INT *, const HOST_WIDE_INT *, unsigned int, unsigned int)
Definition wide-int.cc:769
hwi_with_prec two(unsigned int)
Definition wide-int.h:2032
UNARY_FUNCTION bswap(const T &)
unsigned int add_large(HOST_WIDE_INT *, const HOST_WIDE_INT *, unsigned int, const HOST_WIDE_INT *, unsigned int, unsigned int, signop, overflow_type *)
Definition wide-int.cc:1172
unsigned int lshift_large(HOST_WIDE_INT *, const HOST_WIDE_INT *, unsigned int, unsigned int, unsigned int)
Definition wide-int.cc:2053
Ca unsigned int precision
Definition poly-int.h:746
BINARY_PREDICATE ge_p(const T1 &, const T2 &, signop)
static void accumulate_overflow(overflow_type &, overflow_type)
Definition wide-int.h:4064
BINARY_PREDICATE lts_p(const T1 &, const T2 &)
BINARY_FUNCTION bit_and(const T1 &, const T2 &)
UNARY_FUNCTION abs(const T &)
unsigned int sub_large(HOST_WIDE_INT *, const HOST_WIDE_INT *, unsigned int, const HOST_WIDE_INT *, unsigned int, unsigned int, signop, overflow_type *)
Definition wide-int.cc:1638
BINARY_FUNCTION smul(const T1 &, const T2 &, overflow_type *)
Ca & a
Definition poly-int.h:745
UNARY_FUNCTION bit_not(const T &)
BINARY_PREDICATE geu_p(const T1 &, const T2 &)
wide_int max_value(machine_mode, signop)
Definition rtl.h:2350
UNARY_PREDICATE fits_uhwi_p(const T &)
unsigned int force_to_size(HOST_WIDE_INT *, const HOST_WIDE_INT *, unsigned int, unsigned int, unsigned int, signop sgn)
Definition wide-int.cc:364
int cmps_large(const HOST_WIDE_INT *, unsigned int, unsigned int, const HOST_WIDE_INT *, unsigned int)
Definition wide-int.cc:517
BINARY_FUNCTION mul(const T1 &, const T2 &)
wide_int round_down_for_mask(const wide_int &, const wide_int &)
Definition wide-int.cc:2316
BINARY_FUNCTION gcd(const T1 &, const T2 &, signop=UNSIGNED)
void to_mpz(const wide_int_ref &, mpz_t, signop)
Definition wide-int.cc:206
unsigned int mul_internal(HOST_WIDE_INT *, const HOST_WIDE_INT *, unsigned int, const HOST_WIDE_INT *, unsigned int, unsigned int, signop, overflow_type *, bool)
Definition wide-int.cc:1326
BINARY_PREDICATE gts_p(const T1 &, const T2 &)
BINARY_FUNCTION umin(const T1 &, const T2 &)
void copy(T1 &, const T2 &)
Definition wide-int.h:2184
SHIFT_FUNCTION lrshift(const T1 &, const T2 &)
BINARY_PREDICATE gt_p(const T1 &, const T2 &, signop)
wide_int mod_inv(const wide_int &a, const wide_int &b)
Definition wide-int.cc:2375
BINARY_PREDICATE gtu_p(const T1 &, const T2 &)
UNARY_FUNCTION sext(const T &, unsigned int)
SHIFT_FUNCTION lshift(const T1 &, const T2 &)
int clz(const wide_int_ref &)
Definition wide-int.cc:2178
BINARY_FUNCTION udiv_trunc(const T1 &, const T2 &)
BINARY_PREDICATE ltu_p(const T1 &, const T2 &)
int cmp(const T1 &, const T2 &, signop)
Definition wide-int.h:2523
BINARY_FUNCTION bit_or_not(const T1 &, const T2 &)
BINARY_FUNCTION divmod_trunc(const T1 &, const T2 &, signop, WI_BINARY_RESULT(T1, T2) *)
BINARY_FUNCTION add(const T1 &, const T2 &)
BINARY_PREDICATE ne_p(const T1 &, const T2 &)
BINARY_PREDICATE leu_p(const T1 &, const T2 &)
int parity(const wide_int_ref &)
Definition wide-int.h:3760
unsigned int zext_large(HOST_WIDE_INT *, const HOST_WIDE_INT *, unsigned int, unsigned int, unsigned int)
Definition wide-int.cc:640
BINARY_FUNCTION smax(const T1 &, const T2 &)
BINARY_FUNCTION mod_trunc(const T1 &, const T2 &, signop, overflow_type *=0)
BINARY_FUNCTION min(const T1 &, const T2 &, signop)
i
Definition poly-int.h:750
bool ltu_p_large(const HOST_WIDE_INT *, unsigned int, unsigned int, const HOST_WIDE_INT *, unsigned int)
Definition wide-int.cc:554
BINARY_FUNCTION sdiv_trunc(const T1 &, const T2 &)
overflow_type
Definition wide-int.h:377
@ OVF_UNKNOWN
Definition wide-int.h:383
@ OVF_NONE
Definition wide-int.h:378
@ OVF_UNDERFLOW
Definition wide-int.h:379
@ OVF_OVERFLOW
Definition wide-int.h:380
BINARY_PREDICATE eq_p(const T1 &, const T2 &)
int popcount(const wide_int_ref &)
Definition wide-int.cc:1606
BINARY_FUNCTION mod_floor(const T1 &, const T2 &, signop, overflow_type *=0)
hwi_with_prec one(unsigned int)
Definition wide-int.h:2025
wide_int set_bit_in_zero(unsigned int, unsigned int)
Definition wide-int.h:4015
unsigned int sext_large(HOST_WIDE_INT *, const HOST_WIDE_INT *, unsigned int, unsigned int, unsigned int)
Definition wide-int.cc:613
BINARY_FUNCTION max(const T1 &, const T2 &, signop)
poly_int< N, hwi_with_prec > shwi(const poly_int< N, HOST_WIDE_INT > &a, unsigned int precision)
Definition poly-int.h:721
i
Definition poly-int.h:776
Ca const poly_int< N, Cb > & b
Definition poly-int.h:771
rtx offset
Definition postreload.cc:691
static struct decomposition decompose(rtx)
Definition reload.cc:2385
signop
Definition signop.h:28
@ UNSIGNED
Definition signop.h:30
@ SIGNED
Definition signop.h:29
Definition wide-int.h:1758
static size_t extra_size(unsigned int precision, unsigned int num_elements=N)
Definition wide-int.h:1875
trailing_wide_int operator[](unsigned int)
Definition wide-int.h:1855
size_t extra_size() const
Definition wide-int.h:1786
unsigned char m_num_elements
Definition wide-int.h:1767
unsigned short m_len[N]
Definition wide-int.h:1770
unsigned short m_max_len
Definition wide-int.h:1764
HOST_WIDE_INT m_val[1]
Definition wide-int.h:1774
unsigned int num_elements() const
Definition wide-int.h:1781
unsigned short m_precision
Definition wide-int.h:1761
typedef WIDE_INT_REF_FOR(trailing_wide_int_storage) const _reference
void set_precision(unsigned int precision, unsigned int num_elements=N)
Definition wide-int.h:1843
unsigned int get_precision() const
Definition wide-int.h:1780
bool predicate_result
Definition wide-int.h:534
result_type operator_result
Definition wide-int.h:533
result_type signed_shift_result_type
Definition wide-int.h:535
bool signed_predicate_result
Definition wide-int.h:536
STATIC_ASSERT(int_traits< T1 >::precision==int_traits< T2 >::precision)
generic_wide_int< widest_int_storage< int_traits< T1 >::precision > > result_type
Definition wide-int.h:532
result_type signed_shift_result_type
Definition wide-int.h:509
generic_wide_int< widest_int_storage< int_traits< T1 >::precision > > result_type
Definition wide-int.h:506
bool predicate_result
Definition wide-int.h:508
bool signed_predicate_result
Definition wide-int.h:510
result_type operator_result
Definition wide-int.h:507
result_type operator_result
Definition wide-int.h:475
bool predicate_result
Definition wide-int.h:476
bool signed_predicate_result
Definition wide-int.h:478
result_type signed_shift_result_type
Definition wide-int.h:477
generic_wide_int< widest_int_storage< int_traits< T2 >::precision > > result_type
Definition wide-int.h:474
widest_int result_type
Definition wide-int.h:445
result_type signed_shift_result_type
Definition wide-int.h:466
bool predicate_result
Definition wide-int.h:465
result_type operator_result
Definition wide-int.h:464
generic_wide_int< fixed_wide_int_storage< int_traits< T2 >::precision > > result_type
Definition wide-int.h:463
bool signed_predicate_result
Definition wide-int.h:467
bool predicate_result
Definition wide-int.h:454
wide_int result_type
Definition wide-int.h:452
result_type operator_result
Definition wide-int.h:453
result_type operator_result
Definition wide-int.h:496
bool predicate_result
Definition wide-int.h:497
generic_wide_int< fixed_wide_int_storage< int_traits< T1 >::precision > > result_type
Definition wide-int.h:495
bool signed_predicate_result
Definition wide-int.h:499
result_type signed_shift_result_type
Definition wide-int.h:498
bool signed_predicate_result
Definition wide-int.h:524
result_type signed_shift_result_type
Definition wide-int.h:523
result_type operator_result
Definition wide-int.h:521
STATIC_ASSERT(int_traits< T1 >::precision==int_traits< T2 >::precision)
bool predicate_result
Definition wide-int.h:522
generic_wide_int< fixed_wide_int_storage< int_traits< T1 >::precision > > result_type
Definition wide-int.h:520
wide_int result_type
Definition wide-int.h:484
bool predicate_result
Definition wide-int.h:486
result_type operator_result
Definition wide-int.h:485
result_type operator_result
Definition wide-int.h:543
wide_int result_type
Definition wide-int.h:542
bool predicate_result
Definition wide-int.h:544
Definition wide-int.h:435
static FIXED_WIDE_INT(N) get_binary_result(const T1 &
static const T2 &static unsigned int get_binary_precision(const T1 &, const T2 &)
static WIDEST_INT(N) get_binary_result(const T1 &
static const T2 &static unsigned int get_binary_precision(const T1 &, const T2 &)
Definition wide-int.h:427
static hwi_with_prec zero(const T &)
Definition wide-int.h:2043
static int zero(const T &)
Definition wide-int.h:2044
Definition wide-int.h:3945
Definition wide-int.h:3946
Definition wide-int.h:1895
static const bool is_sign_extended
Definition wide-int.h:1898
static const bool host_dependent_precision
Definition wide-int.h:1897
static wi::storage_ref decompose(HOST_WIDE_INT *, unsigned int, T)
Definition wide-int.h:1914
static const bool needs_write_val_arg
Definition wide-int.h:1899
static unsigned int get_precision(T)
Definition wide-int.h:1907
#define gcc_assert(EXPR)
Definition system.h:821
#define CEIL(x, y)
Definition system.h:396
#define IN_RANGE(VALUE, LOWER, UPPER)
Definition system.h:320
#define STATIC_CONSTANT_P(X)
Definition system.h:864
#define UNLIKELY(x)
Definition system.h:759
#define bool
Definition system.h:893
#define STATIC_ASSERT(X)
Definition system.h:871
#define gcc_checking_assert(EXPR)
Definition system.h:828
#define MAX(X, Y)
Definition system.h:393
#define LIKELY(x)
Definition system.h:758
static void insert(void)
Definition tree-ssa-pre.cc:3800
generic_wide_int< widest_int_storage< WIDEST_INT_MAX_PRECISION > > widest_int
Definition wide-int.h:345
#define WIDEST_INT(N)
Definition wide-int.h:1484
#define UNARY_PREDICATE
Definition wide-int.h:560
#define ASSIGNMENT_OPERATOR(OP, F)
Definition wide-int.h:805
#define SHIFT_FUNCTION
Definition wide-int.h:568
#define WIDE_INT_REF_FOR(T)
Definition wide-int.h:362
generic_wide_int< wide_int_ref_storage< false > > wide_int_ref
Definition wide-int.h:353
generic_wide_int< widest_int_storage< WIDEST_INT_MAX_PRECISION *2 > > widest2_int
Definition wide-int.h:346
generic_wide_int< trailing_wide_int_storage > trailing_wide_int
Definition wide-int.h:1739
#define WI_SIGNED_SHIFT_RESULT(T1, T2)
Definition wide-int.h:299
#define WIDE_INT_MAX_ELTS
Definition wide-int.h:252
#define BINARY_OPERATOR(OP, F)
Definition wide-int.h:3834
#define ADDR_MAX_PRECISION
Definition wide-int.h:276
#define SIGNED_BINARY_PREDICATE(OP, F)
Definition wide-int.h:3803
#define INCDEC_OPERATOR(OP, DELTA)
Definition wide-int.h:814
#define WI_BINARY_RESULT(T1, T2)
Definition wide-int.h:289
#define WI_UNARY_RESULT_VAR(RESULT, VAL, T, X)
Definition wide-int.h:329
#define BINARY_FUNCTION
Definition wide-int.h:566
#define SHIFT_ASSIGNMENT_OPERATOR(OP, OP2)
Definition wide-int.h:810
generic_wide_int< wide_int_storage > wide_int
Definition wide-int.h:343
const T2 & y
Definition wide-int.h:3870
#define FIXED_WIDE_INT(N)
Definition wide-int.h:340
#define WI_BINARY_RESULT_VAR(RESULT, VAL, T1, X, T2, Y)
Definition wide-int.h:323
STATIC_ASSERT(WIDE_INT_MAX_INL_ELTS< WIDE_INT_MAX_ELTS)
#define BINARY_PREDICATE
Definition wide-int.h:564
#define WIDE_INT_MAX_INL_ELTS
Definition wide-int.h:243
#define UNARY_OPERATOR(OP, F)
Definition wide-int.h:3818
#define WIDE_INT_MAX_INL_PRECISION
Definition wide-int.h:247
#define WI_UNARY_RESULT(T)
Definition wide-int.h:315
#define SHIFT_OPERATOR(OP, F)
Definition wide-int.h:3842
#define WIDE_INT_MAX_HWIS(PRECISION)
Definition wide-int.h:284
#define UNARY_FUNCTION
Definition wide-int.h:562