Tom Stellard | 75aadc2 | 2012-12-11 21:25:42 +0000 | [diff] [blame] | 1 | //===-- MCTargetDesc/AMDGPUMCAsmInfo.cpp - Assembly Info ------------------===// |
| 2 | // |
Chandler Carruth | 2946cd7 | 2019-01-19 08:50:56 +0000 | [diff] [blame] | 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 |
Tom Stellard | 75aadc2 | 2012-12-11 21:25:42 +0000 | [diff] [blame] | 6 | // |
| 7 | /// \file |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | |
| 10 | #include "AMDGPUMCAsmInfo.h" |
Matt Arsenault | 01e062f | 2016-06-16 21:14:05 +0000 | [diff] [blame] | 11 | #include "llvm/ADT/Triple.h" |
Tom Stellard | 75aadc2 | 2012-12-11 21:25:42 +0000 | [diff] [blame] | 12 | |
| 13 | using namespace llvm; |
Matt Arsenault | 01e062f | 2016-06-16 21:14:05 +0000 | [diff] [blame] | 14 | |
Daniel Sanders | 50f1723 | 2015-09-15 16:17:27 +0000 | [diff] [blame] | 15 | AMDGPUMCAsmInfo::AMDGPUMCAsmInfo(const Triple &TT) : MCAsmInfoELF() { |
Konstantin Zhuravlyov | 1209684 | 2017-04-17 18:02:09 +0000 | [diff] [blame] | 16 | CodePointerSize = (TT.getArch() == Triple::amdgcn) ? 8 : 4; |
Matt Arsenault | df6539f | 2017-04-24 19:40:51 +0000 | [diff] [blame] | 17 | StackGrowsUp = true; |
Tom Stellard | 75aadc2 | 2012-12-11 21:25:42 +0000 | [diff] [blame] | 18 | HasSingleParameterDotFile = false; |
Tom Stellard | 75aadc2 | 2012-12-11 21:25:42 +0000 | [diff] [blame] | 19 | //===------------------------------------------------------------------===// |
Matt Arsenault | ed1fd7e | 2016-06-27 21:42:49 +0000 | [diff] [blame] | 20 | MinInstAlignment = 4; |
Matt Arsenault | 01e062f | 2016-06-16 21:14:05 +0000 | [diff] [blame] | 21 | MaxInstLength = (TT.getArch() == Triple::amdgcn) ? 8 : 16; |
Tom Stellard | 75aadc2 | 2012-12-11 21:25:42 +0000 | [diff] [blame] | 22 | SeparatorString = "\n"; |
Tom Stellard | 75aadc2 | 2012-12-11 21:25:42 +0000 | [diff] [blame] | 23 | CommentString = ";"; |
Matt Arsenault | 4e27343 | 2014-12-04 00:06:57 +0000 | [diff] [blame] | 24 | PrivateLabelPrefix = ""; |
Tom Stellard | 75aadc2 | 2012-12-11 21:25:42 +0000 | [diff] [blame] | 25 | InlineAsmStart = ";#ASMSTART"; |
| 26 | InlineAsmEnd = ";#ASMEND"; |
Tom Stellard | 75aadc2 | 2012-12-11 21:25:42 +0000 | [diff] [blame] | 27 | |
| 28 | //===--- Data Emission Directives -------------------------------------===// |
Tom Stellard | 75aadc2 | 2012-12-11 21:25:42 +0000 | [diff] [blame] | 29 | SunStyleELFSectionSwitchSyntax = true; |
| 30 | UsesELFSectionDirectiveForBSS = true; |
Tom Stellard | 75aadc2 | 2012-12-11 21:25:42 +0000 | [diff] [blame] | 31 | |
Tom Stellard | 75aadc2 | 2012-12-11 21:25:42 +0000 | [diff] [blame] | 32 | //===--- Global Variable Emission Directives --------------------------===// |
Tom Stellard | 75aadc2 | 2012-12-11 21:25:42 +0000 | [diff] [blame] | 33 | HasAggressiveSymbolFolding = true; |
| 34 | COMMDirectiveAlignmentIsInBytes = false; |
Tom Stellard | 75aadc2 | 2012-12-11 21:25:42 +0000 | [diff] [blame] | 35 | HasNoDeadStrip = true; |
Tom Stellard | 75aadc2 | 2012-12-11 21:25:42 +0000 | [diff] [blame] | 36 | WeakRefDirective = ".weakref\t"; |
Tom Stellard | 75aadc2 | 2012-12-11 21:25:42 +0000 | [diff] [blame] | 37 | //===--- Dwarf Emission Directives -----------------------------------===// |
Tom Stellard | 75aadc2 | 2012-12-11 21:25:42 +0000 | [diff] [blame] | 38 | SupportsDebugInformation = true; |
Tom Stellard | 75aadc2 | 2012-12-11 21:25:42 +0000 | [diff] [blame] | 39 | } |
Tom Stellard | e135ffd | 2015-09-25 21:41:28 +0000 | [diff] [blame] | 40 | |
| 41 | bool AMDGPUMCAsmInfo::shouldOmitSectionDirective(StringRef SectionName) const { |
Tom Stellard | 00f2f91 | 2015-12-02 19:47:57 +0000 | [diff] [blame] | 42 | return SectionName == ".hsatext" || SectionName == ".hsadata_global_agent" || |
| 43 | SectionName == ".hsadata_global_program" || |
Tom Stellard | 9760f03 | 2015-12-03 03:34:32 +0000 | [diff] [blame] | 44 | SectionName == ".hsarodata_readonly_agent" || |
Tom Stellard | e135ffd | 2015-09-25 21:41:28 +0000 | [diff] [blame] | 45 | MCAsmInfo::shouldOmitSectionDirective(SectionName); |
| 46 | } |