-
Notifications
You must be signed in to change notification settings - Fork 881
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Should vector crypto instructions constraint vd_num/vs1_num/vs2_num align to lmul? #1548
Comments
Can you give a specific example of a case you think is broken today? |
cc @egouriou-rivos (and @chihminchao) |
Yes, the vector crypto extensions should follow the LMUL alignment requirement. I will create a PR for it. |
what status of the PR |
cc @timhsu404 |
@timhsu404 any progress on this issue ? |
@timhsu404 is busy with another internal issue and may not have time on this issue this month. |
@nibrunieAtSi5 Not really. I have already done the very first version, but still tracking on some bugs. |
Vector crypto instruction VPR alignment rules:
|
… (vcrypto insn on element groups)
I have developed a test case, https://gist.github.com/nibrunie/80a00047dce935011614530d86a829e6, which seems to be passing with flying colors on spike when I would have expected almost every instruction to trap. |
I think the issue is a bit worse than I initially thought: not checking alignment can also lead to segmentation fault as there is no guard to prevent spike from trying to access / write vector registers outside the valid For example, when selecting The following program seems to seg fault on spike de5094a (Sept 20th):
|
@nibrunie for example lmul=8 vaesdf.vs v8, v11 i think this is overleap, but i think it will not trap in your PR? |
I think you are right @xinyuwang-starfive , this used to be covered by the alignment check (https://github.com/nibrunieAtSi5/riscv-isa-sim/blob/de5094a1a901d77ff44f89b38e00fefa15d4018e/riscv/zvkned_ext_macros.h#L21) but since we are implementing the proper relaxed index constraint for the scalar operand the alignment check is no longer sufficient. I will try to have a proper / closer look over the week-end and fix my PRs. |
@nibrunie |
@xinyuwang-starfive , this was fixed on Sept 25th (b1ce0a3) on the PR opened to address this issue #1815. Is your branch up-to-date ? |
According to zvkned_ext_macros.h, no where constraint vd/vs1 number align to lmul. And overlap just check vs_num == vd_num.
however even with vlen =128, it would be possible to set lmul = 2, register groups could overlap with numbers not the same.
The text was updated successfully, but these errors were encountered: