This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Vector subscription patch
- From: Richard Henderson <rth at redhat dot com>
- To: Artem Shinkarov <artyom dot shinkaroff at gmail dot com>
- Cc: gcc-patches at gcc dot gnu dot org, Richard Guenther <richard dot guenther at gmail dot com>, "Joseph S. Myers" <joseph at codesourcery dot com>
- Date: Wed, 20 Oct 2010 11:57:49 -0700
- Subject: Re: Vector subscription patch
- References: <AANLkTinBCvNWt3ymLHvGWVCJ-cPL84wX++bTy+EBVj5M@mail.gmail.com>
> + c_common_mark_addressable_vec (array);
> + type = build_qualified_type (TREE_TYPE (type), TYPE_QUALS (type));
> + type = build_pointer_type (type);
> + type1 = build_pointer_type (TREE_TYPE (array));
> + array = build1 (ADDR_EXPR, type1, array);
> + array = convert (type, array);
I think it's a bit unfortunate to be expanding this to memory
access and arithmetic immediately in the front end.
We have vec_extract_optab in the backends that allows extraction
of a single element of a vector, and vec_set_optab that allows
insertion of a single element of a vector.
These patterns are used by store_bit_field and extract_bit_field,
generally in response to BIT_FIELD_REF. This is probably a better
way to represent the operation.
r~