LLVM 20.0.0git
|
#include "Target/PowerPC/MCTargetDesc/PPCMCCodeEmitter.h"
Additional Inherited Members | |
Protected Member Functions inherited from llvm::MCCodeEmitter | |
MCCodeEmitter () | |
Definition at line 25 of file PPCMCCodeEmitter.h.
|
inline |
Definition at line 31 of file PPCMCCodeEmitter.h.
|
delete |
|
overridedefault |
|
overridevirtual |
Encode the given Inst
to bytes and append to CB
.
Implements llvm::MCCodeEmitter.
Definition at line 503 of file PPCMCCodeEmitter.cpp.
References llvm::big, getBinaryCodeForInstr(), getInstSizeInBytes(), llvm::little, llvm_unreachable, MI, and Size.
unsigned PPCMCCodeEmitter::get_crbitm_encoding | ( | const MCInst & | MI, |
unsigned | OpNo, | ||
SmallVectorImpl< MCFixup > & | Fixups, | ||
const MCSubtargetInfo & | STI | ||
) | const |
Definition at line 457 of file PPCMCCodeEmitter.cpp.
References assert(), llvm::MCRegisterInfo::getEncodingValue(), llvm::MCOperand::getReg(), llvm::MCContext::getRegisterInfo(), and MI.
unsigned PPCMCCodeEmitter::getAbsCondBrEncoding | ( | const MCInst & | MI, |
unsigned | OpNo, | ||
SmallVectorImpl< MCFixup > & | Fixups, | ||
const MCSubtargetInfo & | STI | ||
) | const |
Definition at line 179 of file PPCMCCodeEmitter.cpp.
References llvm::MCFixup::create(), llvm::PPC::fixup_ppc_brcond14abs, llvm::MCOperand::getExpr(), getMachineOpValue(), llvm::MCOperand::isImm(), llvm::MCOperand::isReg(), and MI.
unsigned PPCMCCodeEmitter::getAbsDirectBrEncoding | ( | const MCInst & | MI, |
unsigned | OpNo, | ||
SmallVectorImpl< MCFixup > & | Fixups, | ||
const MCSubtargetInfo & | STI | ||
) | const |
Definition at line 166 of file PPCMCCodeEmitter.cpp.
References llvm::MCFixup::create(), llvm::PPC::fixup_ppc_br24abs, llvm::MCOperand::getExpr(), getMachineOpValue(), llvm::MCOperand::isImm(), llvm::MCOperand::isReg(), and MI.
uint64_t llvm::PPCMCCodeEmitter::getBinaryCodeForInstr | ( | const MCInst & | MI, |
SmallVectorImpl< MCFixup > & | Fixups, | ||
const MCSubtargetInfo & | STI | ||
) | const |
Referenced by encodeInstruction().
unsigned PPCMCCodeEmitter::getCondBrEncoding | ( | const MCInst & | MI, |
unsigned | OpNo, | ||
SmallVectorImpl< MCFixup > & | Fixups, | ||
const MCSubtargetInfo & | STI | ||
) | const |
Definition at line 154 of file PPCMCCodeEmitter.cpp.
References llvm::MCFixup::create(), llvm::PPC::fixup_ppc_brcond14, llvm::MCOperand::getExpr(), getMachineOpValue(), llvm::MCOperand::isImm(), llvm::MCOperand::isReg(), and MI.
unsigned PPCMCCodeEmitter::getDirectBrEncoding | ( | const MCInst & | MI, |
unsigned | OpNo, | ||
SmallVectorImpl< MCFixup > & | Fixups, | ||
const MCSubtargetInfo & | STI | ||
) | const |
Definition at line 43 of file PPCMCCodeEmitter.cpp.
References llvm::MCFixup::create(), llvm::PPC::fixup_ppc_br24, llvm::PPC::fixup_ppc_br24_notoc, llvm::MCOperand::getExpr(), getMachineOpValue(), llvm::MCOperand::isImm(), isNoTOCCallInstr(), llvm::MCOperand::isReg(), and MI.
Referenced by getTLSCallEncoding().
uint64_t PPCMCCodeEmitter::getDispRI34Encoding | ( | const MCInst & | MI, |
unsigned | OpNo, | ||
SmallVectorImpl< MCFixup > & | Fixups, | ||
const MCSubtargetInfo & | STI | ||
) | const |
Definition at line 387 of file PPCMCCodeEmitter.cpp.
References getMachineOpValue(), and MI.
uint64_t PPCMCCodeEmitter::getDispRI34PCRelEncoding | ( | const MCInst & | MI, |
unsigned | OpNo, | ||
SmallVectorImpl< MCFixup > & | Fixups, | ||
const MCSubtargetInfo & | STI | ||
) | const |
Definition at line 304 of file PPCMCCodeEmitter.cpp.
References llvm::MCBinaryExpr::Add, assert(), llvm::MCExpr::Binary, llvm::MCExpr::Constant, llvm::MCFixup::create(), llvm::PPC::fixup_ppc_pcrel34, llvm::MCOperand::getExpr(), llvm::MCExpr::getKind(), llvm::MCSymbolRefExpr::getKind(), llvm::MCBinaryExpr::getLHS(), getMachineOpValue(), llvm::MCBinaryExpr::getOpcode(), llvm::MCBinaryExpr::getRHS(), llvm::MCOperand::isExpr(), LHS, llvm_unreachable, MI, RHS, std::swap(), llvm::MCExpr::SymbolRef, llvm::MCSymbolRefExpr::VK_PCREL, llvm::MCSymbolRefExpr::VK_PPC_GOT_PCREL, llvm::MCSymbolRefExpr::VK_PPC_GOT_TLSGD_PCREL, llvm::MCSymbolRefExpr::VK_PPC_GOT_TLSLD_PCREL, and llvm::MCSymbolRefExpr::VK_PPC_GOT_TPREL_PCREL.
unsigned PPCMCCodeEmitter::getDispRIEncoding | ( | const MCInst & | MI, |
unsigned | OpNo, | ||
SmallVectorImpl< MCFixup > & | Fixups, | ||
const MCSubtargetInfo & | STI | ||
) | const |
Definition at line 244 of file PPCMCCodeEmitter.cpp.
References llvm::MCFixup::create(), llvm::PPC::fixup_ppc_half16, llvm::MCOperand::getExpr(), getMachineOpValue(), llvm::MCOperand::isImm(), and MI.
unsigned PPCMCCodeEmitter::getDispRIHashEncoding | ( | const MCInst & | MI, |
unsigned | OpNo, | ||
SmallVectorImpl< MCFixup > & | Fixups, | ||
const MCSubtargetInfo & | STI | ||
) | const |
Definition at line 289 of file PPCMCCodeEmitter.cpp.
References assert(), llvm::MCOperand::getImm(), llvm::MCOperand::isImm(), and MI.
unsigned PPCMCCodeEmitter::getDispRIX16Encoding | ( | const MCInst & | MI, |
unsigned | OpNo, | ||
SmallVectorImpl< MCFixup > & | Fixups, | ||
const MCSubtargetInfo & | STI | ||
) | const |
Definition at line 272 of file PPCMCCodeEmitter.cpp.
References assert(), llvm::MCFixup::create(), llvm::PPC::fixup_ppc_half16dq, llvm::MCOperand::getExpr(), llvm::MCOperand::getImm(), getMachineOpValue(), llvm::MCOperand::isImm(), and MI.
unsigned PPCMCCodeEmitter::getDispRIXEncoding | ( | const MCInst & | MI, |
unsigned | OpNo, | ||
SmallVectorImpl< MCFixup > & | Fixups, | ||
const MCSubtargetInfo & | STI | ||
) | const |
Definition at line 258 of file PPCMCCodeEmitter.cpp.
References llvm::MCFixup::create(), llvm::PPC::fixup_ppc_half16ds, llvm::MCOperand::getExpr(), getMachineOpValue(), llvm::MCOperand::isImm(), and MI.
unsigned PPCMCCodeEmitter::getDispSPE2Encoding | ( | const MCInst & | MI, |
unsigned | OpNo, | ||
SmallVectorImpl< MCFixup > & | Fixups, | ||
const MCSubtargetInfo & | STI | ||
) | const |
Definition at line 416 of file PPCMCCodeEmitter.cpp.
References assert(), getMachineOpValue(), llvm::MCOperand::isImm(), and MI.
unsigned PPCMCCodeEmitter::getDispSPE4Encoding | ( | const MCInst & | MI, |
unsigned | OpNo, | ||
SmallVectorImpl< MCFixup > & | Fixups, | ||
const MCSubtargetInfo & | STI | ||
) | const |
Definition at line 406 of file PPCMCCodeEmitter.cpp.
References assert(), getMachineOpValue(), llvm::MCOperand::isImm(), and MI.
unsigned PPCMCCodeEmitter::getDispSPE8Encoding | ( | const MCInst & | MI, |
unsigned | OpNo, | ||
SmallVectorImpl< MCFixup > & | Fixups, | ||
const MCSubtargetInfo & | STI | ||
) | const |
Definition at line 396 of file PPCMCCodeEmitter.cpp.
References assert(), getMachineOpValue(), llvm::MCOperand::isImm(), and MI.
unsigned PPCMCCodeEmitter::getImm16Encoding | ( | const MCInst & | MI, |
unsigned | OpNo, | ||
SmallVectorImpl< MCFixup > & | Fixups, | ||
const MCSubtargetInfo & | STI | ||
) | const |
Definition at line 202 of file PPCMCCodeEmitter.cpp.
References llvm::MCFixup::create(), llvm::PPC::fixup_ppc_half16, llvm::MCOperand::getExpr(), getMachineOpValue(), llvm::MCOperand::isImm(), llvm::MCOperand::isReg(), and MI.
uint64_t PPCMCCodeEmitter::getImm34Encoding | ( | const MCInst & | MI, |
unsigned | OpNo, | ||
SmallVectorImpl< MCFixup > & | Fixups, | ||
const MCSubtargetInfo & | STI, | ||
MCFixupKind | Fixup | ||
) | const |
Definition at line 214 of file PPCMCCodeEmitter.cpp.
References assert(), llvm::MCFixup::create(), Fixup, llvm::MCOperand::getExpr(), getMachineOpValue(), llvm::MCOperand::isImm(), llvm::MCOperand::isReg(), and MI.
Referenced by getImm34EncodingNoPCRel(), and getImm34EncodingPCRel().
uint64_t PPCMCCodeEmitter::getImm34EncodingNoPCRel | ( | const MCInst & | MI, |
unsigned | OpNo, | ||
SmallVectorImpl< MCFixup > & | Fixups, | ||
const MCSubtargetInfo & | STI | ||
) | const |
Definition at line 229 of file PPCMCCodeEmitter.cpp.
References llvm::PPC::fixup_ppc_imm34, getImm34Encoding(), and MI.
uint64_t PPCMCCodeEmitter::getImm34EncodingPCRel | ( | const MCInst & | MI, |
unsigned | OpNo, | ||
SmallVectorImpl< MCFixup > & | Fixups, | ||
const MCSubtargetInfo & | STI | ||
) | const |
Definition at line 237 of file PPCMCCodeEmitter.cpp.
References llvm::PPC::fixup_ppc_pcrel34, getImm34Encoding(), and MI.
Definition at line 533 of file PPCMCCodeEmitter.cpp.
References llvm::MCInstrInfo::get(), and MI.
Referenced by encodeInstruction().
uint64_t PPCMCCodeEmitter::getMachineOpValue | ( | const MCInst & | MI, |
const MCOperand & | MO, | ||
SmallVectorImpl< MCFixup > & | Fixups, | ||
const MCSubtargetInfo & | STI | ||
) | const |
getMachineOpValue - Return binary encoding of operand.
If the machine operand requires relocation, record the relocation and return zero.
Definition at line 482 of file PPCMCCodeEmitter.cpp.
References assert(), llvm::MCInstrInfo::get(), llvm::MCRegisterInfo::getEncodingValue(), llvm::MCOperand::getImm(), getOpIdxForMO(), llvm::MCOperand::getReg(), llvm::MCContext::getRegisterInfo(), llvm::PPC::getRegNumForOperand(), llvm::MCOperand::isImm(), llvm::MCOperand::isReg(), and MI.
Referenced by getAbsCondBrEncoding(), getAbsDirectBrEncoding(), getCondBrEncoding(), getDirectBrEncoding(), getDispRI34Encoding(), getDispRI34PCRelEncoding(), getDispRIEncoding(), getDispRIX16Encoding(), getDispRIXEncoding(), getDispSPE2Encoding(), getDispSPE4Encoding(), getDispSPE8Encoding(), getImm16Encoding(), getImm34Encoding(), getTLSRegEncoding(), and getVSRpEvenEncoding().
unsigned PPCMCCodeEmitter::getTLSCallEncoding | ( | const MCInst & | MI, |
unsigned | OpNo, | ||
SmallVectorImpl< MCFixup > & | Fixups, | ||
const MCSubtargetInfo & | STI | ||
) | const |
Definition at line 445 of file PPCMCCodeEmitter.cpp.
References llvm::MCFixup::create(), llvm::PPC::fixup_ppc_nofixup, getDirectBrEncoding(), llvm::MCOperand::getExpr(), and MI.
unsigned PPCMCCodeEmitter::getTLSRegEncoding | ( | const MCInst & | MI, |
unsigned | OpNo, | ||
SmallVectorImpl< MCFixup > & | Fixups, | ||
const MCSubtargetInfo & | STI | ||
) | const |
Definition at line 425 of file PPCMCCodeEmitter.cpp.
References llvm::MCFixup::create(), llvm::PPC::fixup_ppc_nofixup, llvm::MCRegisterInfo::getEncodingValue(), llvm::MCOperand::getExpr(), llvm::MCSymbolRefExpr::getKind(), getMachineOpValue(), llvm::MCContext::getRegisterInfo(), llvm::MCSubtargetInfo::getTargetTriple(), llvm::MCOperand::isReg(), MI, and llvm::MCSymbolRefExpr::VK_PPC_TLS_PCREL.
unsigned PPCMCCodeEmitter::getVSRpEvenEncoding | ( | const MCInst & | MI, |
unsigned | OpNo, | ||
SmallVectorImpl< MCFixup > & | Fixups, | ||
const MCSubtargetInfo & | STI | ||
) | const |
Definition at line 193 of file PPCMCCodeEmitter.cpp.
References assert(), getMachineOpValue(), and MI.
Check if Opcode corresponds to a call instruction that should be marked with the NOTOC relocation.
Definition at line 62 of file PPCMCCodeEmitter.cpp.
References llvm::MCInstrInfo::get(), llvm::MCInstrDesc::isCall(), llvm_unreachable, and MI.
Referenced by getDirectBrEncoding().
Definition at line 539 of file PPCMCCodeEmitter.cpp.
References llvm::MCInstrInfo::get(), MI, llvm::PPCII::Prefixed, and llvm::MCInstrDesc::TSFlags.
|
delete |