LLVM 20.0.0git
LoongArchTargetParser.h
Go to the documentation of this file.
1//==-- LoongArch64TargetParser - Parser for LoongArch64 features --*- C++ -*-=//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9// This file implements a target parser to recognise LoongArch hardware features
10// such as CPU/ARCH and extension names.
11//
12//===----------------------------------------------------------------------===//
13
14#ifndef LLVM_TARGETPARSER_LOONGARCHTARGETPARSER_H
15#define LLVM_TARGETPARSER_LOONGARCHTARGETPARSER_H
16
18#include <vector>
19
20namespace llvm {
21class StringRef;
22
23namespace LoongArch {
24
26 // 64-bit ISA is available.
27 FK_64BIT = 1 << 1,
28
29 // Single-precision floating-point instructions are available.
30 FK_FP32 = 1 << 2,
31
32 // Double-precision floating-point instructions are available.
33 FK_FP64 = 1 << 3,
34
35 // Loongson SIMD Extension is available.
36 FK_LSX = 1 << 4,
37
38 // Loongson Advanced SIMD Extension is available.
39 FK_LASX = 1 << 5,
40
41 // Loongson Binary Translation Extension is available.
42 FK_LBT = 1 << 6,
43
44 // Loongson Virtualization Extension is available.
45 FK_LVZ = 1 << 7,
46
47 // Allow memory accesses to be unaligned.
48 FK_UAL = 1 << 8,
49
50 // Floating-point approximate reciprocal instructions are available.
51 FK_FRECIPE = 1 << 9,
52};
53
57};
58
59enum class ArchKind {
60#define LOONGARCH_ARCH(NAME, KIND, FEATURES) KIND,
61#include "LoongArchTargetParser.def"
62};
63
64struct ArchInfo {
68};
69
70bool isValidArchName(StringRef Arch);
71bool getArchFeatures(StringRef Arch, std::vector<StringRef> &Features);
72bool isValidCPUName(StringRef TuneCPU);
74StringRef getDefaultArch(bool Is64Bit);
75
76} // namespace LoongArch
77
78} // namespace llvm
79
80#endif // LLVM_TARGETPARSER_LOONGARCHTARGETPARSER_H
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
Definition: SmallVector.h:586
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:50
StringRef getDefaultArch(bool Is64Bit)
bool getArchFeatures(StringRef Arch, std::vector< StringRef > &Features)
bool isValidCPUName(StringRef TuneCPU)
bool isValidArchName(StringRef Arch)
void fillValidCPUList(SmallVectorImpl< StringRef > &Values)
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18