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 |
| 18 | introduction. Please see :doc:`../TableGenFundamentals`. |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 19 | |
Dmitri Gribenko | 6a144e4 | 2012-11-29 17:41:05 +0000 | [diff] [blame] | 20 | The *filename* argument specifies the name of a Target Description (``.td``) |
| 21 | file to read as input. |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 22 | |
| 23 | OPTIONS |
| 24 | ------- |
| 25 | |
Dmitri Gribenko | 6a144e4 | 2012-11-29 17:41:05 +0000 | [diff] [blame] | 26 | .. option:: -help |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 27 | |
| 28 | Print a summary of command line options. |
| 29 | |
Dmitri Gribenko | 6a144e4 | 2012-11-29 17:41:05 +0000 | [diff] [blame] | 30 | .. option:: -o filename |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 31 | |
Dmitri Gribenko | 6a144e4 | 2012-11-29 17:41:05 +0000 | [diff] [blame] | 32 | Specify the output file name. If ``filename`` is ``-``, then |
| 33 | :program:`tblgen` sends its output to standard output. |
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 | .. option:: -I directory |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 36 | |
Dmitri Gribenko | 6a144e4 | 2012-11-29 17:41:05 +0000 | [diff] [blame] | 37 | Specify where to find other target description files for inclusion. The |
| 38 | ``directory`` value should be a full or partial path to a directory that |
| 39 | contains target description files. |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 40 | |
Dmitri Gribenko | 6a144e4 | 2012-11-29 17:41:05 +0000 | [diff] [blame] | 41 | .. option:: -asmparsernum N |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 42 | |
Dmitri Gribenko | 6a144e4 | 2012-11-29 17:41:05 +0000 | [diff] [blame] | 43 | Make -gen-asm-parser emit assembly writer number ``N``. |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 44 | |
Dmitri Gribenko | 6a144e4 | 2012-11-29 17:41:05 +0000 | [diff] [blame] | 45 | .. option:: -asmwriternum N |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 46 | |
Dmitri Gribenko | 6a144e4 | 2012-11-29 17:41:05 +0000 | [diff] [blame] | 47 | Make -gen-asm-writer emit assembly writer number ``N``. |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 48 | |
Dmitri Gribenko | 6a144e4 | 2012-11-29 17:41:05 +0000 | [diff] [blame] | 49 | .. option:: -class className |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 50 | |
| 51 | Print the enumeration list for this class. |
| 52 | |
Dmitri Gribenko | 6a144e4 | 2012-11-29 17:41:05 +0000 | [diff] [blame] | 53 | .. option:: -print-records |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 54 | |
| 55 | Print all records to standard output (default). |
| 56 | |
Dmitri Gribenko | 6a144e4 | 2012-11-29 17:41:05 +0000 | [diff] [blame] | 57 | .. option:: -print-enums |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 58 | |
| 59 | Print enumeration values for a class |
| 60 | |
Dmitri Gribenko | 6a144e4 | 2012-11-29 17:41:05 +0000 | [diff] [blame] | 61 | .. option:: -print-sets |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 62 | |
| 63 | Print expanded sets for testing DAG exprs. |
| 64 | |
Dmitri Gribenko | 6a144e4 | 2012-11-29 17:41:05 +0000 | [diff] [blame] | 65 | .. option:: -gen-emitter |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 66 | |
| 67 | Generate machine code emitter. |
| 68 | |
Dmitri Gribenko | 6a144e4 | 2012-11-29 17:41:05 +0000 | [diff] [blame] | 69 | .. option:: -gen-register-info |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 70 | |
| 71 | Generate registers and register classes info. |
| 72 | |
Dmitri Gribenko | 6a144e4 | 2012-11-29 17:41:05 +0000 | [diff] [blame] | 73 | .. option:: -gen-instr-info |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 74 | |
| 75 | Generate instruction descriptions. |
| 76 | |
Dmitri Gribenko | 6a144e4 | 2012-11-29 17:41:05 +0000 | [diff] [blame] | 77 | .. option:: -gen-asm-writer |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 78 | |
| 79 | Generate the assembly writer. |
| 80 | |
Dmitri Gribenko | 6a144e4 | 2012-11-29 17:41:05 +0000 | [diff] [blame] | 81 | .. option:: -gen-disassembler |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 82 | |
| 83 | Generate disassembler. |
| 84 | |
Dmitri Gribenko | 6a144e4 | 2012-11-29 17:41:05 +0000 | [diff] [blame] | 85 | .. option:: -gen-pseudo-lowering |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 86 | |
| 87 | Generate pseudo instruction lowering. |
| 88 | |
Dmitri Gribenko | 6a144e4 | 2012-11-29 17:41:05 +0000 | [diff] [blame] | 89 | .. option:: -gen-dag-isel |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 90 | |
| 91 | Generate a DAG (Directed Acycle Graph) instruction selector. |
| 92 | |
Dmitri Gribenko | 6a144e4 | 2012-11-29 17:41:05 +0000 | [diff] [blame] | 93 | .. option:: -gen-asm-matcher |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 94 | |
| 95 | Generate assembly instruction matcher. |
| 96 | |
Dmitri Gribenko | 6a144e4 | 2012-11-29 17:41:05 +0000 | [diff] [blame] | 97 | .. option:: -gen-dfa-packetizer |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 98 | |
| 99 | Generate DFA Packetizer for VLIW targets. |
| 100 | |
Dmitri Gribenko | 6a144e4 | 2012-11-29 17:41:05 +0000 | [diff] [blame] | 101 | .. option:: -gen-fast-isel |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 102 | |
| 103 | Generate a "fast" instruction selector. |
| 104 | |
Dmitri Gribenko | 6a144e4 | 2012-11-29 17:41:05 +0000 | [diff] [blame] | 105 | .. option:: -gen-subtarget |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 106 | |
| 107 | Generate subtarget enumerations. |
| 108 | |
Dmitri Gribenko | 6a144e4 | 2012-11-29 17:41:05 +0000 | [diff] [blame] | 109 | .. option:: -gen-intrinsic |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 110 | |
| 111 | Generate intrinsic information. |
| 112 | |
Dmitri Gribenko | 6a144e4 | 2012-11-29 17:41:05 +0000 | [diff] [blame] | 113 | .. option:: -gen-tgt-intrinsic |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 114 | |
| 115 | Generate target intrinsic information. |
| 116 | |
Dmitri Gribenko | 6a144e4 | 2012-11-29 17:41:05 +0000 | [diff] [blame] | 117 | .. option:: -gen-enhanced-disassembly-info |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 118 | |
| 119 | Generate enhanced disassembly info. |
| 120 | |
Dmitri Gribenko | 6a144e4 | 2012-11-29 17:41:05 +0000 | [diff] [blame] | 121 | .. option:: -version |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 122 | |
| 123 | Show the version number of this program. |
| 124 | |
Daniel Dunbar | 3b709d5 | 2012-05-08 16:50:35 +0000 | [diff] [blame] | 125 | EXIT STATUS |
| 126 | ----------- |
| 127 | |
Dmitri Gribenko | 6a144e4 | 2012-11-29 17:41:05 +0000 | [diff] [blame] | 128 | 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] | 129 | occurs, it will exit with a non-zero value. |