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/TargetParser/Triple.h"
15
16using namespace llvm;
17
18NVPTXMCAsmInfo::NVPTXMCAsmInfo(const Triple &TheTriple,
19 const MCTargetOptions &Options)
20 : MCAsmInfo(Options) {
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 SupportsSignedData = false;
50
51 InternalSymbolPrefix = "$L__";
52
53 // TODO: Can we just disable this?
54 WeakDirective = "\t// .weak\t";
55 GlobalDirective = "\t// .globl\t";
56
57 UseIntegratedAssembler = false;
58
59 // ptxas does not support DWARF `.file fileno directory filename'
60 // syntax as of v11.X.
61 EnableDwarfFileDirectoryDefault = false;
62}
63