1b4b54153ad760c69a00a08531abef4ed434a5092Tony Linthicum//=-- Hexagon.h - Top-level interface for Hexagon representation --*- C++ -*-=//
2b4b54153ad760c69a00a08531abef4ed434a5092Tony Linthicum//
3b4b54153ad760c69a00a08531abef4ed434a5092Tony Linthicum//                     The LLVM Compiler Infrastructure
4b4b54153ad760c69a00a08531abef4ed434a5092Tony Linthicum//
5b4b54153ad760c69a00a08531abef4ed434a5092Tony Linthicum// This file is distributed under the University of Illinois Open Source
6b4b54153ad760c69a00a08531abef4ed434a5092Tony Linthicum// License. See LICENSE.TXT for details.
7b4b54153ad760c69a00a08531abef4ed434a5092Tony Linthicum//
8b4b54153ad760c69a00a08531abef4ed434a5092Tony Linthicum//===----------------------------------------------------------------------===//
9b4b54153ad760c69a00a08531abef4ed434a5092Tony Linthicum//
10b4b54153ad760c69a00a08531abef4ed434a5092Tony Linthicum// This file contains the entry points for global functions defined in the LLVM
11b4b54153ad760c69a00a08531abef4ed434a5092Tony Linthicum// Hexagon back-end.
12b4b54153ad760c69a00a08531abef4ed434a5092Tony Linthicum//
13b4b54153ad760c69a00a08531abef4ed434a5092Tony Linthicum//===----------------------------------------------------------------------===//
14b4b54153ad760c69a00a08531abef4ed434a5092Tony Linthicum
15b4b54153ad760c69a00a08531abef4ed434a5092Tony Linthicum#ifndef TARGET_Hexagon_H
16b4b54153ad760c69a00a08531abef4ed434a5092Tony Linthicum#define TARGET_Hexagon_H
17b4b54153ad760c69a00a08531abef4ed434a5092Tony Linthicum
18d239ff67f210094c205be7e57332948caecf6a24Tony Linthicum#include "MCTargetDesc/HexagonMCTargetDesc.h"
19b4b54153ad760c69a00a08531abef4ed434a5092Tony Linthicum#include "llvm/Target/TargetLowering.h"
20e5041e6fa8fa74a26e031b7487be1912257c87f1Evandro Menezes#include "llvm/Target/TargetMachine.h"
21b4b54153ad760c69a00a08531abef4ed434a5092Tony Linthicum
22b4b54153ad760c69a00a08531abef4ed434a5092Tony Linthicumnamespace llvm {
23b4b54153ad760c69a00a08531abef4ed434a5092Tony Linthicum  class FunctionPass;
24d6c98ae63824854ea2175b362a10985cac7cfb32Jyotsna Verma  class ModulePass;
25b4b54153ad760c69a00a08531abef4ed434a5092Tony Linthicum  class TargetMachine;
26e5041e6fa8fa74a26e031b7487be1912257c87f1Evandro Menezes  class MachineInstr;
27d6c98ae63824854ea2175b362a10985cac7cfb32Jyotsna Verma  class HexagonMCInst;
28e5041e6fa8fa74a26e031b7487be1912257c87f1Evandro Menezes  class HexagonAsmPrinter;
29b4b54153ad760c69a00a08531abef4ed434a5092Tony Linthicum  class HexagonTargetMachine;
30b4b54153ad760c69a00a08531abef4ed434a5092Tony Linthicum  class raw_ostream;
31b4b54153ad760c69a00a08531abef4ed434a5092Tony Linthicum
32ba54bca472a15d0657e1b88776f7069042b60b4eBill Wendling  FunctionPass *createHexagonISelDag(HexagonTargetMachine &TM,
33f6563427c40774953d4a7a0387a000f7a6d94ee1Jyotsna Verma                                     CodeGenOpt::Level OptLevel);
34ed6fe299cf411ca315bc90aa6dfc095d28689ae2Krzysztof Parzyszek  FunctionPass *createHexagonDelaySlotFillerPass(const TargetMachine &TM);
35ed6fe299cf411ca315bc90aa6dfc095d28689ae2Krzysztof Parzyszek  FunctionPass *createHexagonFPMoverPass(const TargetMachine &TM);
36ed6fe299cf411ca315bc90aa6dfc095d28689ae2Krzysztof Parzyszek  FunctionPass *createHexagonRemoveExtendArgs(const HexagonTargetMachine &TM);
37ed6fe299cf411ca315bc90aa6dfc095d28689ae2Krzysztof Parzyszek  FunctionPass *createHexagonCFGOptimizer(const HexagonTargetMachine &TM);
385262abb2682a4d09cda3563a55f27caffb57466cBrendon Cahoon
39ed6fe299cf411ca315bc90aa6dfc095d28689ae2Krzysztof Parzyszek  FunctionPass *createHexagonSplitTFRCondSets(const HexagonTargetMachine &TM);
40f931f691ee23d431135481fcf23a58658824ca67Jyotsna Verma  FunctionPass *createHexagonSplitConst32AndConst64(
41f931f691ee23d431135481fcf23a58658824ca67Jyotsna Verma                      const HexagonTargetMachine &TM);
42ed6fe299cf411ca315bc90aa6dfc095d28689ae2Krzysztof Parzyszek  FunctionPass *createHexagonExpandPredSpillCode(
43ed6fe299cf411ca315bc90aa6dfc095d28689ae2Krzysztof Parzyszek                      const HexagonTargetMachine &TM);
44b4b54153ad760c69a00a08531abef4ed434a5092Tony Linthicum  FunctionPass *createHexagonHardwareLoops();
45ab7955b9ce3197215406bc9fc97b22074127d035Sirish Pande  FunctionPass *createHexagonPeephole();
46b4b54153ad760c69a00a08531abef4ed434a5092Tony Linthicum  FunctionPass *createHexagonFixupHwLoops();
47a29a8965e206e689d292d7f2e42f2548770e30d3Jyotsna Verma  FunctionPass *createHexagonNewValueJump();
48a29a8965e206e689d292d7f2e42f2548770e30d3Jyotsna Verma  FunctionPass *createHexagonCopyToCombine();
4926f61a158b3cce69252c05cc0e79f500d6c3d92eSirish Pande  FunctionPass *createHexagonPacketizer();
50b33857040f63a9fdfb0c2a2ca2af67ec12cf9d02Sirish Pande  FunctionPass *createHexagonNewValueJump();
51b33857040f63a9fdfb0c2a2ca2af67ec12cf9d02Sirish Pande
52e5041e6fa8fa74a26e031b7487be1912257c87f1Evandro Menezes/* TODO: object output.
53e5041e6fa8fa74a26e031b7487be1912257c87f1Evandro Menezes  MCCodeEmitter *createHexagonMCCodeEmitter(const Target &,
54ed6fe299cf411ca315bc90aa6dfc095d28689ae2Krzysztof Parzyszek                                            const TargetMachine &TM,
55e5041e6fa8fa74a26e031b7487be1912257c87f1Evandro Menezes                                            MCContext &Ctx);
56e5041e6fa8fa74a26e031b7487be1912257c87f1Evandro Menezes*/
57e5041e6fa8fa74a26e031b7487be1912257c87f1Evandro Menezes/* TODO: assembler input.
58b33857040f63a9fdfb0c2a2ca2af67ec12cf9d02Sirish Pande  TargetAsmBackend *createHexagonAsmBackend(const Target &,
5926f61a158b3cce69252c05cc0e79f500d6c3d92eSirish Pande                                                  const std::string &);
60e5041e6fa8fa74a26e031b7487be1912257c87f1Evandro Menezes*/
61d6c98ae63824854ea2175b362a10985cac7cfb32Jyotsna Verma  void HexagonLowerToMC(const MachineInstr *MI, HexagonMCInst &MCI,
62e5041e6fa8fa74a26e031b7487be1912257c87f1Evandro Menezes                        HexagonAsmPrinter &AP);
63b4b54153ad760c69a00a08531abef4ed434a5092Tony Linthicum} // end namespace llvm;
64b4b54153ad760c69a00a08531abef4ed434a5092Tony Linthicum
65b4b54153ad760c69a00a08531abef4ed434a5092Tony Linthicum#define Hexagon_POINTER_SIZE 4
66b4b54153ad760c69a00a08531abef4ed434a5092Tony Linthicum
67b4b54153ad760c69a00a08531abef4ed434a5092Tony Linthicum#define Hexagon_PointerSize (Hexagon_POINTER_SIZE)
68b4b54153ad760c69a00a08531abef4ed434a5092Tony Linthicum#define Hexagon_PointerSize_Bits (Hexagon_POINTER_SIZE * 8)
69b4b54153ad760c69a00a08531abef4ed434a5092Tony Linthicum#define Hexagon_WordSize Hexagon_PointerSize
70b4b54153ad760c69a00a08531abef4ed434a5092Tony Linthicum#define Hexagon_WordSize_Bits Hexagon_PointerSize_Bits
71b4b54153ad760c69a00a08531abef4ed434a5092Tony Linthicum
72b4b54153ad760c69a00a08531abef4ed434a5092Tony Linthicum// allocframe saves LR and FP on stack before allocating
73b4b54153ad760c69a00a08531abef4ed434a5092Tony Linthicum// a new stack frame. This takes 8 bytes.
74b4b54153ad760c69a00a08531abef4ed434a5092Tony Linthicum#define HEXAGON_LRFP_SIZE 8
75b4b54153ad760c69a00a08531abef4ed434a5092Tony Linthicum
76e5041e6fa8fa74a26e031b7487be1912257c87f1Evandro Menezes// Normal instruction size (in bytes).
77e5041e6fa8fa74a26e031b7487be1912257c87f1Evandro Menezes#define HEXAGON_INSTR_SIZE 4
78e5041e6fa8fa74a26e031b7487be1912257c87f1Evandro Menezes
7926f61a158b3cce69252c05cc0e79f500d6c3d92eSirish Pande// Maximum number of words and instructions in a packet.
80e5041e6fa8fa74a26e031b7487be1912257c87f1Evandro Menezes#define HEXAGON_PACKET_SIZE 4
81e5041e6fa8fa74a26e031b7487be1912257c87f1Evandro Menezes
82b4b54153ad760c69a00a08531abef4ed434a5092Tony Linthicum#endif
83