-inline void maskToBitWidth(GenericValue& GV, unsigned BitWidth) {
- uint64_t BitMask = (1ull << BitWidth) - 1;
- if (BitWidth <= 8)
- GV.Int8Val &= BitMask;
- else if (BitWidth <= 16)
- GV.Int16Val &= BitMask;
- else if (BitWidth <= 32)
- GV.Int32Val &= BitMask;
- else
- GV.Int64Val &= BitMask;
-}