This is an archive of the discontinued LLVM Phabricator instance.

[LLDB][RISCV] Add RVV register infos
ClosedPublic

Authored by Emmmer on Feb 6 2023, 1:31 AM.

Details

Summary

RVV stands for "RISC-V V Extension", which adds 32 vector registers, and seven unprivileged CSRs (vstart, vxsat, vxrm, vcsr, vtype, vl, vlenb) to a base scalar RISC-V ISA.

The base vector extension is intended to provide general support for data-parallel execution within the 32-bit instruction encoding space, with later vector extensions supporting richer functionality for certain domains.

This patch adds the definitions of RVV registers in RegisterInfos_riscv64.h, whose purpose is to provide support (such as reading, writing, and calculating the offsets) for future register-related functions.

Diff Detail

Event Timeline

Emmmer created this revision.Feb 6 2023, 1:31 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 6 2023, 1:31 AM
Emmmer requested review of this revision.Feb 6 2023, 1:31 AM
luismarques added inline comments.Feb 6 2023, 6:19 AM
lldb/source/Plugins/Process/Utility/RegisterInfos_riscv64.h
70

What's the plan to support scalable vectors? How is that handled in LLDB for SVE?

Emmmer added inline comments.Feb 6 2023, 9:11 AM
lldb/source/Plugins/Process/Utility/RegisterInfos_riscv64.h
70

I just figured out how to support variable byte offsets in RegisterInfos (thanks to the arm implementation). The version that supports SVE will be updated later.

Emmmer updated this revision to Diff 495161.Feb 6 2023, 9:28 AM

@kito-cheng any objections? I know nothing about RISCV-V.

lldb wise this is fine, we can debate the crossover with sve support code in later patches if needed.

If so, it’s LGTM

lldb/source/Plugins/Process/Utility/RegisterInfos_riscv64.h
70

My understanding is further support will be added in follow up patches?

Emmmer added inline comments.Apr 17 2023, 10:47 PM
lldb/source/Plugins/Process/Utility/RegisterInfos_riscv64.h
70

Yes, that's correct! The current implementation with variable byte offsets is a step in the right direction.

kito-cheng accepted this revision.Apr 18 2023, 2:25 AM
This revision is now accepted and ready to land.Apr 18 2023, 2:25 AM
This revision was automatically updated to reflect the committed changes.

In the time since this was written and landed, I added an extra field to register information. Fixed that here: https://github.com/llvm/llvm-project/commit/ee9a646192db1cc5d1df57d69232fdd2a5c89fc5