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