-
Notifications
You must be signed in to change notification settings - Fork 878
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
[#1548][vector crypto] adding register index LMUL alignement checks #1815
base: master
Are you sure you want to change the base?
[#1548][vector crypto] adding register index LMUL alignement checks #1815
Conversation
… (vcrypto insn on element groups)
Documenting constrains at the macro definition level rather than at the macro call site. Co-authored-by: Nicolas Brunie <[email protected]> Signed-off-by: Nicolas Brunie <[email protected]>
Signed-off-by: Nicolas Brunie <[email protected]>
Signed-off-by: Nicolas Brunie <[email protected]>
…crypto .vs instructions
Implementing @xinyuwang-starfive's feedback, #1548 (comment), in 028a174 Fixing the no-overlap constraints between |
int vd_emul = P.VU.vflmul < 1.f ? 1 : (int) P.VU.vflmul; \ | ||
int aligned_vd = vd / vd_emul; \ | ||
int aligned_vs2 = vs2 / vd_emul; \ | ||
require(aligned_vd != aligned_vs2); \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could also be implemented by masking the log2(max(LMUL, 1))
LSBs of the register indices.
Need to check if there is not already a macro to perform this function.
Co-authored-by: Nicolas Brunie <[email protected]> Signed-off-by: Nicolas Brunie <[email protected]>
Notice this is a local workaround fix. Please use riscv-software-src#1815 instead.
This pull request implement two things:
.vs
instruction(a) the EMUL alignment of vector operand/destination (
=EMUL
for the vector element group operands and the destination) is specified in the main RVV spec; when a vector register group is not EMUL aligned, the behavior is listed as "reserved" and spike has implemented this check to trigger illegal instruction exception when the condition was not met (e.g.riscv-isa-sim/riscv/v_ext_macros.h
Line 128 in de5094a
(b) is not specified clearly in the vector crypto specification (current version https://github.com/riscv/riscv-isa-manual/blob/7023c601443adf21850772e02e3d920bc68b2237/src/vector-crypto.adoc)
The vector crypto specification lists multiple times the intent to allow the vector register group for the scalar-element-group to have
EMUL = EGW / VLEN
(and to be aligned with thisEMUL
and not with the globalLMUL
associated with other vector operands/destination of the instruction).