Path: blob/main/contrib/llvm-project/clang/lib/Basic/Targets/VE.h
35266 views
//===--- VE.h - Declare VE target feature support ---------------*- C++ -*-===//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===----------------------------------------------------------------------===//7//8// This file declares VE TargetInfo objects.9//10//===----------------------------------------------------------------------===//1112#ifndef LLVM_CLANG_LIB_BASIC_TARGETS_VE_H13#define LLVM_CLANG_LIB_BASIC_TARGETS_VE_H1415#include "clang/Basic/TargetInfo.h"16#include "clang/Basic/TargetOptions.h"17#include "llvm/Support/Compiler.h"18#include "llvm/TargetParser/Triple.h"1920namespace clang {21namespace targets {2223class LLVM_LIBRARY_VISIBILITY VETargetInfo : public TargetInfo {2425public:26VETargetInfo(const llvm::Triple &Triple, const TargetOptions &)27: TargetInfo(Triple) {28NoAsmVariants = true;29LongDoubleWidth = 128;30LongDoubleAlign = 128;31LongDoubleFormat = &llvm::APFloat::IEEEquad();32DoubleAlign = LongLongAlign = 64;33SuitableAlign = 64;34LongWidth = LongAlign = PointerWidth = PointerAlign = 64;35SizeType = UnsignedLong;36PtrDiffType = SignedLong;37IntPtrType = SignedLong;38IntMaxType = SignedLong;39Int64Type = SignedLong;40RegParmMax = 8;41MaxAtomicPromoteWidth = MaxAtomicInlineWidth = 64;42HasUnalignedAccess = true;4344WCharType = UnsignedInt;45WIntType = UnsignedInt;46UseZeroLengthBitfieldAlignment = true;47resetDataLayout(48"e-m:e-i64:64-n32:64-S128-v64:64:64-v128:64:64-v256:64:64-v512:64:64-"49"v1024:64:64-v2048:64:64-v4096:64:64-v8192:64:64-v16384:64:64");50}5152void getTargetDefines(const LangOptions &Opts,53MacroBuilder &Builder) const override;5455bool hasSjLjLowering() const override { return true; }5657ArrayRef<Builtin::Info> getTargetBuiltins() const override;5859BuiltinVaListKind getBuiltinVaListKind() const override {60return TargetInfo::VoidPtrBuiltinVaList;61}6263CallingConvCheckResult checkCallingConvention(CallingConv CC) const override {64switch (CC) {65default:66return CCCR_Warning;67case CC_C:68return CCCR_OK;69}70}7172std::string_view getClobbers() const override { return ""; }7374ArrayRef<const char *> getGCCRegNames() const override {75static const char *const GCCRegNames[] = {76// Regular registers77"sx0", "sx1", "sx2", "sx3", "sx4", "sx5", "sx6", "sx7",78"sx8", "sx9", "sx10", "sx11", "sx12", "sx13", "sx14", "sx15",79"sx16", "sx17", "sx18", "sx19", "sx20", "sx21", "sx22", "sx23",80"sx24", "sx25", "sx26", "sx27", "sx28", "sx29", "sx30", "sx31",81"sx32", "sx33", "sx34", "sx35", "sx36", "sx37", "sx38", "sx39",82"sx40", "sx41", "sx42", "sx43", "sx44", "sx45", "sx46", "sx47",83"sx48", "sx49", "sx50", "sx51", "sx52", "sx53", "sx54", "sx55",84"sx56", "sx57", "sx58", "sx59", "sx60", "sx61", "sx62", "sx63",85};86return llvm::ArrayRef(GCCRegNames);87}8889ArrayRef<TargetInfo::GCCRegAlias> getGCCRegAliases() const override {90static const TargetInfo::GCCRegAlias GCCRegAliases[] = {91{{"s0"}, "sx0"},92{{"s1"}, "sx1"},93{{"s2"}, "sx2"},94{{"s3"}, "sx3"},95{{"s4"}, "sx4"},96{{"s5"}, "sx5"},97{{"s6"}, "sx6"},98{{"s7"}, "sx7"},99{{"s8", "sl"}, "sx8"},100{{"s9", "fp"}, "sx9"},101{{"s10", "lr"}, "sx10"},102{{"s11", "sp"}, "sx11"},103{{"s12", "outer"}, "sx12"},104{{"s13"}, "sx13"},105{{"s14", "tp"}, "sx14"},106{{"s15", "got"}, "sx15"},107{{"s16", "plt"}, "sx16"},108{{"s17", "info"}, "sx17"},109{{"s18"}, "sx18"},110{{"s19"}, "sx19"},111{{"s20"}, "sx20"},112{{"s21"}, "sx21"},113{{"s22"}, "sx22"},114{{"s23"}, "sx23"},115{{"s24"}, "sx24"},116{{"s25"}, "sx25"},117{{"s26"}, "sx26"},118{{"s27"}, "sx27"},119{{"s28"}, "sx28"},120{{"s29"}, "sx29"},121{{"s30"}, "sx30"},122{{"s31"}, "sx31"},123{{"s32"}, "sx32"},124{{"s33"}, "sx33"},125{{"s34"}, "sx34"},126{{"s35"}, "sx35"},127{{"s36"}, "sx36"},128{{"s37"}, "sx37"},129{{"s38"}, "sx38"},130{{"s39"}, "sx39"},131{{"s40"}, "sx40"},132{{"s41"}, "sx41"},133{{"s42"}, "sx42"},134{{"s43"}, "sx43"},135{{"s44"}, "sx44"},136{{"s45"}, "sx45"},137{{"s46"}, "sx46"},138{{"s47"}, "sx47"},139{{"s48"}, "sx48"},140{{"s49"}, "sx49"},141{{"s50"}, "sx50"},142{{"s51"}, "sx51"},143{{"s52"}, "sx52"},144{{"s53"}, "sx53"},145{{"s54"}, "sx54"},146{{"s55"}, "sx55"},147{{"s56"}, "sx56"},148{{"s57"}, "sx57"},149{{"s58"}, "sx58"},150{{"s59"}, "sx59"},151{{"s60"}, "sx60"},152{{"s61"}, "sx61"},153{{"s62"}, "sx62"},154{{"s63"}, "sx63"},155};156return llvm::ArrayRef(GCCRegAliases);157}158159bool validateAsmConstraint(const char *&Name,160TargetInfo::ConstraintInfo &Info) const override {161switch (*Name) {162default:163return false;164case 'v':165Info.setAllowsRegister();166return true;167}168return false;169}170171bool allowsLargerPreferedTypeAlignment() const override { return false; }172};173} // namespace targets174} // namespace clang175#endif // LLVM_CLANG_LIB_BASIC_TARGETS_VE_H176177178