1 //===--- VE.h - Declare VE target feature support ---------------*- C++ -*-===//
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
7 //===----------------------------------------------------------------------===//
9 // This file declares VE TargetInfo objects.
11 //===----------------------------------------------------------------------===//
13 #ifndef LLVM_CLANG_LIB_BASIC_TARGETS_VE_H
14 #define LLVM_CLANG_LIB_BASIC_TARGETS_VE_H
16 #include "clang/Basic/TargetInfo.h"
17 #include "clang/Basic/TargetOptions.h"
18 #include "llvm/ADT/Triple.h"
19 #include "llvm/Support/Compiler.h"
24 class LLVM_LIBRARY_VISIBILITY VETargetInfo
: public TargetInfo
{
25 static const Builtin::Info BuiltinInfo
[];
28 VETargetInfo(const llvm::Triple
&Triple
, const TargetOptions
&)
29 : TargetInfo(Triple
) {
31 LongDoubleWidth
= 128;
32 LongDoubleAlign
= 128;
33 LongDoubleFormat
= &llvm::APFloat::IEEEquad();
34 DoubleAlign
= LongLongAlign
= 64;
36 LongWidth
= LongAlign
= PointerWidth
= PointerAlign
= 64;
37 SizeType
= UnsignedLong
;
38 PtrDiffType
= SignedLong
;
39 IntPtrType
= SignedLong
;
40 IntMaxType
= SignedLong
;
41 Int64Type
= SignedLong
;
43 MaxAtomicPromoteWidth
= MaxAtomicInlineWidth
= 64;
45 WCharType
= UnsignedInt
;
46 WIntType
= UnsignedInt
;
47 UseZeroLengthBitfieldAlignment
= true;
49 "e-m:e-i64:64-n32:64-S128-v64:64:64-v128:64:64-v256:64:64-v512:64:64-"
50 "v1024:64:64-v2048:64:64-v4096:64:64-v8192:64:64-v16384:64:64");
53 void getTargetDefines(const LangOptions
&Opts
,
54 MacroBuilder
&Builder
) const override
;
56 bool hasSjLjLowering() const override
{ return true; }
58 ArrayRef
<Builtin::Info
> getTargetBuiltins() const override
;
60 BuiltinVaListKind
getBuiltinVaListKind() const override
{
61 return TargetInfo::VoidPtrBuiltinVaList
;
64 CallingConvCheckResult
checkCallingConvention(CallingConv CC
) const override
{
73 const char *getClobbers() const override
{ return ""; }
75 ArrayRef
<const char *> getGCCRegNames() const override
{
76 static const char *const GCCRegNames
[] = {
78 "sx0", "sx1", "sx2", "sx3", "sx4", "sx5", "sx6", "sx7",
79 "sx8", "sx9", "sx10", "sx11", "sx12", "sx13", "sx14", "sx15",
80 "sx16", "sx17", "sx18", "sx19", "sx20", "sx21", "sx22", "sx23",
81 "sx24", "sx25", "sx26", "sx27", "sx28", "sx29", "sx30", "sx31",
82 "sx32", "sx33", "sx34", "sx35", "sx36", "sx37", "sx38", "sx39",
83 "sx40", "sx41", "sx42", "sx43", "sx44", "sx45", "sx46", "sx47",
84 "sx48", "sx49", "sx50", "sx51", "sx52", "sx53", "sx54", "sx55",
85 "sx56", "sx57", "sx58", "sx59", "sx60", "sx61", "sx62", "sx63",
87 return llvm::makeArrayRef(GCCRegNames
);
90 ArrayRef
<TargetInfo::GCCRegAlias
> getGCCRegAliases() const override
{
91 static const TargetInfo::GCCRegAlias GCCRegAliases
[] = {
100 {{"s8", "sl"}, "sx8"},
101 {{"s9", "fp"}, "sx9"},
102 {{"s10", "lr"}, "sx10"},
103 {{"s11", "sp"}, "sx11"},
104 {{"s12", "outer"}, "sx12"},
106 {{"s14", "tp"}, "sx14"},
107 {{"s15", "got"}, "sx15"},
108 {{"s16", "plt"}, "sx16"},
109 {{"s17", "info"}, "sx17"},
157 return llvm::makeArrayRef(GCCRegAliases
);
160 bool validateAsmConstraint(const char *&Name
,
161 TargetInfo::ConstraintInfo
&Info
) const override
{
166 Info
.setAllowsRegister();
172 bool allowsLargerPreferedTypeAlignment() const override
{ return false; }
174 } // namespace targets
176 #endif // LLVM_CLANG_LIB_BASIC_TARGETS_VE_H