AMDGPUMCInstLower.h revision dce4a407a24b04eebc6a376f8e62b41aaa7b071f
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
14namespace llvm {
15
16class AMDGPUSubtarget;
17class MCInst;
18class MCContext;
19class MachineInstr;
20
21class 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
38public:
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