This is an archive of the discontinued LLVM Phabricator instance.

[AArch64] Complete the list of extensions supported by .arch and .arch_extension
ClosedPublic

Authored by mstorsjo on Jun 2 2023, 2:48 AM.

Details

Summary

This brings the list of extensions supported here up to date
with what is supported by current git versions of binutils.

Also add a comment to AArch64TargetParser to remind people to
consider adding new ones to the list supported in assembly.

In the case of the "rdma" extension, there's a slight surprise:
LLVM knows of the extension under the name "rdm", while binutils
has it named "rdma". However, binutils appears to accept any
abbreviated prefix of an arch extension, so it does accept the
form "rdm" too even if it formally considers it called "rdma".

Thus common use of it might end up calling it "rdm" and having
that working with binutils. (If such cases are common I guess
we could consider adding "rdm" as an alias here too?)

Diff Detail

Event Timeline

mstorsjo created this revision.Jun 2 2023, 2:48 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 2 2023, 2:48 AM
mstorsjo requested review of this revision.Jun 2 2023, 2:48 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 2 2023, 2:48 AM
lenary edited reviewers, added: pratlucas; removed: lenary.Jun 2 2023, 3:00 AM

I would suggest using "rdm" which is:

  • consistent with both clang and AArch64TargetParser
  • consistent with the actual feature name in the Arm ARM, which is FEAT_RDM. "ARMv8.1-RDMA" is the legacy feature name.
  • accepted by binutils

Otherwise LGTM

I would suggest using "rdm" which is:

  • consistent with both clang and AArch64TargetParser
  • consistent with the actual feature name in the Arm ARM, which is FEAT_RDM. "ARMv8.1-RDMA" is the legacy feature name.
  • accepted by binutils

Ok, those are good arguments. Although, as binutils still documents it as rdma, do you think it'd make sense to support both namings for it? I'd hate to not support the naming that they advertise. I guess it'd be as simple as having two entries in this table.

Ok, those are good arguments. Although, as binutils still documents it as rdma, do you think it'd make sense to support both namings for it? I'd hate to not support the naming that they advertise. I guess it'd be as simple as having two entries in this table.

Yeah, if it's as simple as that then I can't see any harm in accepting both.

Function Multi Versioning also uses "+rdm".

mstorsjo updated this revision to Diff 527802.Jun 2 2023, 4:13 AM

Updated to support both "rdm" and "rdma"; added a comment in the table about it, and testing both forms in the test file.

tmatheson accepted this revision.Jun 2 2023, 4:16 AM

LGTM, thanks.

This revision is now accepted and ready to land.Jun 2 2023, 4:16 AM

Thanks for the update!

If anyone has time to make the backend use the list from the target parser (or the backend itself) that would be even better.

If anyone has time to make the backend use the list from the target parser (or the backend itself) that would be even better.

Yep, that'd be ideal. The target parser has a much larger set of extensions though, and some of them use different spellings between binutils and llvm, so for the .arch and .arch_extension cases in asm, I've aligned with binutils here - e.g. compnum doesn't seem to have a direct counterpart in targetparser (or is that fcma?).

mstorsjo updated this revision to Diff 527848.Jun 2 2023, 6:50 AM

Added a release note