summaryrefslogtreecommitdiffstats
path: root/llvm/docs/TableGen
diff options
context:
space:
mode:
authorPete Cooper <peter_cooper@apple.com>2014-08-07 05:47:13 +0000
committerPete Cooper <peter_cooper@apple.com>2014-08-07 05:47:13 +0000
commit9b90dc7c6aabae7f094d84cb121ea8417a90f169 (patch)
treea0fd7414e533f0d09f1ac98128dd4a47323d1db1 /llvm/docs/TableGen
parent94891ddf0d633c3c31819c26c034659aea11210f (diff)
downloadbcm5719-llvm-9b90dc7c6aabae7f094d84cb121ea8417a90f169.tar.gz
bcm5719-llvm-9b90dc7c6aabae7f094d84cb121ea8417a90f169.zip
Update Tablegen documents given that binary literals are now sized
llvm-svn: 215088
Diffstat (limited to 'llvm/docs/TableGen')
-rw-r--r--llvm/docs/TableGen/LangIntro.rst9
-rw-r--r--llvm/docs/TableGen/LangRef.rst4
2 files changed, 10 insertions, 3 deletions
diff --git a/llvm/docs/TableGen/LangIntro.rst b/llvm/docs/TableGen/LangIntro.rst
index 54d88731012..5bb6ee267cd 100644
--- a/llvm/docs/TableGen/LangIntro.rst
+++ b/llvm/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
diff --git a/llvm/docs/TableGen/LangRef.rst b/llvm/docs/TableGen/LangRef.rst
index 9b074be38dc..29581520497 100644
--- a/llvm/docs/TableGen/LangRef.rst
+++ b/llvm/docs/TableGen/LangRef.rst
@@ -55,6 +55,10 @@ One aspect to note is that the :token:`DecimalInteger` token *includes* the
``+`` or ``-``, as opposed to having ``+`` and ``-`` be unary operators as
most languages do.
+Also note that :token:`BinInteger` creates a value of type ``bits<n>``
+(where ``n`` is the number of bits). This will implicitly convert to
+integers when needed.
+
TableGen has identifier-like tokens:
.. productionlist::
OpenPOWER on IntegriCloud