1 //=-- Hexagon.h - Top-level interface for Hexagon representation --*- C++ -*-=//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file contains the entry points for global functions defined in the LLVM
13 //===----------------------------------------------------------------------===//
15 #ifndef TARGET_Hexagon_H
16 #define TARGET_Hexagon_H
18 #include "MCTargetDesc/HexagonMCTargetDesc.h"
19 #include "llvm/Target/TargetLowering.h"
20 #include "llvm/Target/TargetMachine.h"
28 class HexagonAsmPrinter;
29 class HexagonTargetMachine;
32 FunctionPass *createHexagonISelDag(const 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);
39 FunctionPass *createHexagonSplitTFRCondSets(const HexagonTargetMachine &TM);
40 FunctionPass *createHexagonExpandPredSpillCode(
41 const HexagonTargetMachine &TM);
42 FunctionPass *createHexagonHardwareLoops();
43 FunctionPass *createHexagonPeephole();
44 FunctionPass *createHexagonFixupHwLoops();
45 FunctionPass *createHexagonPacketizer();
46 FunctionPass *createHexagonNewValueJump();
48 /* TODO: object output.
49 MCCodeEmitter *createHexagonMCCodeEmitter(const Target &,
50 const TargetMachine &TM,
53 /* TODO: assembler input.
54 TargetAsmBackend *createHexagonAsmBackend(const Target &,
57 void HexagonLowerToMC(const MachineInstr *MI, HexagonMCInst &MCI,
58 HexagonAsmPrinter &AP);
59 } // end namespace llvm;
61 #define Hexagon_POINTER_SIZE 4
63 #define Hexagon_PointerSize (Hexagon_POINTER_SIZE)
64 #define Hexagon_PointerSize_Bits (Hexagon_POINTER_SIZE * 8)
65 #define Hexagon_WordSize Hexagon_PointerSize
66 #define Hexagon_WordSize_Bits Hexagon_PointerSize_Bits
68 // allocframe saves LR and FP on stack before allocating
69 // a new stack frame. This takes 8 bytes.
70 #define HEXAGON_LRFP_SIZE 8
72 // Normal instruction size (in bytes).
73 #define HEXAGON_INSTR_SIZE 4
75 // Maximum number of words and instructions in a packet.
76 #define HEXAGON_PACKET_SIZE 4