Coverage Report

Created: 2019-07-24 05:18

/Users/buildslave/jenkins/workspace/clang-stage2-coverage-R/llvm/tools/clang/lib/Basic/Targets/AArch64.h
Line
Count
Source
1
//===--- AArch64.h - Declare AArch64 target feature support -----*- 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 declares AArch64 TargetInfo objects.
10
//
11
//===----------------------------------------------------------------------===//
12
13
#ifndef LLVM_CLANG_LIB_BASIC_TARGETS_AARCH64_H
14
#define LLVM_CLANG_LIB_BASIC_TARGETS_AARCH64_H
15
16
#include "OSTargets.h"
17
#include "clang/Basic/TargetBuiltins.h"
18
#include "llvm/Support/TargetParser.h"
19
20
namespace clang {
21
namespace targets {
22
23
class LLVM_LIBRARY_VISIBILITY AArch64TargetInfo : public TargetInfo {
24
  virtual void setDataLayout() = 0;
25
  static const TargetInfo::GCCRegAlias GCCRegAliases[];
26
  static const char *const GCCRegNames[];
27
28
  enum FPUModeEnum { FPUMode, NeonMode = (1 << 0), SveMode = (1 << 1) };
29
30
  unsigned FPU;
31
  bool HasCRC;
32
  bool HasCrypto;
33
  bool HasUnaligned;
34
  bool HasFullFP16;
35
  bool HasDotProd;
36
  bool HasFP16FML;
37
  bool HasMTE;
38
39
  llvm::AArch64::ArchKind ArchKind;
40
41
  static const Builtin::Info BuiltinInfo[];
42
43
  std::string ABI;
44
45
public:
46
  AArch64TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts);
47
48
  StringRef getABI() const override;
49
  bool setABI(const std::string &Name) override;
50
51
  bool isValidCPUName(StringRef Name) const override;
52
  void fillValidCPUList(SmallVectorImpl<StringRef> &Values) const override;
53
  bool setCPU(const std::string &Name) override;
54
55
1.49M
  bool useFP16ConversionIntrinsics() const override {
56
1.49M
    return false;
57
1.49M
  }
58
59
  void getTargetDefinesARMV81A(const LangOptions &Opts,
60
                               MacroBuilder &Builder) const;
61
  void getTargetDefinesARMV82A(const LangOptions &Opts,
62
                               MacroBuilder &Builder) const;
63
  void getTargetDefinesARMV83A(const LangOptions &Opts,
64
                               MacroBuilder &Builder) const;
65
  void getTargetDefinesARMV84A(const LangOptions &Opts,
66
                               MacroBuilder &Builder) const;
67
  void getTargetDefinesARMV85A(const LangOptions &Opts,
68
                               MacroBuilder &Builder) const;
69
  void getTargetDefines(const LangOptions &Opts,
70
                        MacroBuilder &Builder) const override;
71
72
  ArrayRef<Builtin::Info> getTargetBuiltins() const override;
73
74
  bool hasFeature(StringRef Feature) const override;
75
  bool handleTargetFeatures(std::vector<std::string> &Features,
76
                            DiagnosticsEngine &Diags) override;
77
78
  CallingConvCheckResult checkCallingConvention(CallingConv CC) const override;
79
80
  bool isCLZForZeroUndef() const override;
81
82
  BuiltinVaListKind getBuiltinVaListKind() const override;
83
84
  ArrayRef<const char *> getGCCRegNames() const override;
85
  ArrayRef<TargetInfo::GCCRegAlias> getGCCRegAliases() const override;
86
  bool validateAsmConstraint(const char *&Name,
87
                             TargetInfo::ConstraintInfo &Info) const override;
88
  bool
89
  validateConstraintModifier(StringRef Constraint, char Modifier, unsigned Size,
90
                             std::string &SuggestedModifier) const override;
91
  const char *getClobbers() const override;
92
93
  StringRef getConstraintRegister(StringRef Constraint,
94
322
                                  StringRef Expression) const override {
95
322
    return Expression;
96
322
  }
97
98
  int getEHDataRegisterNumber(unsigned RegNo) const override;
99
};
100
101
class LLVM_LIBRARY_VISIBILITY AArch64leTargetInfo : public AArch64TargetInfo {
102
public:
103
  AArch64leTargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts);
104
105
  void getTargetDefines(const LangOptions &Opts,
106
                            MacroBuilder &Builder) const override;
107
private:
108
  void setDataLayout() override;
109
};
110
111
class LLVM_LIBRARY_VISIBILITY WindowsARM64TargetInfo
112
    : public WindowsTargetInfo<AArch64leTargetInfo> {
113
  const llvm::Triple Triple;
114
115
public:
116
  WindowsARM64TargetInfo(const llvm::Triple &Triple,
117
                         const TargetOptions &Opts);
118
119
  void setDataLayout() override;
120
121
  BuiltinVaListKind getBuiltinVaListKind() const override;
122
123
  CallingConvCheckResult checkCallingConvention(CallingConv CC) const override;
124
};
125
126
// Windows ARM, MS (C++) ABI
127
class LLVM_LIBRARY_VISIBILITY MicrosoftARM64TargetInfo
128
    : public WindowsARM64TargetInfo {
129
public:
130
  MicrosoftARM64TargetInfo(const llvm::Triple &Triple,
131
                           const TargetOptions &Opts);
132
133
  void getTargetDefines(const LangOptions &Opts,
134
                        MacroBuilder &Builder) const override;
135
  TargetInfo::CallingConvKind
136
  getCallingConvKind(bool ClangABICompat4) const override;
137
138
  unsigned getMinGlobalAlign(uint64_t TypeSize) const override;
139
};
140
141
// ARM64 MinGW target
142
class LLVM_LIBRARY_VISIBILITY MinGWARM64TargetInfo
143
    : public WindowsARM64TargetInfo {
144
public:
145
  MinGWARM64TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts);
146
};
147
148
class LLVM_LIBRARY_VISIBILITY AArch64beTargetInfo : public AArch64TargetInfo {
149
public:
150
  AArch64beTargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts);
151
  void getTargetDefines(const LangOptions &Opts,
152
                        MacroBuilder &Builder) const override;
153
154
private:
155
  void setDataLayout() override;
156
};
157
158
class LLVM_LIBRARY_VISIBILITY DarwinAArch64TargetInfo
159
    : public DarwinTargetInfo<AArch64leTargetInfo> {
160
public:
161
  DarwinAArch64TargetInfo(const llvm::Triple &Triple, const TargetOptions &Opts);
162
163
  BuiltinVaListKind getBuiltinVaListKind() const override;
164
165
 protected:
166
  void getOSDefines(const LangOptions &Opts, const llvm::Triple &Triple,
167
                    MacroBuilder &Builder) const override;
168
};
169
170
// 64-bit RenderScript is aarch64
171
class LLVM_LIBRARY_VISIBILITY RenderScript64TargetInfo
172
    : public AArch64leTargetInfo {
173
public:
174
  RenderScript64TargetInfo(const llvm::Triple &Triple,
175
                           const TargetOptions &Opts);
176
177
  void getTargetDefines(const LangOptions &Opts,
178
                        MacroBuilder &Builder) const override;
179
};
180
181
} // namespace targets
182
} // namespace clang
183
184
#endif // LLVM_CLANG_LIB_BASIC_TARGETS_AARCH64_H