This is an archive of the discontinued LLVM Phabricator instance.

[AArch64][SME] Add SME read/write intrinsics that map to the mova instruction
ClosedPublic

Authored by david-arm on Jun 9 2022, 9:06 AM.

Details

Summary

This patch adds implementations for the read/write SME ACLE intrinsics:

@llvm.aarch64.sme.read.horiz
@llvm.aarch64.sme.read.vert
@llvm.aarch64.sme.write.horiz
@llvm.aarch64.sme.write.vert

These all map to the SME mova instruction.

Diff Detail

Event Timeline

david-arm created this revision.Jun 9 2022, 9:06 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 9 2022, 9:06 AM
david-arm requested review of this revision.Jun 9 2022, 9:06 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 9 2022, 9:06 AM

Sorry! The heading says mova instruction, but in the ll file there are only movs?!?.

Sorry! The heading says mova instruction, but in the ll file there are only movs?!?.

Ah yes, sorry for the confusion. Yes 'mov' is actually the preferred alias for the SME 'mova' vector-to-tile and tile-to-vector instructions!

aemerson added inline comments.Jun 13 2022, 4:16 PM
llvm/lib/Target/AArch64/SMEInstrFormats.td
641–655

Do my eyes deceive me or is this the same as sme_vector_to_tile_patterns?

c-rhodes added inline comments.Jun 14 2022, 3:20 AM
llvm/lib/Target/AArch64/SMEInstrFormats.td
718–719

this is repeated a bunch how about doing:

defvar op = !if(is_col, int_aarch64_sme_write_vert,
                        int_aarch64_sme_write_horiz);

above and replacing uses with op to clean it up a bit?

757–761

nit: alignment, but it looks like this q_patterns class can be removed as Amara noticed.

792–803

these two are the same?

958–967

also the same

llvm/test/CodeGen/AArch64/SME/sme-intrinsics-mova-extract.ll
299

16i8

the insert tests also prefix this with 'v'

david-arm added inline comments.Jun 14 2022, 3:26 AM
llvm/lib/Target/AArch64/SMEInstrFormats.td
641–655

Good point - they are the same! :facepalm

792–803

No, they're different. One is nxv2i64 and the other is nxv2f64.

958–967

Yep, these two are definitely the same. :)

david-arm updated this revision to Diff 436775.Jun 14 2022, 7:27 AM
  • Tidied up the isel patterns.
  • Made the _q test names consistent.
david-arm marked 6 inline comments as done.Jun 14 2022, 7:28 AM
david-arm added inline comments.
llvm/lib/Target/AArch64/SMEInstrFormats.td
718–719

Great suggestion @c-rhodes!

aemerson accepted this revision.Jun 14 2022, 10:24 AM

No further comments from me, LGTM if Cullen approves.

This revision is now accepted and ready to land.Jun 14 2022, 10:24 AM
This revision was landed with ongoing or failed builds.Jun 15 2022, 2:31 AM
This revision was automatically updated to reflect the committed changes.
david-arm marked an inline comment as done.