1 //===- AMDGPUMCInstLower.h MachineInstr Lowering 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 /// \file 9 //===----------------------------------------------------------------------===// 10 11 #ifndef AMDGPU_MCINSTLOWER_H 12 #define AMDGPU_MCINSTLOWER_H 13 14 namespace llvm { 15 16 class AMDGPUSubtarget; 17 class MachineInstr; 18 class MCContext; 19 class MCInst; 20 21 class AMDGPUMCInstLower { 22 23 // This must be kept in sync with the SISubtarget class in SIInstrInfo.td 24 enum SISubtarget { 25 SI = 0 26 }; 27 28 MCContext &Ctx; 29 const AMDGPUSubtarget &ST; 30 31 /// Convert a member of the AMDGPUSubtarget::Generation enum to the 32 /// SISubtarget enum. 33 enum SISubtarget AMDGPUSubtargetToSISubtarget(unsigned Gen) const; 34 35 /// Get the MC opcode for this MachineInstr. 36 unsigned getMCOpcode(unsigned MIOpcode) const; 37 38 public: 39 AMDGPUMCInstLower(MCContext &ctx, const AMDGPUSubtarget &ST); 40 41 /// \brief Lower a MachineInstr to an MCInst 42 void lower(const MachineInstr *MI, MCInst &OutMI) const; 43 44 }; 45 46 } // End namespace llvm 47 48 #endif //AMDGPU_MCINSTLOWER_H 49