From: Bob Wilson Date: Fri, 12 Nov 2010 17:24:46 +0000 (+0000) Subject: Add a separate NeonPolyVector kind to distinguish polynomial vector types. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=491328c90c00ecad6ad27fa0ab3cdf9195a4a820;p=clang Add a separate NeonPolyVector kind to distinguish polynomial vector types. Add support for mangling those types according to ARM's ABI. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118898 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/AST/Type.h b/include/clang/AST/Type.h index 73c1911c27..31c4361b22 100644 --- a/include/clang/AST/Type.h +++ b/include/clang/AST/Type.h @@ -1918,7 +1918,8 @@ public: AltiVecVector, // is AltiVec vector AltiVecPixel, // is AltiVec 'vector Pixel' AltiVecBool, // is AltiVec 'vector bool ...' - NeonVector // is ARM Neon vector + NeonVector, // is ARM Neon vector + NeonPolyVector // is ARM Neon polynomial vector }; protected: /// ElementType - The element type of the vector. diff --git a/lib/CodeGen/Mangle.cpp b/lib/CodeGen/Mangle.cpp index bcb3fe6fdf..8ee67e76e9 100644 --- a/lib/CodeGen/Mangle.cpp +++ b/lib/CodeGen/Mangle.cpp @@ -1413,17 +1413,25 @@ bool CXXNameMangler::mangleNeonVectorType(const VectorType *T) { return false; unsigned EltBits = 0; const char *EltName = 0; - switch (cast(EltType)->getKind()) { - case BuiltinType::SChar: EltBits = 8; EltName = "int8_t"; break; - case BuiltinType::UChar: EltBits = 8; EltName = "uint8_t"; break; - case BuiltinType::Short: EltBits = 16; EltName = "int16_t"; break; - case BuiltinType::UShort: EltBits = 16; EltName = "uint16_t"; break; - case BuiltinType::Int: EltBits = 32; EltName = "int32_t"; break; - case BuiltinType::UInt: EltBits = 32; EltName = "uint32_t"; break; - case BuiltinType::LongLong: EltBits = 64; EltName = "int64_t"; break; - case BuiltinType::ULongLong: EltBits = 64; EltName = "uint64_t"; break; - case BuiltinType::Float: EltBits = 32; EltName = "float32_t"; break; - default: return false; + if (T->getVectorKind() == VectorType::NeonPolyVector) { + switch (cast(EltType)->getKind()) { + case BuiltinType::SChar: EltBits = 8; EltName = "poly8_t"; break; + case BuiltinType::Short: EltBits = 16; EltName = "poly16_t"; break; + default: return false; + } + } else { + switch (cast(EltType)->getKind()) { + case BuiltinType::SChar: EltBits = 8; EltName = "int8_t"; break; + case BuiltinType::UChar: EltBits = 8; EltName = "uint8_t"; break; + case BuiltinType::Short: EltBits = 16; EltName = "int16_t"; break; + case BuiltinType::UShort: EltBits = 16; EltName = "uint16_t"; break; + case BuiltinType::Int: EltBits = 32; EltName = "int32_t"; break; + case BuiltinType::UInt: EltBits = 32; EltName = "uint32_t"; break; + case BuiltinType::LongLong: EltBits = 64; EltName = "int64_t"; break; + case BuiltinType::ULongLong: EltBits = 64; EltName = "uint64_t"; break; + case BuiltinType::Float: EltBits = 32; EltName = "float32_t"; break; + default: return false; + } } const char *BaseName = 0; unsigned BitSize = T->getNumElements() * EltBits; @@ -1446,7 +1454,9 @@ bool CXXNameMangler::mangleNeonVectorType(const VectorType *T) { // ::= // ::= p # AltiVec vector pixel void CXXNameMangler::mangleType(const VectorType *T) { - if (T->getVectorKind() == VectorType::NeonVector && mangleNeonVectorType(T)) + if ((T->getVectorKind() == VectorType::NeonVector || + T->getVectorKind() == VectorType::NeonPolyVector) && + mangleNeonVectorType(T)) return; Out << "Dv" << T->getNumElements() << '_'; if (T->getVectorKind() == VectorType::AltiVecPixel)