This is an archive of the discontinued LLVM Phabricator instance.

[AArch64][SVE2] Add the SVE2.1 pmov instructions
ClosedPublic

Authored by david-arm on Nov 7 2022, 8:56 AM.

Details

Summary

This patch adds the assembly/disassembly for the following instructions:

pmov : Move predicate to vector
pmov : Move vector to predicate

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

Diff Detail

Event Timeline

david-arm created this revision.Nov 7 2022, 8:56 AM
Herald added a project: Restricted Project. · View Herald Transcript
david-arm requested review of this revision.Nov 7 2022, 8:56 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 7 2022, 8:56 AM
paulwalker-arm added inline comments.Nov 7 2022, 10:06 AM
llvm/lib/Target/AArch64/SVEInstrFormats.td
9289

Please can you join these into a single 4-bit opcode?

9306–9316

I think you might not need this based on https://developer.arm.com/documentation/ddi0602/2022-09/SVE-Instructions/PMOV--to-predicate---Move-predicate-from-vector-.

It says When the predicate element specifier is.B, each bit [N] from the least-significant VL/8 bits in the source vector register is copied to bit [N] of the destination predicate register. The immediate index, if specified, must be 0.

Note the last part. This suggests PMOV <Pd>.B, <Zn>[0] is allowed, but PMOV <Pd>.B, <Zn> is the preferred disassembly. I know the alias isn't shown but the text seems clear and favourable because you can just add/implement VectorIndex032b along with an InastAlias rather than needing special instruction classes.

9336

Please can you join these into a single 4-bit opcode?

9347–9348

Not sure why the docs split this but feel free to join them if you want.

Matt added a subscriber: Matt.Nov 7 2022, 12:40 PM
david-arm updated this revision to Diff 473965.Nov 8 2022, 5:23 AM
  • Added support for both Zd[0] and Zd forms with the byte variant, plus added extra tests for the alias.
david-arm marked 4 inline comments as done.Nov 8 2022, 5:23 AM
paulwalker-arm accepted this revision.Nov 8 2022, 8:13 AM
This revision is now accepted and ready to land.Nov 8 2022, 8:13 AM
This revision was automatically updated to reflect the committed changes.