blob: d8fab5b7c01a2f7d78c8ae7b32a9188f6847b32d [file] [log] [blame]
Jia Liub22310f2012-02-18 12:03:15 +00001//===-- PPCMCAsmInfo.cpp - PPC asm properties -----------------------------===//
Jim Laskey0e835412006-09-07 22:05:02 +00002//
3// The LLVM Compiler Infrastructure
4//
Chris Lattnerf3ebc3f2007-12-29 20:36:04 +00005// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
Jim Laskey0e835412006-09-07 22:05:02 +00007//
8//===----------------------------------------------------------------------===//
9//
Chris Lattner05457462009-08-22 21:03:30 +000010// This file contains the declarations of the MCAsmInfoDarwin properties.
Jim Laskey0e835412006-09-07 22:05:02 +000011//
12//===----------------------------------------------------------------------===//
13
Chris Lattner7b26fce2009-08-22 20:48:53 +000014#include "PPCMCAsmInfo.h"
Daniel Sanders50f17232015-09-15 16:17:27 +000015#include "llvm/ADT/Triple.h"
David Fang1b018492013-12-10 21:37:41 +000016
Jim Laskey0e835412006-09-07 22:05:02 +000017using namespace llvm;
18
David Blaikiea379b1812011-12-20 02:50:00 +000019void PPCMCAsmInfoDarwin::anchor() { }
20
Daniel Sanders50f17232015-09-15 16:17:27 +000021PPCMCAsmInfoDarwin::PPCMCAsmInfoDarwin(bool is64Bit, const Triple& T) {
Eli Bendersky32aab222013-01-23 16:22:04 +000022 if (is64Bit) {
23 PointerSize = CalleeSaveStackSlotSize = 8;
24 }
Evan Chenga83b37a2011-07-15 02:09:41 +000025 IsLittleEndian = false;
26
Jim Laskey28663c72006-12-21 20:26:09 +000027 CommentString = ";";
Rafael Espindola5164e6e2011-05-02 15:58:16 +000028 ExceptionsType = ExceptionHandling::DwarfCFI;
Jim Grosbach693e36a2009-08-11 00:09:57 +000029
Daniel Dunbar86c065d2009-08-13 17:03:38 +000030 if (!is64Bit)
Craig Topper062a2ba2014-04-25 05:30:21 +000031 Data64bitsDirective = nullptr; // We can't emit a 64-bit unit in PPC32 mode.
Rafael Espindola1c8ac8f2010-12-04 03:21:47 +000032
Chris Lattner96db1ab2009-08-11 23:03:40 +000033 AssemblerDialect = 1; // New-Style mnemonics.
Dale Johannesen237b1c12010-01-06 02:21:00 +000034 SupportsDebugInformation= true; // Debug information.
David Fang1b018492013-12-10 21:37:41 +000035
Iain Sandoe68038582013-12-13 15:46:48 +000036 // The installed assembler for OSX < 10.6 lacks some directives.
David Fang1b018492013-12-10 21:37:41 +000037 // FIXME: this should really be a check on the assembler characteristics
38 // rather than OS version
Daniel Sanders50f17232015-09-15 16:17:27 +000039 if (T.isMacOSX() && T.isMacOSXVersionLT(10, 6))
David Fang1b018492013-12-10 21:37:41 +000040 HasWeakDefCanBeHiddenDirective = false;
Daniel Sanders753e1762014-02-13 14:44:26 +000041
42 UseIntegratedAssembler = true;
Jim Laskey28663c72006-12-21 20:26:09 +000043}
44
Joerg Sonnenberger5f233fc2014-08-04 18:46:13 +000045void PPCELFMCAsmInfo::anchor() { }
David Blaikiea379b1812011-12-20 02:50:00 +000046
Daniel Sanders50f17232015-09-15 16:17:27 +000047PPCELFMCAsmInfo::PPCELFMCAsmInfo(bool is64Bit, const Triple& T) {
Rafael Espindola86bd6a12015-03-05 18:55:50 +000048 // FIXME: This is not always needed. For example, it is not needed in the
49 // v2 abi.
50 NeedsLocalForSize = true;
51
Eli Benderskyf7595262013-01-23 17:12:15 +000052 if (is64Bit) {
53 PointerSize = CalleeSaveStackSlotSize = 8;
54 }
Daniel Sanders50f17232015-09-15 16:17:27 +000055 IsLittleEndian = T.getArch() == Triple::ppc64le;
Evan Chengde4ae462011-08-01 19:43:05 +000056
Rafael Espindola4536b9a2010-02-06 03:32:21 +000057 // ".comm align is in bytes but .align is pow-2."
58 AlignmentIsInBytes = false;
59
Jim Laskey28663c72006-12-21 20:26:09 +000060 CommentString = "#";
Rafael Espindola43c4e242013-10-16 01:34:32 +000061
Bruno Cardoso Lopes62e6a8b2009-08-13 23:30:21 +000062 // Uses '.section' before '.bss' directive
63 UsesELFSectionDirectiveForBSS = true;
Nick Lewycky5805c462007-07-25 03:48:45 +000064
Nicolas Geoffray80c741e2007-12-21 12:19:44 +000065 // Debug Information
Nicolas Geoffray80c741e2007-12-21 12:19:44 +000066 SupportsDebugInformation = true;
Nicolas Geoffray80c741e2007-12-21 12:19:44 +000067
David Majnemer0c58bc62013-09-25 10:47:21 +000068 DollarIsPC = true;
69
Nicolas Geoffray80c741e2007-12-21 12:19:44 +000070 // Set up DWARF directives
Ulrich Weigand32d725b2013-06-12 14:46:54 +000071 MinInstAlignment = 4;
Nicolas Geoffray80c741e2007-12-21 12:19:44 +000072
73 // Exceptions handling
Roman Divacky10a448d2012-09-12 15:29:32 +000074 ExceptionsType = ExceptionHandling::DwarfCFI;
Chris Lattner7faf1fd2009-08-11 22:06:07 +000075
76 ZeroDirective = "\t.space\t";
Craig Topper062a2ba2014-04-25 05:30:21 +000077 Data64bitsDirective = is64Bit ? "\t.quad\t" : nullptr;
Ulrich Weigand266db7f2013-07-08 20:20:51 +000078 AssemblerDialect = 1; // New-Style mnemonics.
Joerg Sonnenbergerb604f822014-08-04 18:45:10 +000079 LCOMMDirectiveAlignmentType = LCOMM::ByteAlignment;
Daniel Sanders753e1762014-02-13 14:44:26 +000080
Ulrich Weigand6b577e22015-01-13 19:43:45 +000081 UseIntegratedAssembler = true;
Jim Laskey28663c72006-12-21 20:26:09 +000082}
Anton Korobeynikovd73396b2008-02-27 23:49:15 +000083