This is an archive of the discontinued LLVM Phabricator instance.

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

Authored by david-arm on Oct 20 2022, 7:30 AM.

Details

Summary

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

FCLAMP : Floating-point clamp to minimum/maximum number

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

Diff Detail

Event Timeline

david-arm created this revision.Oct 20 2022, 7:30 AM
david-arm requested review of this revision.Oct 20 2022, 7:30 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 20 2022, 7:30 AM
sdesmalen added inline comments.Oct 20 2022, 7:34 AM
llvm/lib/Target/AArch64/AArch64SMEInstrInfo.td
247 ↗(On Diff #469226)

nit: SME2 or SVE2.1 instructions

251 ↗(On Diff #469226)

nit: sve2p1_ ? I also wonder if these should live in AArch64SVEInstrInfo.td instead?

david-arm added inline comments.Oct 20 2022, 7:37 AM
llvm/lib/Target/AArch64/AArch64SMEInstrInfo.td
251 ↗(On Diff #469226)

That's a good question! I followed the same precedent as the SVE2 instructions above that were added for SME. Perhaps we can also move those to AArch64SVEInstrInfo.td for consistency?

sdesmalen added inline comments.Oct 20 2022, 7:44 AM
llvm/lib/Target/AArch64/AArch64SMEInstrInfo.td
251 ↗(On Diff #469226)

Yes, I think so. If you move them to AArch64SVEInstrInfo.td, they should probably have a different predicate too, i.e. HasSVE2p1orSME (instead of HasSVE2p1orSME2 as you introduced here).

  • Renamed classes to sve2p1_* and moved them into AArch64SVEInstrInfo.td
david-arm marked 3 inline comments as done.Oct 20 2022, 10:19 AM
david-arm added inline comments.
llvm/lib/Target/AArch64/AArch64SMEInstrInfo.td
251 ↗(On Diff #469226)

I've done that as part of the parent D136352 patch

david-arm updated this revision to Diff 469533.Oct 21 2022, 3:36 AM
david-arm marked an inline comment as done.
  • Rebase.
  • Moved tests to llvm/test/MC/AArch64/SVE2
sdesmalen accepted this revision.Oct 21 2022, 3:42 AM
This revision is now accepted and ready to land.Oct 21 2022, 3:42 AM
david-arm updated this revision to Diff 469574.Oct 21 2022, 6:25 AM
david-arm added a subscriber: c-rhodes.
  • After @c-rhodes's request on https://reviews.llvm.org/D136427 I'm changing the chain of patches to put tests in llvm/test/MC/AArch64/SVE2p1 and rename the tests to be just fclamp.s and fclamp-diagnostics.s
This revision was landed with ongoing or failed builds.Oct 21 2022, 7:33 AM
This revision was automatically updated to reflect the committed changes.