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?
117 // Target Parsers, one per architecture.
118 class ARMTargetParser {
119 static StringRef getFPUSynonym(StringRef FPU);
120 static StringRef getArchSynonym(StringRef Arch);
123 static StringRef getCanonicalArchName(StringRef Arch);
126 static const char * getFPUName(unsigned FPUKind);
127 static const char * getArchName(unsigned ArchKind);
128 static unsigned getArchDefaultCPUArch(unsigned ArchKind);
129 static const char * getArchDefaultCPUName(unsigned ArchKind);
130 static const char * getArchExtName(unsigned ArchExtKind);
131 static const char * getDefaultCPU(StringRef Arch);
134 static unsigned parseFPU(StringRef FPU);
135 static unsigned parseArch(StringRef Arch);
136 static unsigned parseArchExt(StringRef ArchExt);
137 static unsigned parseCPUArch(StringRef CPU);
138 static unsigned parseArchISA(StringRef Arch);
139 static unsigned parseArchEndian(StringRef Arch);