This patch provides intrinsics support for Memory Tagging Extension (MTE),
which was introduced with the Armv8.5-a architecture.
These intrinsics are available when __ARM_FEATURE_MEMORY_TAGGING is defined.
Each intrinsic is described in detail in the latest ACLE Q1 2019 documentation:
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
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.