This is an archive of the discontinued LLVM Phabricator instance.

[Clang][AArch64][SVE] Allow subscript operator for SVE types
ClosedPublic

Authored by DavidTruby on Mar 30 2022, 8:20 AM.

Details

Summary

Undefined behaviour is just passed on to extract_element when the
index is out of bounds. Subscript on svbool_t is not allowed as
it isn't an operation natively supported in the ISA.

Diff Detail

Event Timeline

DavidTruby created this revision.Mar 30 2022, 8:20 AM
Herald added a project: Restricted Project. · View Herald Transcript
DavidTruby requested review of this revision.Mar 30 2022, 8:20 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 30 2022, 8:20 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript

Subscript on svbool_t is not allowed as this doesn't really have meaningful semantics.

Not sure what you mean by this; LLVM supports extractelement on <vscale x 16 x i1> vectors. I guess the fact that it's a "vscale x 16" element vector might not be intuitive?

Not sure what you mean by this; LLVM supports extractelement on <vscale x 16 x i1> vectors. I guess the fact that it's a "vscale x 16" element vector might not be intuitive?

It's a native operation at the LLVM level but not at the ISA level, unlike the data registers. Code quality would be quite poor if we just allowed it naively so I thought it better to disallow it to not give the impression it's easy/free. I will update the text in the commit message to make this more clear.

DavidTruby edited the summary of this revision. (Show Details)Mar 31 2022, 6:18 AM
Matt added a subscriber: Matt.Mar 31 2022, 9:29 AM
bsmith accepted this revision.Apr 8 2022, 3:01 AM

LGTM!

This revision is now accepted and ready to land.Apr 8 2022, 3:01 AM