This is an archive of the discontinued LLVM Phabricator instance.

[AArch64][SME] Support NEON vector to GPR integer moves in streaming mode
ClosedPublic

Authored by c-rhodes on Aug 11 2021, 7:18 AM.

Details

Summary

A small subset of the NEON instruction set is legal in streaming mode.
This patch adds support for the following vector to integer move
instructions:

0x00 1110 0000 0001 0010 11xx xxxx xxxx # SMOV W|Xd,Vn.B[0]
0x00 1110 0000 0010 0010 11xx xxxx xxxx # SMOV W|Xd,Vn.H[0]
0100 1110 0000 0100 0010 11xx xxxx xxxx # SMOV Xd,Vn.S[0]
0000 1110 0000 0001 0011 11xx xxxx xxxx # UMOV Wd,Vn.B[0]
0000 1110 0000 0010 0011 11xx xxxx xxxx # UMOV Wd,Vn.H[0]
0000 1110 0000 0100 0011 11xx xxxx xxxx # UMOV Wd,Vn.S[0]
0100 1110 0000 1000 0011 11xx xxxx xxxx # UMOV Xd,Vn.D[0]

Only the zero index variants are legal, all others indexes are illegal.
To support this, new instructions are defined specifically for zero
index which is hardcoded, along an implicit 'VectorIndex0' operand.
Since the index operand is implicit and takes no bits in the encoding,
custom decoding is required to add the operand.

I'm not sure if this is the best approach but the predicate constraint
on a subset of an operand is unusual. Would be interested to hear some
alternatives.

The instructions are predicated on 'HasNEONorStreamingSVE', i.e. they're
enabled by either +neon or +streaming-sve. This follows on from the work
in D106272 to support the subset of SVE(2) instructions that are legal
in streaming mode.

Depends on D107902.

Diff Detail

Event Timeline

c-rhodes created this revision.Aug 11 2021, 7:18 AM
c-rhodes requested review of this revision.Aug 11 2021, 7:18 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 11 2021, 7:18 AM
Matt added a subscriber: Matt.Aug 11 2021, 9:07 AM
c-rhodes updated this revision to Diff 365963.Aug 12 2021, 4:19 AM

Fix failing tests, UMOV aliases were using wrong index type, should have been VectorIndex0.

sdesmalen accepted this revision.Sep 2 2021, 3:08 AM
sdesmalen added inline comments.
llvm/test/MC/AArch64/SME/streaming-mode-neon.s
16

I was expecting streaming-sve or neon, or is the diagnostic arbitrary? (i.e. both are valid)

This revision is now accepted and ready to land.Sep 2 2021, 3:08 AM
c-rhodes added inline comments.Sep 2 2021, 3:45 AM
llvm/test/MC/AArch64/SME/streaming-mode-neon.s
16

I was expecting streaming-sve or neon, or is the diagnostic arbitrary? (i.e. both are valid)

I expected the same but I think it's arbitrary, for the other NEON instructions that are legal in streaming mode but not for a specific variant like this the diagnostic is streaming-sve or neon.

This revision was landed with ongoing or failed builds.Sep 3 2021, 12:59 AM
This revision was automatically updated to reflect the committed changes.