1 //=-- Hexagon.h - Top-level interface for Hexagon representation --*- C++ -*-=// 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 entry points for global functions defined in the LLVM 11 // Hexagon back-end. 12 // 13 //===----------------------------------------------------------------------===// 14 15 #ifndef TARGET_Hexagon_H 16 #define TARGET_Hexagon_H 17 18 #include "MCTargetDesc/HexagonMCTargetDesc.h" 19 #include "llvm/Target/TargetLowering.h" 20 #include "llvm/Target/TargetMachine.h" 21 22 namespace llvm { 23 class FunctionPass; 24 class ModulePass; 25 class TargetMachine; 26 class MachineInstr; 27 class HexagonMCInst; 28 class HexagonAsmPrinter; 29 class HexagonTargetMachine; 30 class raw_ostream; 31 32 FunctionPass *createHexagonISelDag(HexagonTargetMachine &TM, 33 CodeGenOpt::Level OptLevel); 34 FunctionPass *createHexagonDelaySlotFillerPass(const TargetMachine &TM); 35 FunctionPass *createHexagonFPMoverPass(const TargetMachine &TM); 36 FunctionPass *createHexagonRemoveExtendArgs(const HexagonTargetMachine &TM); 37 FunctionPass *createHexagonCFGOptimizer(const HexagonTargetMachine &TM); 38 39 FunctionPass *createHexagonSplitTFRCondSets(const HexagonTargetMachine &TM); 40 FunctionPass *createHexagonSplitConst32AndConst64( 41 const HexagonTargetMachine &TM); 42 FunctionPass *createHexagonExpandPredSpillCode( 43 const HexagonTargetMachine &TM); 44 FunctionPass *createHexagonHardwareLoops(); 45 FunctionPass *createHexagonPeephole(); 46 FunctionPass *createHexagonFixupHwLoops(); 47 FunctionPass *createHexagonNewValueJump(); 48 FunctionPass *createHexagonCopyToCombine(); 49 FunctionPass *createHexagonPacketizer(); 50 FunctionPass *createHexagonNewValueJump(); 51 52 /* TODO: object output. 53 MCCodeEmitter *createHexagonMCCodeEmitter(const Target &, 54 const TargetMachine &TM, 55 MCContext &Ctx); 56 */ 57 /* TODO: assembler input. 58 TargetAsmBackend *createHexagonAsmBackend(const Target &, 59 const std::string &); 60 */ 61 void HexagonLowerToMC(const MachineInstr *MI, HexagonMCInst &MCI, 62 HexagonAsmPrinter &AP); 63 } // end namespace llvm; 64 65 #define Hexagon_POINTER_SIZE 4 66 67 #define Hexagon_PointerSize (Hexagon_POINTER_SIZE) 68 #define Hexagon_PointerSize_Bits (Hexagon_POINTER_SIZE * 8) 69 #define Hexagon_WordSize Hexagon_PointerSize 70 #define Hexagon_WordSize_Bits Hexagon_PointerSize_Bits 71 72 // allocframe saves LR and FP on stack before allocating 73 // a new stack frame. This takes 8 bytes. 74 #define HEXAGON_LRFP_SIZE 8 75 76 // Normal instruction size (in bytes). 77 #define HEXAGON_INSTR_SIZE 4 78 79 // Maximum number of words and instructions in a packet. 80 #define HEXAGON_PACKET_SIZE 4 81 82 #endif 83