This is an archive of the discontinued LLVM Phabricator instance.

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

Authored by david-arm on Oct 21 2022, 1:10 AM.

Details

Summary

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

FDOT : Half-precision floating-point dot product
FDOT : Half-precision floating-point indexed dot product

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

Diff Detail

Event Timeline

david-arm created this revision.Oct 21 2022, 1:10 AM
david-arm requested review of this revision.Oct 21 2022, 1:10 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 21 2022, 1:10 AM
david-arm added inline comments.Oct 21 2022, 1:14 AM
llvm/test/MC/AArch64/SME2/fdot_sme2_or_sve2p1-diagnostics.s
1 ↗(On Diff #469496)

I just realised these tests should probably be moved to SVE2. I'll do that in an update!

sdesmalen added inline comments.Oct 21 2022, 3:48 AM
llvm/lib/Target/AArch64/AArch64SVEInstrInfo.td
3579

I think this should be ZZZI

david-arm updated this revision to Diff 469540.Oct 21 2022, 3:58 AM
  • Renamed FDOT_ZZI to FDOT_ZZZI.
david-arm marked an inline comment as done.Oct 21 2022, 3:58 AM
sdesmalen accepted this revision.Oct 21 2022, 3:59 AM
This revision is now accepted and ready to land.Oct 21 2022, 3:59 AM
c-rhodes added inline comments.
llvm/test/MC/AArch64/SME2/fdot_sme2_or_sve2p1-diagnostics.s
1 ↗(On Diff #469496)

I just realised these tests should probably be moved to SVE2. I'll do that in an update!

how about creating an SVE2.1 directory? And I don't think sme2_or_sve2p1 needs to be in the filename.

david-arm updated this revision to Diff 469579.Oct 21 2022, 6:37 AM
  • Moved tests into llvm/test/MC/AArch64/SVE2p1 directory and removed the sme2_or_sve2p1 parts from the names.
david-arm marked an inline comment as done.Oct 21 2022, 6:37 AM
paulwalker-arm added inline comments.Oct 21 2022, 7:53 AM
llvm/lib/Target/AArch64/SVEInstrFormats.td
8221

I guess you taken this by cloning sve_bfloat_dot_base, but is this correct? ElementSize is used for movprfx handling and usually the largest element type is choose. Given these are unpredicated instructions I'm wondering if the easiest fix is to just remove the line?

For what it's worth I suspect sve_bfloat_dot_base is also wrong for the same reason.

8246

As above?

david-arm updated this revision to Diff 469614.Oct 21 2022, 8:08 AM
  • Removed ElementType from instruction classes.
david-arm marked 2 inline comments as done.Oct 21 2022, 8:08 AM
paulwalker-arm added inline comments.Oct 21 2022, 8:17 AM
llvm/lib/Target/AArch64/AArch64SVEInstrInfo.td
3578–3579

Sorry, last drive by comment I promise, but should these be FDOT_ZZZ_S and FDOT_ZZZI_S to match the existing naming style? As before, I think the existing bfloat classes are not to be followed because they're wrong.

david-arm added inline comments.Oct 21 2022, 8:20 AM
llvm/lib/Target/AArch64/AArch64SVEInstrInfo.td
3578–3579

Is that to denote the fact the output size is different to the input, i.e. this is a special case? I just want to make sure we're consistent with naming schemes that's all because the FCLAMP_ZZZ above it doesn't have a _H suffix. It's useful to know for future patches if we should be putting a suffix for the destination element size on everything.

paulwalker-arm added inline comments.Oct 21 2022, 8:27 AM
llvm/lib/Target/AArch64/AArch64SVEInstrInfo.td
3578–3579

FCLAMP_ZZZ does have this but it's buried within the sve2p1_fclamp multiclass. In general all the SVE instructions end with an element type letter that is usually but not always the result register's element type. See how SDOT/UDOT is defined. The exception here is that currently only a single variant exists but that might not always be the case.

david-arm updated this revision to Diff 469634.Oct 21 2022, 8:45 AM
  • Added _S suffix to instruction names.
david-arm marked 2 inline comments as done.Oct 21 2022, 8:46 AM
david-arm added inline comments.
llvm/lib/Target/AArch64/AArch64SVEInstrInfo.td
3578–3579

Doh! Of course the fclamp are in a multiclass. :face_palm

This revision was landed with ongoing or failed builds.Oct 21 2022, 9:27 AM
This revision was automatically updated to reflect the committed changes.
david-arm marked an inline comment as done.