This is an archive of the discontinued LLVM Phabricator instance.

[AArch64][SVE2] Add the SVE2.1 permute vector elements (quadword) instructions
ClosedPublic

Authored by david-arm on Nov 8 2022, 1:21 AM.

Details

Summary

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

zipq1 : Interleave elements from low halves of each pair of quadword vector segments
zipq2 : Interleave elements from high halves of each pair of quadword vector segments
uzpq1 : Concatenate even elements within each pair of quadword vector segments
uzpq2 : Concatenate odd elements within each pair of quadword vector segments
tblq : Programmable table lookup within each quadword vector segment (zeroing)

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

Diff Detail

Event Timeline

david-arm created this revision.Nov 8 2022, 1:21 AM
Herald added a project: Restricted Project. · View Herald Transcript
david-arm requested review of this revision.Nov 8 2022, 1:21 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 8 2022, 1:21 AM
llvm/lib/Target/AArch64/SVEInstrFormats.td
9350

You could re-use class sve2_clamp
and then change:
let Inst{15-11} = 0b11000;
let Inst{10} = U;
to be:
let Inst{15-13} = 0b11;
let Inst{13-10} = op;

david-arm updated this revision to Diff 474195.Nov 9 2022, 1:45 AM
  • Reuse sve2_clamp class from SMEInstrFormats.td
david-arm marked an inline comment as done.Nov 9 2022, 1:46 AM
paulwalker-arm added inline comments.Nov 9 2022, 2:57 AM
llvm/lib/Target/AArch64/SMEInstrFormats.td
1086 ↗(On Diff #474195)

Not really against it but is there a good reason to move this code rather than adding you new sve2p1_tblq multiclass here instead?

llvm/lib/Target/AArch64/SVEInstrFormats.td
9531

I don't think this comment means anything because those bits are passed in via opc.

9544–9549

Can you reuse sve2_clamp here and pass in null_frag? I suppose this depends on whether these permute instructions are going to need floating point patterns but we can alway separate them later if that turns out to be true.

david-arm updated this revision to Diff 474236.Nov 9 2022, 5:22 AM
  • Reuse the old sve2_clamp multiclass with null_frag operators.
david-arm marked 2 inline comments as done.Nov 9 2022, 5:25 AM
david-arm added inline comments.
llvm/lib/Target/AArch64/SMEInstrFormats.td
1086 ↗(On Diff #474195)

As discussed privately, this is actually moving to a different file - SVEInstrFormats.td

llvm/lib/Target/AArch64/SVEInstrFormats.td
9531

My apologies - it was a stray comment I'd left in the code by mistake!

david-arm updated this revision to Diff 474287.Nov 9 2022, 8:38 AM
david-arm marked 2 inline comments as done.

Reverting to original patch due to difference in register constraints between SVE2.1 permute instructions and SVE2 sclamp/uclamp.

paulwalker-arm accepted this revision.Nov 9 2022, 10:27 AM
This revision is now accepted and ready to land.Nov 9 2022, 10:27 AM
This revision was landed with ongoing or failed builds.Nov 10 2022, 1:19 AM
This revision was automatically updated to reflect the committed changes.