LLVM  13.0.0git
MipsBaseInfo.h
Go to the documentation of this file.
1 //===-- MipsBaseInfo.h - Top level definitions for MIPS MC ------*- 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 small standalone helper functions and enum definitions for
10 // the Mips target useful for the compiler back-end and the MC libraries.
11 //
12 //===----------------------------------------------------------------------===//
13 #ifndef LLVM_LIB_TARGET_MIPS_MCTARGETDESC_MIPSBASEINFO_H
14 #define LLVM_LIB_TARGET_MIPS_MCTARGETDESC_MIPSBASEINFO_H
15 
16 #include "MipsFixupKinds.h"
17 #include "MipsMCTargetDesc.h"
18 #include "llvm/MC/MCExpr.h"
19 #include "llvm/MC/MCInstrDesc.h"
20 #include "llvm/Support/DataTypes.h"
22 
23 namespace llvm {
24 
25 /// MipsII - This namespace holds all of the target specific flags that
26 /// instruction info tracks.
27 ///
28 namespace MipsII {
29  /// Target Operand Flag enum.
30  enum TOF {
31  //===------------------------------------------------------------------===//
32  // Mips Specific MachineOperand flags.
33 
35 
36  /// MO_GOT - Represents the offset into the global offset table at which
37  /// the address the relocation entry symbol resides during execution.
39 
40  /// MO_GOT_CALL - Represents the offset into the global offset table at
41  /// which the address of a call site relocation entry symbol resides
42  /// during execution. This is different from the above since this flag
43  /// can only be present in call instructions.
45 
46  /// MO_GPREL - Represents the offset from the current gp value to be used
47  /// for the relocatable object file being produced.
49 
50  /// MO_ABS_HI/LO - Represents the hi or low part of an absolute symbol
51  /// address.
54 
55  /// MO_TLSGD - Represents the offset into the global offset table at which
56  // the module ID and TSL block offset reside during execution (General
57  // Dynamic TLS).
59 
60  /// MO_TLSLDM - Represents the offset into the global offset table at which
61  // the module ID and TSL block offset reside during execution (Local
62  // Dynamic TLS).
66 
67  /// MO_GOTTPREL - Represents the offset from the thread pointer (Initial
68  // Exec TLS).
70 
71  /// MO_TPREL_HI/LO - Represents the hi and low part of the offset from
72  // the thread pointer (Local Exec TLS).
75 
76  // N32/64 Flags.
82 
83  /// MO_HIGHER/HIGHEST - Represents the highest or higher half word of a
84  /// 64-bit symbol address.
87 
88  /// MO_GOT_HI16/LO16, MO_CALL_HI16/LO16 - Relocations used for large GOTs.
93 
94  /// Helper operand used to generate R_MIPS_JALR
96  };
97 
98  enum {
99  //===------------------------------------------------------------------===//
100  // Instruction encodings. These are the standard/most common forms for
101  // Mips instructions.
102  //
103 
104  // Pseudo - This represents an instruction that is a pseudo instruction
105  // or one that has not been implemented yet. It is illegal to code generate
106  // it, but tolerated for intermediate implementation stages.
107  Pseudo = 0,
108 
109  /// FrmR - This form is for instructions of the format R.
110  FrmR = 1,
111  /// FrmI - This form is for instructions of the format I.
112  FrmI = 2,
113  /// FrmJ - This form is for instructions of the format J.
114  FrmJ = 3,
115  /// FrmFR - This form is for instructions of the format FR.
116  FrmFR = 4,
117  /// FrmFI - This form is for instructions of the format FI.
118  FrmFI = 5,
119  /// FrmOther - This form is for instructions that have no specific format.
120  FrmOther = 6,
121 
122  FormMask = 15,
123  /// IsCTI - Instruction is a Control Transfer Instruction.
124  IsCTI = 1 << 4,
125  /// HasForbiddenSlot - Instruction has a forbidden slot.
127  /// HasFCCRegOperand - Instruction uses an $fcc<x> register.
129 
130  };
131 
132  enum OperandType : unsigned {
136  };
137 }
138 }
139 
140 #endif
llvm
Definition: AllocatorList.h:23
llvm::MipsII::FrmOther
@ FrmOther
FrmOther - This form is for instructions that have no specific format.
Definition: MipsBaseInfo.h:120
llvm::MipsII::MO_GOT_LO16
@ MO_GOT_LO16
Definition: MipsBaseInfo.h:90
MCInstrDesc.h
llvm::MipsII::OperandType
OperandType
Definition: MipsBaseInfo.h:132
llvm::MipsII::FrmJ
@ FrmJ
FrmJ - This form is for instructions of the format J.
Definition: MipsBaseInfo.h:114
llvm::MipsII::TOF
TOF
Target Operand Flag enum.
Definition: MipsBaseInfo.h:30
ErrorHandling.h
llvm::MipsII::MO_JALR
@ MO_JALR
Helper operand used to generate R_MIPS_JALR.
Definition: MipsBaseInfo.h:95
llvm::MipsII::MO_DTPREL_HI
@ MO_DTPREL_HI
Definition: MipsBaseInfo.h:64
llvm::MipsII::MO_TPREL_HI
@ MO_TPREL_HI
MO_TPREL_HI/LO - Represents the hi and low part of the offset from.
Definition: MipsBaseInfo.h:73
llvm::MipsII::MO_NO_FLAG
@ MO_NO_FLAG
Definition: MipsBaseInfo.h:34
llvm::MipsII::IsCTI
@ IsCTI
IsCTI - Instruction is a Control Transfer Instruction.
Definition: MipsBaseInfo.h:124
llvm::MipsII::MO_CALL_HI16
@ MO_CALL_HI16
Definition: MipsBaseInfo.h:91
llvm::MipsII::MO_GOTTPREL
@ MO_GOTTPREL
MO_GOTTPREL - Represents the offset from the thread pointer (Initial.
Definition: MipsBaseInfo.h:69
llvm::MipsII::FrmR
@ FrmR
FrmR - This form is for instructions of the format R.
Definition: MipsBaseInfo.h:110
llvm::MipsII::MO_TLSGD
@ MO_TLSGD
MO_TLSGD - Represents the offset into the global offset table at which.
Definition: MipsBaseInfo.h:58
llvm::MipsII::MO_GOT_OFST
@ MO_GOT_OFST
Definition: MipsBaseInfo.h:81
llvm::MipsII::FrmFI
@ FrmFI
FrmFI - This form is for instructions of the format FI.
Definition: MipsBaseInfo.h:118
llvm::MipsII::MO_TLSLDM
@ MO_TLSLDM
MO_TLSLDM - Represents the offset into the global offset table at which.
Definition: MipsBaseInfo.h:63
llvm::MipsII::MO_GOT_HI16
@ MO_GOT_HI16
MO_GOT_HI16/LO16, MO_CALL_HI16/LO16 - Relocations used for large GOTs.
Definition: MipsBaseInfo.h:89
llvm::MipsII::HasForbiddenSlot
@ HasForbiddenSlot
HasForbiddenSlot - Instruction has a forbidden slot.
Definition: MipsBaseInfo.h:126
llvm::MipsII::MO_HIGHEST
@ MO_HIGHEST
Definition: MipsBaseInfo.h:86
llvm::MipsII::MO_ABS_LO
@ MO_ABS_LO
Definition: MipsBaseInfo.h:53
llvm::MipsII::MO_GOT_CALL
@ MO_GOT_CALL
MO_GOT_CALL - Represents the offset into the global offset table at which the address of a call site ...
Definition: MipsBaseInfo.h:44
llvm::MipsII::FrmI
@ FrmI
FrmI - This form is for instructions of the format I.
Definition: MipsBaseInfo.h:112
llvm::MipsII::MO_GOT_DISP
@ MO_GOT_DISP
Definition: MipsBaseInfo.h:79
MipsMCTargetDesc.h
llvm::MipsII::MO_TPREL_LO
@ MO_TPREL_LO
Definition: MipsBaseInfo.h:74
llvm::MipsII::MO_GOT
@ MO_GOT
MO_GOT - Represents the offset into the global offset table at which the address the relocation entry...
Definition: MipsBaseInfo.h:38
llvm::MipsII::MO_GPOFF_LO
@ MO_GPOFF_LO
Definition: MipsBaseInfo.h:78
llvm::MipsII::Pseudo
@ Pseudo
Definition: MipsBaseInfo.h:107
llvm::MipsII::HasFCCRegOperand
@ HasFCCRegOperand
HasFCCRegOperand - Instruction uses an $fcc<x> register.
Definition: MipsBaseInfo.h:128
llvm::MipsII::FormMask
@ FormMask
Definition: MipsBaseInfo.h:122
llvm::MCOI::OPERAND_FIRST_TARGET
@ OPERAND_FIRST_TARGET
Definition: MCInstrDesc.h:76
MipsFixupKinds.h
llvm::MipsII::MO_ABS_HI
@ MO_ABS_HI
MO_ABS_HI/LO - Represents the hi or low part of an absolute symbol address.
Definition: MipsBaseInfo.h:52
llvm::MipsII::MO_GPOFF_HI
@ MO_GPOFF_HI
Definition: MipsBaseInfo.h:77
llvm::MipsII::MO_DTPREL_LO
@ MO_DTPREL_LO
Definition: MipsBaseInfo.h:65
llvm::MipsII::MO_GPREL
@ MO_GPREL
MO_GPREL - Represents the offset from the current gp value to be used for the relocatable object file...
Definition: MipsBaseInfo.h:48
llvm::MipsII::OPERAND_LAST_MIPS_MEM_IMM
@ OPERAND_LAST_MIPS_MEM_IMM
Definition: MipsBaseInfo.h:135
llvm::MipsII::OPERAND_MEM_SIMM9
@ OPERAND_MEM_SIMM9
Definition: MipsBaseInfo.h:134
llvm::MipsII::OPERAND_FIRST_MIPS_MEM_IMM
@ OPERAND_FIRST_MIPS_MEM_IMM
Definition: MipsBaseInfo.h:133
DataTypes.h
llvm::MipsII::MO_CALL_LO16
@ MO_CALL_LO16
Definition: MipsBaseInfo.h:92
llvm::MipsII::FrmFR
@ FrmFR
FrmFR - This form is for instructions of the format FR.
Definition: MipsBaseInfo.h:116
llvm::MipsII::MO_HIGHER
@ MO_HIGHER
MO_HIGHER/HIGHEST - Represents the highest or higher half word of a 64-bit symbol address.
Definition: MipsBaseInfo.h:85
MCExpr.h
llvm::MipsII::MO_GOT_PAGE
@ MO_GOT_PAGE
Definition: MipsBaseInfo.h:80