[PATCH] D155194: [SystemZ][NFC] Use named sub-operands in MC

Ilya Leoshkevich via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 13 06:06:01 PDT 2023


iii created this revision.
iii added a reviewer: uweigand.
Herald added a subscriber: hiraditya.
Herald added a project: All.
iii requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Prepare for removing the MemOpsEmitted workaround for symbolic
displacements by letting TableGen know about the offsets of the
displacement sub-operands within the instruction.

There are alternative ways to do this that were tried and rejected:

- Creating encoders and decoders for each possible displacement offset. This is too repetitive.

- Use VarLenCodeEmitter [1]. The resulting diff is quite large.

Instead, use the named sub-operand support introduced by commit
a538d1f13a13 <https://reviews.llvm.org/rGa538d1f13a1375c212c7018e36deab2cd896bf6e> ("[TableGen][CodeEmitterGen] Allow local names for
sub-operands in a operand list.").

Describe instruction encodings in terms of sub-operands instead of
operands (e.g. B, D, L vs BDL) - this also better matches the pictures
from the Principles of Operation. Decompose operands into sub-operands
using the new (bdaddr12only $B1 <https://reviews.llvm.org/B1>, $D1 <https://reviews.llvm.org/D1>):$BD1 syntax. Replace the
encoders and the decoders of the operands with these of the
sub-operands.

[1] https://m680x0.github.io/blog/2022/02/varlen-encoder.html


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D155194

Files:
  llvm/lib/Target/SystemZ/Disassembler/SystemZDisassembler.cpp
  llvm/lib/Target/SystemZ/MCTargetDesc/SystemZMCCodeEmitter.cpp
  llvm/lib/Target/SystemZ/SystemZInstrFormats.td
  llvm/lib/Target/SystemZ/SystemZInstrInfo.td
  llvm/lib/Target/SystemZ/SystemZInstrVector.td
  llvm/lib/Target/SystemZ/SystemZOperands.td

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D155194.539987.patch
Type: text/x-patch
Size: 101088 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230713/da436215/attachment.bin>


More information about the llvm-commits mailing list