This is an archive of the discontinued LLVM Phabricator instance.

[lldb][AArch64] Implement resizing of SME's ZA register
ClosedPublic

Authored by DavidSpickett on Sep 12 2023, 4:49 AM.

Details

Summary

The size of ZA depends on the streaming vector length regardless
of the active mode. So in addition to vg (which reports the active
mode) we must send the client svg.

Otherwise the mechanics are the same as for non-streaming SVE.
Use the svg value to update the defined size of ZA, accounting
for the fact that ZA is not a single vector but a suqare matrix.

So if svg is 8, a single streaming vector would be 8*8 = 64 bytes.
ZA is that squared, so 64*64 = 4096 bytes.

Testing is included in a later patch.

Diff Detail

Event Timeline

DavidSpickett created this revision.Sep 12 2023, 4:49 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 12 2023, 4:49 AM
DavidSpickett requested review of this revision.Sep 12 2023, 4:49 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 12 2023, 4:49 AM
omjavaid added inline comments.Sep 13 2023, 3:15 AM
lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.h
42

svg

DavidSpickett marked an inline comment as done.Sep 13 2023, 8:44 AM

This apparently requires a rebase now.

omjavaid added inline comments.Sep 15 2023, 3:28 AM
lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp
839

can we combine UpdateARM64SVERegistersInfos and UpdateARM64SMERegistersInfos to avoid back to back calls of ConfigureOffsets

DavidSpickett edited the summary of this revision. (Show Details)Sep 15 2023, 4:14 AM

Combine reconfigure into one function. The tricky thing is we have to read
svg and vg up front because we can't read registers while we're messing
with register offsets.

Otherwise, the result is a bit clearer and it also avoids a second heap
allocation for the storage.

DavidSpickett marked an inline comment as done.Sep 15 2023, 6:43 AM
DavidSpickett added inline comments.
lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp
839

Yes, done. See comments for weird details.

omjavaid accepted this revision.Sep 15 2023, 8:06 AM

This look good

This revision is now accepted and ready to land.Sep 15 2023, 8:06 AM
DavidSpickett marked an inline comment as done.

Rebase