Update Tablegen documents given that binary literals are now sized
authorPete Cooper <peter_cooper@apple.com>
Thu, 7 Aug 2014 05:47:13 +0000 (05:47 +0000)
committerPete Cooper <peter_cooper@apple.com>
Thu, 7 Aug 2014 05:47:13 +0000 (05:47 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@215088 91177308-0d34-0410-b5e6-96231b3b80d8

docs/TableGen/LangIntro.rst
docs/TableGen/LangRef.rst

index 54d88731012ba1459719d7d33ad90cb112982b21..5bb6ee267cd893f5de61d01d74fadc2595e9dd7f 100644 (file)
@@ -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
index 9b074be38dcd46d5af6e76215155a04896e8f157..29581520497ae0152984bf3b4405e037403c1bb5 100644 (file)
@@ -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::