Jia Liu | b22310f | 2012-02-18 12:03:15 +0000 | [diff] [blame] | 1 | //===-- HexagonBaseInfo.h - Top level definitions for Hexagon --*- C++ -*--===// |
Brendon Cahoon | 6f35837 | 2012-02-08 18:25:47 +0000 | [diff] [blame] | 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 small standalone helper functions and enum definitions for |
| 11 | // the Hexagon target useful for the compiler back-end and the MC libraries. |
| 12 | // As such, it deliberately does not include references to LLVM core |
| 13 | // code gen types, passes, etc.. |
| 14 | // |
| 15 | //===----------------------------------------------------------------------===// |
| 16 | |
| 17 | #ifndef HEXAGONBASEINFO_H |
| 18 | #define HEXAGONBASEINFO_H |
| 19 | |
| 20 | namespace llvm { |
| 21 | |
| 22 | /// HexagonII - This namespace holds all of the target specific flags that |
| 23 | /// instruction info tracks. |
| 24 | /// |
| 25 | namespace HexagonII { |
Sirish Pande | 545983e | 2012-02-09 15:20:33 +0000 | [diff] [blame] | 26 | // *** The code below must match HexagonInstrFormat*.td *** // |
Brendon Cahoon | 6f35837 | 2012-02-08 18:25:47 +0000 | [diff] [blame] | 27 | |
Sirish Pande | f8e5e3c | 2012-05-03 21:52:53 +0000 | [diff] [blame] | 28 | // Insn types. |
| 29 | // *** Must match HexagonInstrFormat*.td *** |
| 30 | enum Type { |
| 31 | TypePSEUDO = 0, |
| 32 | TypeALU32 = 1, |
| 33 | TypeCR = 2, |
| 34 | TypeJR = 3, |
| 35 | TypeJ = 4, |
| 36 | TypeLD = 5, |
| 37 | TypeST = 6, |
| 38 | TypeSYSTEM = 7, |
| 39 | TypeXTYPE = 8, |
| 40 | TypeMEMOP = 9, |
| 41 | TypeNV = 10, |
| 42 | TypePREFIX = 30, // Such as extenders. |
| 43 | TypeMARKER = 31 // Such as end of a HW loop. |
| 44 | }; |
| 45 | |
| 46 | |
| 47 | |
Brendon Cahoon | 6f35837 | 2012-02-08 18:25:47 +0000 | [diff] [blame] | 48 | // MCInstrDesc TSFlags |
Sirish Pande | f8e5e3c | 2012-05-03 21:52:53 +0000 | [diff] [blame] | 49 | // *** Must match HexagonInstrFormat*.td *** |
Brendon Cahoon | 6f35837 | 2012-02-08 18:25:47 +0000 | [diff] [blame] | 50 | enum { |
Sirish Pande | f8e5e3c | 2012-05-03 21:52:53 +0000 | [diff] [blame] | 51 | // This 5-bit field describes the insn type. |
| 52 | TypePos = 0, |
| 53 | TypeMask = 0x1f, |
| 54 | |
| 55 | // Solo instructions. |
| 56 | SoloPos = 5, |
| 57 | SoloMask = 0x1, |
Brendon Cahoon | 6f35837 | 2012-02-08 18:25:47 +0000 | [diff] [blame] | 58 | |
| 59 | // Predicated instructions. |
Sirish Pande | f8e5e3c | 2012-05-03 21:52:53 +0000 | [diff] [blame] | 60 | PredicatedPos = 6, |
Brendon Cahoon | 6f35837 | 2012-02-08 18:25:47 +0000 | [diff] [blame] | 61 | PredicatedMask = 0x1 |
| 62 | }; |
| 63 | |
Sirish Pande | 545983e | 2012-02-09 15:20:33 +0000 | [diff] [blame] | 64 | // *** The code above must match HexagonInstrFormat*.td *** // |
Brendon Cahoon | 6f35837 | 2012-02-08 18:25:47 +0000 | [diff] [blame] | 65 | |
| 66 | } // End namespace HexagonII. |
| 67 | |
| 68 | } // End namespace llvm. |
| 69 | |
| 70 | #endif |