aboutsummaryrefslogtreecommitdiffstats
path: root/docs/TableGen
diff options
context:
space:
mode:
authorStephen Hines <srhines@google.com>2014-12-01 14:51:49 -0800
committerStephen Hines <srhines@google.com>2014-12-02 16:08:10 -0800
commit37ed9c199ca639565f6ce88105f9e39e898d82d0 (patch)
tree8fb36d3910e3ee4c4e1b7422f4f017108efc52f5 /docs/TableGen
parentd2327b22152ced7bc46dc629fc908959e8a52d03 (diff)
downloadexternal_llvm-37ed9c199ca639565f6ce88105f9e39e898d82d0.zip
external_llvm-37ed9c199ca639565f6ce88105f9e39e898d82d0.tar.gz
external_llvm-37ed9c199ca639565f6ce88105f9e39e898d82d0.tar.bz2
Update aosp/master LLVM for rebase to r222494.
Change-Id: Ic787f5e0124df789bd26f3f24680f45e678eef2d
Diffstat (limited to 'docs/TableGen')
-rw-r--r--docs/TableGen/BackEnds.rst3
-rw-r--r--docs/TableGen/LangIntro.rst12
-rw-r--r--docs/TableGen/LangRef.rst6
-rw-r--r--docs/TableGen/index.rst4
4 files changed, 17 insertions, 8 deletions
diff --git a/docs/TableGen/BackEnds.rst b/docs/TableGen/BackEnds.rst
index 42de41d..e8544b6 100644
--- a/docs/TableGen/BackEnds.rst
+++ b/docs/TableGen/BackEnds.rst
@@ -78,8 +78,7 @@ returns the (currently, 32-bit unsigned) value of the instruction.
**Output**: C++ code, implementing the target's CodeEmitter
class by overriding the virtual functions as ``<Target>CodeEmitter::function()``.
-**Usage**: Used to include directly at the end of ``<Target>CodeEmitter.cpp``, and
-with option `-mc-emitter` to be included in ``<Target>MCCodeEmitter.cpp``.
+**Usage**: Used to include directly at the end of ``<Target>MCCodeEmitter.cpp``.
RegisterInfo
------------
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.
diff --git a/docs/TableGen/LangRef.rst b/docs/TableGen/LangRef.rst
index 9b074be..134afed 100644
--- a/docs/TableGen/LangRef.rst
+++ b/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::
@@ -92,7 +96,7 @@ wide variety of meanings:
.. productionlist::
BangOperator: one of
:!eq !if !head !tail !con
- :!add !shl !sra !srl
+ :!add !shl !sra !srl !and
:!cast !empty !subst !foreach !listconcat !strconcat
Syntax
diff --git a/docs/TableGen/index.rst b/docs/TableGen/index.rst
index 0860afa..cda41b5 100644
--- a/docs/TableGen/index.rst
+++ b/docs/TableGen/index.rst
@@ -273,7 +273,7 @@ that's only useful for debugging of the TableGen files themselves. The power
in TableGen is, however, to interpret the source files into an internal
representation that can be generated into anything you want.
-Current usage of TableGen is to create include huge files with tables that you
+Current usage of TableGen is to create huge include files with tables that you
can either include directly (if the output is in the language you're coding),
or be used in pre-processing via macros surrounding the include of the file.
@@ -292,7 +292,7 @@ Despite being very generic, TableGen has some deficiencies that have been
pointed out numerous times. The common theme is that, while TableGen allows
you to build Domain-Specific-Languages, the final languages that you create
lack the power of other DSLs, which in turn increase considerably the size
-and complecity of TableGen files.
+and complexity of TableGen files.
At the same time, TableGen allows you to create virtually any meaning of
the basic concepts via custom-made back-ends, which can pervert the original