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 LLVM_LIB_TARGET_HEXAGON_HEXAGON_H
16 #define LLVM_LIB_TARGET_HEXAGON_HEXAGON_H
18 #include "MCTargetDesc/HexagonMCTargetDesc.h"
19 #include "llvm/Target/TargetLowering.h"
20 #include "llvm/Target/TargetMachine.h"
24 class HexagonAsmPrinter;
25 class HexagonTargetMachine;
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();
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();
49 /* TODO: object output.
50 MCCodeEmitter *createHexagonMCCodeEmitter(const Target &,
51 const TargetMachine &TM,
54 /* TODO: assembler input.
55 TargetAsmBackend *createHexagonAsmBackend(const Target &,
58 void HexagonLowerToMC(MachineInstr const *MI, MCInst &MCI,
59 HexagonAsmPrinter &AP);
60 } // end namespace llvm;
62 #define Hexagon_POINTER_SIZE 4
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
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
73 // Normal instruction size (in bytes).
74 #define HEXAGON_INSTR_SIZE 4
76 // Maximum number of words and instructions in a packet.
77 #define HEXAGON_PACKET_SIZE 4