Akira Hatanaka | 17a2f8e | 2011-07-07 20:24:54 +0000 | [diff] [blame] | 1 | //===-- MipsMCInstLower.h - Lower MachineInstr to MCInst -------------------===// |
| 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 | //===----------------------------------------------------------------------===// |
| 9 | |
| 10 | #ifndef MIPSMCINSTLOWER_H |
| 11 | #define MIPSMCINSTLOWER_H |
Akira Hatanaka | 614051a | 2011-08-16 03:51:51 +0000 | [diff] [blame] | 12 | #include "llvm/ADT/SmallVector.h" |
Akira Hatanaka | 17a2f8e | 2011-07-07 20:24:54 +0000 | [diff] [blame] | 13 | #include "llvm/CodeGen/MachineOperand.h" |
| 14 | #include "llvm/Support/Compiler.h" |
| 15 | |
| 16 | namespace 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; |
| 26 | |
| 27 | /// MipsMCInstLower - This class is used to lower an MachineInstr into an |
| 28 | // MCInst. |
| 29 | class LLVM_LIBRARY_VISIBILITY MipsMCInstLower { |
| 30 | typedef MachineOperand::MachineOperandType MachineOperandType; |
| 31 | MCContext &Ctx; |
| 32 | Mangler *Mang; |
| 33 | MipsAsmPrinter &AsmPrinter; |
| 34 | public: |
| 35 | MipsMCInstLower(Mangler *mang, const MachineFunction &MF, |
| 36 | MipsAsmPrinter &asmprinter); |
| 37 | void Lower(const MachineInstr *MI, MCInst &OutMI) const; |
Akira Hatanaka | 614051a | 2011-08-16 03:51:51 +0000 | [diff] [blame] | 38 | void LowerMips1F64LoadStore(const MachineInstr *MI, unsigned Opc, |
| 39 | SmallVector<MCInst, 4>& MCInsts, |
| 40 | bool isLittle, const unsigned *SubReg) const; |
Akira Hatanaka | 17a2f8e | 2011-07-07 20:24:54 +0000 | [diff] [blame] | 41 | private: |
| 42 | MCOperand LowerSymbolOperand(const MachineOperand &MO, |
Akira Hatanaka | 78d1b11 | 2011-08-16 02:15:03 +0000 | [diff] [blame] | 43 | MachineOperandType MOTy, unsigned Offset) const; |
Akira Hatanaka | 8957481 | 2011-08-16 02:21:03 +0000 | [diff] [blame] | 44 | MCOperand LowerOperand(const MachineOperand& MO) const; |
Akira Hatanaka | 17a2f8e | 2011-07-07 20:24:54 +0000 | [diff] [blame] | 45 | }; |
| 46 | } |
| 47 | |
| 48 | #endif |