Dest.Int64Val = Src1.Int64Val OP Src2.Int64Val; \
else \
cerr << "Integer types > 64 bits not supported: " << *Ty << "\n"; \
+ maskToBitWidth(Dest, BitWidth); \
break; \
}
cerr << "Integer types > 64 bits not supported: " << *Ty << "\n"; \
abort(); \
} \
+ maskToBitWidth(Dest, BitWidth); \
} else { \
cerr << "Unhandled type for " #OP " operator: " << *Ty << "\n"; \
abort(); \
cerr << "Integer types > 64 bits not supported: " << *Ty << "\n"; \
abort(); \
} \
+ maskToBitWidth(Dest, BitWidth); \
} else { \
cerr << "Unhandled type for " #OP " operator: " << *Ty << "\n"; \
abort(); \
cerr << "Integer types > 64 bits not supported: " << *Ty << "\n"; \
abort(); \
} \
+ maskToBitWidth(Dest, BitWidth); \
break; \
}
cerr << "Integer types > 64 bits not supported: " << *Ty << "\n"; \
abort(); \
} \
+ maskToBitWidth(Dest, BitWidth); \
break; \
}
GenericValue Dest;
if (const IntegerType *ITy = cast<IntegerType>(Ty)) {
unsigned BitWidth = ITy->getBitWidth();
- uint32_t BitMask = (1ull << BitWidth) - 1;
- if (BitWidth <= 8) {
+ if (BitWidth <= 8)
Dest.Int8Val = ((uint8_t)Src1.Int8Val) << ((uint32_t)Src2.Int8Val);
- Dest.Int8Val &= BitMask;
- } else if (BitWidth <= 16) {
+ else if (BitWidth <= 16)
Dest.Int16Val = ((uint16_t)Src1.Int16Val) << ((uint32_t)Src2.Int8Val);
- Dest.Int16Val &= BitMask;
- } else if (BitWidth <= 32) {
+ else if (BitWidth <= 32)
Dest.Int32Val = ((uint32_t)Src1.Int32Val) << ((uint32_t)Src2.Int8Val);
- Dest.Int32Val &= BitMask;
- } else if (BitWidth <= 64) {
+ else if (BitWidth <= 64)
Dest.Int64Val = ((uint64_t)Src1.Int64Val) << ((uint32_t)Src2.Int8Val);
- Dest.Int64Val &= BitMask;
- } else {
+ else {
cerr << "Integer types > 64 bits not supported: " << *Ty << "\n";
abort();
}
+ maskToBitWidth(Dest, BitWidth);
} else {
cerr << "Unhandled type for Shl instruction: " << *Ty << "\n";
abort();
cerr << "Integer types > 64 bits not supported: " << *Ty << "\n";
abort();
}
+ maskToBitWidth(Dest, BitWidth);
} else {
cerr << "Unhandled type for LShr instruction: " << *Ty << "\n";
abort();
cerr << "Integer types > 64 bits not supported: " << *Ty << "\n"; \
abort();
}
+ maskToBitWidth(Dest, BitWidth);
} else {
cerr << "Unhandled type for AShr instruction: " << *Ty << "\n";
abort();
Dest.Int32Val = Src.Int32Val;
else
Dest.Int64Val = Src.Int64Val;
+ maskToBitWidth(Dest, DBitWidth);
} else
assert(0 && "Invalid BitCast");
} else if (DstTy == Type::FloatTy) {
Dest.Int64Val = Src.Int64Val;
else
assert("Integer types > 64 bits not supported");
+ maskToBitWidth(Dest, BitWidth);
}
IMPLEMENT_VAARG(Pointer);
IMPLEMENT_VAARG(Float);