Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 1 | tblgen - Target Description To C++ Code Generator |
| 2 | ================================================= |
| 3 | |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 4 | SYNOPSIS |
| 5 | -------- |
| 6 | |
Dmitri Gribenko | 6a144e4 | 2012-11-29 17:41:05 +0000 | [diff] [blame] | 7 | :program:`tblgen` [*options*] [*filename*] |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 8 | |
| 9 | DESCRIPTION |
| 10 | ----------- |
| 11 | |
Dmitri Gribenko | 6a144e4 | 2012-11-29 17:41:05 +0000 | [diff] [blame] | 12 | :program:`tblgen` translates from target description (``.td``) files into C++ |
| 13 | code that can be included in the definition of an LLVM target library. Most |
| 14 | users of LLVM will not need to use this program. It is only for assisting with |
| 15 | writing an LLVM target backend. |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 16 | |
Dmitri Gribenko | 6a144e4 | 2012-11-29 17:41:05 +0000 | [diff] [blame] | 17 | The input and output of :program:`tblgen` is beyond the scope of this short |
Sean Silva | b9a65fd | 2014-04-07 22:46:40 +0000 | [diff] [blame] | 18 | introduction; please see the :doc:`introduction to TableGen |
| 19 | <../TableGen/index>`. |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 20 | |
Dmitri Gribenko | 6a144e4 | 2012-11-29 17:41:05 +0000 | [diff] [blame] | 21 | The *filename* argument specifies the name of a Target Description (``.td``) |
| 22 | file to read as input. |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 23 | |
| 24 | OPTIONS |
| 25 | ------- |
| 26 | |
Dmitri Gribenko | 595dd5a | 2013-04-27 16:34:24 +0000 | [diff] [blame] | 27 | .. program:: tblgen |
| 28 | |
Dmitri Gribenko | 6a144e4 | 2012-11-29 17:41:05 +0000 | [diff] [blame] | 29 | .. option:: -help |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 30 | |
| 31 | Print a summary of command line options. |
| 32 | |
Dmitri Gribenko | 6a144e4 | 2012-11-29 17:41:05 +0000 | [diff] [blame] | 33 | .. option:: -o filename |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 34 | |
Dmitri Gribenko | 6a144e4 | 2012-11-29 17:41:05 +0000 | [diff] [blame] | 35 | Specify the output file name. If ``filename`` is ``-``, then |
| 36 | :program:`tblgen` sends its output to standard output. |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 37 | |
Dmitri Gribenko | 6a144e4 | 2012-11-29 17:41:05 +0000 | [diff] [blame] | 38 | .. option:: -I directory |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 39 | |
Dmitri Gribenko | 6a144e4 | 2012-11-29 17:41:05 +0000 | [diff] [blame] | 40 | Specify where to find other target description files for inclusion. The |
| 41 | ``directory`` value should be a full or partial path to a directory that |
| 42 | contains target description files. |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 43 | |
Dmitri Gribenko | 6a144e4 | 2012-11-29 17:41:05 +0000 | [diff] [blame] | 44 | .. option:: -asmparsernum N |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 45 | |
Dmitri Gribenko | 6a144e4 | 2012-11-29 17:41:05 +0000 | [diff] [blame] | 46 | Make -gen-asm-parser emit assembly writer number ``N``. |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 47 | |
Dmitri Gribenko | 6a144e4 | 2012-11-29 17:41:05 +0000 | [diff] [blame] | 48 | .. option:: -asmwriternum N |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 49 | |
Dmitri Gribenko | 6a144e4 | 2012-11-29 17:41:05 +0000 | [diff] [blame] | 50 | Make -gen-asm-writer emit assembly writer number ``N``. |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 51 | |
Dmitri Gribenko | 6a144e4 | 2012-11-29 17:41:05 +0000 | [diff] [blame] | 52 | .. option:: -class className |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 53 | |
| 54 | Print the enumeration list for this class. |
| 55 | |
Dmitri Gribenko | 6a144e4 | 2012-11-29 17:41:05 +0000 | [diff] [blame] | 56 | .. option:: -print-records |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 57 | |
| 58 | Print all records to standard output (default). |
| 59 | |
Simon Tatham | 9cfd4e5 | 2018-07-11 08:40:19 +0000 | [diff] [blame] | 60 | .. option:: -dump-json |
| 61 | |
| 62 | Print a JSON representation of all records, suitable for further |
| 63 | automated processing. |
| 64 | |
Dmitri Gribenko | 6a144e4 | 2012-11-29 17:41:05 +0000 | [diff] [blame] | 65 | .. option:: -print-enums |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 66 | |
Dmitri Gribenko | 595dd5a | 2013-04-27 16:34:24 +0000 | [diff] [blame] | 67 | Print enumeration values for a class. |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 68 | |
Dmitri Gribenko | 6a144e4 | 2012-11-29 17:41:05 +0000 | [diff] [blame] | 69 | .. option:: -print-sets |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 70 | |
| 71 | Print expanded sets for testing DAG exprs. |
| 72 | |
Dmitri Gribenko | 6a144e4 | 2012-11-29 17:41:05 +0000 | [diff] [blame] | 73 | .. option:: -gen-emitter |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 74 | |
| 75 | Generate machine code emitter. |
| 76 | |
Dmitri Gribenko | 6a144e4 | 2012-11-29 17:41:05 +0000 | [diff] [blame] | 77 | .. option:: -gen-register-info |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 78 | |
| 79 | Generate registers and register classes info. |
| 80 | |
Dmitri Gribenko | 6a144e4 | 2012-11-29 17:41:05 +0000 | [diff] [blame] | 81 | .. option:: -gen-instr-info |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 82 | |
| 83 | Generate instruction descriptions. |
| 84 | |
Dmitri Gribenko | 6a144e4 | 2012-11-29 17:41:05 +0000 | [diff] [blame] | 85 | .. option:: -gen-asm-writer |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 86 | |
| 87 | Generate the assembly writer. |
| 88 | |
Dmitri Gribenko | 6a144e4 | 2012-11-29 17:41:05 +0000 | [diff] [blame] | 89 | .. option:: -gen-disassembler |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 90 | |
| 91 | Generate disassembler. |
| 92 | |
Dmitri Gribenko | 6a144e4 | 2012-11-29 17:41:05 +0000 | [diff] [blame] | 93 | .. option:: -gen-pseudo-lowering |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 94 | |
| 95 | Generate pseudo instruction lowering. |
| 96 | |
Dmitri Gribenko | 6a144e4 | 2012-11-29 17:41:05 +0000 | [diff] [blame] | 97 | .. option:: -gen-dag-isel |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 98 | |
| 99 | Generate a DAG (Directed Acycle Graph) instruction selector. |
| 100 | |
Dmitri Gribenko | 6a144e4 | 2012-11-29 17:41:05 +0000 | [diff] [blame] | 101 | .. option:: -gen-asm-matcher |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 102 | |
| 103 | Generate assembly instruction matcher. |
| 104 | |
Dmitri Gribenko | 6a144e4 | 2012-11-29 17:41:05 +0000 | [diff] [blame] | 105 | .. option:: -gen-dfa-packetizer |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 106 | |
| 107 | Generate DFA Packetizer for VLIW targets. |
| 108 | |
Dmitri Gribenko | 6a144e4 | 2012-11-29 17:41:05 +0000 | [diff] [blame] | 109 | .. option:: -gen-fast-isel |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 110 | |
| 111 | Generate a "fast" instruction selector. |
| 112 | |
Dmitri Gribenko | 6a144e4 | 2012-11-29 17:41:05 +0000 | [diff] [blame] | 113 | .. option:: -gen-subtarget |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 114 | |
| 115 | Generate subtarget enumerations. |
| 116 | |
Fangrui Song | 5223dab | 2018-06-25 19:40:08 +0000 | [diff] [blame] | 117 | .. option:: -gen-intrinsic-enums |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 118 | |
Fangrui Song | 5223dab | 2018-06-25 19:40:08 +0000 | [diff] [blame] | 119 | Generate intrinsic enums. |
| 120 | |
| 121 | .. option:: -gen-intrinsic-impl |
| 122 | |
| 123 | Generate intrinsic implementation. |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 124 | |
Dmitri Gribenko | 6a144e4 | 2012-11-29 17:41:05 +0000 | [diff] [blame] | 125 | .. option:: -gen-tgt-intrinsic |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 126 | |
| 127 | Generate target intrinsic information. |
| 128 | |
Dmitri Gribenko | 6a144e4 | 2012-11-29 17:41:05 +0000 | [diff] [blame] | 129 | .. option:: -gen-enhanced-disassembly-info |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 130 | |
| 131 | Generate enhanced disassembly info. |
| 132 | |
Clement Courbet | f4fb61b | 2018-10-25 07:44:01 +0000 | [diff] [blame] | 133 | .. option:: -gen-exegesis |
| 134 | |
| 135 | Generate llvm-exegesis tables. |
| 136 | |
Dmitri Gribenko | 6a144e4 | 2012-11-29 17:41:05 +0000 | [diff] [blame] | 137 | .. option:: -version |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 138 | |
| 139 | Show the version number of this program. |
| 140 | |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 141 | EXIT STATUS |
| 142 | ----------- |
| 143 | |
Dmitri Gribenko | 6a144e4 | 2012-11-29 17:41:05 +0000 | [diff] [blame] | 144 | If :program:`tblgen` succeeds, it will exit with 0. Otherwise, if an error |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 145 | occurs, it will exit with a non-zero value. |