[llvm-commits] [llvm] r61834 - in /llvm/trunk: include/llvm/DerivedTypes.h include/llvm/Intrinsics.td lib/VMCore/Verifier.cpp utils/TableGen/CodeGenTarget.cpp utils/TableGen/IntrinsicEmitter.cpp

Chris Lattner clattner at apple.com
Tue Jan 6 17:13:24 PST 2009


On Jan 6, 2009, at 4:09 PM, Bob Wilson wrote:

> Author: bwilson
> Date: Tue Jan  6 18:09:01 2009
> New Revision: 61834
>
> URL: http://llvm.org/viewvc/llvm-project?rev=61834&view=rev
> Log:
> Improve support for type-generic vector intrinsics by teaching  
> TableGen how
> to handle LLVMMatchType intrinsic parameters, and by adding new  
> subclasses
> of LLVMMatchType to match vector types with integral elements that are
> either twice as wide or half as wide as the elements of the matched  
> type.
>
Thanks Bob!

> +  /// VectorType::getTruncatedElementVectorType - This static  
> method is like
> +  /// getInteger except that the element types are half as wide as  
> the
> +  /// elements in the input type.
> +  ///
> +  static VectorType *getTruncatedElementVectorType(const VectorType  
> *VTy) {
> +    unsigned EltBits = VTy->getElementType()- 
> >getPrimitiveSizeInBits();
> +    const Type *EltTy = IntegerType::get(EltBits / 2);
> +    return VectorType::get(EltTy, VTy->getNumElements());
> +  }

Should this assert that EltBits is a multiple of 2?  It would be nice  
for tblgen to reject cases where the size was not a multiple of two  
also.

-Chris




More information about the llvm-commits mailing list