xref: /aosp_15_r20/external/llvm/lib/Target/Hexagon/Hexagon.h (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker //=-- Hexagon.h - Top-level interface for Hexagon representation --*- C++ -*-=//
2*9880d681SAndroid Build Coastguard Worker //
3*9880d681SAndroid Build Coastguard Worker //                     The LLVM Compiler Infrastructure
4*9880d681SAndroid Build Coastguard Worker //
5*9880d681SAndroid Build Coastguard Worker // This file is distributed under the University of Illinois Open Source
6*9880d681SAndroid Build Coastguard Worker // License. See LICENSE.TXT for details.
7*9880d681SAndroid Build Coastguard Worker //
8*9880d681SAndroid Build Coastguard Worker //===----------------------------------------------------------------------===//
9*9880d681SAndroid Build Coastguard Worker //
10*9880d681SAndroid Build Coastguard Worker // This file contains the entry points for global functions defined in the LLVM
11*9880d681SAndroid Build Coastguard Worker // Hexagon back-end.
12*9880d681SAndroid Build Coastguard Worker //
13*9880d681SAndroid Build Coastguard Worker //===----------------------------------------------------------------------===//
14*9880d681SAndroid Build Coastguard Worker 
15*9880d681SAndroid Build Coastguard Worker #ifndef LLVM_LIB_TARGET_HEXAGON_HEXAGON_H
16*9880d681SAndroid Build Coastguard Worker #define LLVM_LIB_TARGET_HEXAGON_HEXAGON_H
17*9880d681SAndroid Build Coastguard Worker 
18*9880d681SAndroid Build Coastguard Worker #define Hexagon_POINTER_SIZE 4
19*9880d681SAndroid Build Coastguard Worker 
20*9880d681SAndroid Build Coastguard Worker #define Hexagon_PointerSize (Hexagon_POINTER_SIZE)
21*9880d681SAndroid Build Coastguard Worker #define Hexagon_PointerSize_Bits (Hexagon_POINTER_SIZE * 8)
22*9880d681SAndroid Build Coastguard Worker #define Hexagon_WordSize Hexagon_PointerSize
23*9880d681SAndroid Build Coastguard Worker #define Hexagon_WordSize_Bits Hexagon_PointerSize_Bits
24*9880d681SAndroid Build Coastguard Worker 
25*9880d681SAndroid Build Coastguard Worker // allocframe saves LR and FP on stack before allocating
26*9880d681SAndroid Build Coastguard Worker // a new stack frame. This takes 8 bytes.
27*9880d681SAndroid Build Coastguard Worker #define HEXAGON_LRFP_SIZE 8
28*9880d681SAndroid Build Coastguard Worker 
29*9880d681SAndroid Build Coastguard Worker // Normal instruction size (in bytes).
30*9880d681SAndroid Build Coastguard Worker #define HEXAGON_INSTR_SIZE 4
31*9880d681SAndroid Build Coastguard Worker 
32*9880d681SAndroid Build Coastguard Worker // Maximum number of words and instructions in a packet.
33*9880d681SAndroid Build Coastguard Worker #define HEXAGON_PACKET_SIZE 4
34*9880d681SAndroid Build Coastguard Worker #define HEXAGON_MAX_PACKET_SIZE (HEXAGON_PACKET_SIZE * HEXAGON_INSTR_SIZE)
35*9880d681SAndroid Build Coastguard Worker // Minimum number of instructions in an end-loop packet.
36*9880d681SAndroid Build Coastguard Worker #define HEXAGON_PACKET_INNER_SIZE 2
37*9880d681SAndroid Build Coastguard Worker #define HEXAGON_PACKET_OUTER_SIZE 3
38*9880d681SAndroid Build Coastguard Worker // Maximum number of instructions in a packet before shuffling,
39*9880d681SAndroid Build Coastguard Worker // including a compound one or a duplex or an extender.
40*9880d681SAndroid Build Coastguard Worker #define HEXAGON_PRESHUFFLE_PACKET_SIZE (HEXAGON_PACKET_SIZE + 3)
41*9880d681SAndroid Build Coastguard Worker 
42*9880d681SAndroid Build Coastguard Worker // Name of the global offset table as defined by the Hexagon ABI
43*9880d681SAndroid Build Coastguard Worker #define HEXAGON_GOT_SYM_NAME "_GLOBAL_OFFSET_TABLE_"
44*9880d681SAndroid Build Coastguard Worker 
45*9880d681SAndroid Build Coastguard Worker #include "MCTargetDesc/HexagonMCTargetDesc.h"
46*9880d681SAndroid Build Coastguard Worker #include "llvm/Target/TargetLowering.h"
47*9880d681SAndroid Build Coastguard Worker #include "llvm/Target/TargetMachine.h"
48*9880d681SAndroid Build Coastguard Worker 
49*9880d681SAndroid Build Coastguard Worker namespace llvm {
50*9880d681SAndroid Build Coastguard Worker   class HexagonTargetMachine;
51*9880d681SAndroid Build Coastguard Worker 
52*9880d681SAndroid Build Coastguard Worker   /// \brief Creates a Hexagon-specific Target Transformation Info pass.
53*9880d681SAndroid Build Coastguard Worker   ImmutablePass *createHexagonTargetTransformInfoPass(const HexagonTargetMachine *TM);
54*9880d681SAndroid Build Coastguard Worker } // end namespace llvm;
55*9880d681SAndroid Build Coastguard Worker 
56*9880d681SAndroid Build Coastguard Worker #endif
57