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                                const MCTargetOptions &Options) {
22   if (TheTriple.getArch() == Triple::nvptx64) {
23     CodePointerSize = CalleeSaveStackSlotSize = 8;
24   }
25 
26   CommentString = "//";
27 
28   HasSingleParameterDotFile = false;
29 
30   InlineAsmStart = " begin inline asm";
31   InlineAsmEnd = " end inline asm";
32 
33   SupportsDebugInformation = true;
34   // PTX does not allow .align on functions.
35   HasFunctionAlignment = false;
36   HasDotTypeDotSizeDirective = false;
37   // PTX does not allow .hidden or .protected
38   HiddenDeclarationVisibilityAttr = HiddenVisibilityAttr = MCSA_Invalid;
39   ProtectedVisibilityAttr = MCSA_Invalid;
40 
41   Data8bitsDirective = ".b8 ";
42   Data16bitsDirective = nullptr; // not supported
43   Data32bitsDirective = ".b32 ";
44   Data64bitsDirective = ".b64 ";
45   ZeroDirective = ".b8";
46   AsciiDirective = nullptr; // not supported
47   AscizDirective = nullptr; // not supported
48   SupportsQuotedNames = false;
49   SupportsExtendedDwarfLocDirective = false;
50   SupportsSignedData = false;
51 
52   // @TODO: Can we just disable this?
53   WeakDirective = "\t// .weak\t";
54   GlobalDirective = "\t// .globl\t";
55 
56   UseIntegratedAssembler = false;
57 }
58