This is an archive of the discontinued LLVM Phabricator instance.

[AArch64] Add SVE2.1 target feature for Armv9-A 2022 Architecture Extension
ClosedPublic

Authored by david-arm on Oct 20 2022, 7:01 AM.

Details

Summary

First patch in a series adding MC layer support for SVE2.1.

This patch adds the following feature:

sve2p1

Some of the existing SVE instructions added for SME are now
also available under the sve2p1 feature, which are now guarded
by the HasSVE2p1_or_HasSME predicate.

The reference can be found here:
https://developer.arm.com/documentation/ddi0602/2022-09

Diff Detail

Event Timeline

david-arm created this revision.Oct 20 2022, 7:01 AM
david-arm requested review of this revision.Oct 20 2022, 7:01 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 20 2022, 7:01 AM

I think there is a case for this missing in AArch64AsmParser.cpp for the march assembler directive. Can you add that with a corresponding test? (see e.g. llvm/test/MC/AArch64/SME2/directive-arch.s in D135455)

david-arm edited the summary of this revision. (Show Details)
  • Moved existing SVE instructions added for SME into AArch64SVEInstrInfo.td and guarded them a new HasSVE2p1OrSME predicate, since these can now be enabled by SVE2p1.
  • Added directive-arch tests for the new SVE2 feature.
llvm/lib/Target/AArch64/AArch64.td
166

Extra whitespace

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

I know the precedent has been set but I find this awkward to parse. Is HasSVE2p1_or_HasSME a terrible idea? If agreeable we can always convert the other instance later on.

llvm/lib/Target/AArch64/AArch64SVEInstrInfo.td
3570

Existing precedent is just End HasSVE2p1orSME.

llvm/test/MC/AArch64/SME2/feature-sve2p1-implies-sve2.s
7 ↗(On Diff #469272)

Does the CHECK-NOT line provide any value? By which I mean such a message will be followed by an exit(1) and so the lit test will fail anyway?

david-arm added inline comments.Oct 21 2022, 12:35 AM
llvm/lib/Target/AArch64/AArch64InstrInfo.td
159

I don't mind changing it, but I do think it makes sense to also fix up the other names too for consistency (perhaps in a later patch?). I guess your reason for wanting to put 'Has' twice in the name is to make it easily searchable?

@sdesmalen any thoughts?

paulwalker-arm added inline comments.Oct 21 2022, 3:00 AM
llvm/lib/Target/AArch64/AArch64InstrInfo.td
159

Sure, definitely a later patch for the existing cases. The double Has is to reflect this is boolean logic of two existing feature flags, which as you say means they'll show up in the typical search query,

david-arm updated this revision to Diff 469528.Oct 21 2022, 3:20 AM
david-arm edited the summary of this revision. (Show Details)
  • Changed predicate from HasSVE2p1orSME2 to HasSVE2p1_or_HasSME2.
  • Removed CHECK-NOT from directive.s test.
david-arm marked 4 inline comments as done.Oct 21 2022, 3:20 AM
david-arm added inline comments.
llvm/lib/Target/AArch64/AArch64.td
166

The whitespace is deliberate because all the other features have a newline separating them too. I did this for consistency that's all.

sdesmalen added inline comments.Oct 21 2022, 3:37 AM
llvm/lib/Target/AArch64/AArch64InstrInfo.td
159

Yes it would make searching easier, so I'm happy with the suggestion

sdesmalen accepted this revision.Oct 21 2022, 3:41 AM
sdesmalen added inline comments.
llvm/lib/Target/AArch64/AArch64InstrInfo.td
162–164

nit: Should there be a new-line between def HasSVE2p1_or_HasSME and def HasSVE2p1_or_HasSME2 ?

This revision is now accepted and ready to land.Oct 21 2022, 3:41 AM
paulwalker-arm accepted this revision.Oct 21 2022, 5:29 AM
paulwalker-arm added inline comments.
llvm/lib/Target/AArch64/AArch64.td
166

Perhaps you've misunderstood my comment? I just meant there is a double whitespace within Extension 2.1 instructions.

david-arm updated this revision to Diff 469568.Oct 21 2022, 6:10 AM
david-arm added a subscriber: c-rhodes.
david-arm marked an inline comment as done.Oct 21 2022, 6:11 AM
david-arm added inline comments.
llvm/lib/Target/AArch64/AArch64.td
166

Ah yes I see what you mean now. The colour scheme on my browser basically just shows two shades of yellow so it's not very obvious. :)

This revision was landed with ongoing or failed builds.Oct 21 2022, 7:03 AM
This revision was automatically updated to reflect the committed changes.
david-arm marked an inline comment as done.