mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-06 20:32:19 +00:00
Teach BinaryOperator::createNot to work with packed integer types
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27124 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
0a868961d6
commit
fdbc82a925
@ -923,8 +923,15 @@ BinaryOperator *BinaryOperator::createNeg(Value *Op, const std::string &Name,
|
|||||||
|
|
||||||
BinaryOperator *BinaryOperator::createNot(Value *Op, const std::string &Name,
|
BinaryOperator *BinaryOperator::createNot(Value *Op, const std::string &Name,
|
||||||
Instruction *InsertBefore) {
|
Instruction *InsertBefore) {
|
||||||
return new BinaryOperator(Instruction::Xor, Op,
|
Constant *C;
|
||||||
ConstantIntegral::getAllOnesValue(Op->getType()),
|
if (const PackedType *PTy = dyn_cast<PackedType>(Op->getType())) {
|
||||||
|
C = ConstantIntegral::getAllOnesValue(PTy->getElementType());
|
||||||
|
C = ConstantPacked::get(std::vector<Constant*>(PTy->getNumElements(), C));
|
||||||
|
} else {
|
||||||
|
C = ConstantIntegral::getAllOnesValue(Op->getType());
|
||||||
|
}
|
||||||
|
|
||||||
|
return new BinaryOperator(Instruction::Xor, Op, C,
|
||||||
Op->getType(), Name, InsertBefore);
|
Op->getType(), Name, InsertBefore);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user