blob: 080832333671f1b74bb62f2a4284fbddf6be899f [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);
Tony Linthicumb4b54152011-12-12 21:14:40 +000039
40 FunctionPass *createHexagonHardwareLoops();
Sirish Pandeab7955b2012-02-15 18:52:27 +000041 FunctionPass *createHexagonPeephole();
Tony Linthicumb4b54152011-12-12 21:14:40 +000042 FunctionPass *createHexagonFixupHwLoops();
43
Evandro Menezese5041e62012-04-12 17:55:53 +000044/* 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);
Tony Linthicumb4b54152011-12-12 21:14:40 +000054} // end namespace llvm;
55
Tony Linthicumb4b54152011-12-12 21:14:40 +000056#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
Evandro Menezese5041e62012-04-12 17:55:53 +000067// 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
Tony Linthicumb4b54152011-12-12 21:14:40 +000073#endif