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.
109 // FIXME: BE8 vs. BE32?
125 // Target Parsers, one per architecture.
126 class ARMTargetParser {
127 static StringRef getFPUSynonym(StringRef FPU);
128 static StringRef getArchSynonym(StringRef Arch);
131 static StringRef getCanonicalArchName(StringRef Arch);
134 static const char * getFPUName(unsigned FPUKind);
135 static const char * getArchName(unsigned ArchKind);
136 static unsigned getArchDefaultCPUArch(unsigned ArchKind);
137 static const char * getArchDefaultCPUName(unsigned ArchKind);
138 static const char * getArchExtName(unsigned ArchExtKind);
139 static const char * getDefaultCPU(StringRef Arch);
142 static unsigned parseFPU(StringRef FPU);
143 static unsigned parseArch(StringRef Arch);
144 static unsigned parseArchExt(StringRef ArchExt);
145 static unsigned parseCPUArch(StringRef CPU);
146 static unsigned parseArchISA(StringRef Arch);
147 static unsigned parseArchEndian(StringRef Arch);
148 static unsigned parseArchProfile(StringRef Arch);
149 static unsigned parseArchVersion(StringRef Arch);