-APInt::APInt(uint32_t numBits, uint64_t val, bool isSigned)
- : BitWidth(numBits), VAL(0) {
- assert(BitWidth >= MIN_INT_BITS && "bitwidth too small");
- assert(BitWidth <= MAX_INT_BITS && "bitwidth too large");
- if (isSingleWord())
- VAL = val;
- else {
- pVal = getClearedMemory(getNumWords());
- pVal[0] = val;
- if (isSigned && int64_t(val) < 0)
- for (unsigned i = 1; i < getNumWords(); ++i)
- pVal[i] = -1ULL;
- }
- clearUnusedBits();
+void APInt::initSlowCase(unsigned numBits, uint64_t val, bool isSigned) {
+ pVal = getClearedMemory(getNumWords());
+ pVal[0] = val;
+ if (isSigned && int64_t(val) < 0)
+ for (unsigned i = 1; i < getNumWords(); ++i)
+ pVal[i] = -1ULL;
+}
+
+void APInt::initSlowCase(const APInt& that) {
+ pVal = getMemory(getNumWords());
+ memcpy(pVal, that.pVal, getNumWords() * APINT_WORD_SIZE);