blob: 2f3dbdc96f7952d0ba813e1e552c8b897ad44867 [file] [log] [blame]
Tom Stellard75aadc22012-12-11 21:25:42 +00001//===-- MCTargetDesc/AMDGPUMCAsmInfo.cpp - Assembly Info ------------------===//
2//
Chandler Carruth2946cd72019-01-19 08:50:56 +00003// 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
Tom Stellard75aadc22012-12-11 21:25:42 +00006//
7/// \file
8//===----------------------------------------------------------------------===//
9
10#include "AMDGPUMCAsmInfo.h"
Matt Arsenault01e062f2016-06-16 21:14:05 +000011#include "llvm/ADT/Triple.h"
Tom Stellard75aadc22012-12-11 21:25:42 +000012
13using namespace llvm;
Matt Arsenault01e062f2016-06-16 21:14:05 +000014
Daniel Sanders50f17232015-09-15 16:17:27 +000015AMDGPUMCAsmInfo::AMDGPUMCAsmInfo(const Triple &TT) : MCAsmInfoELF() {
Konstantin Zhuravlyov12096842017-04-17 18:02:09 +000016 CodePointerSize = (TT.getArch() == Triple::amdgcn) ? 8 : 4;
Matt Arsenaultdf6539f2017-04-24 19:40:51 +000017 StackGrowsUp = true;
Tom Stellard75aadc22012-12-11 21:25:42 +000018 HasSingleParameterDotFile = false;
Tom Stellard75aadc22012-12-11 21:25:42 +000019 //===------------------------------------------------------------------===//
Matt Arsenaulted1fd7e2016-06-27 21:42:49 +000020 MinInstAlignment = 4;
Matt Arsenault01e062f2016-06-16 21:14:05 +000021 MaxInstLength = (TT.getArch() == Triple::amdgcn) ? 8 : 16;
Tom Stellard75aadc22012-12-11 21:25:42 +000022 SeparatorString = "\n";
Tom Stellard75aadc22012-12-11 21:25:42 +000023 CommentString = ";";
Matt Arsenault4e273432014-12-04 00:06:57 +000024 PrivateLabelPrefix = "";
Tom Stellard75aadc22012-12-11 21:25:42 +000025 InlineAsmStart = ";#ASMSTART";
26 InlineAsmEnd = ";#ASMEND";
Tom Stellard75aadc22012-12-11 21:25:42 +000027
28 //===--- Data Emission Directives -------------------------------------===//
Tom Stellard75aadc22012-12-11 21:25:42 +000029 SunStyleELFSectionSwitchSyntax = true;
30 UsesELFSectionDirectiveForBSS = true;
Tom Stellard75aadc22012-12-11 21:25:42 +000031
Tom Stellard75aadc22012-12-11 21:25:42 +000032 //===--- Global Variable Emission Directives --------------------------===//
Tom Stellard75aadc22012-12-11 21:25:42 +000033 HasAggressiveSymbolFolding = true;
34 COMMDirectiveAlignmentIsInBytes = false;
Tom Stellard75aadc22012-12-11 21:25:42 +000035 HasNoDeadStrip = true;
Tom Stellard75aadc22012-12-11 21:25:42 +000036 WeakRefDirective = ".weakref\t";
Tom Stellard75aadc22012-12-11 21:25:42 +000037 //===--- Dwarf Emission Directives -----------------------------------===//
Tom Stellard75aadc22012-12-11 21:25:42 +000038 SupportsDebugInformation = true;
Tom Stellard75aadc22012-12-11 21:25:42 +000039}
Tom Stellarde135ffd2015-09-25 21:41:28 +000040
41bool AMDGPUMCAsmInfo::shouldOmitSectionDirective(StringRef SectionName) const {
Tom Stellard00f2f912015-12-02 19:47:57 +000042 return SectionName == ".hsatext" || SectionName == ".hsadata_global_agent" ||
43 SectionName == ".hsadata_global_program" ||
Tom Stellard9760f032015-12-03 03:34:32 +000044 SectionName == ".hsarodata_readonly_agent" ||
Tom Stellarde135ffd2015-09-25 21:41:28 +000045 MCAsmInfo::shouldOmitSectionDirective(SectionName);
46}