#include "TableGenBackends.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/Casting.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/TableGen/AArch64ImmCheck.h"
#include "llvm/TableGen/Error.h"
#include "llvm/TableGen/Record.h"
#include "llvm/TableGen/SetTheory.h"
#include <algorithm>
#include <cassert>
#include <cctype>
#include <cstddef>
#include <cstdint>
#include <deque>
#include <map>
#include <optional>
#include <set>
#include <sstream>
#include <string>
#include <unordered_map>
#include <utility>
#include <vector>
usingnamespacellvm;
namespace {
static const Record *CurrentRecord = …;
static void assert_with_loc(bool Assertion, const std::string &Str) { … }
enum ClassKind { … };
namespace NeonTypeFlags {
enum { … };
enum EltType { … };
}
class NeonEmitter;
class TypeSpec : public std::string { … };
class Type { … };
class Variable { … };
class Intrinsic { … };
class NeonEmitter { … };
}
std::string Type::str() const { … }
std::string Type::builtin_str() const { … }
unsigned Type::getNeonEnum() const { … }
Type Type::fromTypedefName(StringRef Name) { … }
void Type::applyTypespec(bool &Quad) { … }
void Type::applyModifiers(StringRef Mods) { … }
StringRef Intrinsic::getNextModifiers(StringRef Proto, unsigned &Pos) const { … }
std::string Intrinsic::getInstTypeCode(Type T, ClassKind CK) const { … }
std::string Intrinsic::getBuiltinTypeStr() { … }
std::string Intrinsic::getMangledName(bool ForceClassS) const { … }
std::string Intrinsic::mangleName(std::string Name, ClassKind LocalCK) const { … }
std::string Intrinsic::replaceParamsIn(std::string S) { … }
void Intrinsic::initVariables() { … }
void Intrinsic::emitPrototype(StringRef NamePrefix) { … }
void Intrinsic::emitOpeningBrace() { … }
void Intrinsic::emitClosingBrace() { … }
void Intrinsic::emitNewLine() { … }
void Intrinsic::emitReverseVariable(Variable &Dest, Variable &Src) { … }
void Intrinsic::emitArgumentReversal() { … }
void Intrinsic::emitReturnVarDecl() { … }
void Intrinsic::emitReturnReversal() { … }
void Intrinsic::emitShadowedArgs() { … }
bool Intrinsic::protoHasScalar() const { … }
void Intrinsic::emitBodyAsBuiltinCall() { … }
void Intrinsic::emitBody(StringRef CallPrefix) { … }
void Intrinsic::emitReturn() { … }
std::pair<Type, std::string> Intrinsic::DagEmitter::emitDag(DagInit *DI) { … }
std::pair<Type, std::string> Intrinsic::DagEmitter::emitDagOp(DagInit *DI) { … }
std::pair<Type, std::string>
Intrinsic::DagEmitter::emitDagCall(DagInit *DI, bool MatchMangledName) { … }
std::pair<Type, std::string> Intrinsic::DagEmitter::emitDagCast(DagInit *DI,
bool IsBitCast){ … }
std::pair<Type, std::string> Intrinsic::DagEmitter::emitDagShuffle(DagInit *DI){ … }
std::pair<Type, std::string> Intrinsic::DagEmitter::emitDagDup(DagInit *DI) { … }
std::pair<Type, std::string> Intrinsic::DagEmitter::emitDagDupTyped(DagInit *DI) { … }
std::pair<Type, std::string> Intrinsic::DagEmitter::emitDagSplat(DagInit *DI) { … }
std::pair<Type, std::string> Intrinsic::DagEmitter::emitDagSaveTemp(DagInit *DI) { … }
std::pair<Type, std::string>
Intrinsic::DagEmitter::emitDagNameReplace(DagInit *DI) { … }
std::pair<Type, std::string> Intrinsic::DagEmitter::emitDagLiteral(DagInit *DI){ … }
std::pair<Type, std::string>
Intrinsic::DagEmitter::emitDagArg(Init *Arg, std::string ArgName) { … }
std::string Intrinsic::generate() { … }
void Intrinsic::generateImpl(bool ReverseArguments,
StringRef NamePrefix, StringRef CallPrefix) { … }
void Intrinsic::indexBody() { … }
Intrinsic &NeonEmitter::getIntrinsic(StringRef Name, ArrayRef<Type> Types,
std::optional<std::string> MangledName) { … }
void NeonEmitter::createIntrinsic(const Record *R,
SmallVectorImpl<Intrinsic *> &Out) { … }
void NeonEmitter::genBuiltinsDef(raw_ostream &OS,
SmallVectorImpl<Intrinsic *> &Defs) { … }
void NeonEmitter::genStreamingSVECompatibleList(
raw_ostream &OS, SmallVectorImpl<Intrinsic *> &Defs) { … }
void NeonEmitter::genOverloadTypeCheckCode(raw_ostream &OS,
SmallVectorImpl<Intrinsic *> &Defs) { … }
inline bool
NeonEmitter::areRangeChecksCompatible(const ArrayRef<ImmCheck> ChecksA,
const ArrayRef<ImmCheck> ChecksB) { … }
void NeonEmitter::genIntrinsicRangeCheckCode(
raw_ostream &OS, SmallVectorImpl<Intrinsic *> &Defs) { … }
void NeonEmitter::runHeader(raw_ostream &OS) { … }
static void emitNeonTypeDefs(const std::string& types, raw_ostream &OS) { … }
void NeonEmitter::run(raw_ostream &OS) { … }
void NeonEmitter::runFP16(raw_ostream &OS) { … }
void NeonEmitter::runVectorTypes(raw_ostream &OS) { … }
void NeonEmitter::runBF16(raw_ostream &OS) { … }
void clang::EmitNeon(const RecordKeeper &Records, raw_ostream &OS) { … }
void clang::EmitFP16(const RecordKeeper &Records, raw_ostream &OS) { … }
void clang::EmitBF16(const RecordKeeper &Records, raw_ostream &OS) { … }
void clang::EmitNeonSema(const RecordKeeper &Records, raw_ostream &OS) { … }
void clang::EmitVectorTypes(const RecordKeeper &Records, raw_ostream &OS) { … }
void clang::EmitNeonTest(const RecordKeeper &Records, raw_ostream &OS) { … }