LLVM  10.0.0svn
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/Support/DataTypes.h"
21 
22 namespace llvm {
23 
24 /// MipsII - This namespace holds all of the target specific flags that
25 /// instruction info tracks.
26 ///
27 namespace MipsII {
28  /// Target Operand Flag enum.
29  enum TOF {
30  //===------------------------------------------------------------------===//
31  // Mips Specific MachineOperand flags.
32 
34 
35  /// MO_GOT - Represents the offset into the global offset table at which
36  /// the address the relocation entry symbol resides during execution.
38 
39  /// MO_GOT_CALL - Represents the offset into the global offset table at
40  /// which the address of a call site relocation entry symbol resides
41  /// during execution. This is different from the above since this flag
42  /// can only be present in call instructions.
44 
45  /// MO_GPREL - Represents the offset from the current gp value to be used
46  /// for the relocatable object file being produced.
48 
49  /// MO_ABS_HI/LO - Represents the hi or low part of an absolute symbol
50  /// address.
53 
54  /// MO_TLSGD - Represents the offset into the global offset table at which
55  // the module ID and TSL block offset reside during execution (General
56  // Dynamic TLS).
58 
59  /// MO_TLSLDM - Represents the offset into the global offset table at which
60  // the module ID and TSL block offset reside during execution (Local
61  // Dynamic TLS).
65 
66  /// MO_GOTTPREL - Represents the offset from the thread pointer (Initial
67  // Exec TLS).
69 
70  /// MO_TPREL_HI/LO - Represents the hi and low part of the offset from
71  // the thread pointer (Local Exec TLS).
74 
75  // N32/64 Flags.
81 
82  /// MO_HIGHER/HIGHEST - Represents the highest or higher half word of a
83  /// 64-bit symbol address.
86 
87  /// MO_GOT_HI16/LO16, MO_CALL_HI16/LO16 - Relocations used for large GOTs.
92 
93  /// Helper operand used to generate R_MIPS_JALR
95  };
96 
97  enum {
98  //===------------------------------------------------------------------===//
99  // Instruction encodings. These are the standard/most common forms for
100  // Mips instructions.
101  //
102 
103  // Pseudo - This represents an instruction that is a pseudo instruction
104  // or one that has not been implemented yet. It is illegal to code generate
105  // it, but tolerated for intermediate implementation stages.
106  Pseudo = 0,
107 
108  /// FrmR - This form is for instructions of the format R.
109  FrmR = 1,
110  /// FrmI - This form is for instructions of the format I.
111  FrmI = 2,
112  /// FrmJ - This form is for instructions of the format J.
113  FrmJ = 3,
114  /// FrmFR - This form is for instructions of the format FR.
115  FrmFR = 4,
116  /// FrmFI - This form is for instructions of the format FI.
117  FrmFI = 5,
118  /// FrmOther - This form is for instructions that have no specific format.
119  FrmOther = 6,
120 
121  FormMask = 15,
122  /// IsCTI - Instruction is a Control Transfer Instruction.
123  IsCTI = 1 << 4,
124  /// HasForbiddenSlot - Instruction has a forbidden slot.
126  /// IsPCRelativeLoad - A Load instruction with implicit source register
127  /// ($pc) with explicit offset and destination register
129  /// HasFCCRegOperand - Instruction uses an $fcc<x> register.
131 
132  };
133 }
134 }
135 
136 #endif
This class represents lattice values for constants.
Definition: AllocatorList.h:23
MO_TLSLDM - Represents the offset into the global offset table at which.
Definition: MipsBaseInfo.h:62
MO_HIGHER/HIGHEST - Represents the highest or higher half word of a 64-bit symbol address...
Definition: MipsBaseInfo.h:84
MO_GOT_HI16/LO16, MO_CALL_HI16/LO16 - Relocations used for large GOTs.
Definition: MipsBaseInfo.h:88
MO_TLSGD - Represents the offset into the global offset table at which.
Definition: MipsBaseInfo.h:57
FrmFR - This form is for instructions of the format FR.
Definition: MipsBaseInfo.h:115
FrmJ - This form is for instructions of the format J.
Definition: MipsBaseInfo.h:113
FrmFI - This form is for instructions of the format FI.
Definition: MipsBaseInfo.h:117
MO_ABS_HI/LO - Represents the hi or low part of an absolute symbol address.
Definition: MipsBaseInfo.h:51
HasForbiddenSlot - Instruction has a forbidden slot.
Definition: MipsBaseInfo.h:125
MO_GPREL - Represents the offset from the current gp value to be used for the relocatable object file...
Definition: MipsBaseInfo.h:47
MO_GOT_CALL - Represents the offset into the global offset table at which the address of a call site ...
Definition: MipsBaseInfo.h:43
MO_GOTTPREL - Represents the offset from the thread pointer (Initial.
Definition: MipsBaseInfo.h:68
MO_GOT - Represents the offset into the global offset table at which the address the relocation entry...
Definition: MipsBaseInfo.h:37
FrmOther - This form is for instructions that have no specific format.
Definition: MipsBaseInfo.h:119
MO_TPREL_HI/LO - Represents the hi and low part of the offset from.
Definition: MipsBaseInfo.h:72
HasFCCRegOperand - Instruction uses an $fcc<x> register.
Definition: MipsBaseInfo.h:130
IsCTI - Instruction is a Control Transfer Instruction.
Definition: MipsBaseInfo.h:123
IsPCRelativeLoad - A Load instruction with implicit source register ($pc) with explicit offset and de...
Definition: MipsBaseInfo.h:128
TOF
Target Operand Flag enum.
Definition: MipsBaseInfo.h:29
FrmI - This form is for instructions of the format I.
Definition: MipsBaseInfo.h:111
FrmR - This form is for instructions of the format R.
Definition: MipsBaseInfo.h:109
Helper operand used to generate R_MIPS_JALR.
Definition: MipsBaseInfo.h:94