but not on X86 becuase shift by word size is "undefined".
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34825
91177308-0d34-0410-b5e6-
96231b3b80d8
if (wordsBefore == wordsAfter) {
uint32_t newWordBits = width % APINT_BITS_PER_WORD;
// The extension is contained to the wordsBefore-1th word.
- uint64_t mask = (~0ULL >> (APINT_BITS_PER_WORD - newWordBits)) << wordBits;
+ uint64_t mask = ~0ULL;
+ if (newWordBits)
+ mask >>= APINT_BITS_PER_WORD - newWordBits;
+ mask <<= wordBits;
if (wordsBefore == 1)
VAL |= mask;
else