Home | History | Annotate | Download | only in Scalar

Lines Matching full:bitwidth

367 /// Returns k such that lambda(2^Bitwidth) = 2^k, where lambda is the Carmichael
368 /// function. This means that x^(2^k) === 1 mod 2^Bitwidth for
369 /// every odd x, i.e. x^(2^k) = 1 for every odd x in Bitwidth-bit arithmetic.
370 /// Note that 0 <= k < Bitwidth, and if Bitwidth > 3 then x^(2^k) = 0 for every
371 /// even x in Bitwidth-bit arithmetic.
372 static unsigned CarmichaelShift(unsigned Bitwidth) {
373 if (Bitwidth < 3)
374 return Bitwidth - 1;
375 return Bitwidth - 2;
424 unsigned Bitwidth = LHS.getBitWidth();
425 // If CM is the Carmichael number then a weight W satisfying W >= CM+Bitwidth
426 // can be replaced with W-CM. That's because x^W=x^(W-CM) for every Bitwidth
429 Bitwidth)
431 // Bitwidth bits.
434 if (Bitwidth > 3) {
436 APInt CM = APInt::getOneBitSet(Bitwidth, CarmichaelShift(Bitwidth));
438 APInt Threshold = CM + Bitwidth;
440 // For Bitwidth 4 or more the following sum does not overflow.
447 unsigned CM = 1U << CarmichaelShift(Bitwidth);
448 unsigned Threshold = CM + Bitwidth;
537 unsigned Bitwidth = I->getType()->getScalarType()->getPrimitiveSizeInBits();
553 Worklist.push_back(std::make_pair(I, APInt(Bitwidth, 1)));
699 // because the expression was "X xor X" or consisted of 2^Bitwidth additions:
704 Ops.emplace_back(Identity, APInt(Bitwidth, 1));