This is an archive of the discontinued LLVM Phabricator instance.

[AArch64] Add asm aliases for MOV, LDR, STR with predicate-as-counter
ClosedPublic

Authored by CarolineConcatto on Mar 17 2023, 10:42 AM.

Details

Summary

In the 2022-12 release of the A64 ISA it was updated that the assembler must
also accept predicate-as-counter register names for the source predicate
register and the destination predicate register for:

  • *MOV: Move predicate (unpredicated)*
  • *LDR (predicate): Load predicate register*
  • *STR (predicate): Store predicate register*

Diff Detail

Event Timeline

CarolineConcatto requested review of this revision.Mar 17 2023, 10:42 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 17 2023, 10:42 AM
sdesmalen accepted this revision.Mar 17 2023, 10:55 AM
sdesmalen added inline comments.
llvm/lib/Target/AArch64/AArch64SVEInstrInfo.td
2211

nit: please remove newline

This revision is now accepted and ready to land.Mar 17 2023, 10:55 AM
sdesmalen requested changes to this revision.Mar 17 2023, 11:00 AM

Sorry for the quick turn-around here, but I just realise that we probably want to guard these aliases with HasSVE2p1_or_HasSME2, because without those features the concept of a predicate-as-counter does not exist. I see that we haven't done this for pfalse either.

This revision now requires changes to proceed.Mar 17 2023, 11:00 AM
  • Allow the alias to be used only when sve2.1 or sme2 are enabled.
  • Remove extra space
sdesmalen added inline comments.Mar 20 2023, 4:50 AM
llvm/lib/Target/AArch64/AArch64SVEInstrInfo.td
3847

nit: Could you add a comment here saying that these are aliases for existing (SVE) instructions for which predicate-as-counter can be accepted as an operand to the instruction?

llvm/test/MC/AArch64/SVE/ldr_alias.s
1 ↗(On Diff #506538)

Is it worth combining these tests into a single predicate-as-counter-aliases.s test?

llvm/test/MC/AArch64/SVE/orr.s
156 ↗(On Diff #506538)

nit: unrelated whitespace change?

Matt added a subscriber: Matt.Mar 20 2023, 8:44 AM
CarolineConcatto marked an inline comment as done.

-Paste all the tests for the predicate-as-counter in one file

CarolineConcatto marked an inline comment as done.Mar 20 2023, 9:24 AM
sdesmalen accepted this revision.Mar 22 2023, 3:37 AM
This revision is now accepted and ready to land.Mar 22 2023, 3:37 AM
This revision was landed with ongoing or failed builds.Mar 22 2023, 9:06 AM
This revision was automatically updated to reflect the committed changes.