Jia Liu | 31d157a | 2012-02-18 12:03:15 +0000 | [diff] [blame] | 1 | //===-- Thumb1InstrInfo.h - Thumb-1 Instruction Information -----*- C++ -*-===// |
David Goodwin | b50ea5c | 2009-07-02 22:18:33 +0000 | [diff] [blame] | 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 | // This file contains the Thumb-1 implementation of the TargetInstrInfo class. |
| 11 | // |
| 12 | //===----------------------------------------------------------------------===// |
| 13 | |
| 14 | #ifndef THUMB1INSTRUCTIONINFO_H |
| 15 | #define THUMB1INSTRUCTIONINFO_H |
| 16 | |
David Goodwin | b50ea5c | 2009-07-02 22:18:33 +0000 | [diff] [blame] | 17 | #include "ARM.h" |
Craig Topper | c1f6f42 | 2012-03-17 07:33:42 +0000 | [diff] [blame] | 18 | #include "ARMBaseInstrInfo.h" |
David Goodwin | b50ea5c | 2009-07-02 22:18:33 +0000 | [diff] [blame] | 19 | #include "Thumb1RegisterInfo.h" |
| 20 | |
| 21 | namespace llvm { |
| 22 | class ARMSubtarget; |
| 23 | |
| 24 | class Thumb1InstrInfo : public ARMBaseInstrInfo { |
| 25 | Thumb1RegisterInfo RI; |
| 26 | public: |
| 27 | explicit Thumb1InstrInfo(const ARMSubtarget &STI); |
| 28 | |
Jim Grosbach | c01810e | 2012-02-28 23:53:30 +0000 | [diff] [blame] | 29 | /// getNoopForMachoTarget - Return the noop instruction to use for a noop. |
| 30 | void getNoopForMachoTarget(MCInst &NopInst) const; |
| 31 | |
David Goodwin | 334c264 | 2009-07-08 16:09:28 +0000 | [diff] [blame] | 32 | // Return the non-pre/post incrementing version of 'Opc'. Return 0 |
| 33 | // if there is not such an opcode. |
| 34 | unsigned getUnindexedOpcode(unsigned Opc) const; |
| 35 | |
David Goodwin | b50ea5c | 2009-07-02 22:18:33 +0000 | [diff] [blame] | 36 | /// getRegisterInfo - TargetInstrInfo is a superset of MRegister info. As |
| 37 | /// such, whenever a client has an instance of instruction info, it should |
| 38 | /// always be able to get register info as well (through this method). |
| 39 | /// |
| 40 | const Thumb1RegisterInfo &getRegisterInfo() const { return RI; } |
| 41 | |
Jakob Stoklund Olesen | ac27366 | 2010-07-11 06:33:54 +0000 | [diff] [blame] | 42 | void copyPhysReg(MachineBasicBlock &MBB, |
| 43 | MachineBasicBlock::iterator I, DebugLoc DL, |
| 44 | unsigned DestReg, unsigned SrcReg, |
| 45 | bool KillSrc) const; |
David Goodwin | b50ea5c | 2009-07-02 22:18:33 +0000 | [diff] [blame] | 46 | void storeRegToStackSlot(MachineBasicBlock &MBB, |
Eric Christopher | 00ed59a | 2010-10-15 22:49:28 +0000 | [diff] [blame] | 47 | MachineBasicBlock::iterator MBBI, |
| 48 | unsigned SrcReg, bool isKill, int FrameIndex, |
Evan Cheng | 746ad69 | 2010-05-06 19:06:44 +0000 | [diff] [blame] | 49 | const TargetRegisterClass *RC, |
| 50 | const TargetRegisterInfo *TRI) const; |
David Goodwin | b50ea5c | 2009-07-02 22:18:33 +0000 | [diff] [blame] | 51 | |
David Goodwin | b50ea5c | 2009-07-02 22:18:33 +0000 | [diff] [blame] | 52 | void loadRegFromStackSlot(MachineBasicBlock &MBB, |
Eric Christopher | 00ed59a | 2010-10-15 22:49:28 +0000 | [diff] [blame] | 53 | MachineBasicBlock::iterator MBBI, |
| 54 | unsigned DestReg, int FrameIndex, |
Evan Cheng | 746ad69 | 2010-05-06 19:06:44 +0000 | [diff] [blame] | 55 | const TargetRegisterClass *RC, |
| 56 | const TargetRegisterInfo *TRI) const; |
David Goodwin | b50ea5c | 2009-07-02 22:18:33 +0000 | [diff] [blame] | 57 | |
David Goodwin | b50ea5c | 2009-07-02 22:18:33 +0000 | [diff] [blame] | 58 | }; |
| 59 | } |
| 60 | |
| 61 | #endif // THUMB1INSTRUCTIONINFO_H |