1//===-- MipsMCAsmInfo.h - Mips Asm Info ------------------------*- C++ -*--===//
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 declaration of the MipsMCAsmInfo class.
10//
11//===----------------------------------------------------------------------===//
12
13#ifndef LLVM_LIB_TARGET_MIPS_MCTARGETDESC_MIPSMCASMINFO_H
14#define LLVM_LIB_TARGET_MIPS_MCTARGETDESC_MIPSMCASMINFO_H
15
16#include "llvm/MC/MCAsmInfoCOFF.h"
17#include "llvm/MC/MCAsmInfoELF.h"
18#include "llvm/MC/MCFixup.h"
19
20namespace llvm {
21class Triple;
22
23class MipsELFMCAsmInfo : public MCAsmInfoELF {
24 void anchor() override;
25
26public:
27 explicit MipsELFMCAsmInfo(const Triple &TheTriple,
28 const MCTargetOptions &Options);
29 void printSpecifierExpr(raw_ostream &OS,
30 const MCSpecifierExpr &Expr) const override;
31 bool evaluateAsRelocatableImpl(const MCSpecifierExpr &Expr, MCValue &Res,
32 const MCAssembler *Asm) const override;
33 bool usesCompInstByteOrder(const MCSubtargetInfo &STI) const override;
34};
35
36class MipsCOFFMCAsmInfo : public MCAsmInfoGNUCOFF {
37 void anchor() override;
38
39public:
40 explicit MipsCOFFMCAsmInfo(const MCTargetOptions &Options);
41 void printSpecifierExpr(raw_ostream &OS,
42 const MCSpecifierExpr &Expr) const override;
43 bool evaluateAsRelocatableImpl(const MCSpecifierExpr &Expr, MCValue &Res,
44 const MCAssembler *Asm) const override;
45};
46
47namespace Mips {
48using Specifier = uint16_t;
49enum {
50 S_None,
51 S_CALL_HI16 = FirstTargetFixupKind,
52 S_CALL_LO16,
53 S_DTPREL,
54 S_DTPREL_HI,
55 S_DTPREL_LO,
56 S_GOT,
57 S_GOTTPREL,
58 S_GOT_CALL,
59 S_GOT_DISP,
60 S_GOT_HI16,
61 S_GOT_LO16,
62 S_GOT_OFST,
63 S_GOT_PAGE,
64 S_GPREL,
65 S_HI,
66 S_HIGHER,
67 S_HIGHEST,
68 S_LO,
69 S_NEG,
70 S_PCREL_HI16,
71 S_PCREL_LO16,
72 S_TLSGD,
73 S_TLSLDM,
74 S_TPREL_HI,
75 S_TPREL_LO,
76 S_Special,
77};
78
79bool isGpOff(const MCSpecifierExpr &E);
80const MCSpecifierExpr *createGpOff(const MCExpr *Expr, Specifier S,
81 MCContext &Ctx);
82}
83
84} // namespace llvm
85
86#endif
87