aboutsummaryrefslogtreecommitdiffstats
path: root/docs/TableGen/LangIntro.rst
diff options
context:
space:
mode:
Diffstat (limited to 'docs/TableGen/LangIntro.rst')
-rw-r--r--docs/TableGen/LangIntro.rst12
1 files changed, 9 insertions, 3 deletions
diff --git a/docs/TableGen/LangIntro.rst b/docs/TableGen/LangIntro.rst
index 3e74dff..85c74a5 100644
--- a/docs/TableGen/LangIntro.rst
+++ b/docs/TableGen/LangIntro.rst
@@ -94,7 +94,9 @@ supported include:
uninitialized field
``0b1001011``
- binary integer value
+ binary integer value.
+ Note that this is sized by the number of bits given and will not be
+ silently extended/truncated.
``07654321``
octal integer value (indicated by a leading 0)
@@ -116,8 +118,9 @@ supported include:
In rare cases, TableGen is unable to deduce the element type in which case
the user must specify it explicitly.
-``{ a, b, c }``
- initializer for a "bits<3>" value
+``{ a, b, 0b10 }``
+ initializer for a "bits<4>" value.
+ 1-bit from "a", 1-bit from "b", 2-bits from 0b10.
``value``
value reference
@@ -208,6 +211,9 @@ supported include:
on string, int and bit objects. Use !cast<string> to compare other types of
objects.
+``!shl(a,b)`` ``!srl(a,b)`` ``!sra(a,b)`` ``!add(a,b)`` ``!and(a,b)``
+ The usual binary and arithmetic operators.
+
Note that all of the values have rules specifying how they convert to values
for different types. These rules allow you to assign a value like "``7``"
to a "``bits<4>``" value, for example.