Conversation
There was a problem hiding this comment.
1 issue found across 5 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="src/rv32_v_template.c">
<violation number="1" location="src/rv32_v_template.c:6459">
P3: The new vmv<nr>r.v handlers call rvv_require_operable(rv), which raises an illegal-instruction trap when vtype.vill is set. That is inconsistent with this file's existing whole-register instructions (vs1r.v/vs2r.v/vs4r.v/vs8r.v, lines ~4272-4294), which deliberately do NOT gate on vtype/vill and only validate register span. Per the V 1.0 spec note, whole-register operations do not depend on vtype. If vill is expected to be tolerated for whole-register ops here, this gate will trap where the sibling instructions would not. Confirm the intended vill behavior for the move family and align it with the load/store whole-register paths.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
| }) | ||
|
|
||
| RVOP(vmv1r_v, { | ||
| if (rvv_require_operable(rv)) |
There was a problem hiding this comment.
P3: The new vmv<nr>r.v handlers call rvv_require_operable(rv), which raises an illegal-instruction trap when vtype.vill is set. That is inconsistent with this file's existing whole-register instructions (vs1r.v/vs2r.v/vs4r.v/vs8r.v, lines ~4272-4294), which deliberately do NOT gate on vtype/vill and only validate register span. Per the V 1.0 spec note, whole-register operations do not depend on vtype. If vill is expected to be tolerated for whole-register ops here, this gate will trap where the sibling instructions would not. Confirm the intended vill behavior for the move family and align it with the load/store whole-register paths.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src/rv32_v_template.c, line 6459:
<comment>The new vmv<nr>r.v handlers call rvv_require_operable(rv), which raises an illegal-instruction trap when vtype.vill is set. That is inconsistent with this file's existing whole-register instructions (vs1r.v/vs2r.v/vs4r.v/vs8r.v, lines ~4272-4294), which deliberately do NOT gate on vtype/vill and only validate register span. Per the V 1.0 spec note, whole-register operations do not depend on vtype. If vill is expected to be tolerated for whole-register ops here, this gate will trap where the sibling instructions would not. Confirm the intended vill behavior for the move family and align it with the load/store whole-register paths.</comment>
<file context>
@@ -6429,6 +6455,34 @@ RVOP(vmv_s_x, {
})
+RVOP(vmv1r_v, {
+ if (rvv_require_operable(rv))
+ return false;
+ if (!rvv_exec_whole_reg_move(rv, ir, 1))
</file context>
Add vmv<nr>r.v (V 1.0 section 16.6), which copies NREG whole vector registers. These operate as if EEW=SEW and EMUL=NREG with an effective length of NREG*VLEN/SEW, so the guard is vstart >= evl rather than the usual vstart >= vl. vd == vs2 is an architectural NOP. Only simm values 0, 1, 3 and 7 encode NREG-1; every other simm[4:0] is reserved, as is the masked form.
Implements the whole-register move family from #734.
Adds
vmv<nr>r.v(V 1.0 §16.6) at the OPIVI site of funct6=0x27, which waspreviously rejected with a FIXME so the encoding would not fall through to
vsmul.vx.These copy NREG whole vector registers — all VLEN bits each — operating as
if EEW=SEW and EMUL=NREG. Three details from the spec are worth calling out:
evl = NREG * VLEN/SEW, so the guard isvstart >= evl, not the usualvstart >= vl;vd == vs2is an architectural NOP;simm[2:0]values 0, 1, 3 and 7 encode NREG-1. Every othersimm[4:0]is reserved, as is the masked form.Encodings checked against riscv-opcodes. Decode tests cover the four valid
forms, seven reserved
simmvalues, the masked forms, and confirmvsmul.vxstill decodes from the same funct6.Smoke coverage exercises
vmv1r.v, the second register of avmv2r.vgroup(so a copy that moves only one register is caught), and the
vd == vs2NOP.make checkpasses; the build was checked in the default,EXT_V,JIT+
EXT_VandEXT_V-without-EXT_Fconfigurations. clang-format 20.1.7clean.
Summary by cubic
Implements the
vmv<nr>r.vwhole-register move family (V 1.0 §16.6) for RVV. Previously these encodings were rejected to prevent falling through tovsmul.vx; now they decode and execute correctly, including the special effective-length guard and the architectural NOP whenvd == vs2.simm[2:0]values 0, 1, 3, and 7 are valid; all othersimm[4:0]values and the masked form are reserved.evl = NREG * VLEN/SEW, so the guard isvstart >= evl, notvstart >= vl.simmvalues, masked forms, and confirmvsmul.vxstill decodes from the same funct6.vmv1r.v, the second register of avmv2r.vgroup, and thevd == vs2NOP.make checkpasses across the default,EXT_V, JIT+EXT_V, andEXT_V-without-EXT_Fconfigurations.Written for commit fdfadf8. Summary will update on new commits.