forked from llvm/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[AArch64] Assembly Support for FEAT_GCS/FEAT_CHK
This implements support for two new 2022 A-profile extensions: - FEAT_CHK - Check Feature Status Extension - FEAT_GCS - Guarded Control Stacks FEAT_CHK is mandatory from armv8.0-a, but is in the hint space so there's no clang command-line flag for it, and we only print the hint as `chkfeat x16` at v8.9a and above, to be compatible when using a non-integrated assembler that might not yet know about the extension. FEAT_GCS is optional from armv9.4-a onwards. It is enabled using `+gcs` in a clang `-march=` or `-mcpu=` option string, or using a `.arch_extension gcs` assembly directive. This patch includes changes by Ties Stuij, Tomas Matheson, and Keith Walker. Differential Revision: https://reviews.llvm.org/D145563
- Loading branch information
Showing
14 changed files
with
387 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// RUN: llvm-mc -triple aarch64 -mattr=+chk -show-encoding %s | FileCheck %s | ||
// RUN: llvm-mc -triple aarch64 -mattr=+v8.9a -show-encoding %s | FileCheck %s | ||
// RUN: llvm-mc -triple aarch64 -mattr=+v9.4a -show-encoding %s | FileCheck %s | ||
// RUN: llvm-mc -triple aarch64 -mattr=+v8a -show-encoding %s | FileCheck %s --check-prefix=NO-CHK | ||
|
||
// FEAT_CHK is mandatory from v8.0-a, but a clang user may not be using the LLVM | ||
// integrated assembler, so we cannot just print `chkfeat x16` in all | ||
// circumstances. Thankfully, we can always print `hint #40` when we cannot | ||
// print `chkfeat x16`. | ||
// | ||
// So, in this case, we only print `chkfeat x16` from v8.9-a onwards, as an | ||
// assembler that understands v8.9-a will understand `chkfeat x16`, and those | ||
// that understand previous versions may not. | ||
|
||
chkfeat x16 | ||
// CHECK: chkfeat x16 // encoding: [0x1f,0x25,0x03,0xd5] | ||
// NO-CHK: hint #40 // encoding: [0x1f,0x25,0x03,0xd5] | ||
|
||
hint #40 | ||
// CHECK: chkfeat x16 // encoding: [0x1f,0x25,0x03,0xd5] | ||
// NO-CHK: hint #40 // encoding: [0x1f,0x25,0x03,0xd5] |
Oops, something went wrong.