diff options
| author | Chris Lattner <sabre@nondot.org> | 2006-03-25 21:54:21 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2006-03-25 21:54:21 +0000 |
| commit | e8e7ac465db76182fe09f97dcb9390f3f9d3866a (patch) | |
| tree | b3fd17b36e043384d11f987c1b4d5b2e6f8aeb7e /llvm/lib | |
| parent | 88bb8d85744b0d0ad4294230c3b93e705aa098c9 (diff) | |
| download | bcm5719-llvm-e8e7ac465db76182fe09f97dcb9390f3f9d3866a.tar.gz bcm5719-llvm-e8e7ac465db76182fe09f97dcb9390f3f9d3866a.zip | |
Teach BinaryOperator::createNot to work with packed integer types
llvm-svn: 27124
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/VMCore/Instructions.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/llvm/lib/VMCore/Instructions.cpp b/llvm/lib/VMCore/Instructions.cpp index 0bd55c91512..f28a413a172 100644 --- a/llvm/lib/VMCore/Instructions.cpp +++ b/llvm/lib/VMCore/Instructions.cpp @@ -923,8 +923,15 @@ BinaryOperator *BinaryOperator::createNeg(Value *Op, const std::string &Name, BinaryOperator *BinaryOperator::createNot(Value *Op, const std::string &Name, Instruction *InsertBefore) { - return new BinaryOperator(Instruction::Xor, Op, - ConstantIntegral::getAllOnesValue(Op->getType()), + Constant *C; + 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); } |

