blob: cbd5264a141ff673222f1fc3db51b5b5c39c723d [file] [log] [blame]
Jia Liu8f5e8c12012-02-17 01:23:50 +00001//===-- MipsMCInstLower.h - Lower MachineInstr to MCInst -------*- C++ -*--===//
Akira Hatanaka17a2f8e2011-07-07 20:24:54 +00002//
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//===----------------------------------------------------------------------===//
9
10#ifndef MIPSMCINSTLOWER_H
11#define MIPSMCINSTLOWER_H
Bruno Cardoso Lopesce1a5382011-11-08 22:26:47 +000012#include "llvm/ADT/SmallVector.h"
Akira Hatanaka17a2f8e2011-07-07 20:24:54 +000013#include "llvm/CodeGen/MachineOperand.h"
14#include "llvm/Support/Compiler.h"
15
16namespace llvm {
17 class MCAsmInfo;
18 class MCContext;
19 class MCInst;
20 class MCOperand;
21 class MCSymbol;
22 class MachineInstr;
23 class MachineFunction;
24 class Mangler;
25 class MipsAsmPrinter;
Jia Liubb481f82012-02-28 07:46:26 +000026
Akira Hatanaka17a2f8e2011-07-07 20:24:54 +000027/// MipsMCInstLower - This class is used to lower an MachineInstr into an
28// MCInst.
29class LLVM_LIBRARY_VISIBILITY MipsMCInstLower {
30 typedef MachineOperand::MachineOperandType MachineOperandType;
31 MCContext &Ctx;
32 Mangler *Mang;
33 MipsAsmPrinter &AsmPrinter;
34public:
35 MipsMCInstLower(Mangler *mang, const MachineFunction &MF,
Jia Liubb481f82012-02-28 07:46:26 +000036 MipsAsmPrinter &asmprinter);
Akira Hatanaka17a2f8e2011-07-07 20:24:54 +000037 void Lower(const MachineInstr *MI, MCInst &OutMI) const;
Bruno Cardoso Lopesce1a5382011-11-08 22:26:47 +000038 void LowerCPLOAD(const MachineInstr *MI, SmallVector<MCInst, 4>& MCInsts);
Jia Liubb481f82012-02-28 07:46:26 +000039 void LowerCPRESTORE(const MachineInstr *MI, SmallVector<MCInst, 4>& MCInsts);
Akira Hatanaka421455f2011-11-23 22:19:28 +000040 void LowerUnalignedLoadStore(const MachineInstr *MI,
41 SmallVector<MCInst, 4>& MCInsts);
Akira Hatanaka648f00c2012-02-24 22:34:47 +000042 void LowerSETGP01(const MachineInstr *MI, SmallVector<MCInst, 4>& MCInsts);
Akira Hatanaka17a2f8e2011-07-07 20:24:54 +000043private:
44 MCOperand LowerSymbolOperand(const MachineOperand &MO,
Akira Hatanaka78d1b112011-08-16 02:15:03 +000045 MachineOperandType MOTy, unsigned Offset) const;
Akira Hatanaka421455f2011-11-23 22:19:28 +000046 MCOperand LowerOperand(const MachineOperand& MO, unsigned offset = 0) const;
Akira Hatanaka17a2f8e2011-07-07 20:24:54 +000047};
48}
49
50#endif