LLVM 20.0.0git
Public Member Functions | List of all members
llvm::PPCMCCodeEmitter Class Reference

#include "Target/PowerPC/MCTargetDesc/PPCMCCodeEmitter.h"

Inheritance diagram for llvm::PPCMCCodeEmitter:
Inheritance graph
[legend]

Public Member Functions

 PPCMCCodeEmitter (const MCInstrInfo &mcii, MCContext &ctx)
 
 PPCMCCodeEmitter (const PPCMCCodeEmitter &)=delete
 
void operator= (const PPCMCCodeEmitter &)=delete
 
 ~PPCMCCodeEmitter () override=default
 
unsigned getDirectBrEncoding (const MCInst &MI, unsigned OpNo, SmallVectorImpl< MCFixup > &Fixups, const MCSubtargetInfo &STI) const
 
unsigned getCondBrEncoding (const MCInst &MI, unsigned OpNo, SmallVectorImpl< MCFixup > &Fixups, const MCSubtargetInfo &STI) const
 
unsigned getAbsDirectBrEncoding (const MCInst &MI, unsigned OpNo, SmallVectorImpl< MCFixup > &Fixups, const MCSubtargetInfo &STI) const
 
unsigned getAbsCondBrEncoding (const MCInst &MI, unsigned OpNo, SmallVectorImpl< MCFixup > &Fixups, const MCSubtargetInfo &STI) const
 
unsigned getImm16Encoding (const MCInst &MI, unsigned OpNo, SmallVectorImpl< MCFixup > &Fixups, const MCSubtargetInfo &STI) const
 
uint64_t getImm34Encoding (const MCInst &MI, unsigned OpNo, SmallVectorImpl< MCFixup > &Fixups, const MCSubtargetInfo &STI, MCFixupKind Fixup) const
 
uint64_t getImm34EncodingNoPCRel (const MCInst &MI, unsigned OpNo, SmallVectorImpl< MCFixup > &Fixups, const MCSubtargetInfo &STI) const
 
uint64_t getImm34EncodingPCRel (const MCInst &MI, unsigned OpNo, SmallVectorImpl< MCFixup > &Fixups, const MCSubtargetInfo &STI) const
 
unsigned getDispRIEncoding (const MCInst &MI, unsigned OpNo, SmallVectorImpl< MCFixup > &Fixups, const MCSubtargetInfo &STI) const
 
unsigned getDispRIXEncoding (const MCInst &MI, unsigned OpNo, SmallVectorImpl< MCFixup > &Fixups, const MCSubtargetInfo &STI) const
 
unsigned getDispRIX16Encoding (const MCInst &MI, unsigned OpNo, SmallVectorImpl< MCFixup > &Fixups, const MCSubtargetInfo &STI) const
 
unsigned getDispRIHashEncoding (const MCInst &MI, unsigned OpNo, SmallVectorImpl< MCFixup > &Fixups, const MCSubtargetInfo &STI) const
 
uint64_t getDispRI34PCRelEncoding (const MCInst &MI, unsigned OpNo, SmallVectorImpl< MCFixup > &Fixups, const MCSubtargetInfo &STI) const
 
uint64_t getDispRI34Encoding (const MCInst &MI, unsigned OpNo, SmallVectorImpl< MCFixup > &Fixups, const MCSubtargetInfo &STI) const
 
unsigned getDispSPE8Encoding (const MCInst &MI, unsigned OpNo, SmallVectorImpl< MCFixup > &Fixups, const MCSubtargetInfo &STI) const
 
unsigned getDispSPE4Encoding (const MCInst &MI, unsigned OpNo, SmallVectorImpl< MCFixup > &Fixups, const MCSubtargetInfo &STI) const
 
unsigned getDispSPE2Encoding (const MCInst &MI, unsigned OpNo, SmallVectorImpl< MCFixup > &Fixups, const MCSubtargetInfo &STI) const
 
unsigned getTLSRegEncoding (const MCInst &MI, unsigned OpNo, SmallVectorImpl< MCFixup > &Fixups, const MCSubtargetInfo &STI) const
 
unsigned getTLSCallEncoding (const MCInst &MI, unsigned OpNo, SmallVectorImpl< MCFixup > &Fixups, const MCSubtargetInfo &STI) const
 
unsigned get_crbitm_encoding (const MCInst &MI, unsigned OpNo, SmallVectorImpl< MCFixup > &Fixups, const MCSubtargetInfo &STI) const
 
unsigned getVSRpEvenEncoding (const MCInst &MI, unsigned OpNo, SmallVectorImpl< MCFixup > &Fixups, const MCSubtargetInfo &STI) const
 
uint64_t getMachineOpValue (const MCInst &MI, const MCOperand &MO, SmallVectorImpl< MCFixup > &Fixups, const MCSubtargetInfo &STI) const
 getMachineOpValue - Return binary encoding of operand.
 
uint64_t getBinaryCodeForInstr (const MCInst &MI, SmallVectorImpl< MCFixup > &Fixups, const MCSubtargetInfo &STI) const
 
void encodeInstruction (const MCInst &MI, SmallVectorImpl< char > &CB, SmallVectorImpl< MCFixup > &Fixups, const MCSubtargetInfo &STI) const override
 Encode the given Inst to bytes and append to CB.
 
unsigned getInstSizeInBytes (const MCInst &MI) const
 
bool isPrefixedInstruction (const MCInst &MI) const
 
bool isNoTOCCallInstr (const MCInst &MI) const
 Check if Opcode corresponds to a call instruction that should be marked with the NOTOC relocation.
 
- Public Member Functions inherited from llvm::MCCodeEmitter
 MCCodeEmitter (const MCCodeEmitter &)=delete
 
MCCodeEmitteroperator= (const MCCodeEmitter &)=delete
 
virtual ~MCCodeEmitter ()
 
virtual void reset ()
 Lifetime management.
 
virtual void encodeInstruction (const MCInst &Inst, SmallVectorImpl< char > &CB, SmallVectorImpl< MCFixup > &Fixups, const MCSubtargetInfo &STI) const =0
 Encode the given Inst to bytes and append to CB.
 

Additional Inherited Members

- Protected Member Functions inherited from llvm::MCCodeEmitter
 MCCodeEmitter ()
 

Detailed Description

Definition at line 25 of file PPCMCCodeEmitter.h.

Constructor & Destructor Documentation

◆ PPCMCCodeEmitter() [1/2]

llvm::PPCMCCodeEmitter::PPCMCCodeEmitter ( const MCInstrInfo mcii,
MCContext ctx 
)
inline

Definition at line 31 of file PPCMCCodeEmitter.h.

◆ PPCMCCodeEmitter() [2/2]

llvm::PPCMCCodeEmitter::PPCMCCodeEmitter ( const PPCMCCodeEmitter )
delete

◆ ~PPCMCCodeEmitter()

llvm::PPCMCCodeEmitter::~PPCMCCodeEmitter ( )
overridedefault

Member Function Documentation

◆ encodeInstruction()

void PPCMCCodeEmitter::encodeInstruction ( const MCInst Inst,
SmallVectorImpl< char > &  CB,
SmallVectorImpl< MCFixup > &  Fixups,
const MCSubtargetInfo STI 
) const
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.

◆ get_crbitm_encoding()

unsigned PPCMCCodeEmitter::get_crbitm_encoding ( const MCInst MI,
unsigned  OpNo,
SmallVectorImpl< MCFixup > &  Fixups,
const MCSubtargetInfo STI 
) const

◆ getAbsCondBrEncoding()

unsigned PPCMCCodeEmitter::getAbsCondBrEncoding ( const MCInst MI,
unsigned  OpNo,
SmallVectorImpl< MCFixup > &  Fixups,
const MCSubtargetInfo STI 
) const

◆ getAbsDirectBrEncoding()

unsigned PPCMCCodeEmitter::getAbsDirectBrEncoding ( const MCInst MI,
unsigned  OpNo,
SmallVectorImpl< MCFixup > &  Fixups,
const MCSubtargetInfo STI 
) const

◆ getBinaryCodeForInstr()

uint64_t llvm::PPCMCCodeEmitter::getBinaryCodeForInstr ( const MCInst MI,
SmallVectorImpl< MCFixup > &  Fixups,
const MCSubtargetInfo STI 
) const

Referenced by encodeInstruction().

◆ getCondBrEncoding()

unsigned PPCMCCodeEmitter::getCondBrEncoding ( const MCInst MI,
unsigned  OpNo,
SmallVectorImpl< MCFixup > &  Fixups,
const MCSubtargetInfo STI 
) const

◆ getDirectBrEncoding()

unsigned PPCMCCodeEmitter::getDirectBrEncoding ( const MCInst MI,
unsigned  OpNo,
SmallVectorImpl< MCFixup > &  Fixups,
const MCSubtargetInfo STI 
) const

◆ getDispRI34Encoding()

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.

◆ getDispRI34PCRelEncoding()

uint64_t PPCMCCodeEmitter::getDispRI34PCRelEncoding ( const MCInst MI,
unsigned  OpNo,
SmallVectorImpl< MCFixup > &  Fixups,
const MCSubtargetInfo STI 
) const

◆ getDispRIEncoding()

unsigned PPCMCCodeEmitter::getDispRIEncoding ( const MCInst MI,
unsigned  OpNo,
SmallVectorImpl< MCFixup > &  Fixups,
const MCSubtargetInfo STI 
) const

◆ getDispRIHashEncoding()

unsigned PPCMCCodeEmitter::getDispRIHashEncoding ( const MCInst MI,
unsigned  OpNo,
SmallVectorImpl< MCFixup > &  Fixups,
const MCSubtargetInfo STI 
) const

◆ getDispRIX16Encoding()

unsigned PPCMCCodeEmitter::getDispRIX16Encoding ( const MCInst MI,
unsigned  OpNo,
SmallVectorImpl< MCFixup > &  Fixups,
const MCSubtargetInfo STI 
) const

◆ getDispRIXEncoding()

unsigned PPCMCCodeEmitter::getDispRIXEncoding ( const MCInst MI,
unsigned  OpNo,
SmallVectorImpl< MCFixup > &  Fixups,
const MCSubtargetInfo STI 
) const

◆ getDispSPE2Encoding()

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.

◆ getDispSPE4Encoding()

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.

◆ getDispSPE8Encoding()

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.

◆ getImm16Encoding()

unsigned PPCMCCodeEmitter::getImm16Encoding ( const MCInst MI,
unsigned  OpNo,
SmallVectorImpl< MCFixup > &  Fixups,
const MCSubtargetInfo STI 
) const

◆ getImm34Encoding()

uint64_t PPCMCCodeEmitter::getImm34Encoding ( const MCInst MI,
unsigned  OpNo,
SmallVectorImpl< MCFixup > &  Fixups,
const MCSubtargetInfo STI,
MCFixupKind  Fixup 
) const

◆ getImm34EncodingNoPCRel()

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.

◆ getImm34EncodingPCRel()

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.

◆ getInstSizeInBytes()

unsigned PPCMCCodeEmitter::getInstSizeInBytes ( const MCInst MI) const

Definition at line 533 of file PPCMCCodeEmitter.cpp.

References llvm::MCInstrInfo::get(), and MI.

Referenced by encodeInstruction().

◆ getMachineOpValue()

uint64_t PPCMCCodeEmitter::getMachineOpValue ( const MCInst MI,
const MCOperand MO,
SmallVectorImpl< MCFixup > &  Fixups,
const MCSubtargetInfo STI 
) const

◆ getTLSCallEncoding()

unsigned PPCMCCodeEmitter::getTLSCallEncoding ( const MCInst MI,
unsigned  OpNo,
SmallVectorImpl< MCFixup > &  Fixups,
const MCSubtargetInfo STI 
) const

◆ getTLSRegEncoding()

unsigned PPCMCCodeEmitter::getTLSRegEncoding ( const MCInst MI,
unsigned  OpNo,
SmallVectorImpl< MCFixup > &  Fixups,
const MCSubtargetInfo STI 
) const

◆ getVSRpEvenEncoding()

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.

◆ isNoTOCCallInstr()

bool PPCMCCodeEmitter::isNoTOCCallInstr ( const MCInst MI) const

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().

◆ isPrefixedInstruction()

bool PPCMCCodeEmitter::isPrefixedInstruction ( const MCInst MI) const

◆ operator=()

void llvm::PPCMCCodeEmitter::operator= ( const PPCMCCodeEmitter )
delete

The documentation for this class was generated from the following files: