LLVM  8.0.1
AMDGPUMCCodeEmitter.h
Go to the documentation of this file.
1 //===-- AMDGPUCodeEmitter.h - AMDGPU Code Emitter interface -----*- C++ -*-===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 /// \file
11 /// CodeEmitter interface for R600 and SI codegen.
12 //
13 //===----------------------------------------------------------------------===//
14 
15 #ifndef LLVM_LIB_TARGET_AMDGPU_MCTARGETDESC_AMDGPUMCCODEEMITTER_H
16 #define LLVM_LIB_TARGET_AMDGPU_MCTARGETDESC_AMDGPUMCCODEEMITTER_H
17 
18 #include "llvm/MC/MCCodeEmitter.h"
20 
21 namespace llvm {
22 
23 class MCInst;
24 class MCInstrInfo;
25 class MCOperand;
26 class MCSubtargetInfo;
27 class FeatureBitset;
28 
30  virtual void anchor();
31 
32 protected:
33  const MCInstrInfo &MCII;
34 
35  AMDGPUMCCodeEmitter(const MCInstrInfo &mcii) : MCII(mcii) {}
36 
37 public:
38 
39  uint64_t getBinaryCodeForInstr(const MCInst &MI,
41  const MCSubtargetInfo &STI) const;
42 
43  virtual uint64_t getMachineOpValue(const MCInst &MI, const MCOperand &MO,
45  const MCSubtargetInfo &STI) const {
46  return 0;
47  }
48 
49  virtual unsigned getSOPPBrEncoding(const MCInst &MI, unsigned OpNo,
51  const MCSubtargetInfo &STI) const {
52  return 0;
53  }
54 
55  virtual unsigned getSDWASrcEncoding(const MCInst &MI, unsigned OpNo,
57  const MCSubtargetInfo &STI) const {
58  return 0;
59  }
60 
61  virtual unsigned getSDWAVopcDstEncoding(const MCInst &MI, unsigned OpNo,
63  const MCSubtargetInfo &STI) const {
64  return 0;
65  }
66 
67 protected:
68  uint64_t computeAvailableFeatures(const FeatureBitset &FB) const;
69  void verifyInstructionPredicates(const MCInst &MI,
70  uint64_t AvailableFeatures) const;
71 };
72 
73 } // End namespace llvm
74 
75 #endif
AMDGPUMCCodeEmitter(const MCInstrInfo &mcii)
This class represents lattice values for constants.
Definition: AllocatorList.h:24
void verifyInstructionPredicates(const MCInst &MI, uint64_t AvailableFeatures) const
virtual unsigned getSDWAVopcDstEncoding(const MCInst &MI, unsigned OpNo, SmallVectorImpl< MCFixup > &Fixups, const MCSubtargetInfo &STI) const
uint64_t getBinaryCodeForInstr(const MCInst &MI, SmallVectorImpl< MCFixup > &Fixups, const MCSubtargetInfo &STI) const
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
Definition: APFloat.h:42
virtual unsigned getSOPPBrEncoding(const MCInst &MI, unsigned OpNo, SmallVectorImpl< MCFixup > &Fixups, const MCSubtargetInfo &STI) const
Instances of this class represent a single low-level machine instruction.
Definition: MCInst.h:161
Container class for subtarget features.
MCCodeEmitter - Generic instruction encoding interface.
Definition: MCCodeEmitter.h:22
Interface to description of machine instruction set.
Definition: MCInstrInfo.h:24
uint64_t computeAvailableFeatures(const FeatureBitset &FB) const
virtual unsigned getSDWASrcEncoding(const MCInst &MI, unsigned OpNo, SmallVectorImpl< MCFixup > &Fixups, const MCSubtargetInfo &STI) const
virtual uint64_t getMachineOpValue(const MCInst &MI, const MCOperand &MO, SmallVectorImpl< MCFixup > &Fixups, const MCSubtargetInfo &STI) const
Generic base class for all target subtargets.
IRTranslator LLVM IR MI
Instances of this class represent operands of the MCInst class.
Definition: MCInst.h:35