[llvm-dev] [RISCV] Instruction grouping problem encountered while reusing B extension in K ext

Qixing Xue via llvm-dev llvm-dev at lists.llvm.org
Fri Mar 12 02:31:32 PST 2021


Hello to those working on RISCV,

As formerly discussed in riscv/riscv-crypto#81<https://github.com/riscv/riscv-crypto/issues/81>, we are currently implementing MC Layer of K extension for LLVM. While setting predicates property for instructions, we encountered the problem that the Zkg​ and Zkb​ feature sets are reusing part but not all instructions from Zbp​ and Zbc​ extensions, as shown in the image in the issue (the same image in attachment; asterisk "means the extensions are expected to be unchanged in the official version").

By acknowledging that we cannot simply reuse the whole set of Zbp​ and Zbc​ instructions, this might require us to further group the instructions by modifying the definition file (`.td` TableGen file) of B extension. This seems a bit invasive since it requires to rename things like `HasStdExtZbbOrZbp` into `HasStdExtZbbOrZbpOrZkb`, take instruction ror​ for example.

This problem seems applies to both GCC and LLVM in a similar way and I am wondering whether this modification is acceptable, or are there any other ideas?

Best Regards,
Qixing Xue (@ksyx)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20210312/f989ed43/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: inst-grouping.png
Type: image/png
Size: 344189 bytes
Desc: inst-grouping.png
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20210312/f989ed43/attachment-0001.png>


More information about the llvm-dev mailing list