https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124271
--- Comment #9 from Hongtao Liu <liuhongt at gcc dot gnu.org> ---
(In reply to Andrew Pinski from comment #8)
> (In reply to Hongtao Liu from comment #7)
> > (In reply to Hongtao Liu from comment #6)
> > > >
> > > > > + unsigned int inner_prec = outer_prec / 2;
> > > > > + poly_uint64 outer_nelts = TYPE_VECTOR_SUBPARTS (type);
> > > > > + tree inner_scalar = build_nonstandard_integer_type
> > > > > (inner_prec, 1);
> > > >
> > > > I think 1 here should be `TYPE_UNSIGNED (TREE_TYPE (type))` otherwise
> > > > you
> > > > get a type mismatch I think.
> >
> > static inline long mul32( long a, long b) {
> > return (a & 0xffffffff) * (b & 0xffffffff);
> > }
> >
> > + (mult (bit_and @0 VECTOR_CST@2)
> > + (bit_and @1 @2))
> > + (if (uniform_vector_p (@2)
> > + && TYPE_VECTOR_SUBPARTS (type).is_constant ()
> > + && TYPE_VECTOR_SUBPARTS (type).to_constant () > 1)
>
> I was going to ask why the > 1 and then I remembered the /2 below.
> Also why not just:
> known_gt (TYPE_VECTOR_SUBPARTS (type), 1)
Will change to known_gt (TYPE_VECTOR_SUBPARTS (type), HOST_WIDE_INT_1U)) to
avoid warning of different signness in the comparison.
>
> I am not sure you need to know if it a constant or not, just that it has at
> least 2 elements.
>
I'm not sure if there are any issues with the scalable vector length .
Currently, since both the aarch64 and riscv backends don't support
vec_widen_umult_even, I can't verify it for now. However, after removing the
constant check, there are no errors reported.