This is an archive of the discontinued LLVM Phabricator instance.

[AArch64][clang] implement 2022 General Data-Processing instructions
ClosedPublic

Authored by stuij on Nov 22 2022, 3:42 AM.

Details

Summary

This patch implements the 2022 Architecture General Data-Processing Instructions

They include:

Common Short Sequence Compression (CSSC) instructions

  • scalar comparison instructions SMAX, SMIN, UMAX, UMIN (32/64 bits) with or without immediate
  • ABS (absolute), CNT (count non-zero bits), CTZ (count trailing zeroes)
  • command-line options for CSSC

Associated with these instructions in the documentation is the Range Prefetch
Memory (RPRFM) instruction, which signals to the memory system that data memory
accesses from a specified range of addresses are likely to occur in the near
future. The instruction lies in hint space, and is made unconditional.

Specs for the individual instructions can be found here:
https://developer.arm.com/documentation/ddi0602/2022-09/Base-Instructions/

contributors to this patch:

  • Cullen Rhodes
  • Son Tuan Vu
  • Mark Murray
  • Tomas Matheson
  • Sam Elliott
  • Ties Stuij

Diff Detail

Event Timeline

stuij created this revision.Nov 22 2022, 3:42 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 22 2022, 3:42 AM
stuij requested review of this revision.Nov 22 2022, 3:42 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptNov 22 2022, 3:42 AM
lenary accepted this revision.Nov 22 2022, 4:28 AM

LGTM!

This revision is now accepted and ready to land.Nov 22 2022, 4:28 AM

Oh, actually, I have a few nits. You can fix them on commit though.

llvm/lib/Target/AArch64/AArch64.td
497

Please use the full name in parens: FEAT_CSSC (we've done this upstream for most other architectural extensions).

llvm/test/MC/AArch64/armv9.4a-v94-dp.s
1 ↗(On Diff #477133)

CSSC is actually a v8.9a feature, can you update this filename?

llvm/test/MC/Disassembler/AArch64/armv9.4a-v94-dp.txt
1 ↗(On Diff #477133)

And this filename too?

dmgreen added inline comments.
llvm/include/llvm/Support/AArch64TargetParser.h
79

48!?

llvm/lib/Target/AArch64/AArch64.td
497

Can you add (FEAT_SCCS) to this (if that is the correct name).

llvm/lib/Target/AArch64/AArch64InstrFormats.td
11725

Can we make this WriteI, maybe. I think that would probably be the closest sched class.

tschuett added inline comments.
llvm/lib/Target/AArch64/AArch64InstrFormats.td
11698

FEAT_CSSC or FEAT_V94_DP?

stuij updated this revision to Diff 477143.Nov 22 2022, 5:14 AM
stuij marked 6 inline comments as done.

addressed review comments

llvm/lib/Target/AArch64/AArch64InstrFormats.td
11725

I'm assuming you meant WriteLD.

dmgreen added inline comments.Nov 22 2022, 5:17 AM
llvm/lib/Target/AArch64/AArch64InstrFormats.td
11725

That would be a Load I believe. There are the min/max instructions? I think "simple ALU instruction" should be the closest match, which would be WriteI

stuij updated this revision to Diff 477146.Nov 22 2022, 5:33 AM

addressed review comment

stuij marked an inline comment as done.Nov 22 2022, 5:35 AM
stuij added inline comments.
llvm/lib/Target/AArch64/AArch64InstrFormats.td
11725

ah right, sorry misread your comment.

stuij updated this revision to Diff 477156.Nov 22 2022, 5:54 AM
stuij marked an inline comment as done.

renamed *v94-dp* to *cssc*

stuij marked an inline comment as done.Nov 22 2022, 5:55 AM
stuij added inline comments.
llvm/lib/Target/AArch64/AArch64InstrFormats.td
11698

Yes, should be FEAT_CSSC. Thanks!

dmgreen accepted this revision.Nov 22 2022, 6:00 AM

Thanks. I haven't looked though all the details, but thanks for fixing the scheduling info.

This revision was landed with ongoing or failed builds.Nov 22 2022, 6:24 AM
This revision was automatically updated to reflect the committed changes.
stuij marked an inline comment as done.