1 //===-- MipsMCAsmInfo.cpp - Mips Asm Properties ---------------------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file contains the declarations of the MipsMCAsmInfo properties.
12 //===----------------------------------------------------------------------===//
14 #include "MipsMCAsmInfo.h"
15 #include "llvm/ADT/Triple.h"
19 void MipsMCAsmInfo::anchor() { }
21 MipsMCAsmInfo::MipsMCAsmInfo(const Triple &TheTriple) {
22 IsLittleEndian = TheTriple.isLittleEndian();
24 if (TheTriple.isMIPS64()) {
25 CodePointerSize = CalleeSaveStackSlotSize = 8;
28 // FIXME: This condition isn't quite right but it's the best we can do until
29 // this object can identify the ABI. It will misbehave when using O32
30 // on a mips64*-* triple.
31 if (TheTriple.isMIPS32()) {
32 PrivateGlobalPrefix = "$";
33 PrivateLabelPrefix = "$";
36 AlignmentIsInBytes = false;
37 Data16bitsDirective = "\t.2byte\t";
38 Data32bitsDirective = "\t.4byte\t";
39 Data64bitsDirective = "\t.8byte\t";
41 ZeroDirective = "\t.space\t";
42 GPRel32Directive = "\t.gpword\t";
43 GPRel64Directive = "\t.gpdword\t";
44 DTPRel32Directive = "\t.dtprelword\t";
45 DTPRel64Directive = "\t.dtpreldword\t";
46 TPRel32Directive = "\t.tprelword\t";
47 TPRel64Directive = "\t.tpreldword\t";
48 UseAssignmentForEHBegin = true;
49 SupportsDebugInformation = true;
50 ExceptionsType = ExceptionHandling::DwarfCFI;
51 DwarfRegNumForCFI = true;
52 HasMipsExpressions = true;
54 // Enable IAS by default for O32.
55 if (TheTriple.isMIPS32())
56 UseIntegratedAssembler = true;
58 // Enable IAS by default for Debian mips64/mips64el.
59 if (TheTriple.getEnvironment() == Triple::GNUABI64)
60 UseIntegratedAssembler = true;
62 // Enable IAS by default for Android mips64el that uses N64 ABI.
63 if (TheTriple.getArch() == Triple::mips64el && TheTriple.isAndroid())
64 UseIntegratedAssembler = true;
66 // Enable IAS by default for FreeBSD / OpenBSD mips64/mips64el.
67 if (TheTriple.isOSFreeBSD() ||
68 TheTriple.isOSOpenBSD())
69 UseIntegratedAssembler = true;