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