Home | History | Annotate | Download | only in gcc

Lines Matching refs:wi

144 wi::from_array (HOST_WIDE_INT *val, const HOST_WIDE_INT *xval,
157 wi::from_buffer (const unsigned char *buffer, unsigned int buffer_len)
207 wi::to_mpz (const wide_int_ref &x, mpz_t result, signop sgn)
213 if (wi::neg_p (x, sgn))
233 else if (excess < 0 && wi::neg_p (x))
255 wi::from_mpz (const_tree type, mpz_t x, bool wrap)
330 wi::max_value (unsigned int precision, signop sgn)
344 wi::min_value (unsigned int precision, signop sgn)
352 return wi::set_bit_in_zero (precision - 1, precision);
366 wi::force_to_size (HOST_WIDE_INT *val, const HOST_WIDE_INT *xval,
451 wi::eq_p_large (const HOST_WIDE_INT *op0, unsigned int op0len,
481 wi::lts_p_large (const HOST_WIDE_INT *op0, unsigned int op0len,
519 wi::cmps_large (const HOST_WIDE_INT *op0, unsigned int op0len,
556 wi::ltu_p_large (const HOST_WIDE_INT *op0, unsigned int op0len,
583 wi::cmpu_large (const HOST_WIDE_INT *op0, unsigned int op0len,
615 wi::sext_large (HOST_WIDE_INT *val, const HOST_WIDE_INT *xval,
642 wi::zext_large (HOST_WIDE_INT *val, const HOST_WIDE_INT *xval,
671 wi::insert (const wide_int &x, const wide_int &y, unsigned int start,
687 mask = wi::shifted_mask (start, width, false, precision);
688 tmp = wi::lshift (wide_int::from (y, precision, UNSIGNED), start);
691 tmp = wi::bit_and_not (x, mask);
701 wi::set_bit_large (HOST_WIDE_INT *val, const HOST_WIDE_INT *xval,
777 wi::mask (HOST_WIDE_INT *val, unsigned int width, bool negate,
811 wi::shifted_mask (HOST_WIDE_INT *val, unsigned int start, unsigned int width,
875 wi::and_large (HOST_WIDE_INT *val, const HOST_WIDE_INT *op0,
932 wi::and_not_large (HOST_WIDE_INT *val, const HOST_WIDE_INT *op0,
990 wi::or_large (HOST_WIDE_INT *val, const HOST_WIDE_INT *op0,
1048 wi::or_not_large (HOST_WIDE_INT *val, const HOST_WIDE_INT *op0,
1106 wi::xor_large (HOST_WIDE_INT *val, const HOST_WIDE_INT *op0,
1152 wi::add_large (HOST_WIDE_INT *val, const HOST_WIDE_INT *op0,
1155 signop sgn, wi::overflow_type *overflow)
1186 = (sgn == UNSIGNED && carry) ? wi::OVF_OVERFLOW : wi::OVF_NONE;
1197 *overflow = wi::OVF_UNDERFLOW;
1199 *overflow = wi::OVF_OVERFLOW;
1201 *overflow = wi::OVF_NONE;
1204 *overflow = wi::OVF_NONE;
1212 *overflow = (x <= o0) ? wi::OVF_OVERFLOW : wi::OVF_NONE;
1214 *overflow = (x < o0) ? wi::OVF_OVERFLOW : wi::OVF_NONE;
1306 wi::mul_internal (HOST_WIDE_INT *val, const HOST_WIDE_INT *op1val,
1309 wi::overflow_type *overflow, bool high)
1334 *overflow = wi::OVF_NONE;
1336 wide_int_ref op1 = wi::storage_ref (op1val, op1len, prec);
1337 wide_int_ref op2 = wi::storage_ref (op2val, op2len, prec);
1352 && wi::fits_uhwi_p (op1)
1353 && wi::fits_uhwi_p (op2))
1378 *overflow = (upper != 0) ? wi::OVF_OVERFLOW : wi::OVF_NONE;
1391 val[0] = wi::neg_p (op2, sgn) ? -1 : 0;
1402 val[0] = wi::neg_p (op1, sgn) ? -1 : 0;
1475 if (wi::neg_p (op1))
1486 if (wi::neg_p (op2))
1518 *overflow = (sgn == UNSIGNED) ? wi::OVF_OVERFLOW : wi::OVF_UNKNOWN;
1527 wi::popcount (const wide_int_ref &x)
1559 wi::sub_large (HOST_WIDE_INT *val, const HOST_WIDE_INT *op0,
1562 signop sgn, wi::overflow_type *overflow)
1754 wi::divmod_internal (HOST_WIDE_INT *quotient, unsigned int *remainder_len,
1760 wi::overflow_type *oflow)
1778 wide_int_ref dividend = wi::storage_ref (dividend_val, dividend_len,
1780 wide_int_ref divisor = wi::storage_ref (divisor_val, divisor_len,
1790 && wi::only_sign_bit_p (dividend))
1817 && wi::fits_shwi_p (dividend)
1818 && wi::fits_shwi_p (divisor))
1852 && wi::fits_uhwi_p (dividend)
1853 && wi::fits_uhwi_p (divisor))
1876 if (wi::neg_p (dividend))
1882 if (wi::neg_p (divisor))
1915 quotient_len = wi::sub_large (quotient, zeros, 1, quotient,
1925 *remainder_len = wi::sub_large (remainder, zeros, 1, remainder,
1940 wi::lshift_large (HOST_WIDE_INT *val, const HOST_WIDE_INT *xval,
2012 wi::lrshift_large (HOST_WIDE_INT *val, const HOST_WIDE_INT *xval,
2039 wi::arshift_large (HOST_WIDE_INT *val, const HOST_WIDE_INT *xval,
2058 wi::clz (const wide_int_ref &x)
2083 wi::clrsb (const wide_int_ref &x)
2111 wi::ctz (const wide_int_ref &x)
2127 wi::exact_log2 (const wide_int_ref &x)
2159 wi::floor_log2 (const wide_int_ref &x)
2167 wi::ffs (const wide_int_ref &x)
2175 wi::only_sign_bit_p (const wide_int_ref &x, unsigned int precision)
2182 wi::only_sign_bit_p (const wide_int_ref &x)
2196 wi::round_down_for_mask (const wide_int &val, const wide_int &mask)
2199 wide_int extra_bits = wi::bit_and_not (val, mask);
2206 wide_int lower_mask = wi::mask (precision - wi::clz (extra_bits),
2222 wi::round_up_for_mask (const wide_int &val, const wide_int &mask)
2225 wide_int extra_bits = wi::bit_and_not (val, mask);
2231 wide_int upper_mask = wi::mask (precision - wi::clz (extra_bits),
2246 wide_int tmp = wi::bit_and_not (upper_mask, val);
2255 wi::mod_inv (const wide_int &a, const wide_int &b)
2258 gcc_checking_assert (wi::eq_p (wi::gcd (a, b), 1));
2267 if (wi::eq_p (b, 1))
2270 while (wi::gt_p (c, 1, UNSIGNED))
2273 wide_int q = wi::divmod_trunc (c, d, UNSIGNED, &d);
2276 x0 = wi::sub (x1, wi::mul (q, x0));
2279 if (wi::lt_p (x1, 0, SIGNED))
2352 return wi::shwi (i, 32);
2373 /* Verify that print_dec (WI, ..., SGN) gives the expected string
2377 assert_deceq (const char *expected, const wide_int_ref &wi, signop sgn)
2380 print_dec (wi, buf, sgn);
2387 assert_hexeq (const char *expected, const wide_int_ref &wi)
2390 print_hex (wi, buf);
2405 assert_hexeq ("0x1fffffffffffffffff", wi::shwi (-1, 69));
2406 assert_hexeq ("0xffffffffffffffff", wi::mask (64, false, 69));
2407 assert_hexeq ("0xffffffffffffffff", wi::mask <widest_int> (64, false));
2411 wi::lshift (1, 129) + wi::lshift (1, 64) - 2);
2413 wi::lshift (1, 129) + wi::lshift (1, 74)
2414 + wi::lshift (0x1234567, 32) + 0x89abcdef);
2430 assert_deceq ("-7", wi::neg (a), SIGNED);
2431 assert_deceq ("10", wi::add (a, b), SIGNED);
2432 assert_deceq ("4", wi::sub (a, b), SIGNED);
2433 assert_deceq ("-4", wi::sub (b, a), SIGNED);
2434 assert_deceq ("21", wi::mul (a, b), SIGNED);
2454 ASSERT_TRUE (wi::eq_p (a, a));
2455 ASSERT_FALSE (wi::eq_p (a, b));
2458 ASSERT_TRUE (wi::ne_p (a, b));
2459 ASSERT_FALSE (wi::ne_p (a, a));
2462 ASSERT_FALSE (wi::lts_p (a, a));
2463 ASSERT_FALSE (wi::lts_p (a, b));
2464 ASSERT_TRUE (wi::lts_p (b, a));
2467 ASSERT_TRUE (wi::les_p (a, a));
2468 ASSERT_FALSE (wi::les_p (a, b));
2469 ASSERT_TRUE (wi::les_p (b, a));
2472 ASSERT_FALSE (wi::gts_p (a, a));
2473 ASSERT_TRUE (wi::gts_p (a, b));
2474 ASSERT_FALSE (wi::gts_p (b, a));
2477 ASSERT_TRUE (wi::ges_p (a, a));
2478 ASSERT_TRUE (wi::ges_p (a, b));
2479 ASSERT_FALSE (wi::ges_p (b, a));
2482 ASSERT_EQ (-1, wi::cmps (b, a));
2483 ASSERT_EQ (0, wi::cmps (a, a));
2484 ASSERT_EQ (1, wi::cmps (a, b));
2509 wi::overflow_type overflow;
2512 sum = wi::add (wi::max_value (prec, UNSIGNED) - offset, 1,
2515 ASSERT_EQ (overflow != wi::OVF_NONE, offset == 0);
2517 sum = wi::add (1, wi::max_value (prec, UNSIGNED) - offset,
2520 ASSERT_EQ (overflow != wi::OVF_NONE, offset == 0);
2522 diff = wi::sub (wi::max_value (prec, UNSIGNED) - offset,
2523 wi::max_value (prec, UNSIGNED),
2526 ASSERT_EQ (overflow != wi::OVF_NONE, offset != 0);
2528 diff = wi::sub (wi::max_value (prec, UNSIGNED) - offset,
2529 wi::max_value (prec, UNSIGNED) - 1,
2532 ASSERT_EQ (overflow != wi::OVF_NONE, offset > 1);
2542 ASSERT_EQ (17, wi::round_down_for_mask (wi::shwi (17, prec),
2543 wi::shwi (0xf1, prec)));
2544 ASSERT_EQ (17, wi::round_up_for_mask (wi::shwi (17, prec),
2545 wi::shwi (0xf1, prec)));
2547 ASSERT_EQ (1, wi::round_down_for_mask (wi::shwi (6, prec),
2548 wi::shwi (0xf1, prec)));
2549 ASSERT_EQ (16, wi::round_up_for_mask (wi::shwi (6, prec),
2550 wi::shwi (0xf1, prec)));
2552 ASSERT_EQ (17, wi::round_down_for_mask (wi::shwi (24, prec),
2553 wi::shwi (0xf1, prec)));
2554 ASSERT_EQ (32, wi::round_up_for_mask (wi::shwi (24, prec),
2555 wi::shwi (0xf1, prec)));
2557 ASSERT_EQ (0x011, wi::round_down_for_mask (wi::shwi (0x22, prec),
2558 wi::shwi (0x111, prec)));
2559 ASSERT_EQ (0x100, wi::round_up_for_mask (wi::shwi (0x22, prec),
2560 wi::shwi (0x111, prec)));
2562 ASSERT_EQ (100, wi::round_down_for_mask (wi::shwi (101, prec),
2563 wi::shwi (0xfc, prec)));
2564 ASSERT_EQ (104, wi::round_up_for_mask (wi::shwi (101, prec),
2565 wi::shwi (0xfc, prec)));
2567 ASSERT_EQ (0x2bc, wi::round_down_for_mask (wi::shwi (0x2c2, prec),
2568 wi::shwi (0xabc, prec)));
2569 ASSERT_EQ (0x800, wi::round_up_for_mask (wi::shwi (0x2c2, prec),
2570 wi::shwi (0xabc, prec)));
2572 ASSERT_EQ (0xabc, wi::round_down_for_mask (wi::shwi (0xabd, prec),
2573 wi::shwi (0xabc, prec)));
2574 ASSERT_EQ (0, wi::round_up_for_mask (wi::shwi (0xabd, prec),
2575 wi::shwi (0xabc, prec)));
2577 ASSERT_EQ (0xabc, wi::round_down_for_mask (wi::shwi (0x1000, prec),
2578 wi::shwi (0xabc, prec)));
2579 ASSERT_EQ (0, wi::round_up_for_mask (wi::shwi (0x1000, prec),
2580 wi::shwi (0xabc, prec)));
2593 ASSERT_EQ (wi::mask (128, false, 128),
2594 wi::shifted_mask (0, 128, false, 128));
2595 ASSERT_EQ (wi::mask (128, true, 128),
2596 wi::shifted_mask (0, 128, true, 128));