mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-11 21:38:19 +00:00
Fix problems in the PartSet lowering having to do with incorrect bit width.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36180 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -538,8 +538,10 @@ static Instruction *LowerPartSet(CallInst *CI) {
|
|||||||
new BranchInst(large, small, is_large, entry);
|
new BranchInst(large, small, is_large, entry);
|
||||||
|
|
||||||
// Block "large"
|
// Block "large"
|
||||||
BinaryOperator* MaskBits =
|
Instruction* MaskBits =
|
||||||
BinaryOperator::createSub(RepBitWidth, NumBits, "", large);
|
BinaryOperator::createSub(RepBitWidth, NumBits, "", large);
|
||||||
|
MaskBits = CastInst::createIntegerCast(MaskBits, RepMask->getType(),
|
||||||
|
false, "", large);
|
||||||
BinaryOperator* Mask1 =
|
BinaryOperator* Mask1 =
|
||||||
BinaryOperator::createLShr(RepMask, MaskBits, "", large);
|
BinaryOperator::createLShr(RepMask, MaskBits, "", large);
|
||||||
BinaryOperator* Rep2 = BinaryOperator::createAnd(Mask1, Rep, "", large);
|
BinaryOperator* Rep2 = BinaryOperator::createAnd(Mask1, Rep, "", large);
|
||||||
@ -575,10 +577,10 @@ static Instruction *LowerPartSet(CallInst *CI) {
|
|||||||
Value* t8 = BinaryOperator::createXor(t7, ValMask, "", reverse);
|
Value* t8 = BinaryOperator::createXor(t7, ValMask, "", reverse);
|
||||||
Value* t9 = BinaryOperator::createAnd(t8, Val, "", reverse);
|
Value* t9 = BinaryOperator::createAnd(t8, Val, "", reverse);
|
||||||
Value* t10 = BinaryOperator::createShl(Rep4, Lo, "", reverse);
|
Value* t10 = BinaryOperator::createShl(Rep4, Lo, "", reverse);
|
||||||
if (RepBits < ValBits)
|
if (32 < ValBits)
|
||||||
RepBitWidth =
|
RepBitWidth =
|
||||||
cast<ConstantInt>(ConstantExpr::getZExt(RepBitWidth, ValTy));
|
cast<ConstantInt>(ConstantExpr::getZExt(RepBitWidth, ValTy));
|
||||||
else if (RepBits > ValBits)
|
else if (32 > ValBits)
|
||||||
RepBitWidth =
|
RepBitWidth =
|
||||||
cast<ConstantInt>(ConstantExpr::getTrunc(RepBitWidth, ValTy));
|
cast<ConstantInt>(ConstantExpr::getTrunc(RepBitWidth, ValTy));
|
||||||
Value* t11 = BinaryOperator::createSub(RepBitWidth, Hi, "", reverse);
|
Value* t11 = BinaryOperator::createSub(RepBitWidth, Hi, "", reverse);
|
||||||
|
Reference in New Issue
Block a user