xref: /freebsd/contrib/llvm-project/llvm/lib/Target/Mips/MCTargetDesc/MipsMCAsmInfo.cpp (revision 1631382cf2820245cc72965498ff174bb548dd63)
1 //===-- MipsMCAsmInfo.cpp - Mips Asm Properties ---------------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file contains the declarations of the MipsMCAsmInfo properties.
10 //
11 //===----------------------------------------------------------------------===//
12 
13 #include "MipsMCAsmInfo.h"
14 #include "MipsABIInfo.h"
15 #include "llvm/TargetParser/Triple.h"
16 
17 using namespace llvm;
18 
19 void MipsMCAsmInfo::anchor() { }
20 
21 MipsMCAsmInfo::MipsMCAsmInfo(const Triple &TheTriple,
22                              const MCTargetOptions &Options) {
23   IsLittleEndian = TheTriple.isLittleEndian();
24 
25   MipsABIInfo ABI = MipsABIInfo::computeTargetABI(TheTriple, "", Options);
26 
27   if (TheTriple.isMIPS64() && !ABI.IsN32())
28     CodePointerSize = CalleeSaveStackSlotSize = 8;
29 
30   if (ABI.IsO32())
31     PrivateGlobalPrefix = "$";
32   else if (ABI.IsN32() || ABI.IsN64())
33     PrivateGlobalPrefix = ".L";
34   PrivateLabelPrefix = PrivateGlobalPrefix;
35 
36   AlignmentIsInBytes          = false;
37   Data16bitsDirective         = "\t.2byte\t";
38   Data32bitsDirective         = "\t.4byte\t";
39   Data64bitsDirective         = "\t.8byte\t";
40   CommentString               = "#";
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;
53 }
54