Tony Linthicum | b4b5415 | 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 | |
| 15 | #ifndef TARGET_Hexagon_H |
| 16 | #define TARGET_Hexagon_H |
| 17 | |
Tony Linthicum | d239ff6 | 2011-12-15 22:29:08 +0000 | [diff] [blame] | 18 | #include "MCTargetDesc/HexagonMCTargetDesc.h" |
Tony Linthicum | b4b5415 | 2011-12-12 21:14:40 +0000 | [diff] [blame] | 19 | #include "llvm/Target/TargetLowering.h" |
Evandro Menezes | e5041e6 | 2012-04-12 17:55:53 +0000 | [diff] [blame] | 20 | #include "llvm/Target/TargetMachine.h" |
Tony Linthicum | b4b5415 | 2011-12-12 21:14:40 +0000 | [diff] [blame] | 21 | |
| 22 | namespace llvm { |
| 23 | class FunctionPass; |
| 24 | class TargetMachine; |
Evandro Menezes | e5041e6 | 2012-04-12 17:55:53 +0000 | [diff] [blame] | 25 | class MachineInstr; |
| 26 | class MCInst; |
| 27 | class HexagonAsmPrinter; |
Tony Linthicum | b4b5415 | 2011-12-12 21:14:40 +0000 | [diff] [blame] | 28 | class HexagonTargetMachine; |
| 29 | class raw_ostream; |
| 30 | |
| 31 | FunctionPass *createHexagonISelDag(HexagonTargetMachine &TM); |
| 32 | FunctionPass *createHexagonDelaySlotFillerPass(TargetMachine &TM); |
| 33 | FunctionPass *createHexagonFPMoverPass(TargetMachine &TM); |
| 34 | FunctionPass *createHexagonRemoveExtendOps(HexagonTargetMachine &TM); |
| 35 | FunctionPass *createHexagonCFGOptimizer(HexagonTargetMachine &TM); |
| 36 | |
Evandro Menezes | e5041e6 | 2012-04-12 17:55:53 +0000 | [diff] [blame] | 37 | FunctionPass *createHexagonSplitTFRCondSets(HexagonTargetMachine &TM); |
| 38 | FunctionPass *createHexagonExpandPredSpillCode(HexagonTargetMachine &TM); |
Brendon Cahoon | 6d532d8 | 2012-05-11 19:56:59 +0000 | [diff] [blame^] | 39 | FunctionPass *createHexagonOptimizeConstExt(HexagonTargetMachine &TM); |
Tony Linthicum | b4b5415 | 2011-12-12 21:14:40 +0000 | [diff] [blame] | 40 | FunctionPass *createHexagonHardwareLoops(); |
Sirish Pande | ab7955b | 2012-02-15 18:52:27 +0000 | [diff] [blame] | 41 | FunctionPass *createHexagonPeephole(); |
Tony Linthicum | b4b5415 | 2011-12-12 21:14:40 +0000 | [diff] [blame] | 42 | FunctionPass *createHexagonFixupHwLoops(); |
Sirish Pande | 26f61a1 | 2012-05-03 21:52:53 +0000 | [diff] [blame] | 43 | FunctionPass *createHexagonPacketizer(); |
Tony Linthicum | b4b5415 | 2011-12-12 21:14:40 +0000 | [diff] [blame] | 44 | |
Evandro Menezes | e5041e6 | 2012-04-12 17:55:53 +0000 | [diff] [blame] | 45 | /* TODO: object output. |
| 46 | MCCodeEmitter *createHexagonMCCodeEmitter(const Target &, |
| 47 | TargetMachine &TM, |
| 48 | MCContext &Ctx); |
| 49 | */ |
| 50 | /* TODO: assembler input. |
Sirish Pande | 26f61a1 | 2012-05-03 21:52:53 +0000 | [diff] [blame] | 51 | TargetAsmBackend *createHexagonAsmBackend(const Target &, |
| 52 | const std::string &); |
Evandro Menezes | e5041e6 | 2012-04-12 17:55:53 +0000 | [diff] [blame] | 53 | */ |
| 54 | void HexagonLowerToMC(const MachineInstr *MI, MCInst &MCI, |
| 55 | HexagonAsmPrinter &AP); |
Tony Linthicum | b4b5415 | 2011-12-12 21:14:40 +0000 | [diff] [blame] | 56 | } // end namespace llvm; |
| 57 | |
Tony Linthicum | b4b5415 | 2011-12-12 21:14:40 +0000 | [diff] [blame] | 58 | #define Hexagon_POINTER_SIZE 4 |
| 59 | |
| 60 | #define Hexagon_PointerSize (Hexagon_POINTER_SIZE) |
| 61 | #define Hexagon_PointerSize_Bits (Hexagon_POINTER_SIZE * 8) |
| 62 | #define Hexagon_WordSize Hexagon_PointerSize |
| 63 | #define Hexagon_WordSize_Bits Hexagon_PointerSize_Bits |
| 64 | |
| 65 | // allocframe saves LR and FP on stack before allocating |
| 66 | // a new stack frame. This takes 8 bytes. |
| 67 | #define HEXAGON_LRFP_SIZE 8 |
| 68 | |
Evandro Menezes | e5041e6 | 2012-04-12 17:55:53 +0000 | [diff] [blame] | 69 | // Normal instruction size (in bytes). |
| 70 | #define HEXAGON_INSTR_SIZE 4 |
| 71 | |
Sirish Pande | 26f61a1 | 2012-05-03 21:52:53 +0000 | [diff] [blame] | 72 | // Maximum number of words and instructions in a packet. |
Evandro Menezes | e5041e6 | 2012-04-12 17:55:53 +0000 | [diff] [blame] | 73 | #define HEXAGON_PACKET_SIZE 4 |
| 74 | |
Tony Linthicum | b4b5415 | 2011-12-12 21:14:40 +0000 | [diff] [blame] | 75 | #endif |