44 : MRI(mri), MCII(mcii) {}
45 R600MCCodeEmitter(
const R600MCCodeEmitter &) =
delete;
46 R600MCCodeEmitter &operator=(
const R600MCCodeEmitter &) =
delete;
63 unsigned getHWReg(
unsigned regNo)
const;
65 uint64_t getBinaryCodeForInstr(
const MCInst &
MI,
68 uint64_t computeAvailableFeatures(
const FeatureBitset &FB)
const;
69 void verifyInstructionPredicates(
const MCInst &
MI,
70 uint64_t AvailableFeatures)
const;
96 return new R600MCCodeEmitter(MCII, MRI);
102 verifyInstructionPredicates(MI,
112 }
else if (
IS_VTX(Desc)) {
113 uint64_t InstWord01 = getBinaryCodeForInstr(MI, Fixups, STI);
116 InstWord2 |= 1 << 19;
119 Emit(InstWord01, OS);
122 }
else if (
IS_TEX(Desc)) {
125 int64_t SrcSelect[4] = {
137 uint64_t Word01 = getBinaryCodeForInstr(MI, Fixups, STI);
140 SrcSelect[
ELEMENT_W] << 29 | Offsets[0] << 0 | Offsets[1] << 5 |
147 uint64_t Inst = getBinaryCodeForInstr(MI, Fixups, STI);
151 uint64_t ISAOpCode = Inst & (0x3FFULL << 39);
152 Inst &= ~(0x3FFULL << 39);
153 Inst |= ISAOpCode << 1;
163 void R600MCCodeEmitter::Emit(uint64_t Value,
raw_ostream &OS)
const {
171 uint64_t R600MCCodeEmitter::getMachineOpValue(
const MCInst &MI,
177 return MRI.getEncodingValue(MO.
getReg());
188 const unsigned offset = (&MO == &MI.
getOperand(0)) ? 0 : 4;
197 #define ENABLE_INSTR_PREDICATE_VERIFIER 198 #include "R600GenMCCodeEmitter.inc"
This class represents lattice values for constants.
void push_back(const T &Elt)
Describe properties that are true of each instruction in the target description file.
MCCodeEmitter * createR600MCCodeEmitter(const MCInstrInfo &MCII, const MCRegisterInfo &MRI, MCContext &Ctx)
const FeatureBitset & getFeatureBits() const
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
A four-byte section relative fixup.
#define HAS_NATIVE_OPERANDS(Flags)
unsigned getReg() const
Returns the register number.
Context object for machine code objects.
const MCExpr * getExpr() const
Instances of this class represent a single low-level machine instruction.
#define HW_REG_MASK
Defines for extracting register information from register encoding.
MCRegisterInfo base class - We assume that the target defines a static array of MCRegisterDesc object...
void write(void *memory, value_type value, endianness endian)
Write a value to memory with a particular endianness.
unsigned const MachineRegisterInfo * MRI
Container class for subtarget features.
MCCodeEmitter - Generic instruction encoding interface.
Interface to description of machine instruction set.
static MCFixup create(uint32_t Offset, const MCExpr *Value, MCFixupKind Kind, SMLoc Loc=SMLoc())
const MCOperand & getOperand(unsigned i) const
Provides AMDGPU specific target descriptions.
Generic base class for all target subtargets.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
LLVM Value Representation.
This class implements an extremely fast bulk output stream that can only output to a stream...
static unsigned getHWReg(const SIInstrInfo *TII, const MachineInstr &RegInstr)
unsigned getOpcode() const
Instances of this class represent operands of the MCInst class.