LLVM 19.0.0git
Go to the documentation of this file.
1//===-- MCTargetDesc/AMDGPUMCAsmInfo.cpp - Assembly Info ------------------===//
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
7/// \file
10#include "AMDGPUMCAsmInfo.h"
15using namespace llvm;
18 const MCTargetOptions &Options) {
19 CodePointerSize = (TT.getArch() == Triple::amdgcn) ? 8 : 4;
20 StackGrowsUp = true;
22 //===------------------------------------------------------------------===//
25 // This is the maximum instruction encoded size for gfx10. With a known
26 // subtarget, it can be reduced to 8 bytes.
27 MaxInstLength = (TT.getArch() == Triple::amdgcn) ? 20 : 16;
28 SeparatorString = "\n";
29 CommentString = ";";
30 InlineAsmStart = ";#ASMSTART";
31 InlineAsmEnd = ";#ASMEND";
33 //===--- Data Emission Directives -------------------------------------===//
36 //===--- Global Variable Emission Directives --------------------------===//
39 HasNoDeadStrip = true;
40 //===--- Dwarf Emission Directives -----------------------------------===//
42 UsesCFIWithoutEH = true;
43 DwarfRegNumForCFI = true;
49 return SectionName == ".hsatext" || SectionName == ".hsadata_global_agent" ||
50 SectionName == ".hsadata_global_program" ||
51 SectionName == ".hsarodata_readonly_agent" ||
56 if (!STI || STI->getTargetTriple().getArch() == Triple::r600)
57 return MaxInstLength;
59 // Maximum for NSA encoded images
60 if (STI->hasFeature(AMDGPU::FeatureNSAEncoding))
61 return 20;
63 // 64-bit instruction with 32-bit literal.
64 if (STI->hasFeature(AMDGPU::FeatureVOP3Literal))
65 return 12;
67 return 8;
Provides AMDGPU specific target descriptions.
static LVOptions Options
Definition: LVOptions.cpp:25
unsigned getMaxInstLength(const MCSubtargetInfo *STI) const override
Returns the maximum possible encoded instruction size in bytes.
AMDGPUMCAsmInfo(const Triple &TT, const MCTargetOptions &Options)
bool shouldOmitSectionDirective(StringRef SectionName) const override
Return true if the .section directive should be omitted when emitting SectionName.
unsigned MinInstAlignment
Every possible instruction length is a multiple of this value.
Definition: MCAsmInfo.h:115
bool HasNoDeadStrip
True if this target supports the MachO .no_dead_strip directive.
Definition: MCAsmInfo.h:406
bool UseIntegratedAssembler
Should we use the integrated assembler? The integrated assembler should be enabled by default (by the...
Definition: MCAsmInfo.h:519
unsigned MaxInstLength
This is the maximum possible length of an instruction, which is needed to compute the size of an inli...
Definition: MCAsmInfo.h:111
const char * InlineAsmStart
If these are nonempty, they contain a directive to emit before and after an inline assembly statement...
Definition: MCAsmInfo.h:182
bool UsesELFSectionDirectiveForBSS
This is true if this target uses ELF '.section' directive before the '.bss' one.
Definition: MCAsmInfo.h:322
bool SupportsDebugInformation
True if target supports emission of debugging information.
Definition: MCAsmInfo.h:454
bool StackGrowsUp
True if target stack grow up. Default is false.
Definition: MCAsmInfo.h:82
const char * InlineAsmEnd
Definition: MCAsmInfo.h:183
const char * SeparatorString
This string, if specified, is used to separate instructions from each other when on the same line.
Definition: MCAsmInfo.h:131
virtual bool shouldOmitSectionDirective(StringRef SectionName) const
Return true if the .section directive should be omitted when emitting SectionName.
Definition: MCAsmInfo.cpp:122
bool UsesCFIWithoutEH
True if target uses CFI unwind information for other purposes than EH (debugging / sanitizers) when E...
Definition: MCAsmInfo.h:461
bool HasSingleParameterDotFile
True if the target has a single parameter .file directive, this is true for ELF targets.
Definition: MCAsmInfo.h:394
bool COMMDirectiveAlignmentIsInBytes
True is .comm's and .lcomms optional alignment is to be specified in bytes instead of log2(n).
Definition: MCAsmInfo.h:368
bool HasAggressiveSymbolFolding
False if the assembler requires that we use.
Definition: MCAsmInfo.h:364
bool DwarfRegNumForCFI
True if dwarf register numbers are printed instead of symbolic register names in ....
Definition: MCAsmInfo.h:488
unsigned CodePointerSize
Code pointer size in bytes. Default is 4.
Definition: MCAsmInfo.h:72
StringRef CommentString
This indicates the comment string used by the assembler.
Definition: MCAsmInfo.h:135
Generic base class for all target subtargets.
bool hasFeature(unsigned Feature) const
const Triple & getTargetTriple() const
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:50
Triple - Helper class for working with autoconf configuration names.
Definition: Triple.h:44
ArchType getArch() const
Get the parsed architecture type of this triple.
Definition: Triple.h:373
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18