Go to the documentation of this file.
32 const std::size_t new_width = numeric_cast_v<std::size_t>(
power(2, bits));
34 const bool need_typecast =
35 new_width > *x_width || x.
type().
id() != ID_unsignedbv;
41 for(std::size_t shift = 1; shift < new_width; shift <<= 1)
48 std::string bitstring;
49 bitstring.reserve(new_width);
50 for(std::size_t i = 0; i < new_width / (2 * shift); ++i)
51 bitstring += std::string(shift,
'0') + std::string(shift,
'1');
#define CHECK_RETURN(CONDITION)
The plus expression Associativity is not specified.
Base class for all expressions.
Fixed-width bit-vector with unsigned binary interpretation.
A namespacet is essentially one or two symbol tables bound together, to allow for symbol lookups in t...
typet & type()
Return the type of the expression.
optionalt< mp_integer > pointer_offset_bits(const typet &type, const namespacet &ns)
const irep_idt & id() const
exprt lower_popcount(const popcount_exprt &expr, const namespacet &ns)
Lower a popcount_exprt to arithmetic and logic expressions.
const mp_integer binary2integer(const std::string &n, bool is_signed)
convert binary string representation to mp_integer
The popcount (counting the number of bits set to 1) expression.
Semantic type conversion.
A constant literal expression.
API to expression classes.