LLVM: lib/Target/LoongArch/LoongArchMCInstLower.cpp Source File (original) (raw)

1

2

3

4

5

6

7

8

9

10

11

12

13

23

24using namespace llvm;

25

30

32 default:

36 break;

39 Kind = ELF::R_LARCH_B26;

40 break;

42 Kind = ELF::R_LARCH_PCALA_HI20;

43 break;

45 Kind = ELF::R_LARCH_PCALA_LO12;

46 break;

48 Kind = ELF::R_LARCH_PCALA64_LO20;

49 break;

51 Kind = ELF::R_LARCH_PCALA64_HI12;

52 break;

54 Kind = ELF::R_LARCH_GOT_PC_HI20;

55 break;

57 Kind = ELF::R_LARCH_GOT_PC_LO12;

58 break;

60 Kind = ELF::R_LARCH_GOT64_PC_LO20;

61 break;

63 Kind = ELF::R_LARCH_GOT64_PC_HI12;

64 break;

66 Kind = ELF::R_LARCH_TLS_LE_HI20;

67 break;

69 Kind = ELF::R_LARCH_TLS_LE_LO12;

70 break;

72 Kind = ELF::R_LARCH_TLS_LE64_LO20;

73 break;

75 Kind = ELF::R_LARCH_TLS_LE64_HI12;

76 break;

78 Kind = ELF::R_LARCH_TLS_IE_PC_HI20;

79 break;

81 Kind = ELF::R_LARCH_TLS_IE_PC_LO12;

82 break;

84 Kind = ELF::R_LARCH_TLS_IE64_PC_LO20;

85 break;

87 Kind = ELF::R_LARCH_TLS_IE64_PC_HI12;

88 break;

90 Kind = ELF::R_LARCH_TLS_LD_PC_HI20;

91 break;

93 Kind = ELF::R_LARCH_TLS_GD_PC_HI20;

94 break;

96 Kind = ELF::R_LARCH_CALL36;

97 break;

99 Kind = ELF::R_LARCH_TLS_DESC_PC_HI20;

100 break;

102 Kind = ELF::R_LARCH_TLS_DESC_PC_LO12;

103 break;

105 Kind = ELF::R_LARCH_TLS_DESC64_PC_LO20;

106 break;

108 Kind = ELF::R_LARCH_TLS_DESC64_PC_HI12;

109 break;

111 Kind = ELF::R_LARCH_TLS_DESC_LD;

112 break;

114 Kind = ELF::R_LARCH_TLS_DESC_CALL;

115 break;

117 Kind = ELF::R_LARCH_TLS_LE_HI20_R;

118 break;

120 Kind = ELF::R_LARCH_TLS_LE_ADD_R;

121 break;

123 Kind = ELF::R_LARCH_TLS_LE_LO12_R;

124 break;

125

126 }

127

129

133

137}

138

143 default:

145 "lowerLoongArchMachineOperandToMCOperand: unknown operand type");

147

149 return false;

151 break;

153

154 return false;

157 break;

160 break;

163 break;

166 break;

170 break;

174 break;

177 break;

178 }

179 return true;

180}

181

185

190 }

191 return false;

192}

static MCOperand lowerSymbolOperand(const MachineOperand &MO, MCSymbol *Sym, const AsmPrinter &AP)

Definition LoongArchMCInstLower.cpp:26

This class is intended to be used as a driving class for all asm writers.

virtual MCSymbol * GetCPISymbol(unsigned CPID) const

Return the symbol for the specified constant pool entry.

MCSymbol * GetJTISymbol(unsigned JTID, bool isLinkerPrivate=false) const

Return the symbol for the specified jump table entry.

MCSymbol * getSymbolPreferLocal(const GlobalValue &GV) const

Similar to getSymbol() but preferred for references.

MCContext & OutContext

This is the context for the output file that we are streaming.

MCSymbol * GetBlockAddressSymbol(const BlockAddress *BA) const

Return the MCSymbol used to satisfy BlockAddress uses of the specified basic block.

MCSymbol * GetExternalSymbolSymbol(const Twine &Sym) const

Return the MCSymbol for the specified ExternalSymbol.

static const LoongArchMCExpr * create(const MCExpr *Expr, uint16_t S, MCContext &Ctx, bool Hint=false)

static const MCBinaryExpr * createAdd(const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx, SMLoc Loc=SMLoc())

static LLVM_ABI const MCConstantExpr * create(int64_t Value, MCContext &Ctx, bool PrintInHex=false, unsigned SizeInBytes=0)

Context object for machine code objects.

Base class for the full range of assembler expressions which are needed for parsing.

Instances of this class represent a single low-level machine instruction.

void addOperand(const MCOperand Op)

void setOpcode(unsigned Op)

Instances of this class represent operands of the MCInst class.

static MCOperand createExpr(const MCExpr *Val)

static MCOperand createReg(MCRegister Reg)

static MCOperand createImm(int64_t Val)

static const MCSymbolRefExpr * create(const MCSymbol *Symbol, MCContext &Ctx, SMLoc Loc=SMLoc())

MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...

LLVM_ABI MCSymbol * getSymbol() const

Return the MCSymbol for this basic block.

Representation of each machine instruction.

MachineOperand class - Representation of each machine instruction operand.

const GlobalValue * getGlobal() const

MachineBasicBlock * getMBB() const

bool isJTI() const

isJTI - Tests if this is a MO_JumpTableIndex operand.

const BlockAddress * getBlockAddress() const

MachineOperandType getType() const

getType - Returns the MachineOperandType for this operand.

const char * getSymbolName() const

Register getReg() const

getReg - Returns the register number.

@ MO_Immediate

Immediate operand.

@ MO_ConstantPoolIndex

Address of indexed Constant in Constant Pool.

@ MO_GlobalAddress

Address of a global value.

@ MO_RegisterMask

Mask of preserved registers.

@ MO_BlockAddress

Address of a basic block.

@ MO_MachineBasicBlock

MachineBasicBlock reference.

@ MO_Register

Register operand.

@ MO_ExternalSymbol

Name of external global symbol.

@ MO_JumpTableIndex

Address of indexed Jump Table for switch.

int64_t getOffset() const

Return the offset from the symbol in this operand.

bool isMBB() const

isMBB - Tests if this is a MO_MachineBasicBlock operand.

#define llvm_unreachable(msg)

Marks that the current location is not supposed to be reachable.

static bool hasRelaxFlag(const MachineOperand &MO)

static unsigned getDirectFlags(const MachineOperand &MO)

This is an optimization pass for GlobalISel generic memory operations.

bool lowerLoongArchMachineInstrToMCInst(const MachineInstr *MI, MCInst &OutMI, AsmPrinter &AP)

Definition LoongArchMCInstLower.cpp:182

bool lowerLoongArchMachineOperandToMCOperand(const MachineOperand &MO, MCOperand &MCOp, const AsmPrinter &AP)

Definition LoongArchMCInstLower.cpp:139

LLVM_ABI void report_fatal_error(Error Err, bool gen_crash_diag=true)