27 const float huge_valf = std::numeric_limits<float>::infinity();
34 static constexpr struct ConstexprData {
37 static constexpr int NumDigitsConstexpr(
uint64_t N) {
45 constexpr ConstexprData() {
48 uint64_t Digits = NumDigitsConstexpr(Val) - 1;
64 return Digits + (
X >=
Data.Boundaries[Digits]);
70 assert(Z &&
"Division by zero");
71 bool Overflowed =
false;
77 APInt Divisor(128, Z);
78 return (WideProduct + Divisor.
lshr(1)).udiv(Divisor).getLimitedValue();
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
This file implements a class to represent arbitrary precision integral constant values and operations...
static InstructionCost divideNearest(InstructionCost Numerator, uint64_t Denominator)
static TableGen::Emitter::Opt Y("gen-skeleton-entry", EmitSkeleton, "Generate example skeleton entry")
Class for arbitrary precision integers.
APInt lshr(unsigned shiftAmt) const
Logical right-shift function.
This is an optimization pass for GlobalISel generic memory operations.
LLVM_ABI int NumDigitsBase10(uint64_t X)
Returns the number of digits in the given integer.
int countl_zero(T Val)
Count number of 0's from the most significant bit to the least stopping at the first 1.
LLVM_ABI const float huge_valf
Use this rather than HUGE_VALF; the latter causes warnings on MSVC.
std::enable_if_t< std::is_unsigned_v< T >, T > SaturatingMultiply(T X, T Y, bool *ResultOverflowed=nullptr)
Multiply two unsigned integers, X and Y, of type T.
LLVM_ABI uint64_t mulDivNearest(uint64_t X, uint64_t Y, uint64_t Z)
Returns (X * Y) / Z rounded by round-half-up, like divideNearest.