This is an archive of the discontinued LLVM Phabricator instance.

[AArch64][SME2] Add multi-vector saturating rounding shift right intrinsics
ClosedPublic

Authored by kmclaughlin on Jan 24 2023, 6:30 AM.

Details

Summary

Adds IR intrinsics for the following SME2 instructions:

  • sqrshr (2 and 4 vector)
  • uqrshr (2 and 4 vector)
  • sqrshru (2 and 4 vector)
  • sqrshrn (4 vector)
  • uqrshrn (4 vector)
  • sqrshrun (4 vector)

Also adds intrinsics for the following SVE2p1 instructions:

  • sqrshrn (2 vector)
  • uqrshrn (2 vector)
  • sqrshrun (2 vector)
NOTE: These intrinsics are still in development and are subject to future changes.

Diff Detail

Event Timeline

kmclaughlin created this revision.Jan 24 2023, 6:30 AM
kmclaughlin requested review of this revision.Jan 24 2023, 6:30 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 24 2023, 6:30 AM

Hey Kerry,
Thank you for the patch. I made some comments.
Some are the comments you thankfully raised on my previous patches.
Thank you for that btw.

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

Kerry I have a glance and is it correct to assume that we should replace the ZPR4 and ZPR3 in SME2_Sat_Shift_VG2_Pat and ZPR2Mul2 and SME2_Sat_Shift_VG4_Pat by ZPR4Mul4

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

Just double check again if ZPR2 is the correct one

llvm/test/CodeGen/AArch64/sme2-intrinsics-qrshr.ll
3

David asked me to remove-mattr=+sve from my tests, because it is not needed. Is it in yours?

Matt added a subscriber: Matt.Jan 24 2023, 10:30 AM
kmclaughlin marked 2 inline comments as done.
  • Replace ZPR2/ZPR4 with ZPR2Mul2/ZPR4Mul4 in SME2_Sat_Shift_VG2_Pat & SME2_Sat_Shift_VG4_Pat.
  • Removed unnecessary flags from the RUN lines of the tests.
llvm/lib/Target/AArch64/SMEInstrFormats.td
158

Thanks @CarolineConcatto, you're right that this should be ZPR2Mul2 & ZPR4Mul4. I've changed this and added an unused first argument to each of the tests to make sure the multi-vector lists start with a multiple of 2 or 4.

llvm/test/CodeGen/AArch64/sme2-intrinsics-qrshr.ll
3

It's not needed, I've removed unnecessary flags from this test and sve2p1-intrinsics-qrshr.ll.

CarolineConcatto accepted this revision.Jan 25 2023, 6:46 AM

Thank you @kmclaughlin for checking and making the changes.
I don't see any problems with this patch now.
So, LGTM!

This revision is now accepted and ready to land.Jan 25 2023, 6:46 AM
This revision was landed with ongoing or failed builds.Jan 26 2023, 3:13 AM
This revision was automatically updated to reflect the committed changes.