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