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.getArch() == Triple::mips64el) ||
25 (TheTriple.getArch() == Triple::mips64)) {
26 CodePointerSize = CalleeSaveStackSlotSize = 8;
29 // FIXME: This condition isn't quite right but it's the best we can do until
30 // this object can identify the ABI. It will misbehave when using O32
31 // on a mips64*-* triple.
32 if ((TheTriple.getArch() == Triple::mipsel) ||
33 (TheTriple.getArch() == Triple::mips)) {
34 PrivateGlobalPrefix = "$";
35 PrivateLabelPrefix = "$";
38 AlignmentIsInBytes = false;
39 Data16bitsDirective = "\t.2byte\t";
40 Data32bitsDirective = "\t.4byte\t";
41 Data64bitsDirective = "\t.8byte\t";
43 ZeroDirective = "\t.space\t";
44 GPRel32Directive = "\t.gpword\t";
45 GPRel64Directive = "\t.gpdword\t";
46 DTPRel32Directive = "\t.dtprelword\t";
47 DTPRel64Directive = "\t.dtpreldword\t";
48 TPRel32Directive = "\t.tprelword\t";
49 TPRel64Directive = "\t.tpreldword\t";
50 UseAssignmentForEHBegin = true;
51 SupportsDebugInformation = true;
52 ExceptionsType = ExceptionHandling::DwarfCFI;
53 DwarfRegNumForCFI = true;
54 HasMipsExpressions = true;
56 // Enable IAS by default for O32.
57 if (TheTriple.getArch() == Triple::mips ||
58 TheTriple.getArch() == Triple::mipsel)
59 UseIntegratedAssembler = true;
61 // Enable IAS by default for Debian mips64/mips64el.
62 if (TheTriple.getEnvironment() == Triple::GNUABI64)
63 UseIntegratedAssembler = true;