Hi Robin:

Thanks for your try, but before I moving forward to debug that, I want
to check with you: I got m2 for the following testcase with following
commands:
$ riscv64-unknown-linux-gnu-gcc test.c -march=rv64gcv -O2 -S
-mrvv-max-lmul=m1 -o -

```c
#include <stdint.h>
typedef int32_t int32x8_t __attribute__((vector_size(32)));
int32x8_t __attribute__((riscv_vls_cc(128)))
test_256bit_vector(int32x8_t vec1, int32x8_t vec2) {
  int32x8_t result;
  result = vec1 + vec2;
  return result;
}
```
```asm
test_256bit_vector:
       vsetivli        zero,8,e32,m2,ta,ma
       vadd.vv v8,v8,v10
       ret
```

I suspect I may stack those patches in the wrong way,
do you mind sharing your code on github or somewhere to make sure we
have the same status?
Or you can give me your github account so I can share the write
permission on my repo?

----

This is the branch I tried to stack your patch:
https://github.com/kito-cheng/gcc/tree/kitoc/vls-cc-testing-4

And this is the branch I tried, this branch is what I suppose to
shared with you but seems I didn't update the branch correctly before:
https://github.com/kito-cheng/gcc/tree/kitoc/vls-cc-testing-2


Thanks :)
On Thu, Sep 4, 2025 at 4:36 AM Robin Dapp <rdapp....@gmail.com> wrote:
>
> > There are still a few (5) testsuite failures, though.  It looks like most of
> > them are similar, latent and due to us not handling small VLS BImodes
> > properly.  Maybe we still need
> >
> > diff --git a/gcc/config/riscv/riscv-v.cc b/gcc/config/riscv/riscv-v.cc
> > index d2edffb36a2..d2d99b828ac 100644
> > --- a/gcc/config/riscv/riscv-v.cc
> > +++ b/gcc/config/riscv/riscv-v.cc
> > @@ -2220,7 +2220,7 @@ get_vector_mode (scalar_mode inner_mode, poly_uint64 
> > nunits)
> >      if (inner_mode == GET_MODE_INNER (mode)
> >         && known_eq (nunits, GET_MODE_NUNITS (mode))
> >         && (riscv_v_ext_vector_mode_p (mode)
> > -           || riscv_v_ext_vls_mode_p (mode)))
> > +           || (riscv_v_ext_vls_mode_p (mode) && vls_mode_valid_p (mode))))
> >        return mode;
> >    return opt_machine_mode ();
> >  }
>
> With the hunk above on top of the patch (and obviously
> +     && (!riscv_v_ext_vls_mode_p (vmode) || vls_mode_valid_p (vmode))
> removed again) the test suite is unchanged for me.
>
> --
> Regards
>  Robin
>

Reply via email to