qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v8 02/10] target/riscv: handle vstart >= vl in vext_set_tail_


From: Richard Henderson
Subject: Re: [PATCH v8 02/10] target/riscv: handle vstart >= vl in vext_set_tail_elems_1s()
Date: Sat, 9 Mar 2024 08:40:01 -1000
User-agent: Mozilla Thunderbird

On 3/8/24 11:53, Daniel Henrique Barboza wrote:
+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;
      }

This isn't going to work for ...

@@ -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;

... ldst, because we also need to increment vstart in the load loop, for consumption by the exception path.

You'll need to structure the helper as

    if (vstart >= vl) {
       vstart = 0;
       return;
    }
    for (i = vstart; i < vl; vstart = ++i) {
        ...
    }
    set_tail_elems(...);
    vstart = 0;


r~



reply via email to

[Prev in Thread] Current Thread [Next in Thread]