diff options
| author | Francis Visoiu Mistrih <francisvm@yahoo.com> | 2017-12-08 22:53:21 +0000 |
|---|---|---|
| committer | Francis Visoiu Mistrih <francisvm@yahoo.com> | 2017-12-08 22:53:21 +0000 |
| commit | 440f69c95aeadb6e4c920d81db50c44c17810d97 (patch) | |
| tree | 46c5c1a57cb6c39e7f540f62358f27da57e1bf2c /llvm/docs | |
| parent | 9b8caf5bd796b25a8a6e457e7b0d73da8163633d (diff) | |
| download | bcm5719-llvm-440f69c95aeadb6e4c920d81db50c44c17810d97.tar.gz bcm5719-llvm-440f69c95aeadb6e4c920d81db50c44c17810d97.zip | |
[CodeGen] Move printing MO_Immediate operands to MachineOperand::print
Work towards the unification of MIR and debug output by refactoring the
interfaces.
Add support for operand subreg index as an immediate to debug printing
and use ::print in the MIRPrinter.
Differential Review: https://reviews.llvm.org/D40965
llvm-svn: 320209
Diffstat (limited to 'llvm/docs')
| -rw-r--r-- | llvm/docs/MIRLangRef.rst | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/llvm/docs/MIRLangRef.rst b/llvm/docs/MIRLangRef.rst index e217b792e62..562b11a6d18 100644 --- a/llvm/docs/MIRLangRef.rst +++ b/llvm/docs/MIRLangRef.rst @@ -430,6 +430,35 @@ immediate machine operand ``-42``: %eax = MOV32ri -42 +An immediate operand is also used to represent a subregister index when the +machine instruction has one of the following opcodes: + +- ``EXTRACT_SUBREG`` + +- ``INSERT_SUBREG`` + +- ``REG_SEQUENCE`` + +- ``SUBREG_TO_REG`` + +In case this is true, the Machine Operand is printed according to the target. + +For example: + +In AArch64RegisterInfo.td: + +.. code-block:: text + + def sub_32 : SubRegIndex<32>; + +If the third operand is an immediate with the value ``15`` (target-dependent +value), based on the instruction's opcode and the operand's index the operand +will be printed as ``%subreg.sub_32``: + +.. code-block:: text + + %1:gpr64 = SUBREG_TO_REG 0, %0, %subreg.sub_32 + For integers > 64bit, we use a special machine operand, ``MO_CImmediate``, which stores the immediate in a ``ConstantInt`` using an ``APInt`` (LLVM's arbitrary precision integers). |

