1 //===-- NVPTXMCAsmInfo.cpp - NVPTX asm properties -------------------------===// 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 contains the declarations of the NVPTXMCAsmInfo properties. 10 // 11 //===----------------------------------------------------------------------===// 12 13 #include "NVPTXMCAsmInfo.h" 14 #include "llvm/ADT/Triple.h" 15 16 using namespace llvm; 17 18 void NVPTXMCAsmInfo::anchor() {} 19 20 NVPTXMCAsmInfo::NVPTXMCAsmInfo(const Triple &TheTriple) { 21 if (TheTriple.getArch() == Triple::nvptx64) { 22 CodePointerSize = CalleeSaveStackSlotSize = 8; 23 } 24 25 CommentString = "//"; 26 27 HasSingleParameterDotFile = false; 28 29 InlineAsmStart = " begin inline asm"; 30 InlineAsmEnd = " end inline asm"; 31 32 SupportsDebugInformation = true; 33 // PTX does not allow .align on functions. 34 HasFunctionAlignment = false; 35 HasDotTypeDotSizeDirective = false; 36 // PTX does not allow .hidden or .protected 37 HiddenDeclarationVisibilityAttr = HiddenVisibilityAttr = MCSA_Invalid; 38 ProtectedVisibilityAttr = MCSA_Invalid; 39 40 Data8bitsDirective = ".b8 "; 41 Data16bitsDirective = nullptr; // not supported 42 Data32bitsDirective = ".b32 "; 43 Data64bitsDirective = ".b64 "; 44 ZeroDirective = ".b8"; 45 AsciiDirective = nullptr; // not supported 46 AscizDirective = nullptr; // not supported 47 SupportsQuotedNames = false; 48 SupportsExtendedDwarfLocDirective = false; 49 50 // @TODO: Can we just disable this? 51 WeakDirective = "\t// .weak\t"; 52 GlobalDirective = "\t// .globl\t"; 53 } 54