/Users/buildslave/jenkins/workspace/coverage/llvm-project/clang/lib/Basic/Targets/VE.h
Line | Count | Source (jump to first uncovered line) |
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 | | |
16 | | #include "clang/Basic/TargetInfo.h" |
17 | | #include "clang/Basic/TargetOptions.h" |
18 | | #include "llvm/ADT/Triple.h" |
19 | | #include "llvm/Support/Compiler.h" |
20 | | |
21 | | namespace clang { |
22 | | namespace targets { |
23 | | |
24 | | class LLVM_LIBRARY_VISIBILITY VETargetInfo : public TargetInfo { |
25 | | static const Builtin::Info BuiltinInfo[]; |
26 | | |
27 | | public: |
28 | | VETargetInfo(const llvm::Triple &Triple, const TargetOptions &) |
29 | 3 | : TargetInfo(Triple) { |
30 | 3 | NoAsmVariants = true; |
31 | 3 | LongDoubleWidth = 128; |
32 | 3 | LongDoubleAlign = 128; |
33 | 3 | LongDoubleFormat = &llvm::APFloat::IEEEquad(); |
34 | 3 | DoubleAlign = LongLongAlign = 64; |
35 | 3 | SuitableAlign = 64; |
36 | 3 | LongWidth = LongAlign = PointerWidth = PointerAlign = 64; |
37 | 3 | SizeType = UnsignedLong; |
38 | 3 | PtrDiffType = SignedLong; |
39 | 3 | IntPtrType = SignedLong; |
40 | 3 | IntMaxType = SignedLong; |
41 | 3 | Int64Type = SignedLong; |
42 | 3 | RegParmMax = 8; |
43 | 3 | MaxAtomicPromoteWidth = MaxAtomicInlineWidth = 64; |
44 | | |
45 | 3 | WCharType = UnsignedInt; |
46 | 3 | WIntType = UnsignedInt; |
47 | 3 | UseZeroLengthBitfieldAlignment = true; |
48 | 3 | resetDataLayout( |
49 | 3 | "e-m:e-i64:64-n32:64-S128-v64:64:64-v128:64:64-v256:64:64-v512:64:64-" |
50 | 3 | "v1024:64:64-v2048:64:64-v4096:64:64-v8192:64:64-v16384:64:64"); |
51 | 3 | } |
52 | | |
53 | | void getTargetDefines(const LangOptions &Opts, |
54 | | MacroBuilder &Builder) const override; |
55 | | |
56 | 2 | bool hasSjLjLowering() const override { return true; } |
57 | | |
58 | | ArrayRef<Builtin::Info> getTargetBuiltins() const override; |
59 | | |
60 | 3 | BuiltinVaListKind getBuiltinVaListKind() const override { |
61 | 3 | return TargetInfo::VoidPtrBuiltinVaList; |
62 | 3 | } |
63 | | |
64 | 0 | CallingConvCheckResult checkCallingConvention(CallingConv CC) const override { |
65 | 0 | switch (CC) { |
66 | 0 | default: |
67 | 0 | return CCCR_Warning; |
68 | 0 | case CC_C: |
69 | 0 | return CCCR_OK; |
70 | 0 | } |
71 | 0 | } |
72 | | |
73 | 0 | const char *getClobbers() const override { return ""; } |
74 | | |
75 | 0 | ArrayRef<const char *> getGCCRegNames() const override { |
76 | 0 | static const char *const GCCRegNames[] = { |
77 | | // Regular registers |
78 | 0 | "sx0", "sx1", "sx2", "sx3", "sx4", "sx5", "sx6", "sx7", |
79 | 0 | "sx8", "sx9", "sx10", "sx11", "sx12", "sx13", "sx14", "sx15", |
80 | 0 | "sx16", "sx17", "sx18", "sx19", "sx20", "sx21", "sx22", "sx23", |
81 | 0 | "sx24", "sx25", "sx26", "sx27", "sx28", "sx29", "sx30", "sx31", |
82 | 0 | "sx32", "sx33", "sx34", "sx35", "sx36", "sx37", "sx38", "sx39", |
83 | 0 | "sx40", "sx41", "sx42", "sx43", "sx44", "sx45", "sx46", "sx47", |
84 | 0 | "sx48", "sx49", "sx50", "sx51", "sx52", "sx53", "sx54", "sx55", |
85 | 0 | "sx56", "sx57", "sx58", "sx59", "sx60", "sx61", "sx62", "sx63", |
86 | 0 | }; |
87 | 0 | return llvm::makeArrayRef(GCCRegNames); |
88 | 0 | } |
89 | | |
90 | 0 | ArrayRef<TargetInfo::GCCRegAlias> getGCCRegAliases() const override { |
91 | 0 | static const TargetInfo::GCCRegAlias GCCRegAliases[] = { |
92 | 0 | {{"s0"}, "sx0"}, |
93 | 0 | {{"s1"}, "sx1"}, |
94 | 0 | {{"s2"}, "sx2"}, |
95 | 0 | {{"s3"}, "sx3"}, |
96 | 0 | {{"s4"}, "sx4"}, |
97 | 0 | {{"s5"}, "sx5"}, |
98 | 0 | {{"s6"}, "sx6"}, |
99 | 0 | {{"s7"}, "sx7"}, |
100 | 0 | {{"s8", "sl"}, "sx8"}, |
101 | 0 | {{"s9", "fp"}, "sx9"}, |
102 | 0 | {{"s10", "lr"}, "sx10"}, |
103 | 0 | {{"s11", "sp"}, "sx11"}, |
104 | 0 | {{"s12", "outer"}, "sx12"}, |
105 | 0 | {{"s13"}, "sx13"}, |
106 | 0 | {{"s14", "tp"}, "sx14"}, |
107 | 0 | {{"s15", "got"}, "sx15"}, |
108 | 0 | {{"s16", "plt"}, "sx16"}, |
109 | 0 | {{"s17", "info"}, "sx17"}, |
110 | 0 | {{"s18"}, "sx18"}, |
111 | 0 | {{"s19"}, "sx19"}, |
112 | 0 | {{"s20"}, "sx20"}, |
113 | 0 | {{"s21"}, "sx21"}, |
114 | 0 | {{"s22"}, "sx22"}, |
115 | 0 | {{"s23"}, "sx23"}, |
116 | 0 | {{"s24"}, "sx24"}, |
117 | 0 | {{"s25"}, "sx25"}, |
118 | 0 | {{"s26"}, "sx26"}, |
119 | 0 | {{"s27"}, "sx27"}, |
120 | 0 | {{"s28"}, "sx28"}, |
121 | 0 | {{"s29"}, "sx29"}, |
122 | 0 | {{"s30"}, "sx30"}, |
123 | 0 | {{"s31"}, "sx31"}, |
124 | 0 | {{"s32"}, "sx32"}, |
125 | 0 | {{"s33"}, "sx33"}, |
126 | 0 | {{"s34"}, "sx34"}, |
127 | 0 | {{"s35"}, "sx35"}, |
128 | 0 | {{"s36"}, "sx36"}, |
129 | 0 | {{"s37"}, "sx37"}, |
130 | 0 | {{"s38"}, "sx38"}, |
131 | 0 | {{"s39"}, "sx39"}, |
132 | 0 | {{"s40"}, "sx40"}, |
133 | 0 | {{"s41"}, "sx41"}, |
134 | 0 | {{"s42"}, "sx42"}, |
135 | 0 | {{"s43"}, "sx43"}, |
136 | 0 | {{"s44"}, "sx44"}, |
137 | 0 | {{"s45"}, "sx45"}, |
138 | 0 | {{"s46"}, "sx46"}, |
139 | 0 | {{"s47"}, "sx47"}, |
140 | 0 | {{"s48"}, "sx48"}, |
141 | 0 | {{"s49"}, "sx49"}, |
142 | 0 | {{"s50"}, "sx50"}, |
143 | 0 | {{"s51"}, "sx51"}, |
144 | 0 | {{"s52"}, "sx52"}, |
145 | 0 | {{"s53"}, "sx53"}, |
146 | 0 | {{"s54"}, "sx54"}, |
147 | 0 | {{"s55"}, "sx55"}, |
148 | 0 | {{"s56"}, "sx56"}, |
149 | 0 | {{"s57"}, "sx57"}, |
150 | 0 | {{"s58"}, "sx58"}, |
151 | 0 | {{"s59"}, "sx59"}, |
152 | 0 | {{"s60"}, "sx60"}, |
153 | 0 | {{"s61"}, "sx61"}, |
154 | 0 | {{"s62"}, "sx62"}, |
155 | 0 | {{"s63"}, "sx63"}, |
156 | 0 | }; |
157 | 0 | return llvm::makeArrayRef(GCCRegAliases); |
158 | 0 | } |
159 | | |
160 | | bool validateAsmConstraint(const char *&Name, |
161 | 0 | TargetInfo::ConstraintInfo &Info) const override { |
162 | 0 | switch (*Name) { |
163 | 0 | default: |
164 | 0 | return false; |
165 | 0 | case 'v': |
166 | 0 | Info.setAllowsRegister(); |
167 | 0 | return true; |
168 | 0 | } |
169 | 0 | return false; |
170 | 0 | } |
171 | | |
172 | 51 | bool allowsLargerPreferedTypeAlignment() const override { return false; } |
173 | | }; |
174 | | } // namespace targets |
175 | | } // namespace clang |
176 | | #endif // LLVM_CLANG_LIB_BASIC_TARGETS_VE_H |