This is an archive of the discontinued LLVM Phabricator instance.

[AArch64][SME] Add SME cntsb/h/w/d intrinsics
ClosedPublic

Authored by david-arm on Jun 15 2022, 6:31 AM.

Details

Summary

These intrinsics return the number of elements in a streaming
vector, for example aarch64.sme.cntsw returns the number of
32-bit elements. When in streaming mode these are equivalent
to aarch64.sve.cntb/h/w/d with an input value of 1.

I have implemented these intrinsics using the rdsvl instruction
and added tests here:

CodeGen/AArch64/SME/sme-intrinsics-rdsvl.ll

Diff Detail

Event Timeline

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

Can't the rdsvl immediate be used to do the scaling instead of a shift?

Can't the rdsvl immediate be used to do the scaling instead of a shift?

I think the rdsvl immediate specifies the multiplier, which equates to a shift left. Whereas I want to divide the length by the element size, i.e. a shift right.

aemerson accepted this revision.Jun 15 2022, 10:57 AM

Can't the rdsvl immediate be used to do the scaling instead of a shift?

I think the rdsvl immediate specifies the multiplier, which equates to a shift left. Whereas I want to divide the length by the element size, i.e. a shift right.

Ah yes. LGTM then.

This revision is now accepted and ready to land.Jun 15 2022, 10:57 AM
This revision was landed with ongoing or failed builds.Jun 16 2022, 2:51 AM
This revision was automatically updated to reflect the committed changes.