LLVM  10.0.0svn
AMDGPUMCCodeEmitter.h
Go to the documentation of this file.
1 //===-- AMDGPUCodeEmitter.h - AMDGPU Code Emitter interface -----*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 /// \file
10 /// CodeEmitter interface for R600 and SI codegen.
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #ifndef LLVM_LIB_TARGET_AMDGPU_MCTARGETDESC_AMDGPUMCCODEEMITTER_H
15 #define LLVM_LIB_TARGET_AMDGPU_MCTARGETDESC_AMDGPUMCCODEEMITTER_H
16 
17 #include "llvm/MC/MCCodeEmitter.h"
19 
20 namespace llvm {
21 
22 class MCInst;
23 class MCInstrInfo;
24 class MCOperand;
25 class MCSubtargetInfo;
26 class FeatureBitset;
27 
29  virtual void anchor();
30 
31 protected:
32  const MCInstrInfo &MCII;
33 
34  AMDGPUMCCodeEmitter(const MCInstrInfo &mcii) : MCII(mcii) {}
35 
36 public:
37 
38  uint64_t getBinaryCodeForInstr(const MCInst &MI,
40  const MCSubtargetInfo &STI) const;
41 
42  virtual uint64_t getMachineOpValue(const MCInst &MI, const MCOperand &MO,
44  const MCSubtargetInfo &STI) const {
45  return 0;
46  }
47 
48  virtual unsigned getSOPPBrEncoding(const MCInst &MI, unsigned OpNo,
50  const MCSubtargetInfo &STI) const {
51  return 0;
52  }
53 
54  virtual unsigned getSDWASrcEncoding(const MCInst &MI, unsigned OpNo,
56  const MCSubtargetInfo &STI) const {
57  return 0;
58  }
59 
60  virtual unsigned getSDWAVopcDstEncoding(const MCInst &MI, unsigned OpNo,
62  const MCSubtargetInfo &STI) const {
63  return 0;
64  }
65 
66  virtual unsigned getAVOperandEncoding(const MCInst &MI, unsigned OpNo,
68  const MCSubtargetInfo &STI) const {
69  return 0;
70  }
71 
72 protected:
74  void
76  const FeatureBitset &AvailableFeatures) const;
77 };
78 
79 } // End namespace llvm
80 
81 #endif
AMDGPUMCCodeEmitter(const MCInstrInfo &mcii)
This class represents lattice values for constants.
Definition: AllocatorList.h:23
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:41
FeatureBitset computeAvailableFeatures(const FeatureBitset &FB) const
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:158
Container class for subtarget features.
MCCodeEmitter - Generic instruction encoding interface.
Definition: MCCodeEmitter.h:21
Interface to description of machine instruction set.
Definition: MCInstrInfo.h:23
virtual unsigned getAVOperandEncoding(const MCInst &MI, unsigned OpNo, SmallVectorImpl< MCFixup > &Fixups, const MCSubtargetInfo &STI) const
virtual unsigned getSDWASrcEncoding(const MCInst &MI, unsigned OpNo, SmallVectorImpl< MCFixup > &Fixups, const MCSubtargetInfo &STI) const
void verifyInstructionPredicates(const MCInst &MI, const FeatureBitset &AvailableFeatures) 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:34