diff options
Diffstat (limited to 'clang/utils/TableGen/SveEmitter.cpp')
-rw-r--r-- | clang/utils/TableGen/SveEmitter.cpp | 37 |
1 files changed, 19 insertions, 18 deletions
diff --git a/clang/utils/TableGen/SveEmitter.cpp b/clang/utils/TableGen/SveEmitter.cpp index 0e69600ef861..b2f6ede56522 100644 --- a/clang/utils/TableGen/SveEmitter.cpp +++ b/clang/utils/TableGen/SveEmitter.cpp @@ -362,6 +362,9 @@ std::string SVEType::builtin_str() const { if (isVoid()) return "v"; + if (isScalarPredicate()) + return "b"; + if (isVoidPointer()) S += "v"; else if (!isFloatingPoint()) @@ -916,26 +919,22 @@ std::string Intrinsic::mangleName(ClassKind LocalCK) const { } void Intrinsic::emitIntrinsic(raw_ostream &OS) const { - // Use the preprocessor to - if (getClassKind() != ClassG || getProto().size() <= 1) { - OS << "#define " << mangleName(getClassKind()) - << "(...) __builtin_sve_" << mangleName(ClassS) - << "(__VA_ARGS__)\n"; - } else { - std::string FullName = mangleName(ClassS); - std::string ProtoName = mangleName(ClassG); + bool IsOverloaded = getClassKind() == ClassG && getProto().size() > 1; - OS << "__aio __attribute__((__clang_arm_builtin_alias(" - << "__builtin_sve_" << FullName << ")))\n"; + std::string FullName = mangleName(ClassS); + std::string ProtoName = mangleName(getClassKind()); - OS << getTypes()[0].str() << " " << ProtoName << "("; - for (unsigned I = 0; I < getTypes().size() - 1; ++I) { - if (I != 0) - OS << ", "; - OS << getTypes()[I + 1].str(); - } - OS << ");\n"; + OS << (IsOverloaded ? "__aio " : "__ai ") + << "__attribute__((__clang_arm_builtin_alias(" + << "__builtin_sve_" << FullName << ")))\n"; + + OS << getTypes()[0].str() << " " << ProtoName << "("; + for (unsigned I = 0; I < getTypes().size() - 1; ++I) { + if (I != 0) + OS << ", "; + OS << getTypes()[I + 1].str(); } + OS << ");\n"; } //===----------------------------------------------------------------------===// @@ -1201,7 +1200,9 @@ void SVEEmitter::createHeader(raw_ostream &OS) { OS << "};\n\n"; OS << "/* Function attributes */\n"; - OS << "#define __aio static inline __attribute__((__always_inline__, " + OS << "#define __ai static __inline__ __attribute__((__always_inline__, " + "__nodebug__))\n\n"; + OS << "#define __aio static __inline__ __attribute__((__always_inline__, " "__nodebug__, __overloadable__))\n\n"; // Add reinterpret functions. |