Skip to contentSkip to conversation

target/riscv: Fix handling of NOP for vstart >= vl in vext_vx_rm_2()

PATCH In review Chao Liu 2 participants 2 messages Dec 17, 2024 – Jan 6, 2025 1 message not in the archive RISC-V

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Chao Liu

author
#1 lore raw

PATCH 1/1 target/riscv: Fix handling of NOP for vstart >= vl in vext_vx_rm_2()

fix: https://lore.kernel.org/all/[email protected]/

---
 target/riscv/vector_helper.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
target/riscv/vector_helper.c +2 -2
index a85dd1d200..54bac5922a 100644
@@ -2154,8 +2154,6 @@ vext_vv_rm_1(void *vd, void *v0, void *vs1, void *vs2,
              uint32_t vl, uint32_t vm, int vxrm,
              opivv2_rm_fn *fn, uint32_t vma, uint32_t esz)
 {
-    VSTART_CHECK_EARLY_EXIT(env);
-
     for (uint32_t i = env->vstart; i < vl; i++) {
         if (!vm && !vext_elem_mask(v0, i)) {
             /* set masked-off elements to 1s */
@@ -2179,6 +2177,8 @@ vext_vv_rm_2(void *vd, void *v0, void *vs1, void *vs2,
     uint32_t vta = vext_vta(desc);
     uint32_t vma = vext_vma(desc);
 
+    VSTART_CHECK_EARLY_EXIT(env);
+
     switch (env->vxrm) {
     case 0: /* rnu */
         vext_vv_rm_1(vd, v0, vs1, vs2,
Signature · 1 line
2.47.1
#2 lore raw
Quoted 2 lines · Chao Liu

fix: https://lore.kernel.org/all/[email protected]/

Can you include a commit message of what this fixes?

Instead of linking to the pull request there should be a fixes tag here, like this

Fixes df4252b2ecaf "target/riscv/vector_helpers: do early exit when

vstart >= vl"

Quoted 31 lines
---
 target/riscv/vector_helper.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
target/riscv/vector_helper.c +2 -3
index a85dd1d200..54bac5922a 100644
@@ -2154,8 +2154,6 @@ vext_vv_rm_1(void *vd, void *v0, void *vs1, void *vs2,
              uint32_t vl, uint32_t vm, int vxrm,
              opivv2_rm_fn *fn, uint32_t vma, uint32_t esz)
 {
-    VSTART_CHECK_EARLY_EXIT(env);
-
     for (uint32_t i = env->vstart; i < vl; i++) {
         if (!vm && !vext_elem_mask(v0, i)) {
             /* set masked-off elements to 1s */
@@ -2179,6 +2177,8 @@ vext_vv_rm_2(void *vd, void *v0, void *vs1, void *vs2,
     uint32_t vta = vext_vta(desc);
     uint32_t vma = vext_vma(desc);
 
+    VSTART_CHECK_EARLY_EXIT(env);
+
     switch (env->vxrm) {
     case 0: /* rnu */
         vext_vv_rm_1(vd, v0, vs1, vs2,
--

2.47.1