<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
Hello to those working on RISCV,</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
As formerly discussed in <a href="https://github.com/riscv/riscv-crypto/issues/81" title="https://github.com/riscv/riscv-crypto/issues/81">
riscv/riscv-crypto#81</a>, we are currently implementing MC Layer of K extension for LLVM. While setting predicates property for instructions, we encountered the problem that the
<code>Zkg</code>​ and <code>Zkb</code>​ feature sets are reusing part but not all instructions from
<code>Zbp</code>​ and <code>Zbc</code>​ 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"). </div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
By acknowledging that we cannot simply reuse the whole set of <code>Zbp</code>​ and
<code>Zbc</code>​ 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 `<b><span style="font-weight:400;background-color:rgb(255, 255, 255);display:inline !important">HasStdExtZbbOrZbpOrZkb</span></b>`,
 take instruction <code>ror</code>​ for example. </div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
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?</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
Best Regards,</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
Qixing Xue (@ksyx)</div>
</body>
</html>