blob: 66b387b62c6cdfae07cf58719740a778505838c9 [file] [log] [blame]
Tony Linthicum1213a7a2011-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
Benjamin Kramera7c40ef2014-08-13 16:26:38 +000015#ifndef LLVM_LIB_TARGET_HEXAGON_HEXAGON_H
16#define LLVM_LIB_TARGET_HEXAGON_HEXAGON_H
Tony Linthicum1213a7a2011-12-12 21:14:40 +000017
Tony Linthicum1213a7a2011-12-12 21:14:40 +000018#define Hexagon_POINTER_SIZE 4
19
20#define Hexagon_PointerSize (Hexagon_POINTER_SIZE)
21#define Hexagon_PointerSize_Bits (Hexagon_POINTER_SIZE * 8)
22#define Hexagon_WordSize Hexagon_PointerSize
23#define Hexagon_WordSize_Bits Hexagon_PointerSize_Bits
24
25// allocframe saves LR and FP on stack before allocating
26// a new stack frame. This takes 8 bytes.
27#define HEXAGON_LRFP_SIZE 8
28
Evandro Menezes5cee6212012-04-12 17:55:53 +000029// Normal instruction size (in bytes).
30#define HEXAGON_INSTR_SIZE 4
31
Sirish Pandef8e5e3c2012-05-03 21:52:53 +000032// Maximum number of words and instructions in a packet.
Evandro Menezes5cee6212012-04-12 17:55:53 +000033#define HEXAGON_PACKET_SIZE 4
Colin LeMahieu56efafc2015-06-15 19:05:35 +000034#define HEXAGON_MAX_PACKET_SIZE (HEXAGON_PACKET_SIZE * HEXAGON_INSTR_SIZE)
Colin LeMahieu68d967d2015-05-29 14:44:13 +000035// Minimum number of instructions in an end-loop packet.
36#define HEXAGON_PACKET_INNER_SIZE 2
37#define HEXAGON_PACKET_OUTER_SIZE 3
Colin LeMahieub23c47b2015-05-31 21:57:09 +000038// Maximum number of instructions in a packet before shuffling,
39// including a compound one or a duplex or an extender.
40#define HEXAGON_PRESHUFFLE_PACKET_SIZE (HEXAGON_PACKET_SIZE + 3)
Colin LeMahieu68d967d2015-05-29 14:44:13 +000041
Colin LeMahieu56efafc2015-06-15 19:05:35 +000042// Name of the global offset table as defined by the Hexagon ABI
43#define HEXAGON_GOT_SYM_NAME "_GLOBAL_OFFSET_TABLE_"
44
45#include "MCTargetDesc/HexagonMCTargetDesc.h"
David Blaikieb3bde2e2017-11-17 01:07:10 +000046#include "llvm/CodeGen/TargetLowering.h"
Colin LeMahieu56efafc2015-06-15 19:05:35 +000047#include "llvm/Target/TargetMachine.h"
48
49namespace llvm {
Colin LeMahieu56efafc2015-06-15 19:05:35 +000050 class HexagonTargetMachine;
51
Colin LeMahieu56efafc2015-06-15 19:05:35 +000052 /// \brief Creates a Hexagon-specific Target Transformation Info pass.
53 ImmutablePass *createHexagonTargetTransformInfoPass(const HexagonTargetMachine *TM);
Alexander Kornienkof00654e2015-06-23 09:49:53 +000054} // end namespace llvm;
Colin LeMahieu56efafc2015-06-15 19:05:35 +000055
Tony Linthicum1213a7a2011-12-12 21:14:40 +000056#endif