summaryrefslogtreecommitdiffstats
path: root/llvm/docs/MIRLangRef.rst
diff options
context:
space:
mode:
authorAlex Lorenz <arphaman@gmail.com>2015-08-21 17:26:38 +0000
committerAlex Lorenz <arphaman@gmail.com>2015-08-21 17:26:38 +0000
commit8eadc3f38b73759b3e77425c0037774730ec0a7a (patch)
tree9c6c2f7874ed9ceb1f8d5372529394defbc2a583 /llvm/docs/MIRLangRef.rst
parentc9f4aa6b8c114aaeec323007f95590b3af3cbec4 (diff)
downloadbcm5719-llvm-8eadc3f38b73759b3e77425c0037774730ec0a7a.tar.gz
bcm5719-llvm-8eadc3f38b73759b3e77425c0037774730ec0a7a.zip
MIRLangRef: Describe the syntax for machine instruction names and flags.
llvm-svn: 245710
Diffstat (limited to 'llvm/docs/MIRLangRef.rst')
-rw-r--r--llvm/docs/MIRLangRef.rst41
1 files changed, 40 insertions, 1 deletions
diff --git a/llvm/docs/MIRLangRef.rst b/llvm/docs/MIRLangRef.rst
index b3d558a9a5e..d67c15bcf90 100644
--- a/llvm/docs/MIRLangRef.rst
+++ b/llvm/docs/MIRLangRef.rst
@@ -200,10 +200,49 @@ specified in brackets after the block's definition:
.. TODO: Describe the way the reference to an unnamed LLVM IR block can be
preserved.
+Machine Instructions
+--------------------
+
+A machine instruction is composed of a name, machine operands,
+:ref:`instruction flags <instruction-flags>`, and machine memory operands.
+
+The instruction's name is usually specified before the operands. The example
+below shows an instance of the X86 ``RETQ`` instruction with a single machine
+operand:
+
+.. code-block:: llvm
+
+ RETQ %eax
+
+However, if the machine instruction has one or more explicitly defined register
+operands, the instruction's name has to be specified after them. The example
+below shows an instance of the AArch64 ``LDPXpost`` instruction with three
+defined register operands:
+
+.. code-block:: llvm
+
+ %sp, %fp, %lr = LDPXpost %sp, 2
+
+The instruction names are serialized using the exact definitions from the
+target's ``*InstrInfo.td`` files, and they are case sensitive. This means that
+similar instruction names like ``TSTri`` and ``tSTRi`` represent different
+machine instructions.
+
+.. _instruction-flags:
+
+Instruction Flags
+^^^^^^^^^^^^^^^^^
+
+The flag ``frame-setup`` can be specified before the instruction's name:
+
+.. code-block:: llvm
+
+ %fp = frame-setup ADDXri %sp, 0, 0
+
.. TODO: Describe the parsers default behaviour when optional YAML attributes
are missing.
-.. TODO: Describe the syntax of the machine instructions.
+.. TODO: Describe the syntax for the bundled instructions.
.. TODO: Describe the syntax of the immediate machine operands.
.. TODO: Describe the syntax of the register machine operands.
.. TODO: Describe the syntax of the virtual register operands and their YAML
OpenPOWER on IntegriCloud