riscv-isa-sim
riscv-isa-sim copied to clipboard
Should vector crypto instructions constraint vd_num/vs1_num/vs2_num align to lmul?
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.
Can you give a specific example of a case you think is broken today?
Sorry for delay.
Our VLEN is 256 ,this is our simulation result, in the log we use lmul = 4, dst reg_num & src reg_num is not align to lmul, for vector arithmatic instruction this would cause illegal instruction trap, howerver spike just continue the calcualtion.
cc @egouriou-rivos (and @chihminchao)
Yes, the vector crypto extensions should follow the LMUL alignment requirement. Though the spec do not describe this behavior explicity, it does not make sense that register can not be the same but the content can still possible to overlap or out of the normal register range, the case v30 with LMUL=4 above.
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.
any progress on this issue ?
@nibrunieAtSi5 Not really. I have already done the very first version, but still tracking on some bugs. The progress is pending for now, I'll keep working on this issue after the urgent job has been done.
Vector crypto instruction VPR alignment rules:
Possible alignment value: 1, 2, 4, 8
(1 for any VPR, 2 for V0, V2, ...)
Prerequisite: VLEN * LMUL >= EGW
- Single key in
.vs
inst:max(EGW/VLEN, 1)
- Others:
max(LMUL, 1)