Jia Liu | 9f61011 | 2012-02-17 08:55:11 +0000 | [diff] [blame] | 1 | //===-- MipsMCAsmInfo.cpp - Mips Asm Properties ---------------------------===// |
Bruno Cardoso Lopes | 35e43c4 | 2007-06-06 07:42:06 +0000 | [diff] [blame] | 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
Chris Lattner | f3ebc3f | 2007-12-29 20:36:04 +0000 | [diff] [blame] | 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
Bruno Cardoso Lopes | 35e43c4 | 2007-06-06 07:42:06 +0000 | [diff] [blame] | 7 | // |
Akira Hatanaka | e248912 | 2011-04-15 21:51:11 +0000 | [diff] [blame] | 8 | //===----------------------------------------------------------------------===// |
Bruno Cardoso Lopes | 35e43c4 | 2007-06-06 07:42:06 +0000 | [diff] [blame] | 9 | // |
Chris Lattner | 7b26fce | 2009-08-22 20:48:53 +0000 | [diff] [blame] | 10 | // This file contains the declarations of the MipsMCAsmInfo properties. |
Bruno Cardoso Lopes | 35e43c4 | 2007-06-06 07:42:06 +0000 | [diff] [blame] | 11 | // |
Akira Hatanaka | e248912 | 2011-04-15 21:51:11 +0000 | [diff] [blame] | 12 | //===----------------------------------------------------------------------===// |
Bruno Cardoso Lopes | 35e43c4 | 2007-06-06 07:42:06 +0000 | [diff] [blame] | 13 | |
Chris Lattner | 7b26fce | 2009-08-22 20:48:53 +0000 | [diff] [blame] | 14 | #include "MipsMCAsmInfo.h" |
Daniel Sanders | 50f1723 | 2015-09-15 16:17:27 +0000 | [diff] [blame] | 15 | #include "llvm/ADT/Triple.h" |
Evan Cheng | a83b37a | 2011-07-15 02:09:41 +0000 | [diff] [blame] | 16 | |
Bruno Cardoso Lopes | 35e43c4 | 2007-06-06 07:42:06 +0000 | [diff] [blame] | 17 | using namespace llvm; |
| 18 | |
David Blaikie | a379b181 | 2011-12-20 02:50:00 +0000 | [diff] [blame] | 19 | void MipsMCAsmInfo::anchor() { } |
| 20 | |
Daniel Sanders | 50f1723 | 2015-09-15 16:17:27 +0000 | [diff] [blame] | 21 | MipsMCAsmInfo::MipsMCAsmInfo(const Triple &TheTriple) { |
| 22 | if ((TheTriple.getArch() == Triple::mips) || |
| 23 | (TheTriple.getArch() == Triple::mips64)) |
Evan Cheng | a83b37a | 2011-07-15 02:09:41 +0000 | [diff] [blame] | 24 | IsLittleEndian = false; |
| 25 | |
Daniel Sanders | 50f1723 | 2015-09-15 16:17:27 +0000 | [diff] [blame] | 26 | if ((TheTriple.getArch() == Triple::mips64el) || |
| 27 | (TheTriple.getArch() == Triple::mips64)) { |
Eli Bendersky | 32aab22 | 2013-01-23 16:22:04 +0000 | [diff] [blame] | 28 | PointerSize = CalleeSaveStackSlotSize = 8; |
| 29 | } |
Jack Carter | 9e28cd3 | 2013-01-08 18:53:20 +0000 | [diff] [blame] | 30 | |
Daniel Sanders | 6a73883 | 2016-07-19 10:49:03 +0000 | [diff] [blame^] | 31 | // FIXME: This condition isn't quite right but it's the best we can do until |
| 32 | // this object can identify the ABI. It will misbehave when using O32 |
| 33 | // on a mips64*-* triple. |
| 34 | if ((TheTriple.getArch() == Triple::mipsel) || |
| 35 | (TheTriple.getArch() == Triple::mips)) { |
| 36 | PrivateGlobalPrefix = "$"; |
| 37 | PrivateLabelPrefix = "$"; |
| 38 | } |
| 39 | |
Bruno Cardoso Lopes | 80ab8f9 | 2008-07-14 14:42:54 +0000 | [diff] [blame] | 40 | AlignmentIsInBytes = false; |
Akira Hatanaka | f2bcad9 | 2011-07-01 01:04:43 +0000 | [diff] [blame] | 41 | Data16bitsDirective = "\t.2byte\t"; |
Akira Hatanaka | aa56000 | 2011-05-26 18:59:03 +0000 | [diff] [blame] | 42 | Data32bitsDirective = "\t.4byte\t"; |
Akira Hatanaka | cf10f08 | 2011-12-20 22:52:19 +0000 | [diff] [blame] | 43 | Data64bitsDirective = "\t.8byte\t"; |
Bruno Cardoso Lopes | 80ab8f9 | 2008-07-14 14:42:54 +0000 | [diff] [blame] | 44 | CommentString = "#"; |
Bruno Cardoso Lopes | 80ab8f9 | 2008-07-14 14:42:54 +0000 | [diff] [blame] | 45 | ZeroDirective = "\t.space\t"; |
Chris Lattner | 19bd039 | 2010-01-25 21:10:10 +0000 | [diff] [blame] | 46 | GPRel32Directive = "\t.gpword\t"; |
Akira Hatanaka | f0b0844 | 2012-02-03 04:33:00 +0000 | [diff] [blame] | 47 | GPRel64Directive = "\t.gpdword\t"; |
Rafael Espindola | f491704 | 2014-06-24 22:45:16 +0000 | [diff] [blame] | 48 | UseAssignmentForEHBegin = true; |
Akira Hatanaka | aa56000 | 2011-05-26 18:59:03 +0000 | [diff] [blame] | 49 | SupportsDebugInformation = true; |
| 50 | ExceptionsType = ExceptionHandling::DwarfCFI; |
Akira Hatanaka | 9c6028f | 2011-07-07 23:56:50 +0000 | [diff] [blame] | 51 | DwarfRegNumForCFI = true; |
Daniel Sanders | e160f83 | 2016-05-14 12:43:08 +0000 | [diff] [blame] | 52 | |
| 53 | // Enable IAS by default for O32. |
| 54 | if (TheTriple.getArch() == Triple::mips || |
| 55 | TheTriple.getArch() == Triple::mipsel) |
| 56 | UseIntegratedAssembler = true; |
Bruno Cardoso Lopes | 35e43c4 | 2007-06-06 07:42:06 +0000 | [diff] [blame] | 57 | } |