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