aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Target/Hexagon/Hexagon.h
blob: e0a3b2f5e5eb8743a795d33cd152b6f1f5555c8c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
//=-- Hexagon.h - Top-level interface for Hexagon representation --*- C++ -*-=//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This file contains the entry points for global functions defined in the LLVM
// Hexagon back-end.
//
//===----------------------------------------------------------------------===//

#ifndef LLVM_LIB_TARGET_HEXAGON_HEXAGON_H
#define LLVM_LIB_TARGET_HEXAGON_HEXAGON_H

#include "MCTargetDesc/HexagonMCTargetDesc.h"
#include "llvm/Target/TargetLowering.h"
#include "llvm/Target/TargetMachine.h"

namespace llvm {
  class FunctionPass;
  class HexagonAsmPrinter;
  class HexagonTargetMachine;
  class MachineInstr;
  class MCInst;
  class ModulePass;
  class raw_ostream;
  class TargetMachine;

  FunctionPass *createHexagonISelDag(HexagonTargetMachine &TM,
                                     CodeGenOpt::Level OptLevel);
  FunctionPass *createHexagonDelaySlotFillerPass(const TargetMachine &TM);
  FunctionPass *createHexagonFPMoverPass(const TargetMachine &TM);
  FunctionPass *createHexagonRemoveExtendArgs(const HexagonTargetMachine &TM);
  FunctionPass *createHexagonCFGOptimizer();

  FunctionPass *createHexagonSplitTFRCondSets();
  FunctionPass *createHexagonSplitConst32AndConst64();
  FunctionPass *createHexagonExpandPredSpillCode();
  FunctionPass *createHexagonHardwareLoops();
  FunctionPass *createHexagonPeephole();
  FunctionPass *createHexagonFixupHwLoops();
  FunctionPass *createHexagonNewValueJump();
  FunctionPass *createHexagonCopyToCombine();
  FunctionPass *createHexagonPacketizer();
  FunctionPass *createHexagonNewValueJump();

/* TODO: object output.
  MCCodeEmitter *createHexagonMCCodeEmitter(const Target &,
                                            const TargetMachine &TM,
                                            MCContext &Ctx);
*/
/* TODO: assembler input.
  TargetAsmBackend *createHexagonAsmBackend(const Target &,
                                                  const std::string &);
*/
  void HexagonLowerToMC(MachineInstr const *MI, MCInst &MCI,
                        HexagonAsmPrinter &AP);
} // end namespace llvm;

#define Hexagon_POINTER_SIZE 4

#define Hexagon_PointerSize (Hexagon_POINTER_SIZE)
#define Hexagon_PointerSize_Bits (Hexagon_POINTER_SIZE * 8)
#define Hexagon_WordSize Hexagon_PointerSize
#define Hexagon_WordSize_Bits Hexagon_PointerSize_Bits

// allocframe saves LR and FP on stack before allocating
// a new stack frame. This takes 8 bytes.
#define HEXAGON_LRFP_SIZE 8

// Normal instruction size (in bytes).
#define HEXAGON_INSTR_SIZE 4

// Maximum number of words and instructions in a packet.
#define HEXAGON_PACKET_SIZE 4

#endif