1 //===-- AMDGPUCodeEmitter.h - AMDGPU Code Emitter interface -----*- C++ -*-===//
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
7 //===----------------------------------------------------------------------===//
10 /// CodeEmitter interface for R600 and SI codegen.
12 //===----------------------------------------------------------------------===//
14 #ifndef LLVM_LIB_TARGET_AMDGPU_MCTARGETDESC_AMDGPUMCCODEEMITTER_H
15 #define LLVM_LIB_TARGET_AMDGPU_MCTARGETDESC_AMDGPUMCCODEEMITTER_H
17 #include "llvm/MC/MCCodeEmitter.h"
18 #include "llvm/Support/raw_ostream.h"
25 class MCSubtargetInfo;
28 class AMDGPUMCCodeEmitter : public MCCodeEmitter {
29 virtual void anchor();
32 const MCInstrInfo &MCII;
34 AMDGPUMCCodeEmitter(const MCInstrInfo &mcii) : MCII(mcii) {}
38 uint64_t getBinaryCodeForInstr(const MCInst &MI,
39 SmallVectorImpl<MCFixup> &Fixups,
40 const MCSubtargetInfo &STI) const;
42 virtual uint64_t getMachineOpValue(const MCInst &MI, const MCOperand &MO,
43 SmallVectorImpl<MCFixup> &Fixups,
44 const MCSubtargetInfo &STI) const {
48 virtual unsigned getSOPPBrEncoding(const MCInst &MI, unsigned OpNo,
49 SmallVectorImpl<MCFixup> &Fixups,
50 const MCSubtargetInfo &STI) const {
54 virtual unsigned getSDWASrcEncoding(const MCInst &MI, unsigned OpNo,
55 SmallVectorImpl<MCFixup> &Fixups,
56 const MCSubtargetInfo &STI) const {
60 virtual unsigned getSDWAVopcDstEncoding(const MCInst &MI, unsigned OpNo,
61 SmallVectorImpl<MCFixup> &Fixups,
62 const MCSubtargetInfo &STI) const {
66 virtual unsigned getAVOperandEncoding(const MCInst &MI, unsigned OpNo,
67 SmallVectorImpl<MCFixup> &Fixups,
68 const MCSubtargetInfo &STI) const {
73 FeatureBitset computeAvailableFeatures(const FeatureBitset &FB) const;
75 verifyInstructionPredicates(const MCInst &MI,
76 const FeatureBitset &AvailableFeatures) const;
79 } // End namespace llvm