Hexagon.h revision e5041e6fa8fa74a26e031b7487be1912257c87f1
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
22namespace 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
44/* TODO: object output.
45  MCCodeEmitter *createHexagonMCCodeEmitter(const Target &,
46                                            TargetMachine &TM,
47                                            MCContext &Ctx);
48*/
49/* TODO: assembler input.
50  TargetAsmBackend *createHexagonAsmBackend(const Target &, const std::string &);
51*/
52  void HexagonLowerToMC(const MachineInstr *MI, MCInst &MCI,
53                        HexagonAsmPrinter &AP);
54} // end namespace llvm;
55
56#define Hexagon_POINTER_SIZE 4
57
58#define Hexagon_PointerSize (Hexagon_POINTER_SIZE)
59#define Hexagon_PointerSize_Bits (Hexagon_POINTER_SIZE * 8)
60#define Hexagon_WordSize Hexagon_PointerSize
61#define Hexagon_WordSize_Bits Hexagon_PointerSize_Bits
62
63// allocframe saves LR and FP on stack before allocating
64// a new stack frame. This takes 8 bytes.
65#define HEXAGON_LRFP_SIZE 8
66
67// Normal instruction size (in bytes).
68#define HEXAGON_INSTR_SIZE 4
69
70// Maximum number of words in a packet (in instructions).
71#define HEXAGON_PACKET_SIZE 4
72
73#endif
74