diff options
author | Tim Northover <tnorthover@apple.com> | 2014-03-29 07:04:54 +0000 |
---|---|---|
committer | Tim Northover <tnorthover@apple.com> | 2014-03-29 07:04:54 +0000 |
commit | 7c3e057ff49a67814a48a2702d56faf2a624f9a6 (patch) | |
tree | 096f2e9c4103328a2269378d50b09f226c3436b0 /lib/IR/Function.cpp | |
parent | 224dbf4aec6488e6ac55f2155a238e57086ef473 (diff) | |
download | llvm-7c3e057ff49a67814a48a2702d56faf2a624f9a6.tar.gz llvm-7c3e057ff49a67814a48a2702d56faf2a624f9a6.tar.bz2 llvm-7c3e057ff49a67814a48a2702d56faf2a624f9a6.tar.xz |
Intrinsics: add LLVMHalfElementsVectorType constraint
This is like the LLVMMatchType, except the verifier checks that the
second argument is a vector with the same base type and half the
number of elements.
This will be used by the ARM64 backend.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205079 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/IR/Function.cpp')
-rw-r--r-- | lib/IR/Function.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/IR/Function.cpp b/lib/IR/Function.cpp index f690ee0776..c2ea0e1e4d 100644 --- a/lib/IR/Function.cpp +++ b/lib/IR/Function.cpp @@ -470,7 +470,8 @@ enum IIT_Info { IIT_TRUNC_ARG = 24, IIT_ANYPTR = 25, IIT_V1 = 26, - IIT_VARARG = 27 + IIT_VARARG = 27, + IIT_HALF_VEC_ARG = 28 }; @@ -568,6 +569,12 @@ static void DecodeIITType(unsigned &NextElt, ArrayRef<unsigned char> Infos, ArgInfo)); return; } + case IIT_HALF_VEC_ARG: { + unsigned ArgInfo = (NextElt == Infos.size() ? 0 : Infos[NextElt++]); + OutputTable.push_back(IITDescriptor::get(IITDescriptor::HalfVecArgument, + ArgInfo)); + return; + } case IIT_EMPTYSTRUCT: OutputTable.push_back(IITDescriptor::get(IITDescriptor::Struct, 0)); return; @@ -672,6 +679,9 @@ static Type *DecodeFixedType(ArrayRef<Intrinsic::IITDescriptor> &Infos, assert(ITy->getBitWidth() % 2 == 0); return IntegerType::get(Context, ITy->getBitWidth() / 2); } + case IITDescriptor::HalfVecArgument: + return VectorType::getHalfElementsVectorType(cast<VectorType>( + Tys[D.getArgumentNumber()])); } llvm_unreachable("unhandled"); } |