clang 22.0.0git
VE.h
Go to the documentation of this file.
1//===--- VE.h - Declare VE 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 VE TargetInfo objects.
10//
11//===----------------------------------------------------------------------===//
12
13#ifndef LLVM_CLANG_LIB_BASIC_TARGETS_VE_H
14#define LLVM_CLANG_LIB_BASIC_TARGETS_VE_H
15
18#include "llvm/Support/Compiler.h"
19#include "llvm/TargetParser/Triple.h"
20
21namespace clang {
22namespace targets {
23
24class LLVM_LIBRARY_VISIBILITY VETargetInfo : public TargetInfo {
25
26public:
50
51 void getTargetDefines(const LangOptions &Opts,
52 MacroBuilder &Builder) const override;
53
54 bool hasSjLjLowering() const override { return true; }
55
56 llvm::SmallVector<Builtin::InfosShard> getTargetBuiltins() const override;
57
61
63 switch (CC) {
64 default:
65 return CCCR_Warning;
66 case CC_C:
67 return CCCR_OK;
68 }
69 }
70
71 std::string_view getClobbers() const override { return ""; }
72
74 static const char *const GCCRegNames[] = {
75 // Regular registers
76 "sx0", "sx1", "sx2", "sx3", "sx4", "sx5", "sx6", "sx7",
77 "sx8", "sx9", "sx10", "sx11", "sx12", "sx13", "sx14", "sx15",
78 "sx16", "sx17", "sx18", "sx19", "sx20", "sx21", "sx22", "sx23",
79 "sx24", "sx25", "sx26", "sx27", "sx28", "sx29", "sx30", "sx31",
80 "sx32", "sx33", "sx34", "sx35", "sx36", "sx37", "sx38", "sx39",
81 "sx40", "sx41", "sx42", "sx43", "sx44", "sx45", "sx46", "sx47",
82 "sx48", "sx49", "sx50", "sx51", "sx52", "sx53", "sx54", "sx55",
83 "sx56", "sx57", "sx58", "sx59", "sx60", "sx61", "sx62", "sx63",
84 };
86 }
87
89 static const TargetInfo::GCCRegAlias GCCRegAliases[] = {
90 {{"s0"}, "sx0"},
91 {{"s1"}, "sx1"},
92 {{"s2"}, "sx2"},
93 {{"s3"}, "sx3"},
94 {{"s4"}, "sx4"},
95 {{"s5"}, "sx5"},
96 {{"s6"}, "sx6"},
97 {{"s7"}, "sx7"},
98 {{"s8", "sl"}, "sx8"},
99 {{"s9", "fp"}, "sx9"},
100 {{"s10", "lr"}, "sx10"},
101 {{"s11", "sp"}, "sx11"},
102 {{"s12", "outer"}, "sx12"},
103 {{"s13"}, "sx13"},
104 {{"s14", "tp"}, "sx14"},
105 {{"s15", "got"}, "sx15"},
106 {{"s16", "plt"}, "sx16"},
107 {{"s17", "info"}, "sx17"},
108 {{"s18"}, "sx18"},
109 {{"s19"}, "sx19"},
110 {{"s20"}, "sx20"},
111 {{"s21"}, "sx21"},
112 {{"s22"}, "sx22"},
113 {{"s23"}, "sx23"},
114 {{"s24"}, "sx24"},
115 {{"s25"}, "sx25"},
116 {{"s26"}, "sx26"},
117 {{"s27"}, "sx27"},
118 {{"s28"}, "sx28"},
119 {{"s29"}, "sx29"},
120 {{"s30"}, "sx30"},
121 {{"s31"}, "sx31"},
122 {{"s32"}, "sx32"},
123 {{"s33"}, "sx33"},
124 {{"s34"}, "sx34"},
125 {{"s35"}, "sx35"},
126 {{"s36"}, "sx36"},
127 {{"s37"}, "sx37"},
128 {{"s38"}, "sx38"},
129 {{"s39"}, "sx39"},
130 {{"s40"}, "sx40"},
131 {{"s41"}, "sx41"},
132 {{"s42"}, "sx42"},
133 {{"s43"}, "sx43"},
134 {{"s44"}, "sx44"},
135 {{"s45"}, "sx45"},
136 {{"s46"}, "sx46"},
137 {{"s47"}, "sx47"},
138 {{"s48"}, "sx48"},
139 {{"s49"}, "sx49"},
140 {{"s50"}, "sx50"},
141 {{"s51"}, "sx51"},
142 {{"s52"}, "sx52"},
143 {{"s53"}, "sx53"},
144 {{"s54"}, "sx54"},
145 {{"s55"}, "sx55"},
146 {{"s56"}, "sx56"},
147 {{"s57"}, "sx57"},
148 {{"s58"}, "sx58"},
149 {{"s59"}, "sx59"},
150 {{"s60"}, "sx60"},
151 {{"s61"}, "sx61"},
152 {{"s62"}, "sx62"},
153 {{"s63"}, "sx63"},
154 };
155 return llvm::ArrayRef(GCCRegAliases);
156 }
157
158 bool validateAsmConstraint(const char *&Name,
159 TargetInfo::ConstraintInfo &Info) const override {
160 switch (*Name) {
161 default:
162 return false;
163 case 'v':
164 Info.setAllowsRegister();
165 return true;
166 }
167 return false;
168 }
169
170 bool allowsLargerPreferedTypeAlignment() const override { return false; }
171};
172} // namespace targets
173} // namespace clang
174#endif // LLVM_CLANG_LIB_BASIC_TARGETS_VE_H
Defines the clang::TargetOptions class.
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
TargetInfo(const llvm::Triple &T)
BuiltinVaListKind
The different kinds of __builtin_va_list types defined by the target implementation.
Definition TargetInfo.h:333
@ VoidPtrBuiltinVaList
typedef void* __builtin_va_list;
Definition TargetInfo.h:338
unsigned char RegParmMax
Definition TargetInfo.h:256
unsigned HasUnalignedAccess
Definition TargetInfo.h:284
unsigned char MaxAtomicPromoteWidth
Definition TargetInfo.h:252
void resetDataLayout(StringRef DL)
Set the data layout to the given string.
unsigned char MaxAtomicInlineWidth
Definition TargetInfo.h:252
Options for controlling the target.
ArrayRef< TargetInfo::GCCRegAlias > getGCCRegAliases() const override
Definition VE.h:88
bool allowsLargerPreferedTypeAlignment() const override
Whether target allows to overalign ABI-specified preferred alignment.
Definition VE.h:170
CallingConvCheckResult checkCallingConvention(CallingConv CC) const override
Determines whether a given calling convention is valid for the target.
Definition VE.h:62
ArrayRef< const char * > getGCCRegNames() const override
Definition VE.h:73
std::string_view getClobbers() const override
Returns a string of target-specific clobbers, in LLVM format.
Definition VE.h:71
BuiltinVaListKind getBuiltinVaListKind() const override
Returns the kind of __builtin_va_list type that should be used with this target.
Definition VE.h:58
bool validateAsmConstraint(const char *&Name, TargetInfo::ConstraintInfo &Info) const override
Definition VE.h:158
VETargetInfo(const llvm::Triple &Triple, const TargetOptions &)
Definition VE.h:27
bool hasSjLjLowering() const override
Controls if __builtin_longjmp / __builtin_setjmp can be lowered to llvm.eh.sjlj.longjmp / llvm....
Definition VE.h:54
Defines the clang::TargetInfo interface.
static const char *const GCCRegNames[]
Definition X86.cpp:73
The JSON file list parser is used to communicate input to InstallAPI.
CallingConv
CallingConv - Specifies the calling convention that a function uses.
Definition Specifiers.h:278
unsigned UseZeroLengthBitfieldAlignment
Whether zero length bitfields (e.g., int : 0;) force alignment of the next bitfield.
Definition TargetInfo.h:187
const llvm::fltSemantics * LongDoubleFormat
Definition TargetInfo.h:143