+static void vext_set_tail_elems_1s(CPURISCVState *env, void *vd,
+ uint32_t desc, uint32_t esz,
+ uint32_t max_elems)
{
uint32_t vta = vext_vta(desc);
+ uint32_t nf = vext_nf(desc);
int k;
- if (vta == 0) {
+ /*
+ * Section 5.4 of the RVV spec mentions:
+ * "When vstart ≥ vl, there are no body elements, and no
+ * elements are updated in any destination vector register
+ * group, including that no tail elements are updated
+ * with agnostic values."
+ */
+ if (vta == 0 || env->vstart >= env->vl) {
return;
}
@@ -222,9 +230,8 @@ vext_ldst_stride(void *vd, void *v0, target_ulong base,
k++;
}
}
+ vext_set_tail_elems_1s(env, vd, desc, esz, max_elems);
env->vstart = 0;