Justin Holewinski | ae556d3 | 2012-05-04 20:18:50 +0000 | [diff] [blame] | 1 | //===-- NVPTXMCAsmInfo.cpp - NVPTX asm properties -------------------------===// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | // |
| 10 | // This file contains the declarations of the NVPTXMCAsmInfo properties. |
| 11 | // |
| 12 | //===----------------------------------------------------------------------===// |
| 13 | |
| 14 | #include "NVPTXMCAsmInfo.h" |
Daniel Sanders | 50f1723 | 2015-09-15 16:17:27 +0000 | [diff] [blame] | 15 | #include "llvm/ADT/Triple.h" |
Justin Holewinski | ae556d3 | 2012-05-04 20:18:50 +0000 | [diff] [blame] | 16 | |
| 17 | using namespace llvm; |
| 18 | |
Justin Holewinski | 0497ab1 | 2013-03-30 14:29:21 +0000 | [diff] [blame] | 19 | void NVPTXMCAsmInfo::anchor() {} |
Justin Holewinski | ae556d3 | 2012-05-04 20:18:50 +0000 | [diff] [blame] | 20 | |
Daniel Sanders | 50f1723 | 2015-09-15 16:17:27 +0000 | [diff] [blame] | 21 | NVPTXMCAsmInfo::NVPTXMCAsmInfo(const Triple &TheTriple) { |
| 22 | if (TheTriple.getArch() == Triple::nvptx64) { |
Konstantin Zhuravlyov | dc77b2e | 2017-04-17 17:41:25 +0000 | [diff] [blame] | 23 | CodePointerSize = CalleeSaveStackSlotSize = 8; |
Eli Bendersky | 32aab22 | 2013-01-23 16:22:04 +0000 | [diff] [blame] | 24 | } |
Justin Holewinski | ae556d3 | 2012-05-04 20:18:50 +0000 | [diff] [blame] | 25 | |
| 26 | CommentString = "//"; |
| 27 | |
Justin Holewinski | ae556d3 | 2012-05-04 20:18:50 +0000 | [diff] [blame] | 28 | HasSingleParameterDotFile = false; |
| 29 | |
Justin Lebar | 87a174c | 2016-05-10 00:31:22 +0000 | [diff] [blame] | 30 | InlineAsmStart = " begin inline asm"; |
| 31 | InlineAsmEnd = " end inline asm"; |
Justin Holewinski | ae556d3 | 2012-05-04 20:18:50 +0000 | [diff] [blame] | 32 | |
Eric Christopher | 68f2218 | 2018-05-18 03:13:08 +0000 | [diff] [blame] | 33 | SupportsDebugInformation = true; |
Jingyue Wu | e8290f2 | 2015-03-12 01:50:30 +0000 | [diff] [blame] | 34 | // PTX does not allow .align on functions. |
| 35 | HasFunctionAlignment = false; |
Justin Holewinski | ae556d3 | 2012-05-04 20:18:50 +0000 | [diff] [blame] | 36 | HasDotTypeDotSizeDirective = false; |
Artem Belevich | 5be0706e | 2016-01-15 23:57:53 +0000 | [diff] [blame] | 37 | // PTX does not allow .hidden or .protected |
| 38 | HiddenDeclarationVisibilityAttr = HiddenVisibilityAttr = MCSA_Invalid; |
| 39 | ProtectedVisibilityAttr = MCSA_Invalid; |
Justin Holewinski | ae556d3 | 2012-05-04 20:18:50 +0000 | [diff] [blame] | 40 | |
Eric Christopher | 68f2218 | 2018-05-18 03:13:08 +0000 | [diff] [blame] | 41 | // FIXME: remove comment once debug info is properly supported. |
| 42 | Data8bitsDirective = "// .b8 "; |
| 43 | Data16bitsDirective = nullptr; // not supported |
| 44 | Data32bitsDirective = "// .b32 "; |
| 45 | Data64bitsDirective = "// .b64 "; |
| 46 | ZeroDirective = "// .b8"; |
| 47 | AsciiDirective = nullptr; // not supported |
| 48 | AscizDirective = nullptr; // not supported |
| 49 | SupportsQuotedNames = false; |
| 50 | SupportsExtendedDwarfLocDirective = false; |
Justin Holewinski | ae556d3 | 2012-05-04 20:18:50 +0000 | [diff] [blame] | 51 | |
| 52 | // @TODO: Can we just disable this? |
Jingyue Wu | 5b62eb9 | 2014-12-01 21:16:17 +0000 | [diff] [blame] | 53 | WeakDirective = "\t// .weak\t"; |
Justin Holewinski | ae556d3 | 2012-05-04 20:18:50 +0000 | [diff] [blame] | 54 | GlobalDirective = "\t// .globl\t"; |
| 55 | } |