blob: 11411d997bb3b1a6605fee6d9295da8a7d1fd907 [file] [log] [blame]
Jia Liu9f610112012-02-17 08:55:11 +00001//===-- MipsMCAsmInfo.cpp - Mips Asm Properties ---------------------------===//
Bruno Cardoso Lopes35e43c42007-06-06 07:42:06 +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.
Bruno Cardoso Lopes35e43c42007-06-06 07:42:06 +00007//
Akira Hatanakae2489122011-04-15 21:51:11 +00008//===----------------------------------------------------------------------===//
Bruno Cardoso Lopes35e43c42007-06-06 07:42:06 +00009//
Chris Lattner7b26fce2009-08-22 20:48:53 +000010// This file contains the declarations of the MipsMCAsmInfo properties.
Bruno Cardoso Lopes35e43c42007-06-06 07:42:06 +000011//
Akira Hatanakae2489122011-04-15 21:51:11 +000012//===----------------------------------------------------------------------===//
Bruno Cardoso Lopes35e43c42007-06-06 07:42:06 +000013
Chris Lattner7b26fce2009-08-22 20:48:53 +000014#include "MipsMCAsmInfo.h"
Daniel Sanders50f17232015-09-15 16:17:27 +000015#include "llvm/ADT/Triple.h"
Evan Chenga83b37a2011-07-15 02:09:41 +000016
Bruno Cardoso Lopes35e43c42007-06-06 07:42:06 +000017using namespace llvm;
18
David Blaikiea379b1812011-12-20 02:50:00 +000019void MipsMCAsmInfo::anchor() { }
20
Daniel Sanders50f17232015-09-15 16:17:27 +000021MipsMCAsmInfo::MipsMCAsmInfo(const Triple &TheTriple) {
Simon Atanasyanc986eb52017-04-10 19:42:44 +000022 IsLittleEndian = TheTriple.isLittleEndian();
Evan Chenga83b37a2011-07-15 02:09:41 +000023
Daniel Sanders50f17232015-09-15 16:17:27 +000024 if ((TheTriple.getArch() == Triple::mips64el) ||
25 (TheTriple.getArch() == Triple::mips64)) {
Konstantin Zhuravlyovdc77b2e2017-04-17 17:41:25 +000026 CodePointerSize = CalleeSaveStackSlotSize = 8;
Eli Bendersky32aab222013-01-23 16:22:04 +000027 }
Jack Carter9e28cd32013-01-08 18:53:20 +000028
Daniel Sanders6a738832016-07-19 10:49:03 +000029 // 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 = "$";
36 }
37
Bruno Cardoso Lopes80ab8f92008-07-14 14:42:54 +000038 AlignmentIsInBytes = false;
Akira Hatanakaf2bcad92011-07-01 01:04:43 +000039 Data16bitsDirective = "\t.2byte\t";
Akira Hatanakaaa560002011-05-26 18:59:03 +000040 Data32bitsDirective = "\t.4byte\t";
Akira Hatanakacf10f082011-12-20 22:52:19 +000041 Data64bitsDirective = "\t.8byte\t";
Bruno Cardoso Lopes80ab8f92008-07-14 14:42:54 +000042 CommentString = "#";
Bruno Cardoso Lopes80ab8f92008-07-14 14:42:54 +000043 ZeroDirective = "\t.space\t";
Chris Lattner19bd0392010-01-25 21:10:10 +000044 GPRel32Directive = "\t.gpword\t";
Akira Hatanakaf0b08442012-02-03 04:33:00 +000045 GPRel64Directive = "\t.gpdword\t";
Simon Atanasyaneb9ed612016-08-22 16:18:42 +000046 DTPRel32Directive = "\t.dtprelword\t";
47 DTPRel64Directive = "\t.dtpreldword\t";
48 TPRel32Directive = "\t.tprelword\t";
49 TPRel64Directive = "\t.tpreldword\t";
Rafael Espindolaf4917042014-06-24 22:45:16 +000050 UseAssignmentForEHBegin = true;
Akira Hatanakaaa560002011-05-26 18:59:03 +000051 SupportsDebugInformation = true;
52 ExceptionsType = ExceptionHandling::DwarfCFI;
Akira Hatanaka9c6028f2011-07-07 23:56:50 +000053 DwarfRegNumForCFI = true;
Daniel Sanders3feeb9c2016-08-08 11:50:25 +000054 HasMipsExpressions = true;
Daniel Sanderse160f832016-05-14 12:43:08 +000055
56 // Enable IAS by default for O32.
57 if (TheTriple.getArch() == Triple::mips ||
58 TheTriple.getArch() == Triple::mipsel)
59 UseIntegratedAssembler = true;
Simon Dardis2f9bb162016-09-15 13:13:01 +000060
61 // Enable IAS by default for Debian mips64/mips64el.
62 if (TheTriple.getEnvironment() == Triple::GNUABI64)
63 UseIntegratedAssembler = true;
Bruno Cardoso Lopes35e43c42007-06-06 07:42:06 +000064}