[PATCH] D116157: [AArch64] Adding "armv8.8-a" memcpy/memset support.

Tomas Matheson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 22 03:22:14 PST 2021


tmatheson created this revision.
Herald added subscribers: hiraditya, kristof.beyls.
tmatheson requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

This family of instructions includes CPYF (copy forward), CPYB (copy
backward), SET (memset) and SETG (memset + initialise MTE tags), with
some sub-variants to indicate whether address translation is done in a
privileged or unprivileged way. For the copy instructions, you can
separately specify the read and write translations (so that kernels
can safely use these instructions in syscall handlers, to memcpy
between the calling process's user-space memory map and the kernel's
own privileged one).

The unusual thing about these instructions is that they write back to
multiple registers, because they perform an implementation-defined
amount of copying each time they run, and write back to _all_ the
address and size registers to indicate how much remains to be done
(and the code is expected to loop on them until the size register
becomes zero). But this is no problem in LLVM - you just define each
instruction to have multiple outputs, multiple inputs, and a set of
constraints tying their register numbers together appropriately.

This commit introduces a special subtarget feature called MOPS (after
the name the spec gives to the CPU id field), which is a dependency of
the top-level 8.8-A feature, and uses that to enable most of the new
instructions. The SETMG instructions also depend on MTE (and the test
checks that).

Patch by Simon Tatham, Victor Campos, Tomas Matheson and Sam Elliott


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D116157

Files:
  llvm/lib/Target/AArch64/AArch64.td
  llvm/lib/Target/AArch64/AArch64InstrFormats.td
  llvm/lib/Target/AArch64/AArch64InstrInfo.td
  llvm/lib/Target/AArch64/AArch64Subtarget.h
  llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp
  llvm/lib/Target/AArch64/Disassembler/AArch64Disassembler.cpp
  llvm/test/MC/AArch64/armv8.8a-mops.s
  llvm/test/MC/Disassembler/AArch64/armv8.8a-mops.txt

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D116157.395830.patch
Type: text/x-patch
Size: 61074 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211222/49d19237/attachment-0001.bin>


More information about the llvm-commits mailing list