1f4a2713aSLionel Sambuc //===-- Thumb1InstrInfo.h - Thumb-1 Instruction Information -----*- C++ -*-===//
2f4a2713aSLionel Sambuc //
3f4a2713aSLionel Sambuc //                     The LLVM Compiler Infrastructure
4f4a2713aSLionel Sambuc //
5f4a2713aSLionel Sambuc // This file is distributed under the University of Illinois Open Source
6f4a2713aSLionel Sambuc // License. See LICENSE.TXT for details.
7f4a2713aSLionel Sambuc //
8f4a2713aSLionel Sambuc //===----------------------------------------------------------------------===//
9f4a2713aSLionel Sambuc //
10f4a2713aSLionel Sambuc // This file contains the Thumb-1 implementation of the TargetInstrInfo class.
11f4a2713aSLionel Sambuc //
12f4a2713aSLionel Sambuc //===----------------------------------------------------------------------===//
13f4a2713aSLionel Sambuc 
14*0a6a1f1dSLionel Sambuc #ifndef LLVM_LIB_TARGET_ARM_THUMB1INSTRINFO_H
15*0a6a1f1dSLionel Sambuc #define LLVM_LIB_TARGET_ARM_THUMB1INSTRINFO_H
16f4a2713aSLionel Sambuc 
17f4a2713aSLionel Sambuc #include "ARMBaseInstrInfo.h"
18f4a2713aSLionel Sambuc #include "Thumb1RegisterInfo.h"
19f4a2713aSLionel Sambuc 
20f4a2713aSLionel Sambuc namespace llvm {
21f4a2713aSLionel Sambuc   class ARMSubtarget;
22f4a2713aSLionel Sambuc 
23f4a2713aSLionel Sambuc class Thumb1InstrInfo : public ARMBaseInstrInfo {
24f4a2713aSLionel Sambuc   Thumb1RegisterInfo RI;
25f4a2713aSLionel Sambuc public:
26f4a2713aSLionel Sambuc   explicit Thumb1InstrInfo(const ARMSubtarget &STI);
27f4a2713aSLionel Sambuc 
28f4a2713aSLionel Sambuc   /// getNoopForMachoTarget - Return the noop instruction to use for a noop.
29*0a6a1f1dSLionel Sambuc   void getNoopForMachoTarget(MCInst &NopInst) const override;
30f4a2713aSLionel Sambuc 
31f4a2713aSLionel Sambuc   // Return the non-pre/post incrementing version of 'Opc'. Return 0
32f4a2713aSLionel Sambuc   // if there is not such an opcode.
33*0a6a1f1dSLionel Sambuc   unsigned getUnindexedOpcode(unsigned Opc) const override;
34f4a2713aSLionel Sambuc 
35f4a2713aSLionel Sambuc   /// getRegisterInfo - TargetInstrInfo is a superset of MRegister info.  As
36f4a2713aSLionel Sambuc   /// such, whenever a client has an instance of instruction info, it should
37f4a2713aSLionel Sambuc   /// always be able to get register info as well (through this method).
38f4a2713aSLionel Sambuc   ///
getRegisterInfo()39*0a6a1f1dSLionel Sambuc   const Thumb1RegisterInfo &getRegisterInfo() const override { return RI; }
40f4a2713aSLionel Sambuc 
41f4a2713aSLionel Sambuc   void copyPhysReg(MachineBasicBlock &MBB,
42f4a2713aSLionel Sambuc                    MachineBasicBlock::iterator I, DebugLoc DL,
43f4a2713aSLionel Sambuc                    unsigned DestReg, unsigned SrcReg,
44*0a6a1f1dSLionel Sambuc                    bool KillSrc) const override;
45f4a2713aSLionel Sambuc   void storeRegToStackSlot(MachineBasicBlock &MBB,
46f4a2713aSLionel Sambuc                            MachineBasicBlock::iterator MBBI,
47f4a2713aSLionel Sambuc                            unsigned SrcReg, bool isKill, int FrameIndex,
48f4a2713aSLionel Sambuc                            const TargetRegisterClass *RC,
49*0a6a1f1dSLionel Sambuc                            const TargetRegisterInfo *TRI) const override;
50f4a2713aSLionel Sambuc 
51f4a2713aSLionel Sambuc   void loadRegFromStackSlot(MachineBasicBlock &MBB,
52f4a2713aSLionel Sambuc                             MachineBasicBlock::iterator MBBI,
53f4a2713aSLionel Sambuc                             unsigned DestReg, int FrameIndex,
54f4a2713aSLionel Sambuc                             const TargetRegisterClass *RC,
55*0a6a1f1dSLionel Sambuc                             const TargetRegisterInfo *TRI) const override;
56f4a2713aSLionel Sambuc 
57*0a6a1f1dSLionel Sambuc private:
58*0a6a1f1dSLionel Sambuc   void expandLoadStackGuard(MachineBasicBlock::iterator MI,
59*0a6a1f1dSLionel Sambuc                             Reloc::Model RM) const override;
60f4a2713aSLionel Sambuc };
61f4a2713aSLionel Sambuc }
62f4a2713aSLionel Sambuc 
63*0a6a1f1dSLionel Sambuc #endif
64