riscv / riscv-isa-manual

RISC-V Instruction Set Manual
https://riscv.org/
Creative Commons Attribution 4.0 International
3.71k stars 644 forks source link

Wonder why `vmvnr.v` depends on vtype #1709

Closed huxuan0307 closed 3 weeks ago

huxuan0307 commented 3 weeks ago

Why the whole register move instruction vmvnr.v depends on vtype.ill but they don't depend on any useful configs(vsew, vlmul, vta, vma) in vtype.

Is this an unnecessary dependencies need to be removed?

aswaterman commented 3 weeks ago

The main reason is that this extension is already ratified. What you propose would be a backwards-incompatible change, in that existing HW would no longer conform to the spec if we changed the spec.

huxuan0307 commented 3 weeks ago

Thank you for your reply. But the reason you gave is just an obviously consequence not the "reason", I think. ^_^ There is an issue in llvm repo that may need to be answered by spec designer. llvm-project#114518

topperc commented 3 weeks ago

The spec does say

"The instructions operate as if EEW=SEW, EMUL = NREG, effective length evl= EMUL * VLEN/SEW."

So some implementation may use SEW when executing vmvnr.v

SEW and LMUL are also needed to calculate vstart if the implementation can take a trap in the middle of the instruction.

aswaterman commented 3 weeks ago

And Craig raises a good point.