blob: 00d1f1ba19a3bba0691c2ad59059c65bad5d7b3c [file] [log] [blame]
Tom Stellard75aadc22012-12-11 21:25:42 +00001//===- 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
Benjamin Kramera7c40ef2014-08-13 16:26:38 +000011#ifndef LLVM_LIB_TARGET_R600_AMDGPUMCINSTLOWER_H
12#define LLVM_LIB_TARGET_R600_AMDGPUMCINSTLOWER_H
Tom Stellard75aadc22012-12-11 21:25:42 +000013
14namespace llvm {
15
Tom Stellardc721a232014-05-16 20:56:47 +000016class AMDGPUSubtarget;
Tom Stellard75aadc22012-12-11 21:25:42 +000017class MachineInstr;
Matt Arsenault236d9af2014-06-23 18:00:20 +000018class MCContext;
19class MCInst;
Tom Stellard75aadc22012-12-11 21:25:42 +000020
21class AMDGPUMCInstLower {
22
Tom Stellardc721a232014-05-16 20:56:47 +000023 // This must be kept in sync with the SISubtarget class in SIInstrInfo.td
24 enum SISubtarget {
25 SI = 0
26 };
27
Tom Stellard9e90b582012-12-17 15:14:54 +000028 MCContext &Ctx;
Tom Stellardc721a232014-05-16 20:56:47 +000029 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;
Tom Stellard9e90b582012-12-17 15:14:54 +000037
Tom Stellard75aadc22012-12-11 21:25:42 +000038public:
Tom Stellardc721a232014-05-16 20:56:47 +000039 AMDGPUMCInstLower(MCContext &ctx, const AMDGPUSubtarget &ST);
Tom Stellard75aadc22012-12-11 21:25:42 +000040
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
Benjamin Kramera7c40ef2014-08-13 16:26:38 +000048#endif