summaryrefslogtreecommitdiffstats
path: root/docs/MIRLangRef.rst
diff options
context:
space:
mode:
authorAlex Lorenz <arphaman@gmail.com>2015-09-08 11:38:16 +0000
committerAlex Lorenz <arphaman@gmail.com>2015-09-08 11:38:16 +0000
commit1fd577388c6440b0d4fd562fa3b3f084aab5aa5a (patch)
tree9925471e7afe230067ff19c69e0a1204f64c02af /docs/MIRLangRef.rst
parent3acfef5bd33f0d72f71c58ca9803ab49a4dddc88 (diff)
MIRLangRef: Add documentation for the global value machine operands.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247004 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'docs/MIRLangRef.rst')
-rw-r--r--docs/MIRLangRef.rst23
1 files changed, 22 insertions, 1 deletions
diff --git a/docs/MIRLangRef.rst b/docs/MIRLangRef.rst
index d49bd97136e3..d3c9f828bb33 100644
--- a/docs/MIRLangRef.rst
+++ b/docs/MIRLangRef.rst
@@ -99,6 +99,8 @@ depends on the state of the target specific ``MachineFunctionInfo`` or
High Level Structure
====================
+.. _embedded-module:
+
Embedded Module
---------------
@@ -433,13 +435,32 @@ corresponding internal ``llvm::RegState`` representation:
* - ``debug-use``
- ``RegState::Debug``
+Global Value Operands
+^^^^^^^^^^^^^^^^^^^^^
+
+The global value machine operands reference the global values from the
+:ref:`embedded LLVM IR module <embedded-module>`.
+The example below shows an instance of the X86 ``MOV64rm`` instruction that has
+a global value operand named ``G``:
+
+.. code-block:: llvm
+
+ %rax = MOV64rm %rip, 1, _, @G, _
+
+The named global values are represented using an identifier with the '@' prefix.
+If the identifier doesn't match the regular expression
+`[-a-zA-Z$._][-a-zA-Z$._0-9]*`, then this identifier must be quoted.
+
+The unnamed global values are represented using an unsigned numeric value with
+the '@' prefix, like in the following examples: ``@0``, ``@989``.
+
.. TODO: Describe the parsers default behaviour when optional YAML attributes
are missing.
.. TODO: Describe the syntax for the bundled instructions.
.. TODO: Describe the syntax for virtual register YAML definitions.
.. TODO: Describe the syntax of the subregisters.
.. TODO: Describe the machine function's YAML flag attributes.
-.. TODO: Describe the syntax for the global value, external symbol and register
+.. TODO: Describe the syntax for the external symbol and register
mask machine operands.
.. TODO: Describe the frame information YAML mapping.
.. TODO: Describe the syntax of the stack object machine operands and their