blob: d73be80f5301a05fecee0bc82b8bcbf4077203b0 [file] [log] [blame]
Tony Linthicumb4b54152011-12-12 21:14:40 +00001//=-- 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
Tony Linthicumd239ff62011-12-15 22:29:08 +000018#include "MCTargetDesc/HexagonMCTargetDesc.h"
Tony Linthicumb4b54152011-12-12 21:14:40 +000019#include "llvm/Target/TargetLowering.h"
Evandro Menezese5041e62012-04-12 17:55:53 +000020#include "llvm/Target/TargetMachine.h"
Tony Linthicumb4b54152011-12-12 21:14:40 +000021
22namespace llvm {
23 class FunctionPass;
24 class TargetMachine;
Evandro Menezese5041e62012-04-12 17:55:53 +000025 class MachineInstr;
26 class MCInst;
27 class HexagonAsmPrinter;
Tony Linthicumb4b54152011-12-12 21:14:40 +000028 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
Evandro Menezese5041e62012-04-12 17:55:53 +000037 FunctionPass *createHexagonSplitTFRCondSets(HexagonTargetMachine &TM);
38 FunctionPass *createHexagonExpandPredSpillCode(HexagonTargetMachine &TM);
Brendon Cahoon6d532d82012-05-11 19:56:59 +000039 FunctionPass *createHexagonOptimizeConstExt(HexagonTargetMachine &TM);
Tony Linthicumb4b54152011-12-12 21:14:40 +000040 FunctionPass *createHexagonHardwareLoops();
Sirish Pandeab7955b2012-02-15 18:52:27 +000041 FunctionPass *createHexagonPeephole();
Tony Linthicumb4b54152011-12-12 21:14:40 +000042 FunctionPass *createHexagonFixupHwLoops();
Sirish Pande26f61a12012-05-03 21:52:53 +000043 FunctionPass *createHexagonPacketizer();
Tony Linthicumb4b54152011-12-12 21:14:40 +000044
Evandro Menezese5041e62012-04-12 17:55:53 +000045/* TODO: object output.
46 MCCodeEmitter *createHexagonMCCodeEmitter(const Target &,
47 TargetMachine &TM,
48 MCContext &Ctx);
49*/
50/* TODO: assembler input.
Sirish Pande26f61a12012-05-03 21:52:53 +000051 TargetAsmBackend *createHexagonAsmBackend(const Target &,
52 const std::string &);
Evandro Menezese5041e62012-04-12 17:55:53 +000053*/
54 void HexagonLowerToMC(const MachineInstr *MI, MCInst &MCI,
55 HexagonAsmPrinter &AP);
Tony Linthicumb4b54152011-12-12 21:14:40 +000056} // end namespace llvm;
57
Tony Linthicumb4b54152011-12-12 21:14:40 +000058#define Hexagon_POINTER_SIZE 4
59
60#define Hexagon_PointerSize (Hexagon_POINTER_SIZE)
61#define Hexagon_PointerSize_Bits (Hexagon_POINTER_SIZE * 8)
62#define Hexagon_WordSize Hexagon_PointerSize
63#define Hexagon_WordSize_Bits Hexagon_PointerSize_Bits
64
65// allocframe saves LR and FP on stack before allocating
66// a new stack frame. This takes 8 bytes.
67#define HEXAGON_LRFP_SIZE 8
68
Evandro Menezese5041e62012-04-12 17:55:53 +000069// Normal instruction size (in bytes).
70#define HEXAGON_INSTR_SIZE 4
71
Sirish Pande26f61a12012-05-03 21:52:53 +000072// Maximum number of words and instructions in a packet.
Evandro Menezese5041e62012-04-12 17:55:53 +000073#define HEXAGON_PACKET_SIZE 4
74
Tony Linthicumb4b54152011-12-12 21:14:40 +000075#endif