LLVM 20.0.0git
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"
14
15using namespace llvm;
16
18 const MCTargetOptions &Options) {
19 CodePointerSize = (TT.getArch() == Triple::amdgcn) ? 8 : 4;
20 StackGrowsUp = true;
22 //===------------------------------------------------------------------===//
24
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";
32
33 //===--- Data Emission Directives -------------------------------------===//
35
36 //===--- Global Variable Emission Directives --------------------------===//
38 HasNoDeadStrip = true;
39 //===--- Dwarf Emission Directives -----------------------------------===//
41 UsesCFIWithoutEH = true;
42 DwarfRegNumForCFI = true;
43
45}
46
48 return SectionName == ".hsatext" || SectionName == ".hsadata_global_agent" ||
49 SectionName == ".hsadata_global_program" ||
50 SectionName == ".hsarodata_readonly_agent" ||
52}
53
55 if (!STI || STI->getTargetTriple().getArch() == Triple::r600)
56 return MaxInstLength;
57
58 // Maximum for NSA encoded images
59 if (STI->hasFeature(AMDGPU::FeatureNSAEncoding))
60 return 20;
61
62 // 64-bit instruction with 32-bit literal.
63 if (STI->hasFeature(AMDGPU::FeatureVOP3Literal))
64 return 12;
65
66 return 8;
67}
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:107
bool HasNoDeadStrip
True if this target supports the MachO .no_dead_strip directive.
Definition: MCAsmInfo.h:383
bool UseIntegratedAssembler
Should we use the integrated assembler? The integrated assembler should be enabled by default (by the...
Definition: MCAsmInfo.h:488
unsigned MaxInstLength
This is the maximum possible length of an instruction, which is needed to compute the size of an inli...
Definition: MCAsmInfo.h:103
const char * InlineAsmStart
If these are nonempty, they contain a directive to emit before and after an inline assembly statement...
Definition: MCAsmInfo.h:174
bool UsesELFSectionDirectiveForBSS
This is true if this target uses ELF '.section' directive before the '.bss' one.
Definition: MCAsmInfo.h:314
bool SupportsDebugInformation
True if target supports emission of debugging information.
Definition: MCAsmInfo.h:423
bool StackGrowsUp
True if target stack grow up. Default is false.
Definition: MCAsmInfo.h:82
const char * InlineAsmEnd
Definition: MCAsmInfo.h:175
const char * SeparatorString
This string, if specified, is used to separate instructions from each other when on the same line.
Definition: MCAsmInfo.h:123
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:430
bool HasSingleParameterDotFile
True if the target has a single parameter .file directive, this is true for ELF targets.
Definition: MCAsmInfo.h:371
bool COMMDirectiveAlignmentIsInBytes
True is .comm's and .lcomms optional alignment is to be specified in bytes instead of log2(n).
Definition: MCAsmInfo.h:345
bool DwarfRegNumForCFI
True if dwarf register numbers are printed instead of symbolic register names in ....
Definition: MCAsmInfo.h:457
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:127
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