This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Add a partial_integral_type_p helper function


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]