blob: 55b542948469d1d9f256497c59f1d631e285a53a [file] [log] [blame]
Daniel Dunbar8f4a8a62012-05-08 16:50:35 +00001tblgen - Target Description To C++ Code Generator
2=================================================
3
Daniel Dunbar8f4a8a62012-05-08 16:50:35 +00004SYNOPSIS
5--------
6
Dmitri Gribenkocbb07be2012-11-29 17:41:05 +00007:program:`tblgen` [*options*] [*filename*]
Daniel Dunbar8f4a8a62012-05-08 16:50:35 +00008
9DESCRIPTION
10-----------
11
Dmitri Gribenkocbb07be2012-11-29 17:41:05 +000012:program:`tblgen` translates from target description (``.td``) files into C++
13code that can be included in the definition of an LLVM target library. Most
14users of LLVM will not need to use this program. It is only for assisting with
15writing an LLVM target backend.
Daniel Dunbar8f4a8a62012-05-08 16:50:35 +000016
Dmitri Gribenkocbb07be2012-11-29 17:41:05 +000017The input and output of :program:`tblgen` is beyond the scope of this short
Sean Silva397ee6e2014-04-07 22:46:40 +000018introduction; please see the :doc:`introduction to TableGen
19<../TableGen/index>`.
Daniel Dunbar8f4a8a62012-05-08 16:50:35 +000020
Dmitri Gribenkocbb07be2012-11-29 17:41:05 +000021The *filename* argument specifies the name of a Target Description (``.td``)
22file to read as input.
Daniel Dunbar8f4a8a62012-05-08 16:50:35 +000023
24OPTIONS
25-------
26
Dmitri Gribenko7d8b6072013-04-27 16:34:24 +000027.. program:: tblgen
28
Dmitri Gribenkocbb07be2012-11-29 17:41:05 +000029.. option:: -help
Daniel Dunbar8f4a8a62012-05-08 16:50:35 +000030
31 Print a summary of command line options.
32
Dmitri Gribenkocbb07be2012-11-29 17:41:05 +000033.. option:: -o filename
Daniel Dunbar8f4a8a62012-05-08 16:50:35 +000034
Dmitri Gribenkocbb07be2012-11-29 17:41:05 +000035 Specify the output file name. If ``filename`` is ``-``, then
36 :program:`tblgen` sends its output to standard output.
Daniel Dunbar8f4a8a62012-05-08 16:50:35 +000037
Dmitri Gribenkocbb07be2012-11-29 17:41:05 +000038.. option:: -I directory
Daniel Dunbar8f4a8a62012-05-08 16:50:35 +000039
Dmitri Gribenkocbb07be2012-11-29 17:41:05 +000040 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 Dunbar8f4a8a62012-05-08 16:50:35 +000043
Dmitri Gribenkocbb07be2012-11-29 17:41:05 +000044.. option:: -asmparsernum N
Daniel Dunbar8f4a8a62012-05-08 16:50:35 +000045
Dmitri Gribenkocbb07be2012-11-29 17:41:05 +000046 Make -gen-asm-parser emit assembly writer number ``N``.
Daniel Dunbar8f4a8a62012-05-08 16:50:35 +000047
Dmitri Gribenkocbb07be2012-11-29 17:41:05 +000048.. option:: -asmwriternum N
Daniel Dunbar8f4a8a62012-05-08 16:50:35 +000049
Dmitri Gribenkocbb07be2012-11-29 17:41:05 +000050 Make -gen-asm-writer emit assembly writer number ``N``.
Daniel Dunbar8f4a8a62012-05-08 16:50:35 +000051
Dmitri Gribenkocbb07be2012-11-29 17:41:05 +000052.. option:: -class className
Daniel Dunbar8f4a8a62012-05-08 16:50:35 +000053
54 Print the enumeration list for this class.
55
Dmitri Gribenkocbb07be2012-11-29 17:41:05 +000056.. option:: -print-records
Daniel Dunbar8f4a8a62012-05-08 16:50:35 +000057
58 Print all records to standard output (default).
59
Simon Tatham6a8c6ca2018-07-11 08:40:19 +000060.. option:: -dump-json
61
62 Print a JSON representation of all records, suitable for further
63 automated processing.
64
Dmitri Gribenkocbb07be2012-11-29 17:41:05 +000065.. option:: -print-enums
Daniel Dunbar8f4a8a62012-05-08 16:50:35 +000066
Dmitri Gribenko7d8b6072013-04-27 16:34:24 +000067 Print enumeration values for a class.
Daniel Dunbar8f4a8a62012-05-08 16:50:35 +000068
Dmitri Gribenkocbb07be2012-11-29 17:41:05 +000069.. option:: -print-sets
Daniel Dunbar8f4a8a62012-05-08 16:50:35 +000070
71 Print expanded sets for testing DAG exprs.
72
Dmitri Gribenkocbb07be2012-11-29 17:41:05 +000073.. option:: -gen-emitter
Daniel Dunbar8f4a8a62012-05-08 16:50:35 +000074
75 Generate machine code emitter.
76
Dmitri Gribenkocbb07be2012-11-29 17:41:05 +000077.. option:: -gen-register-info
Daniel Dunbar8f4a8a62012-05-08 16:50:35 +000078
79 Generate registers and register classes info.
80
Dmitri Gribenkocbb07be2012-11-29 17:41:05 +000081.. option:: -gen-instr-info
Daniel Dunbar8f4a8a62012-05-08 16:50:35 +000082
83 Generate instruction descriptions.
84
Dmitri Gribenkocbb07be2012-11-29 17:41:05 +000085.. option:: -gen-asm-writer
Daniel Dunbar8f4a8a62012-05-08 16:50:35 +000086
87 Generate the assembly writer.
88
Dmitri Gribenkocbb07be2012-11-29 17:41:05 +000089.. option:: -gen-disassembler
Daniel Dunbar8f4a8a62012-05-08 16:50:35 +000090
91 Generate disassembler.
92
Dmitri Gribenkocbb07be2012-11-29 17:41:05 +000093.. option:: -gen-pseudo-lowering
Daniel Dunbar8f4a8a62012-05-08 16:50:35 +000094
95 Generate pseudo instruction lowering.
96
Dmitri Gribenkocbb07be2012-11-29 17:41:05 +000097.. option:: -gen-dag-isel
Daniel Dunbar8f4a8a62012-05-08 16:50:35 +000098
99 Generate a DAG (Directed Acycle Graph) instruction selector.
100
Dmitri Gribenkocbb07be2012-11-29 17:41:05 +0000101.. option:: -gen-asm-matcher
Daniel Dunbar8f4a8a62012-05-08 16:50:35 +0000102
103 Generate assembly instruction matcher.
104
Dmitri Gribenkocbb07be2012-11-29 17:41:05 +0000105.. option:: -gen-dfa-packetizer
Daniel Dunbar8f4a8a62012-05-08 16:50:35 +0000106
107 Generate DFA Packetizer for VLIW targets.
108
Dmitri Gribenkocbb07be2012-11-29 17:41:05 +0000109.. option:: -gen-fast-isel
Daniel Dunbar8f4a8a62012-05-08 16:50:35 +0000110
111 Generate a "fast" instruction selector.
112
Dmitri Gribenkocbb07be2012-11-29 17:41:05 +0000113.. option:: -gen-subtarget
Daniel Dunbar8f4a8a62012-05-08 16:50:35 +0000114
115 Generate subtarget enumerations.
116
Fangrui Song05f66262018-06-25 19:40:08 +0000117.. option:: -gen-intrinsic-enums
Daniel Dunbar8f4a8a62012-05-08 16:50:35 +0000118
Fangrui Song05f66262018-06-25 19:40:08 +0000119 Generate intrinsic enums.
120
121.. option:: -gen-intrinsic-impl
122
123 Generate intrinsic implementation.
Daniel Dunbar8f4a8a62012-05-08 16:50:35 +0000124
Dmitri Gribenkocbb07be2012-11-29 17:41:05 +0000125.. option:: -gen-tgt-intrinsic
Daniel Dunbar8f4a8a62012-05-08 16:50:35 +0000126
127 Generate target intrinsic information.
128
Dmitri Gribenkocbb07be2012-11-29 17:41:05 +0000129.. option:: -gen-enhanced-disassembly-info
Daniel Dunbar8f4a8a62012-05-08 16:50:35 +0000130
131 Generate enhanced disassembly info.
132
Dmitri Gribenkocbb07be2012-11-29 17:41:05 +0000133.. option:: -version
Daniel Dunbar8f4a8a62012-05-08 16:50:35 +0000134
135 Show the version number of this program.
136
Daniel Dunbar8f4a8a62012-05-08 16:50:35 +0000137EXIT STATUS
138-----------
139
Dmitri Gribenkocbb07be2012-11-29 17:41:05 +0000140If :program:`tblgen` succeeds, it will exit with 0. Otherwise, if an error
Daniel Dunbar8f4a8a62012-05-08 16:50:35 +0000141occurs, it will exit with a non-zero value.