This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix bool vs. unsigned:1 vectorization (PR tree-optimization/79284)
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Eric Botcazou <ebotcazou at adacore dot com>
- Cc: Richard Biener <rguenther at suse dot de>, gcc-patches at gcc dot gnu dot org, Jeff Law <law at redhat dot com>
- Date: Wed, 1 Feb 2017 09:38:27 +0100
- Subject: Re: [PATCH] Fix bool vs. unsigned:1 vectorization (PR tree-optimization/79284)
- Authentication-results: sourceware.org; auth=none
- References: <20170131182637.GI14051@tucnak> <20170201080157.GQ14051@tucnak> <alpine.LSU.2.20.1702010910230.12993@r111.fhfr.qr> <19554008.zx1bXF0UgE@polaris>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Wed, Feb 01, 2017 at 09:32:46AM +0100, Eric Botcazou wrote:
> > all BOOLEAN_TYPEs but Adas have precision one and are unsigned
> > (their TYPE_SIZE may vary though).
Oops, thanks for the correction. That said, the prec > 1 BOOLEAN_TYPE
aren't compatible with the prec 1 BOOLEAN_TYPE, so the intent of the
predicate is to support precision 1 BOOLEAN_TYPE and anything
types_compatible_p with it, or precision > 1 BOOLEAN_TYPEs (where
anything types_compatible_p with it must be BOOLEAN_TYPE with the
same precision and signedness).
> /* Builds a boolean type of precision PRECISION.
> Used for boolean vectors to choose proper vector element size. */
> tree
> build_nonstandard_boolean_type (unsigned HOST_WIDE_INT precision)
> {
> tree type;
>
> if (precision <= MAX_BOOL_CACHED_PREC)
> {
> type = nonstandard_boolean_type_cache[precision];
> if (type)
> return type;
> }
>
> type = make_node (BOOLEAN_TYPE);
> TYPE_PRECISION (type) = precision;
> fixup_signed_type (type);
>
> if (precision <= MAX_INT_CACHED_PREC)
> nonstandard_boolean_type_cache[precision] = type;
>
> return type;
> }
Jakub