This is an archive of the discontinued LLVM Phabricator instance.

[AArch64] Assembly Support for FEAT_GCS/FEAT_CHK
ClosedPublic

Authored by lenary on Mar 8 2023, 2:35 AM.

Details

Summary

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.

Diff Detail

Event Timeline

lenary created this revision.Mar 8 2023, 2:35 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 8 2023, 2:36 AM
lenary requested review of this revision.Mar 8 2023, 2:36 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptMar 8 2023, 2:36 AM

The CHKFEAT instruction here is not exactly as described in https://developer.arm.com/downloads/-/exploration-tools today - but the next release of that description will be updated with the new syntax.

john.brawn accepted this revision.Mar 14 2023, 5:12 AM
john.brawn added a subscriber: john.brawn.

LGTM, with one minor nitpick.

llvm/lib/Target/AArch64/AArch64InstrInfo.td
1106

It would make more sense to put this immediately after GCSB_DSYNC.

This revision is now accepted and ready to land.Mar 14 2023, 5:12 AM
lenary marked an inline comment as done.Mar 15 2023, 3:38 AM
lenary added inline comments.
llvm/lib/Target/AArch64/AArch64InstrInfo.td
1106

This will be moved in the version that I land.

This revision was landed with ongoing or failed builds.Mar 15 2023, 4:04 AM
This revision was automatically updated to reflect the committed changes.
lenary marked an inline comment as done.