llvm.org GIT mirror llvm / e216468
Update Tablegen documents given that binary literals are now sized git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@215088 91177308-0d34-0410-b5e6-96231b3b80d8 Pete Cooper 5 years ago
2 changed file(s) with 10 addition(s) and 3 deletion(s). Raw diff Collapse all Expand all
9393 uninitialized field
9494
9595 ``0b1001011``
96 binary integer value
96 binary integer value.
97 Note that this is sized by the number of bits given and will not be
98 silently extended/truncated.
9799
98100 ``07654321``
99101 octal integer value (indicated by a leading 0)
115117 In rare cases, TableGen is unable to deduce the element type in which case
116118 the user must specify it explicitly.
117119
118 ``{ a, b, c }``
119 initializer for a "bits<3>" value
120 ``{ a, b, 0b10 }``
121 initializer for a "bits<4>" value.
122 1-bit from "a", 1-bit from "b", 2-bits from 0b10.
120123
121124 ``value``
122125 value reference
5353 One aspect to note is that the :token:`DecimalInteger` token *includes* the
5454 ``+`` or ``-``, as opposed to having ``+`` and ``-`` be unary operators as
5555 most languages do.
56
57 Also note that :token:`BinInteger` creates a value of type ``bits``
58 (where ``n`` is the number of bits). This will implicitly convert to
59 integers when needed.
5660
5761 TableGen has identifier-like tokens:
5862