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" |
| 15 | #include "llvm/ADT/Triple.h" |
| 16 | #include "llvm/Support/CommandLine.h" |
| 17 | |
| 18 | using namespace llvm; |
| 19 | |
Justin Holewinski | ae556d3 | 2012-05-04 20:18:50 +0000 | [diff] [blame] | 20 | // -debug-compile - Command line option to inform opt and llc passes to |
| 21 | // compile for debugging |
Benjamin Kramer | ad5c24f | 2013-05-23 16:09:15 +0000 | [diff] [blame] | 22 | static cl::opt<bool> CompileForDebugging("debug-compile", |
| 23 | cl::desc("Compile for debugging"), |
| 24 | cl::Hidden, cl::init(false)); |
Justin Holewinski | ae556d3 | 2012-05-04 20:18:50 +0000 | [diff] [blame] | 25 | |
Justin Holewinski | 0497ab1 | 2013-03-30 14:29:21 +0000 | [diff] [blame] | 26 | void NVPTXMCAsmInfo::anchor() {} |
Justin Holewinski | ae556d3 | 2012-05-04 20:18:50 +0000 | [diff] [blame] | 27 | |
Craig Topper | 6dc4a8bc | 2014-08-30 16:48:02 +0000 | [diff] [blame] | 28 | NVPTXMCAsmInfo::NVPTXMCAsmInfo(StringRef TT) { |
Justin Holewinski | ae556d3 | 2012-05-04 20:18:50 +0000 | [diff] [blame] | 29 | Triple TheTriple(TT); |
Eli Bendersky | 32aab22 | 2013-01-23 16:22:04 +0000 | [diff] [blame] | 30 | if (TheTriple.getArch() == Triple::nvptx64) { |
| 31 | PointerSize = CalleeSaveStackSlotSize = 8; |
| 32 | } |
Justin Holewinski | ae556d3 | 2012-05-04 20:18:50 +0000 | [diff] [blame] | 33 | |
| 34 | CommentString = "//"; |
| 35 | |
Justin Holewinski | ae556d3 | 2012-05-04 20:18:50 +0000 | [diff] [blame] | 36 | HasSingleParameterDotFile = false; |
| 37 | |
| 38 | InlineAsmStart = " inline asm"; |
| 39 | InlineAsmEnd = " inline asm"; |
| 40 | |
| 41 | SupportsDebugInformation = CompileForDebugging; |
Jingyue Wu | e8290f2 | 2015-03-12 01:50:30 +0000 | [diff] [blame^] | 42 | // PTX does not allow .align on functions. |
| 43 | HasFunctionAlignment = false; |
Justin Holewinski | ae556d3 | 2012-05-04 20:18:50 +0000 | [diff] [blame] | 44 | HasDotTypeDotSizeDirective = false; |
| 45 | |
| 46 | Data8bitsDirective = " .b8 "; |
| 47 | Data16bitsDirective = " .b16 "; |
| 48 | Data32bitsDirective = " .b32 "; |
| 49 | Data64bitsDirective = " .b64 "; |
Justin Holewinski | 0497ab1 | 2013-03-30 14:29:21 +0000 | [diff] [blame] | 50 | ZeroDirective = " .b8"; |
Justin Holewinski | ae556d3 | 2012-05-04 20:18:50 +0000 | [diff] [blame] | 51 | AsciiDirective = " .b8"; |
| 52 | AscizDirective = " .b8"; |
| 53 | |
| 54 | // @TODO: Can we just disable this? |
Jingyue Wu | 5b62eb9 | 2014-12-01 21:16:17 +0000 | [diff] [blame] | 55 | WeakDirective = "\t// .weak\t"; |
Justin Holewinski | ae556d3 | 2012-05-04 20:18:50 +0000 | [diff] [blame] | 56 | GlobalDirective = "\t// .globl\t"; |
| 57 | } |