[PATCH] D60486: [AArch64] Add support for MTE intrinsics

Javed Absar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 9 13:59:45 PDT 2019


javed.absar created this revision.
javed.absar added reviewers: DavidSpickett, olista01.
Herald added a subscriber: kristof.beyls.

This patch provides intrinsics support for Memory Tagging Extension (MTE),
 which was introduced with the Armv8.5-a architecture.
This is llvm patch. The corresponding clang patch is: https://reviews.llvm.org/D60485

These intrinsics are available when __ARM_FEATURE_MEMORY_TAGGING is defined.
Each intrinsic is described in detail in   the latest ACLE Q1 2019 documentation:

  https://developer.arm.com/docs/101028/latest

However, below we also list the intrinsics:

1. T* __arm_mte_create_random_tag(T* src, uint64_t mask); This intrinsic returns a pointer containing a randomly created logical address tag.
2. T* __arm_mte_increment_tag(T* src, unsigned offset); This intrinsic returns a pointer which is a copy of the input pointer src but with the logical address tag part offset by a specified offset value.
3. uint64_t __arm_mte_exclude_tag(T* src, uint64_t excluded); This intrinsic adds a logical tag to the set of excluded logical tags.
4. void __arm_mte_set_tag(T* tag_address); This intrinsic stores an allocation tag, computed from the logical tag, to the tag memory thereby setting the allocation tag for the 16-byte granule of memory.
5. T* __arm_mte_get_tag(T* address); This intrinsic loads the allocation tag from tag memory and returns the corresponding logical tag as part of the returned pointer value.
6. ptrdiff_t __arm_mte_ptrdiff(T* a, T* b); The intrinsic calculates the difference between the address parts of the two pointers, ignoring the tags.


https://reviews.llvm.org/D60486

Files:
  include/llvm/IR/IntrinsicsAArch64.td
  lib/Target/AArch64/AArch64ISelDAGToDAG.cpp
  lib/Target/AArch64/AArch64InstrFormats.td
  lib/Target/AArch64/AArch64InstrInfo.cpp
  lib/Target/AArch64/AArch64InstrInfo.td
  test/CodeGen/AArch64/arm64-mte.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D60486.194393.patch
Type: text/x-patch
Size: 26058 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190409/c24e0e30/attachment-0001.bin>


More information about the llvm-commits mailing list