LLVM  10.0.0svn
AMDGPUMCAsmInfo.cpp
Go to the documentation of this file.
1 //===-- MCTargetDesc/AMDGPUMCAsmInfo.cpp - Assembly Info ------------------===//
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 /// \file
8 //===----------------------------------------------------------------------===//
9 
10 #include "AMDGPUMCAsmInfo.h"
11 #include "llvm/ADT/Triple.h"
14 
15 using namespace llvm;
16 
18  CodePointerSize = (TT.getArch() == Triple::amdgcn) ? 8 : 4;
19  StackGrowsUp = true;
21  //===------------------------------------------------------------------===//
22  MinInstAlignment = 4;
23 
24  // This is the maximum instruction encoded size for gfx10. With a known
25  // subtarget, it can be reduced to 8 bytes.
26  MaxInstLength = (TT.getArch() == Triple::amdgcn) ? 20 : 16;
27  SeparatorString = "\n";
28  CommentString = ";";
29  PrivateLabelPrefix = "";
30  InlineAsmStart = ";#ASMSTART";
31  InlineAsmEnd = ";#ASMEND";
32 
33  //===--- Data Emission Directives -------------------------------------===//
36 
37  //===--- Global Variable Emission Directives --------------------------===//
40  HasNoDeadStrip = true;
41  WeakRefDirective = ".weakref\t";
42  //===--- Dwarf Emission Directives -----------------------------------===//
44 }
45 
47  return SectionName == ".hsatext" || SectionName == ".hsadata_global_agent" ||
48  SectionName == ".hsadata_global_program" ||
49  SectionName == ".hsarodata_readonly_agent" ||
51 }
52 
54  if (!STI || STI->getTargetTriple().getArch() == Triple::r600)
55  return MaxInstLength;
56 
57  // Maximum for NSA encoded images
58  if (STI->getFeatureBits()[AMDGPU::FeatureNSAEncoding])
59  return 20;
60 
61  // 64-bit instruction with 32-bit literal.
62  if (STI->getFeatureBits()[AMDGPU::FeatureVOP3Literal])
63  return 12;
64 
65  return 8;
66 }
bool HasSingleParameterDotFile
True if the target has a single parameter .file directive, this is true for ELF targets.
Definition: MCAsmInfo.h:283
StringRef PrivateLabelPrefix
This prefix is used for labels for basic blocks.
Definition: MCAsmInfo.h:132
This class represents lattice values for constants.
Definition: AllocatorList.h:23
bool shouldOmitSectionDirective(StringRef SectionName) const override
Return true if the .section directive should be omitted when emitting SectionName.
const char * SeparatorString
This string, if specified, is used to separate instructions from each other when on the same line...
Definition: MCAsmInfo.h:110
const Triple & getTargetTriple() const
bool HasNoDeadStrip
True if this target supports the MachO .no_dead_strip directive.
Definition: MCAsmInfo.h:291
const FeatureBitset & getFeatureBits() const
StringRef CommentString
This indicates the comment character used by the assembler.
Definition: MCAsmInfo.h:114
bool UsesELFSectionDirectiveForBSS
This is true if this target uses ELF '.section' directive before the '.bss' one.
Definition: MCAsmInfo.h:221
bool HasAggressiveSymbolFolding
False if the assembler requires that we use.
Definition: MCAsmInfo.h:263
bool StackGrowsUp
True if target stack grow up. Default is false.
Definition: MCAsmInfo.h:73
bool SunStyleELFSectionSwitchSyntax
This is true if this target uses "Sun Style" syntax for section switching ("#alloc,#write" etc) instead of the normal ELF syntax (,"a,w") in .section directives.
Definition: MCAsmInfo.h:216
virtual bool shouldOmitSectionDirective(StringRef SectionName) const
Return true if the .section directive should be omitted when emitting SectionName.
Definition: MCAsmInfo.cpp:122
ArchType getArch() const
getArch - Get the parsed architecture type of this triple.
Definition: Triple.h:296
const char * InlineAsmStart
If these are nonempty, they contain a directive to emit before and after an inline assembly statement...
Definition: MCAsmInfo.h:142
bool COMMDirectiveAlignmentIsInBytes
True is .comm's and .lcomms optional alignment is to be specified in bytes instead of log2(n)...
Definition: MCAsmInfo.h:267
bool SupportsDebugInformation
True if target supports emission of debugging information.
Definition: MCAsmInfo.h:332
const char * WeakRefDirective
This directive, if non-null, is used to declare a global as being a weak undefined symbol...
Definition: MCAsmInfo.h:302
Triple - Helper class for working with autoconf configuration names.
Definition: Triple.h:43
const char * InlineAsmEnd
Definition: MCAsmInfo.h:143
unsigned MinInstAlignment
Every possible instruction length is a multiple of this value.
Definition: MCAsmInfo.h:102
unsigned getMaxInstLength(const MCSubtargetInfo *STI) const override
Returns the maximum possible encoded instruction size in bytes.
unsigned CodePointerSize
Code pointer size in bytes. Default is 4.
Definition: MCAsmInfo.h:63
Provides AMDGPU specific target descriptions.
Generic base class for all target subtargets.
AMDGPUMCAsmInfo(const Triple &TT)
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:48
unsigned MaxInstLength
This is the maximum possible length of an instruction, which is needed to compute the size of an inli...
Definition: MCAsmInfo.h:98