2012-02-17 16:55:11 +08:00
|
|
|
//===-- MipsMCAsmInfo.cpp - Mips Asm Properties ---------------------------===//
|
2007-06-06 15:42:06 +08:00
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
2007-12-30 04:36:04 +08:00
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
2007-06-06 15:42:06 +08:00
|
|
|
//
|
2011-04-16 05:51:11 +08:00
|
|
|
//===----------------------------------------------------------------------===//
|
2007-06-06 15:42:06 +08:00
|
|
|
//
|
2009-08-23 04:48:53 +08:00
|
|
|
// This file contains the declarations of the MipsMCAsmInfo properties.
|
2007-06-06 15:42:06 +08:00
|
|
|
//
|
2011-04-16 05:51:11 +08:00
|
|
|
//===----------------------------------------------------------------------===//
|
2007-06-06 15:42:06 +08:00
|
|
|
|
2009-08-23 04:48:53 +08:00
|
|
|
#include "MipsMCAsmInfo.h"
|
2015-09-16 00:17:27 +08:00
|
|
|
#include "llvm/ADT/Triple.h"
|
2011-07-15 10:09:41 +08:00
|
|
|
|
2007-06-06 15:42:06 +08:00
|
|
|
using namespace llvm;
|
|
|
|
|
2011-12-20 10:50:00 +08:00
|
|
|
void MipsMCAsmInfo::anchor() { }
|
|
|
|
|
2015-09-16 00:17:27 +08:00
|
|
|
MipsMCAsmInfo::MipsMCAsmInfo(const Triple &TheTriple) {
|
2017-04-11 03:42:44 +08:00
|
|
|
IsLittleEndian = TheTriple.isLittleEndian();
|
2011-07-15 10:09:41 +08:00
|
|
|
|
2015-09-16 00:17:27 +08:00
|
|
|
if ((TheTriple.getArch() == Triple::mips64el) ||
|
|
|
|
(TheTriple.getArch() == Triple::mips64)) {
|
2017-04-18 01:41:25 +08:00
|
|
|
CodePointerSize = CalleeSaveStackSlotSize = 8;
|
2013-01-24 00:22:04 +08:00
|
|
|
}
|
2013-01-09 02:53:20 +08:00
|
|
|
|
2016-07-19 18:49:03 +08:00
|
|
|
// FIXME: This condition isn't quite right but it's the best we can do until
|
|
|
|
// this object can identify the ABI. It will misbehave when using O32
|
|
|
|
// on a mips64*-* triple.
|
|
|
|
if ((TheTriple.getArch() == Triple::mipsel) ||
|
|
|
|
(TheTriple.getArch() == Triple::mips)) {
|
|
|
|
PrivateGlobalPrefix = "$";
|
|
|
|
PrivateLabelPrefix = "$";
|
|
|
|
}
|
|
|
|
|
2008-07-14 22:42:54 +08:00
|
|
|
AlignmentIsInBytes = false;
|
2011-07-01 09:04:43 +08:00
|
|
|
Data16bitsDirective = "\t.2byte\t";
|
2011-05-27 02:59:03 +08:00
|
|
|
Data32bitsDirective = "\t.4byte\t";
|
2011-12-21 06:52:19 +08:00
|
|
|
Data64bitsDirective = "\t.8byte\t";
|
2008-07-14 22:42:54 +08:00
|
|
|
CommentString = "#";
|
|
|
|
ZeroDirective = "\t.space\t";
|
2010-01-26 05:10:10 +08:00
|
|
|
GPRel32Directive = "\t.gpword\t";
|
2012-02-03 12:33:00 +08:00
|
|
|
GPRel64Directive = "\t.gpdword\t";
|
2016-08-23 00:18:42 +08:00
|
|
|
DTPRel32Directive = "\t.dtprelword\t";
|
|
|
|
DTPRel64Directive = "\t.dtpreldword\t";
|
|
|
|
TPRel32Directive = "\t.tprelword\t";
|
|
|
|
TPRel64Directive = "\t.tpreldword\t";
|
2014-06-25 06:45:16 +08:00
|
|
|
UseAssignmentForEHBegin = true;
|
2011-05-27 02:59:03 +08:00
|
|
|
SupportsDebugInformation = true;
|
|
|
|
ExceptionsType = ExceptionHandling::DwarfCFI;
|
2011-07-08 07:56:50 +08:00
|
|
|
DwarfRegNumForCFI = true;
|
2016-08-08 19:50:25 +08:00
|
|
|
HasMipsExpressions = true;
|
2016-05-14 20:43:08 +08:00
|
|
|
|
|
|
|
// Enable IAS by default for O32.
|
|
|
|
if (TheTriple.getArch() == Triple::mips ||
|
|
|
|
TheTriple.getArch() == Triple::mipsel)
|
|
|
|
UseIntegratedAssembler = true;
|
2016-09-15 21:13:01 +08:00
|
|
|
|
|
|
|
// Enable IAS by default for Debian mips64/mips64el.
|
|
|
|
if (TheTriple.getEnvironment() == Triple::GNUABI64)
|
|
|
|
UseIntegratedAssembler = true;
|
2007-06-06 15:42:06 +08:00
|
|
|
}
|