On Fri, Oct 10, 2025 at 10:28 PM Robin Dapp <[email protected]> wrote:
>
> > I think it's better to use 'sizetype' here, vect_check_gather_scatter 
> > matches
> > up the precision of the base pointer, but that's not readily available here.
> > The concern is address-spaces, but the optabs do not have the pointer mode
> > as discriminator anyway.  I also wonder why you check !TYPE_OVERFLOW_WRAPS,
> > the comment suggests to check !TYPE_UNSIGNED?  There's no check
> > that the pointer-sized type is actually larger - you possibly rely on
> > what vect_check_gather_scatter does here but an explicit test would be nice 
> > to
> > have.
>
> In case I'm not missing the point now, my assumption was that once we reach
> pointer size overflow doesn't matter any more (and original offset == new
> offset == sizetype is OK).  I guess that's equivalent to relying on two's
> complement arithmetic which not all targets have?  Or can we rely on that
> nowadays?

We can, GCC doesn't support anything else (for TYPE_UNSIGNED).

> What I didn't consider, though, is stuff like i386 x32 where pointer size
> is 32 bit but registers are 64 bit.
>
>
> > The patch otherwise looks OK.  With all the checking we do I now wonder
> > whether it's possible to do this the other way around - get all supported
> > offset vector types for a data vector types by walking the optabs?  It
> > seems the only way is to basically iterate over all (reasonable)
> > vector integer modes
> > for the offset part and then poke the operand predicate for the sign.
> > I'm not sure
> > doing this will make the code much simpler.  It might be sth to keep in 
> > mind.
>
> Yes, I'll see if something can be done.
>
> --
> Regards
>  Robin
>

Reply via email to