[cfe-commits] r118724 - in /cfe/trunk: include/clang/AST/ASTContext.h include/clang/AST/Type.h lib/AST/ASTContext.cpp lib/AST/ASTImporter.cpp lib/AST/TypePrinter.cpp lib/CodeGen/Mangle.cpp lib/Sema/SemaChecking.cpp lib/Sema/SemaInit.cpp lib/Sema/

Bob Wilson bob.wilson at apple.com
Wed Nov 10 14:28:12 PST 2010


On Nov 10, 2010, at 2:17 PM, Frits van Bommel wrote:

> On Wed, Nov 10, 2010 at 10:56 PM, Bob Wilson <bob.wilson at apple.com> wrote:
>> ==============================================================================
>> --- cfe/trunk/include/clang/AST/Type.h (original)
>> +++ cfe/trunk/include/clang/AST/Type.h Wed Nov 10 15:56:12 2010
>> @@ -929,9 +929,9 @@
>> 
>>     unsigned : NumTypeBits;
>> 
>> -    /// AltiVecSpec - AltiVec-specific vector information, used
>> -    /// to differentiate things like 'pixel'.
>> -    unsigned AltiVecSpec : 2;
>> +    /// VecKind - The kind of vector, either a generic vector type or some
>> +    /// target-specific vector type such as for AltiVec or Neon.
>> +    unsigned VecKind : 2;
>> 
>>     /// NumElements - The number of elements in the vector.
>>     unsigned NumElements : 30 - NumTypeBits;
>> @@ -1913,29 +1913,30 @@
>>  /// client is responsible for converting the size into the number of elements.
>>  class VectorType : public Type, public llvm::FoldingSetNode {
>>  public:
>> -  enum AltiVecSpecific {
>> -    NotAltiVec,  // is not AltiVec vector
>> -    AltiVec,     // is AltiVec vector
>> -    Pixel,       // is AltiVec 'vector Pixel'
>> -    Bool         // is AltiVec 'vector bool ...'
>> +  enum VectorKind {
>> +    GenericVector,  // not a target-specific vector type
>> +    AltiVecVector,  // is AltiVec vector
>> +    AltiVecPixel,   // is AltiVec 'vector Pixel'
>> +    AltiVecBool,    // is AltiVec 'vector bool ...'
>> +    NeonVector      // is ARM Neon vector
>>   };
> 
> Now that this enum has 5 elements, doesn't the VecKind bitfield above
> need an extra bit?

Yes, at least.  I may have to add more than one element for Neon.  Without changing the size, this will steal bits away from VectorTypeBitfields::NumElements.  It currently has 14 bits (max 16K elements).  If I knock it down to 13 bits, will anyone have a problem with a maximum vector length of 8K elements?





More information about the cfe-commits mailing list