This is an archive of the discontinued LLVM Phabricator instance.

[AArch64]SME2 Single and Multi vector Shift and Multiply instructions
ClosedPublic

Authored by CarolineConcatto on Oct 18 2022, 2:57 AM.

Details

Summary

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

SQRSHR (four registers): Multi-vector signed saturating rounding shift right narrow by immediate.
       (two registers): Multi-vector signed saturating rounding shift right narrow by immediate.
SQRSHRN: Multi-vector signed saturating rounding shift right narrow by immediate and interleave.
SQRSHRU (four registers): Multi-vector signed saturating rounding shift right unsigned narrow by immediate.
        (two registers): Multi-vector signed saturating rounding shift right unsigned narrow by immediate.
SQRSHRUN: Multi-vector signed saturating rounding shift right unsigned narrow by immediate and interleave.
UQRSHR (four registers): Multi-vector unsigned saturating rounding shift right narrow by immediate
       (two registers): Multi-vector unsigned saturating rounding shift right narrow by immediate.
UQRSHRN: Multi-vector unsigned saturating rounding shift right narrow by immediate and interleave.

The reference can be found here:

https://developer.arm.com/documentation/ddi0602/2022-09

Diff Detail

Event Timeline

Herald added a project: Restricted Project. · View Herald TranscriptOct 18 2022, 2:57 AM
CarolineConcatto requested review of this revision.Oct 18 2022, 2:57 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 18 2022, 2:57 AM

-Undo changes unwanted changes in sqdmulh-diagnostics.s

This patch needs to be rebase, this instructions
defm SQDMULH_2Z2Z : sme2_sqdmulh_vector_vg2_multi<"sqdmulh">;
defm SQDMULH_4Z4Z : sme2_sqdmulh_vector_vg4_multi<"sqdmulh">;
Should not be here.

llvm/lib/Target/AArch64/AArch64SMEInstrInfo.td
239

This needs to be removed.
It is already in:
https://reviews.llvm.org/D135575

Matt added a subscriber: Matt.Oct 21 2022, 12:39 PM
CarolineConcatto edited the summary of this revision. (Show Details)
  • Remove redundant instructions
paulwalker-arm added inline comments.Oct 30 2022, 5:08 AM
llvm/lib/Target/AArch64/SMEInstrFormats.td
3575

Can you create a multiclass for this that means the instructions get an element type suffix? Either that or just add the suffix to the instruction name, but I think we'll need a multiclass anyway for when we wire in code generation support.

3599–3601

Please see sve_int_bin_pred_shift_imm_left for how we usually handle variable length shift imm fields. Following that idiom sme2_sat_shift_vector_vg4 will match the encoding group (i.e. include entries for tsize and imm5) with the multiclass passing in the fixed parts and the fills in the rest using the imm of the required bit length for its datatype.

  • Address review comments
CarolineConcatto marked 2 inline comments as done.Nov 1 2022, 12:57 PM
paulwalker-arm accepted this revision.Nov 1 2022, 5:50 PM

A couple of small requests but otherwise looks good.

llvm/lib/Target/AArch64/SMEInstrFormats.td
3592

This should be _H? because we typically reference the result element type, like you've done for the vg4 variants.

3605–3606

I'm not a fan of leaving holes in Inst like this. However, in this instance the hole is probably a bit big to hide within an opcode parameter so perhaps just add a comment like

// Inst{20-16} = imm5;
3614

Can this be kept as op and the split done within sme2_sat_shift_vector_vg4?

This revision is now accepted and ready to land.Nov 1 2022, 5:50 PM
This revision was landed with ongoing or failed builds.Nov 8 2022, 4:33 AM
This revision was automatically updated to reflect the committed changes.
CarolineConcatto marked 3 inline comments as done.Nov 8 2022, 4:41 AM