summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorZhou Sheng <zhousheng00@gmail.com>2007-05-26 03:43:13 +0000
committerZhou Sheng <zhousheng00@gmail.com>2007-05-26 03:43:13 +0000
commitd7dc1ed64cae9e20fd982d38e244efe1edc31a4c (patch)
treec1af78fab638d18e12ed8df5df25b73266e6af67 /llvm/lib/CodeGen
parent4698083b96d5d772a3fdfcffd10c494d2309b4bb (diff)
downloadbcm5719-llvm-d7dc1ed64cae9e20fd982d38e244efe1edc31a4c.tar.gz
bcm5719-llvm-d7dc1ed64cae9e20fd982d38e244efe1edc31a4c.zip
Correct the logic in LowerPartSet which cleared the bits from 0 to low-1.
llvm-svn: 37331
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/IntrinsicLowering.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/llvm/lib/CodeGen/IntrinsicLowering.cpp b/llvm/lib/CodeGen/IntrinsicLowering.cpp
index b870545008a..c2e4024d11a 100644
--- a/llvm/lib/CodeGen/IntrinsicLowering.cpp
+++ b/llvm/lib/CodeGen/IntrinsicLowering.cpp
@@ -557,11 +557,13 @@ static Instruction *LowerPartSet(CallInst *CI) {
Rplcmnt->addIncoming(NewRes, reverse);
Rplcmnt->addIncoming(Rep4, small);
Value* t0 = CastInst::createIntegerCast(NumBits,ValTy,false,"",result);
- Value* t1 = BinaryOperator::createShl(ValMask, t0, "", result);
- Value* t2 = BinaryOperator::createShl(t1, Lo, "", result);
- Value* t3 = BinaryOperator::createAnd(t2, Val, "", result);
- Value* t4 = BinaryOperator::createShl(Rplcmnt, Lo, "", result);
- Value* Rslt = BinaryOperator::createOr(t3, t4, "part_set", result);
+ Value* t1 = BinaryOperator::createShl(ValMask, Lo, "", result);
+ Value* t2 = BinaryOperator::createNot(t1, "", result);
+ Value* t3 = BinaryOperator::createShl(t1, t0, "", result);
+ Value* t4 = BinaryOperator::createOr(t2, t3, "", result);
+ Value* t5 = BinaryOperator::createAnd(t4, Val, "", result);
+ Value* t6 = BinaryOperator::createShl(Rplcmnt, Lo, "", result);
+ Value* Rslt = BinaryOperator::createOr(t5, t6, "part_set", result);
new ReturnInst(Rslt, result);
}
OpenPOWER on IntegriCloud