LLVM 24.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"
13#include "llvm/ADT/Enum.h"
14#include "llvm/MC/MCExpr.h"
17
18using namespace llvm;
19
21 {{"gotpcrel"}, AMDGPUMCExpr::S_GOTPCREL},
22 {{"gotpcrel32@lo"}, AMDGPUMCExpr::S_GOTPCREL32_LO},
23 {{"gotpcrel32@hi"}, AMDGPUMCExpr::S_GOTPCREL32_HI},
24 {{"rel32@lo"}, AMDGPUMCExpr::S_REL32_LO},
25 {{"rel32@hi"}, AMDGPUMCExpr::S_REL32_HI},
26 {{"rel64"}, AMDGPUMCExpr::S_REL64},
27 {{"abs32@lo"}, AMDGPUMCExpr::S_ABS32_LO},
28 {{"abs32@hi"}, AMDGPUMCExpr::S_ABS32_HI},
29 {{"abs64"}, AMDGPUMCExpr::S_ABS64},
30};
32
35 : MCAsmInfoELF(TT, Options) {
36 CodePointerSize = (TT.isAMDGCN()) ? 8 : 4;
37 StackGrowsUp = true;
39 //===------------------------------------------------------------------===//
41
42 // This is the maximum instruction encoded size for gfx10. With a known
43 // subtarget, it can be reduced to 8 bytes.
44 MaxInstLength = (TT.isAMDGCN()) ? 20 : 16;
45 SeparatorString = "\n";
46 CommentString = ";";
47 InlineAsmStart = ";#ASMSTART";
48 InlineAsmEnd = ";#ASMEND";
50
51 //===--- Global Variable Emission Directives --------------------------===//
53 HasNoDeadStrip = true;
54 //===--- Dwarf Emission Directives -----------------------------------===//
56 UsesCFIWithoutEH = true;
57 DwarfRegNumForCFI = true;
58
59 // MCAsmInfoELF enables this, and with the integrated assembler AsmPrinter
60 // then emits the preferred function alignment as .prefalign, which reduces
61 // the alignment of small functions. Keep emitting it as a plain .p2align so
62 // that enabling the integrated assembler does not change code layout.
64
65 SectionDirectives.insert(".hsatext");
66 SectionDirectives.insert(".hsadata_global_agent");
67 SectionDirectives.insert(".hsadata_global_program");
68 SectionDirectives.insert(".hsarodata_readonly_agent");
69
71}
constexpr EnumStringDef< MCAsmInfo::AtSpecifierKind > AtSpecifierDefs[]
constexpr auto atSpecifiers
Provides AMDGPU specific target descriptions.
#define BUILD_ENUM_STRINGS(Tab)
Definition Enum.h:120
static LVOptions Options
Definition LVOptions.cpp:25
AMDGPUMCAsmInfo(const Triple &TT, const MCTargetOptions &Options)
MCAsmInfoELF(const Triple &TT, const MCTargetOptions &Options)
unsigned MinInstAlignment
Every possible instruction length is a multiple of this value.
Definition MCAsmInfo.h:132
bool HasNoDeadStrip
True if this target supports the MachO .no_dead_strip directive.
Definition MCAsmInfo.h:334
bool UsesSetToEquateSymbol
Use .set instead of = to equate a symbol to an expression.
Definition MCAsmInfo.h:158
SmallDenseSet< StringRef, 8 > SectionDirectives
Sections whose name also is supported as a directive without an explicit ".section" directive.
Definition MCAsmInfo.h:475
unsigned MaxInstLength
This is the maximum possible length of an instruction, which is needed to compute the size of an inli...
Definition MCAsmInfo.h:128
const char * InlineAsmStart
If these are nonempty, they contain a directive to emit before and after an inline assembly statement...
Definition MCAsmInfo.h:179
bool HasPreferredAlignment
Definition MCAsmInfo.h:318
bool SupportsDebugInformation
True if target supports emission of debugging information.
Definition MCAsmInfo.h:372
bool StackGrowsUp
True if target stack grow up. Default is false.
Definition MCAsmInfo.h:102
const char * InlineAsmEnd
Definition MCAsmInfo.h:180
const char * SeparatorString
This string, if specified, is used to separate instructions from each other when on the same line.
Definition MCAsmInfo.h:140
bool UsesCFIWithoutEH
True if target uses CFI unwind information for other purposes than EH (debugging / sanitizers) when t...
Definition MCAsmInfo.h:377
bool HasSingleParameterDotFile
True if the target has a single parameter .file directive, this is true for ELF targets.
Definition MCAsmInfo.h:326
bool COMMDirectiveAlignmentIsInBytes
True is .comm's and .lcomms optional alignment is to be specified in bytes instead of log2(n).
Definition MCAsmInfo.h:307
void initializeAtSpecifiers(EnumStrings< AtSpecifierKind, 1 >)
bool DwarfRegNumForCFI
True if dwarf register numbers are printed instead of symbolic register names in ....
Definition MCAsmInfo.h:408
unsigned CodePointerSize
Code pointer size in bytes. Default is 4.
Definition MCAsmInfo.h:88
StringRef CommentString
This indicates the comment string used by the assembler.
Definition MCAsmInfo.h:144
Triple - Helper class for working with autoconf configuration names.
Definition Triple.h:48
This is an optimization pass for GlobalISel generic memory operations.
Compile-time data representation of enum entries.
Definition Enum.h:47