xref: /freebsd/contrib/llvm-project/llvm/lib/Target/NVPTX/MCTargetDesc/NVPTXMCAsmInfo.cpp (revision e6bfd18d21b225af6a0ed67ceeaf1293b7b9eba5)
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   PrivateGlobalPrefix = "$L__";
53   PrivateLabelPrefix = PrivateGlobalPrefix;
54 
55   // @TODO: Can we just disable this?
56   WeakDirective = "\t// .weak\t";
57   GlobalDirective = "\t// .globl\t";
58 
59   UseIntegratedAssembler = false;
60 
61   // Avoid using parens for identifiers starting with $ - ptxas does
62   // not expect them.
63   UseParensForDollarSignNames = false;
64 
65   // ptxas does not support DWARF `.file fileno directory filename'
66   // syntax as of v11.X.
67   EnableDwarfFileDirectoryDefault = false;
68 }
69