This is an archive of the discontinued LLVM Phabricator instance.

[Clang][AArch64] svldr_vnum/svstr_vnum should use cntsb iso vscale for the offset
ClosedPublic

Authored by sdesmalen on Jul 24 2023, 6:27 AM.

Details

Summary

The specification for LDR/STR says that:

The ZA array vector is selected by the sum of the vector select register
and immediate offset, modulo the number of bytes in a Streaming SVE
vector. [..] This instruction does not require the PE to be in Streaming
SVE mode

When the instruction is used outside of streaming mode, 'vscale' will result
in the wrong value being used for the offset because LLVM's code-generator
will emit the non-streaming 'RDVL/ADDVL' instead of the 'RDSVL/ADDSVL'
instructions which are used to get the Streaming-SVE vector length.

Diff Detail

Event Timeline

sdesmalen created this revision.Jul 24 2023, 6:27 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 24 2023, 6:27 AM
sdesmalen requested review of this revision.Jul 24 2023, 6:27 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 24 2023, 6:27 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
bryanpkc accepted this revision.Jul 24 2023, 6:31 AM

LGTM. Sorry for not catching this earlier.

This revision is now accepted and ready to land.Jul 24 2023, 6:31 AM
This revision was landed with ongoing or failed builds.Jul 24 2023, 7:30 AM
This revision was automatically updated to reflect the committed changes.