|
static unsigned HOST_WIDE_INT | safe_uhwi (const HOST_WIDE_INT *val, unsigned int len, unsigned int i) |
|
static unsigned int | canonize (HOST_WIDE_INT *val, unsigned int len, unsigned int precision) |
|
static unsigned int | canonize_uhwi (HOST_WIDE_INT *val, unsigned int precision) |
|
static HOST_WIDE_INT | selt (const HOST_WIDE_INT *a, unsigned int len, unsigned int blocks_needed, unsigned int small_prec, unsigned int index, signop sgn) |
|
static HOST_WIDE_INT | top_bit_of (const HOST_WIDE_INT *a, unsigned int len, unsigned int prec) |
|
static void | wi_unpack (unsigned HOST_HALF_WIDE_INT *result, const HOST_WIDE_INT *input, unsigned int in_len, unsigned int out_len, unsigned int prec, signop sgn) |
|
static unsigned int | wi_pack (HOST_WIDE_INT *result, const unsigned HOST_HALF_WIDE_INT *input, unsigned int in_len, unsigned int precision) |
|
static int | divmod_internal_2 (unsigned HOST_HALF_WIDE_INT *b_quotient, unsigned HOST_HALF_WIDE_INT *b_remainder, unsigned HOST_HALF_WIDE_INT *b_dividend, unsigned HOST_HALF_WIDE_INT *b_divisor, int m, int n) |
|
static void | rshift_large_common (HOST_WIDE_INT *val, const HOST_WIDE_INT *xval, unsigned int xlen, unsigned int shift, unsigned int len) |
|
void | gt_ggc_mx (widest_int *) |
|
void | gt_pch_nx (widest_int *, void(*)(void *, void *), void *) |
|
void | gt_pch_nx (widest_int *) |
|
DEBUG_FUNCTION void | debug (const wide_int &ref) |
|
DEBUG_FUNCTION void | debug (const wide_int *ptr) |
|
DEBUG_FUNCTION void | debug (const widest_int &ref) |
|
DEBUG_FUNCTION void | debug (const widest_int *ptr) |
|
#define HOST_BITS_PER_HALF_WIDE_INT 32 |
Operations with very long integers.
Copyright (C) 2012-2025 Free Software Foundation, Inc.
Contributed by Kenneth Zadeck <zadeck@naturalbridge.com>
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/>.
Referenced by wi::divmod_internal(), divmod_internal_2(), wi::mul_internal(), wi_pack(), and wi_unpack().
static unsigned int canonize |
( |
HOST_WIDE_INT * | val, |
|
|
unsigned int | len, |
|
|
unsigned int | precision ) |
|
static |
Convert the integer in VAL to canonical form, returning its new length.
LEN is the number of blocks currently in VAL and PRECISION is the number
of bits in the integer it represents.
This function only changes the representation, not the value.
References BLOCKS_NEEDED, HOST_BITS_PER_WIDE_INT, HOST_WIDE_INT_M1, i, sext_hwi(), and SIGN_MASK.
Referenced by wi::add_large(), wi::and_large(), wi::and_not_large(), wi::arshift_large(), wi::bitreverse_large(), wi::bswap_large(), wi::force_to_size(), wi::from_array(), wi::from_buffer(), wi::from_mpz(), wi::lrshift_large(), wi::lshift_large(), wi::or_large(), wi::or_not_large(), wi::set_bit_large(), wi::sext_large(), wi::sub_large(), wi_pack(), wi::xor_large(), and wi::zext_large().
static int divmod_internal_2 |
( |
unsigned HOST_HALF_WIDE_INT * | b_quotient, |
|
|
unsigned HOST_HALF_WIDE_INT * | b_remainder, |
|
|
unsigned HOST_HALF_WIDE_INT * | b_dividend, |
|
|
unsigned HOST_HALF_WIDE_INT * | b_divisor, |
|
|
int | m, |
|
|
int | n ) |
|
static |
Compute B_QUOTIENT and B_REMAINDER from B_DIVIDEND/B_DIVISOR. The
algorithm is a small modification of the algorithm in Hacker's
Delight by Warren, which itself is a small modification of Knuth's
algorithm. M is the number of significant elements of U however
there needs to be at least one extra element of B_DIVIDEND
allocated, N is the number of elements of B_DIVISOR.
Return new value for N.
References b, clz_hwi(), HALF_INT_MASK, HOST_BITS_PER_HALF_WIDE_INT, HOST_WIDE_INT_1U, i, and MIN.
Referenced by wi::divmod_internal().
static HOST_WIDE_INT selt |
( |
const HOST_WIDE_INT * | a, |
|
|
unsigned int | len, |
|
|
unsigned int | blocks_needed, |
|
|
unsigned int | small_prec, |
|
|
unsigned int | index, |
|
|
signop | sgn ) |
|
inlinestatic |
static void wi_unpack |
( |
unsigned HOST_HALF_WIDE_INT * | result, |
|
|
const HOST_WIDE_INT * | input, |
|
|
unsigned int | in_len, |
|
|
unsigned int | out_len, |
|
|
unsigned int | prec, |
|
|
signop | sgn ) |
|
static |
Subroutines of the multiplication and division operations. Unpack
the first IN_LEN HOST_WIDE_INTs in INPUT into 2 * IN_LEN
HOST_HALF_WIDE_INTs of RESULT. The rest of RESULT is filled by
uncompressing the top bit of INPUT[IN_LEN - 1].
References BLOCKS_NEEDED, HALF_INT_MASK, HOST_BITS_PER_HALF_WIDE_INT, HOST_BITS_PER_WIDE_INT, i, safe_uhwi(), sext_hwi(), SIGNED, top_bit_of(), and zext_hwi().
Referenced by wi::divmod_internal(), and wi::mul_internal().