Tony Linthicum | 1213a7a | 2011-12-12 21:14:40 +0000 | [diff] [blame] | 1 | //=-- 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 Kramer | a7c40ef | 2014-08-13 16:26:38 +0000 | [diff] [blame] | 15 | #ifndef LLVM_LIB_TARGET_HEXAGON_HEXAGON_H |
| 16 | #define LLVM_LIB_TARGET_HEXAGON_HEXAGON_H |
Tony Linthicum | 1213a7a | 2011-12-12 21:14:40 +0000 | [diff] [blame] | 17 | |
Tony Linthicum | b3705e0 | 2011-12-15 22:29:08 +0000 | [diff] [blame] | 18 | #include "MCTargetDesc/HexagonMCTargetDesc.h" |
Tony Linthicum | 1213a7a | 2011-12-12 21:14:40 +0000 | [diff] [blame] | 19 | #include "llvm/Target/TargetLowering.h" |
Evandro Menezes | 5cee621 | 2012-04-12 17:55:53 +0000 | [diff] [blame] | 20 | #include "llvm/Target/TargetMachine.h" |
Tony Linthicum | 1213a7a | 2011-12-12 21:14:40 +0000 | [diff] [blame] | 21 | |
| 22 | namespace llvm { |
| 23 | class FunctionPass; |
Jyotsna Verma | 7503a62 | 2013-02-20 16:13:27 +0000 | [diff] [blame] | 24 | class ModulePass; |
Tony Linthicum | 1213a7a | 2011-12-12 21:14:40 +0000 | [diff] [blame] | 25 | class TargetMachine; |
Evandro Menezes | 5cee621 | 2012-04-12 17:55:53 +0000 | [diff] [blame] | 26 | class MachineInstr; |
Jyotsna Verma | 7503a62 | 2013-02-20 16:13:27 +0000 | [diff] [blame] | 27 | class HexagonMCInst; |
Evandro Menezes | 5cee621 | 2012-04-12 17:55:53 +0000 | [diff] [blame] | 28 | class HexagonAsmPrinter; |
Tony Linthicum | 1213a7a | 2011-12-12 21:14:40 +0000 | [diff] [blame] | 29 | class HexagonTargetMachine; |
| 30 | class raw_ostream; |
| 31 | |
Bill Wendling | a3cd350 | 2013-06-19 21:36:55 +0000 | [diff] [blame] | 32 | FunctionPass *createHexagonISelDag(HexagonTargetMachine &TM, |
Jyotsna Verma | d922524 | 2013-02-13 21:38:46 +0000 | [diff] [blame] | 33 | CodeGenOpt::Level OptLevel); |
Krzysztof Parzyszek | d500747 | 2013-05-06 18:38:37 +0000 | [diff] [blame] | 34 | FunctionPass *createHexagonDelaySlotFillerPass(const TargetMachine &TM); |
| 35 | FunctionPass *createHexagonFPMoverPass(const TargetMachine &TM); |
| 36 | FunctionPass *createHexagonRemoveExtendArgs(const HexagonTargetMachine &TM); |
| 37 | FunctionPass *createHexagonCFGOptimizer(const HexagonTargetMachine &TM); |
Tony Linthicum | 1213a7a | 2011-12-12 21:14:40 +0000 | [diff] [blame] | 38 | |
Krzysztof Parzyszek | d500747 | 2013-05-06 18:38:37 +0000 | [diff] [blame] | 39 | FunctionPass *createHexagonSplitTFRCondSets(const HexagonTargetMachine &TM); |
Jyotsna Verma | 5eb5980 | 2013-05-07 19:53:00 +0000 | [diff] [blame] | 40 | FunctionPass *createHexagonSplitConst32AndConst64( |
| 41 | const HexagonTargetMachine &TM); |
Krzysztof Parzyszek | d500747 | 2013-05-06 18:38:37 +0000 | [diff] [blame] | 42 | FunctionPass *createHexagonExpandPredSpillCode( |
| 43 | const HexagonTargetMachine &TM); |
Tony Linthicum | 1213a7a | 2011-12-12 21:14:40 +0000 | [diff] [blame] | 44 | FunctionPass *createHexagonHardwareLoops(); |
Sirish Pande | 30804c2 | 2012-02-15 18:52:27 +0000 | [diff] [blame] | 45 | FunctionPass *createHexagonPeephole(); |
Tony Linthicum | 1213a7a | 2011-12-12 21:14:40 +0000 | [diff] [blame] | 46 | FunctionPass *createHexagonFixupHwLoops(); |
Jyotsna Verma | 803e506 | 2013-05-14 18:54:06 +0000 | [diff] [blame] | 47 | FunctionPass *createHexagonNewValueJump(); |
| 48 | FunctionPass *createHexagonCopyToCombine(); |
Sirish Pande | f8e5e3c | 2012-05-03 21:52:53 +0000 | [diff] [blame] | 49 | FunctionPass *createHexagonPacketizer(); |
Sirish Pande | 4bd20c5 | 2012-05-12 05:10:30 +0000 | [diff] [blame] | 50 | FunctionPass *createHexagonNewValueJump(); |
| 51 | |
Evandro Menezes | 5cee621 | 2012-04-12 17:55:53 +0000 | [diff] [blame] | 52 | /* TODO: object output. |
| 53 | MCCodeEmitter *createHexagonMCCodeEmitter(const Target &, |
Krzysztof Parzyszek | d500747 | 2013-05-06 18:38:37 +0000 | [diff] [blame] | 54 | const TargetMachine &TM, |
Evandro Menezes | 5cee621 | 2012-04-12 17:55:53 +0000 | [diff] [blame] | 55 | MCContext &Ctx); |
| 56 | */ |
| 57 | /* TODO: assembler input. |
Sirish Pande | 4bd20c5 | 2012-05-12 05:10:30 +0000 | [diff] [blame] | 58 | TargetAsmBackend *createHexagonAsmBackend(const Target &, |
Sirish Pande | f8e5e3c | 2012-05-03 21:52:53 +0000 | [diff] [blame] | 59 | const std::string &); |
Evandro Menezes | 5cee621 | 2012-04-12 17:55:53 +0000 | [diff] [blame] | 60 | */ |
Jyotsna Verma | 7503a62 | 2013-02-20 16:13:27 +0000 | [diff] [blame] | 61 | void HexagonLowerToMC(const MachineInstr *MI, HexagonMCInst &MCI, |
Evandro Menezes | 5cee621 | 2012-04-12 17:55:53 +0000 | [diff] [blame] | 62 | HexagonAsmPrinter &AP); |
Tony Linthicum | 1213a7a | 2011-12-12 21:14:40 +0000 | [diff] [blame] | 63 | } // end namespace llvm; |
| 64 | |
Tony Linthicum | 1213a7a | 2011-12-12 21:14:40 +0000 | [diff] [blame] | 65 | #define Hexagon_POINTER_SIZE 4 |
| 66 | |
| 67 | #define Hexagon_PointerSize (Hexagon_POINTER_SIZE) |
| 68 | #define Hexagon_PointerSize_Bits (Hexagon_POINTER_SIZE * 8) |
| 69 | #define Hexagon_WordSize Hexagon_PointerSize |
| 70 | #define Hexagon_WordSize_Bits Hexagon_PointerSize_Bits |
| 71 | |
| 72 | // allocframe saves LR and FP on stack before allocating |
| 73 | // a new stack frame. This takes 8 bytes. |
| 74 | #define HEXAGON_LRFP_SIZE 8 |
| 75 | |
Evandro Menezes | 5cee621 | 2012-04-12 17:55:53 +0000 | [diff] [blame] | 76 | // Normal instruction size (in bytes). |
| 77 | #define HEXAGON_INSTR_SIZE 4 |
| 78 | |
Sirish Pande | f8e5e3c | 2012-05-03 21:52:53 +0000 | [diff] [blame] | 79 | // Maximum number of words and instructions in a packet. |
Evandro Menezes | 5cee621 | 2012-04-12 17:55:53 +0000 | [diff] [blame] | 80 | #define HEXAGON_PACKET_SIZE 4 |
| 81 | |
Tony Linthicum | 1213a7a | 2011-12-12 21:14:40 +0000 | [diff] [blame] | 82 | #endif |