This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Add a partial_integral_type_p helper function
- From: Jeff Law <law at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org, richard dot sandiford at linaro dot org
- Date: Mon, 4 Sep 2017 00:01:24 -0600
- Subject: Re: Add a partial_integral_type_p helper function
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx03.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx03.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=law at redhat dot com
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com D26F17E427
- References: <87inhlmgyj.fsf@linaro.org>
On 08/18/2017 02:13 AM, Richard Sandiford wrote:
> This patch adds a partial_integral_type_p function, to go along
> with the full_integral_type_p added by the previous patch.
>
> Of the changes that didn't previously have an INTEGRAL_TYPE_P check:
>
> - the convert_to_integer_1 hunks are dominated by a case version
> of INTEGRAL_TYPE_P.
>
> - the merge_ranges hunk is dominated by an ENUMERAL_TYPE case.
>
> - vectorizable_reduction has the comment:
>
> /* Do not try to vectorize bit-precision reductions. */
>
> and so I think was only concerned with integers.
>
> - vectorizable_assignment has the comment:
>
> /* We do not handle bit-precision changes. */
>
> and the later:
>
> /* But a conversion that does not change the bit-pattern is ok. */
> && !((TYPE_PRECISION (TREE_TYPE (scalar_dest))
> > TYPE_PRECISION (TREE_TYPE (op)))
> && TYPE_UNSIGNED (TREE_TYPE (op)))
>
> would only make sense if OP is also an integral type.
>
> - vectorizable_shift is inherently restricted to integers.
>
> Tested on aarch64-linux-gnu and x86_64-linux-gnu. OK to install?
>
> Richard
>
>
> 2017-08-17 Richard Sandiford <richard.sandiford@linaro.org>
> Alan Hayward <alan.hayward@arm.com>
> David Sherwood <david.sherwood@arm.com>
>
> gcc/
> * tree.h (partial_integral_type_p): New function.
> * convert.c (convert_to_integer_1): Use it.
> * expr.c (store_fieldexpand_expr_real_2, expand_expr_real_1): Likewise.
> * fold-const.c (merge_ranges): Likewise.
> * tree-ssa-math-opts.c (convert_mult_to_fma): Likewise.
> * tree-tailcall.c (process_assignment): Likewise.
> * tree-vect-loop.c (vectorizable_reduction): Likewise.
> * tree-vect-stmts.c (vectorizable_conversion): Likewise.
> (vectorizable_assignment, vectorizable_shift): Likewise.
OK.
jeff