From b52ee7f5ffd189c4f21ab227c6a24061ef3378fc Mon Sep 17 00:00:00 2001 From: Robert Bocchino Date: Tue, 10 Jan 2006 19:05:34 +0000 Subject: Added support for the extractelement operation. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25181 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/VMCore/Instructions.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'lib/VMCore/Instructions.cpp') diff --git a/lib/VMCore/Instructions.cpp b/lib/VMCore/Instructions.cpp index 1b8d0387cf..06fbcf712c 100644 --- a/lib/VMCore/Instructions.cpp +++ b/lib/VMCore/Instructions.cpp @@ -795,6 +795,26 @@ const Type* GetElementPtrInst::getIndexedType(const Type *Ptr, Value *Idx) { return PTy->getElementType(); } +//===----------------------------------------------------------------------===// +// ExtractElementInst Implementation +//===----------------------------------------------------------------------===// + +ExtractElementInst::ExtractElementInst(Value *Val, Value *Index, + const std::string &Name, Instruction *InsertBef) + : Instruction(cast(Val->getType())->getElementType(), + ExtractElement, Ops, 2, Name, InsertBef) { + Ops[0].init(Val, this); + Ops[1].init(Index, this); +} + +ExtractElementInst::ExtractElementInst(Value *Val, Value *Index, + const std::string &Name, BasicBlock *InsertAE) + : Instruction(cast(Val->getType())->getElementType(), + ExtractElement, Ops, 2, Name, InsertAE) { + Ops[0].init(Val, this); + Ops[1].init(Index, this); +} + //===----------------------------------------------------------------------===// // BinaryOperator Class //===----------------------------------------------------------------------===// @@ -1155,6 +1175,7 @@ CallInst *CallInst::clone() const { return new CallInst(*this); } ShiftInst *ShiftInst::clone() const { return new ShiftInst(*this); } SelectInst *SelectInst::clone() const { return new SelectInst(*this); } VAArgInst *VAArgInst::clone() const { return new VAArgInst(*this); } +ExtractElementInst *ExtractElementInst::clone() const {return new ExtractElementInst(*this); } PHINode *PHINode::clone() const { return new PHINode(*this); } ReturnInst *ReturnInst::clone() const { return new ReturnInst(*this); } BranchInst *BranchInst::clone() const { return new BranchInst(*this); } -- cgit v1.2.3