This is the mail archive of the
mailing list for the GCC project.
Re: Vector indexing patch
- From: Andrew Pinski <pinskia at gmail dot com>
- To: Artem Shinkarov <artyom dot shinkaroff at gmail dot com>
- Cc: gcc-patches at gcc dot gnu dot org, gcc at gcc dot gnu dot org, Richard Guenther <richard dot guenther at gmail dot com>
- Date: Sat, 5 Jun 2010 14:13:58 -0700
- Subject: Re: Vector indexing patch
- References: <AANLkTilHOUeQuit51D2jgJEqkmy_BHC4KvNx-rWn7oKa@mail.gmail.com>
On Tue, Jun 1, 2010 at 12:21 PM, Artem Shinkarov
> This is a reworked patch of Andrew Pinski "Subscripting on vector
> types" in terms of GSoC 2010 [Artjoms Sinkarovs].
> This patch allows to index individual elements of vector type in C.
> For example: vec[i], where vec is a vector with a base type T and i is
> an integer type.
> If i is a constant then we construct a BIT_FIELD_REF node considering
> boundchecking, otherwise we expand it to (((T *)&(vec))[i]).
Creating BIT_FIELD_REF early will break:
#define vector __attribute__((__vector_size__(sizeof(int)*4)))
vector int t;
Which was working with my patch. I think you should just allow
gimplifier (which calls fold_indirect_ref) create BIT_FIELD_REF and
allow the rest of the middle remove TREE_ADDRESSABLE. The middle-end
already knows how to remove TREE_ADDRESSABLE and set the gimple reg on
the decs which need it; I implemented those improvements already.