1 //===-- TargetParser - Parser for target features ---------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file implements a target parser to recognise hardware features such as
11 // FPU/CPU/ARCH names as well as specific support such as HDIV, etc.
13 //===----------------------------------------------------------------------===//
15 #ifndef LLVM_SUPPORT_TARGETPARSER_H
16 #define LLVM_SUPPORT_TARGETPARSER_H
21 // Target specific information into their own namespaces. These should be
22 // generated from TableGen because the information is already there, and there
23 // is where new information about targets will be added.
24 // FIXME: To TableGen this we need to make some table generated files available
25 // even if the back-end is not compiled with LLVM, plus we need to create a new
26 // back-end to TableGen to create these clean tables.
42 FK_CRYPTO_NEON_FP_ARMV8,
72 // Non-standard Arch names.
87 // Arch extension modifiers for CPUs.
98 // Unsupported extensions.
116 // FIXME: BE8 vs. BE32?
132 // Target Parsers, one per architecture.
133 class ARMTargetParser {
134 static StringRef getFPUSynonym(StringRef FPU);
135 static StringRef getArchSynonym(StringRef Arch);
138 static StringRef getCanonicalArchName(StringRef Arch);
141 static const char * getFPUName(unsigned FPUKind);
142 static const char * getArchName(unsigned ArchKind);
143 static unsigned getArchAttr(unsigned ArchKind);
144 static const char * getCPUAttr(unsigned ArchKind);
145 static const char * getSubArch(unsigned ArchKind);
146 static const char * getArchExtName(unsigned ArchExtKind);
147 static const char * getDefaultCPU(StringRef Arch);
150 static unsigned parseFPU(StringRef FPU);
151 static unsigned parseArch(StringRef Arch);
152 static unsigned parseArchExt(StringRef ArchExt);
153 static unsigned parseCPUArch(StringRef CPU);
154 static unsigned parseArchISA(StringRef Arch);
155 static unsigned parseArchEndian(StringRef Arch);
156 static unsigned parseArchProfile(StringRef Arch);
157 static unsigned parseArchVersion(StringRef Arch);