[ARM][clang] Define feature test macro for the PACBTI-M extension
authorTies Stuij <ties.stuij@arm.com>
Thu, 9 Dec 2021 09:40:46 +0000 (09:40 +0000)
committerTies Stuij <ties.stuij@arm.com>
Thu, 9 Dec 2021 10:39:06 +0000 (10:39 +0000)
commite32b818db187a6519ee5eba47e8d7dae1d58a723
treed7a06c0425d53c4afdcced5398d6dfd23dddafda
parent2a73a1ac57f0b7f95d3e75ef8f3dafb174ef5ccc
[ARM][clang] Define feature test macro for the PACBTI-M extension

If the extension string "+pacbti" was given in -march=... or -mcpu=... options the compiler shall define the following preprocessor macros:

    __ARM_FEATURE_PAUTH with value 1.
    __ARM_FEATURE_BTI with value 1.

This patch is part of a series that adds support for the PACBTI-M extension of
the Armv8.1-M architecture, as detailed here:

https://community.arm.com/arm-community-blogs/b/architectures-and-processors-blog/posts/armv8-1-m-pointer-authentication-and-branch-target-identification-extension

The PACBTI-M specification can be found in the Armv8-M Architecture Reference
Manual:

https://developer.arm.com/documentation/ddi0553/latest

The following people contributed to this patch:

- Momchil Velikov
- Ties Stuij

Reviewed By: miyuki

Differential Revision: https://reviews.llvm.org/D112431
clang/lib/Basic/Targets/ARM.cpp
clang/lib/Basic/Targets/ARM.h
clang/test/Preprocessor/arm-target-features.c