Home | History | Annotate | Download | only in Support

Lines Matching defs:Shift

88   // Shift right and round.
89 int Shift = 64 - Width - countLeadingZeros(Digits);
90 return getRounded<DigitsT>(Digits >> Shift, Scale + Shift,
91 Digits & (UINT64_C(1) << (Shift - 1)));
277 /// scales in place. Shift the digits as necessary to form equivalent numbers,
307 // Shift LDigits left as much as possible, then shift RDigits right.
309 assert(ShiftL < getWidth<DigitsT>() && "can't shift more than width");
624 ScaledNumber &operator<<=(int16_t Shift) {
625 shiftLeft(Shift);
628 ScaledNumber &operator>>=(int16_t Shift) {
629 shiftRight(Shift);
634 void shiftLeft(int32_t Shift);
635 void shiftRight(int32_t Shift);
698 /// Should only be called for \c Shift close to zero.
700 /// \pre Shift >= MinScale && Shift + 64 <= MaxScale.
701 static ScaledNumber adjustToWidth(uint64_t N, int32_t Shift) {
702 assert(Shift >= ScaledNumbers::MinScale && "Shift should be close to 0");
703 assert(Shift <= ScaledNumbers::MaxScale - 64 &&
704 "Shift should be close to 0");
705 auto Adjusted = ScaledNumbers::getAdjusted<DigitsT>(N, Shift);
732 int16_t Shift) {
733 return ScaledNumber<DigitsT>(L) <<= Shift;
738 int16_t Shift) {
739 return ScaledNumber<DigitsT>(L) >>= Shift;
834 template <class DigitsT> void ScaledNumber<DigitsT>::shiftLeft(int32_t Shift) {
835 if (!Shift || isZero())
837 assert(Shift != INT32_MIN);
838 if (Shift < 0) {
839 shiftRight(-Shift);
843 // Shift as much as we can in the exponent.
844 int32_t ScaleShift = std::min(Shift, ScaledNumbers::MaxScale - Scale);
846 if (ScaleShift == Shift)
853 // Shift the digits themselves.
854 Shift -= ScaleShift;
855 if (Shift > countLeadingZerosWidth(Digits)) {
861 Digits <<= Shift;
864 template <class DigitsT> void ScaledNumber<DigitsT>::shiftRight(int32_t Shift) {
865 if (!Shift || isZero())
867 assert(Shift != INT32_MIN);
868 if (Shift < 0) {
869 shiftLeft(-Shift);
873 // Shift as much as we can in the exponent.
874 int32_t ScaleShift = std::min(Shift, Scale - ScaledNumbers::MinScale);
876 if (ScaleShift == Shift)
879 // Shift the digits themselves.
880 Shift -= ScaleShift;
881 if (Shift >= Width) {
887 Digits >>= Shift;