Daniel Dunbar | 8f4a8a6 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 1 | tblgen - Target Description To C++ Code Generator |
| 2 | ================================================= |
| 3 | |
Daniel Dunbar | 8f4a8a6 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 4 | SYNOPSIS |
| 5 | -------- |
| 6 | |
Dmitri Gribenko | cbb07be | 2012-11-29 17:41:05 +0000 | [diff] [blame] | 7 | :program:`tblgen` [*options*] [*filename*] |
Daniel Dunbar | 8f4a8a6 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 8 | |
| 9 | DESCRIPTION |
| 10 | ----------- |
| 11 | |
Dmitri Gribenko | cbb07be | 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 | 8f4a8a6 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 16 | |
Dmitri Gribenko | cbb07be | 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 | 397ee6e | 2014-04-07 22:46:40 +0000 | [diff] [blame] | 18 | introduction; please see the :doc:`introduction to TableGen |
| 19 | <../TableGen/index>`. |
Daniel Dunbar | 8f4a8a6 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 20 | |
Dmitri Gribenko | cbb07be | 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 | 8f4a8a6 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 23 | |
| 24 | OPTIONS |
| 25 | ------- |
| 26 | |
Dmitri Gribenko | 7d8b607 | 2013-04-27 16:34:24 +0000 | [diff] [blame] | 27 | .. program:: tblgen |
| 28 | |
Dmitri Gribenko | cbb07be | 2012-11-29 17:41:05 +0000 | [diff] [blame] | 29 | .. option:: -help |
Daniel Dunbar | 8f4a8a6 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 30 | |
| 31 | Print a summary of command line options. |
| 32 | |
Dmitri Gribenko | cbb07be | 2012-11-29 17:41:05 +0000 | [diff] [blame] | 33 | .. option:: -o filename |
Daniel Dunbar | 8f4a8a6 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 34 | |
Dmitri Gribenko | cbb07be | 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 | 8f4a8a6 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 37 | |
Dmitri Gribenko | cbb07be | 2012-11-29 17:41:05 +0000 | [diff] [blame] | 38 | .. option:: -I directory |
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 | 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 | 8f4a8a6 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 43 | |
Dmitri Gribenko | cbb07be | 2012-11-29 17:41:05 +0000 | [diff] [blame] | 44 | .. option:: -asmparsernum N |
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 | Make -gen-asm-parser emit assembly writer number ``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 | .. option:: -asmwriternum 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 | Make -gen-asm-writer emit assembly writer number ``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 | .. option:: -class className |
Daniel Dunbar | 8f4a8a6 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 53 | |
| 54 | Print the enumeration list for this class. |
| 55 | |
Dmitri Gribenko | cbb07be | 2012-11-29 17:41:05 +0000 | [diff] [blame] | 56 | .. option:: -print-records |
Daniel Dunbar | 8f4a8a6 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 57 | |
| 58 | Print all records to standard output (default). |
| 59 | |
Dmitri Gribenko | cbb07be | 2012-11-29 17:41:05 +0000 | [diff] [blame] | 60 | .. option:: -print-enums |
Daniel Dunbar | 8f4a8a6 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 61 | |
Dmitri Gribenko | 7d8b607 | 2013-04-27 16:34:24 +0000 | [diff] [blame] | 62 | Print enumeration values for a class. |
Daniel Dunbar | 8f4a8a6 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 63 | |
Dmitri Gribenko | cbb07be | 2012-11-29 17:41:05 +0000 | [diff] [blame] | 64 | .. option:: -print-sets |
Daniel Dunbar | 8f4a8a6 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 65 | |
| 66 | Print expanded sets for testing DAG exprs. |
| 67 | |
Dmitri Gribenko | cbb07be | 2012-11-29 17:41:05 +0000 | [diff] [blame] | 68 | .. option:: -gen-emitter |
Daniel Dunbar | 8f4a8a6 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 69 | |
| 70 | Generate machine code emitter. |
| 71 | |
Dmitri Gribenko | cbb07be | 2012-11-29 17:41:05 +0000 | [diff] [blame] | 72 | .. option:: -gen-register-info |
Daniel Dunbar | 8f4a8a6 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 73 | |
| 74 | Generate registers and register classes info. |
| 75 | |
Dmitri Gribenko | cbb07be | 2012-11-29 17:41:05 +0000 | [diff] [blame] | 76 | .. option:: -gen-instr-info |
Daniel Dunbar | 8f4a8a6 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 77 | |
| 78 | Generate instruction descriptions. |
| 79 | |
Dmitri Gribenko | cbb07be | 2012-11-29 17:41:05 +0000 | [diff] [blame] | 80 | .. option:: -gen-asm-writer |
Daniel Dunbar | 8f4a8a6 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 81 | |
| 82 | Generate the assembly writer. |
| 83 | |
Dmitri Gribenko | cbb07be | 2012-11-29 17:41:05 +0000 | [diff] [blame] | 84 | .. option:: -gen-disassembler |
Daniel Dunbar | 8f4a8a6 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 85 | |
| 86 | Generate disassembler. |
| 87 | |
Dmitri Gribenko | cbb07be | 2012-11-29 17:41:05 +0000 | [diff] [blame] | 88 | .. option:: -gen-pseudo-lowering |
Daniel Dunbar | 8f4a8a6 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 89 | |
| 90 | Generate pseudo instruction lowering. |
| 91 | |
Dmitri Gribenko | cbb07be | 2012-11-29 17:41:05 +0000 | [diff] [blame] | 92 | .. option:: -gen-dag-isel |
Daniel Dunbar | 8f4a8a6 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 93 | |
| 94 | Generate a DAG (Directed Acycle Graph) instruction selector. |
| 95 | |
Dmitri Gribenko | cbb07be | 2012-11-29 17:41:05 +0000 | [diff] [blame] | 96 | .. option:: -gen-asm-matcher |
Daniel Dunbar | 8f4a8a6 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 97 | |
| 98 | Generate assembly instruction matcher. |
| 99 | |
Dmitri Gribenko | cbb07be | 2012-11-29 17:41:05 +0000 | [diff] [blame] | 100 | .. option:: -gen-dfa-packetizer |
Daniel Dunbar | 8f4a8a6 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 101 | |
| 102 | Generate DFA Packetizer for VLIW targets. |
| 103 | |
Dmitri Gribenko | cbb07be | 2012-11-29 17:41:05 +0000 | [diff] [blame] | 104 | .. option:: -gen-fast-isel |
Daniel Dunbar | 8f4a8a6 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 105 | |
| 106 | Generate a "fast" instruction selector. |
| 107 | |
Dmitri Gribenko | cbb07be | 2012-11-29 17:41:05 +0000 | [diff] [blame] | 108 | .. option:: -gen-subtarget |
Daniel Dunbar | 8f4a8a6 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 109 | |
| 110 | Generate subtarget enumerations. |
| 111 | |
Dmitri Gribenko | cbb07be | 2012-11-29 17:41:05 +0000 | [diff] [blame] | 112 | .. option:: -gen-intrinsic |
Daniel Dunbar | 8f4a8a6 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 113 | |
| 114 | Generate intrinsic information. |
| 115 | |
Dmitri Gribenko | cbb07be | 2012-11-29 17:41:05 +0000 | [diff] [blame] | 116 | .. option:: -gen-tgt-intrinsic |
Daniel Dunbar | 8f4a8a6 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 117 | |
| 118 | Generate target intrinsic information. |
| 119 | |
Dmitri Gribenko | cbb07be | 2012-11-29 17:41:05 +0000 | [diff] [blame] | 120 | .. option:: -gen-enhanced-disassembly-info |
Daniel Dunbar | 8f4a8a6 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 121 | |
| 122 | Generate enhanced disassembly info. |
| 123 | |
Dmitri Gribenko | cbb07be | 2012-11-29 17:41:05 +0000 | [diff] [blame] | 124 | .. option:: -version |
Daniel Dunbar | 8f4a8a6 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 125 | |
| 126 | Show the version number of this program. |
| 127 | |
Daniel Dunbar | 8f4a8a6 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 128 | EXIT STATUS |
| 129 | ----------- |
| 130 | |
Dmitri Gribenko | cbb07be | 2012-11-29 17:41:05 +0000 | [diff] [blame] | 131 | 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] | 132 | occurs, it will exit with a non-zero value. |