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 TargetMachine; 25 class MachineInstr; 26 class MCInst; 27 class HexagonAsmPrinter; 28 class HexagonTargetMachine; 29 class raw_ostream; 30 31 FunctionPass *createHexagonISelDag(HexagonTargetMachine &TM); 32 FunctionPass *createHexagonDelaySlotFillerPass(TargetMachine &TM); 33 FunctionPass *createHexagonFPMoverPass(TargetMachine &TM); 34 FunctionPass *createHexagonRemoveExtendOps(HexagonTargetMachine &TM); 35 FunctionPass *createHexagonCFGOptimizer(HexagonTargetMachine &TM); 36 37 FunctionPass *createHexagonSplitTFRCondSets(HexagonTargetMachine &TM); 38 FunctionPass *createHexagonExpandPredSpillCode(HexagonTargetMachine &TM); 39 40 FunctionPass *createHexagonHardwareLoops(); 41 FunctionPass *createHexagonPeephole(); 42 FunctionPass *createHexagonFixupHwLoops(); 43 FunctionPass *createHexagonPacketizer(); 44 FunctionPass *createHexagonNewValueJump(); 45 46 47 /* TODO: object output. 48 MCCodeEmitter *createHexagonMCCodeEmitter(const Target &, 49 TargetMachine &TM, 50 MCContext &Ctx); 51 */ 52 /* TODO: assembler input. 53 TargetAsmBackend *createHexagonAsmBackend(const Target &, 54 const std::string &); 55 */ 56 void HexagonLowerToMC(const MachineInstr *MI, MCInst &MCI, 57 HexagonAsmPrinter &AP); 58 } // end namespace llvm; 59 60 #define Hexagon_POINTER_SIZE 4 61 62 #define Hexagon_PointerSize (Hexagon_POINTER_SIZE) 63 #define Hexagon_PointerSize_Bits (Hexagon_POINTER_SIZE * 8) 64 #define Hexagon_WordSize Hexagon_PointerSize 65 #define Hexagon_WordSize_Bits Hexagon_PointerSize_Bits 66 67 // allocframe saves LR and FP on stack before allocating 68 // a new stack frame. This takes 8 bytes. 69 #define HEXAGON_LRFP_SIZE 8 70 71 // Normal instruction size (in bytes). 72 #define HEXAGON_INSTR_SIZE 4 73 74 // Maximum number of words and instructions in a packet. 75 #define HEXAGON_PACKET_SIZE 4 76 77 #endif 78