LLVM 23.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
19#include <vector>
20
21namespace llvm {
22class StringRef;
23
24namespace LoongArch {
25
27 // 32-bit ISA is available.
28 FK_32BIT = 1 << 0,
29
30 // 64-bit ISA is available.
31 FK_64BIT = 1 << 1,
32
33 // Single-precision floating-point instructions are available.
34 FK_FP32 = 1 << 2,
35
36 // Double-precision floating-point instructions are available.
37 FK_FP64 = 1 << 3,
38
39 // Loongson SIMD Extension is available.
40 FK_LSX = 1 << 4,
41
42 // Loongson Advanced SIMD Extension is available.
43 FK_LASX = 1 << 5,
44
45 // Loongson Binary Translation Extension is available.
46 FK_LBT = 1 << 6,
47
48 // Loongson Virtualization Extension is available.
49 FK_LVZ = 1 << 7,
50
51 // Allow memory accesses to be unaligned.
52 FK_UAL = 1 << 8,
53
54 // Floating-point approximate reciprocal instructions are available.
55 FK_FRECIPE = 1 << 9,
56
57 // Atomic memory swap and add instructions for byte and half word are
58 // available.
59 FK_LAM_BH = 1 << 10,
60
61 // Atomic memory compare and swap instructions for byte, half word, word and
62 // double word are available.
63 FK_LAMCAS = 1 << 11,
64
65 // Do not generate load-load barrier instructions (dbar 0x700).
66 FK_LD_SEQ_SA = 1 << 12,
67
68 // Assume div.w[u] and mod.w[u] can handle inputs that are not sign-extended.
69 FK_DIV32 = 1 << 13,
70
71 // sc.q is available.
72 FK_SCQ = 1 << 14,
73
74 // 32-bit standard variant is available.
75 FK_32S = 1 << 15,
76};
77
82
83enum class ArchKind {
84#define LOONGARCH_ARCH(NAME, KIND, FEATURES) KIND,
85#include "LoongArchTargetParser.def"
86};
93
96LLVM_ABI bool getArchFeatures(StringRef Arch, std::vector<StringRef> &Features);
100
101} // namespace LoongArch
102
103} // namespace llvm
104
105#endif // LLVM_TARGETPARSER_LOONGARCHTARGETPARSER_H
#define LLVM_ABI
Definition Compiler.h:213
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
StringRef - Represent a constant reference to a string, i.e.
Definition StringRef.h:55
LLVM_ABI StringRef getDefaultArch(bool Is64Bit)
LLVM_ABI bool getArchFeatures(StringRef Arch, std::vector< StringRef > &Features)
LLVM_ABI bool isValidCPUName(StringRef TuneCPU)
LLVM_ABI bool isValidFeatureName(StringRef Feature)
LLVM_ABI bool isValidArchName(StringRef Arch)
LLVM_ABI void fillValidCPUList(SmallVectorImpl< StringRef > &Values)
This is an optimization pass for GlobalISel generic memory operations.
Definition Types.h:26