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: [55/77] Use scalar_int_mode in simplify_const_unary_operation


On 07/13/2017 02:58 AM, Richard Sandiford wrote:
> The main scalar integer block in simplify_const_unary_operation
> had the condition:
> 
>   if (CONST_SCALAR_INT_P (op) && width > 0)
> 
> where "width > 0" was a roundabout way of testing != VOIDmode.
> This patch replaces it with a check for a scalar_int_mode instead.
> It also uses the number of bits in the input rather than the output
> mode to determine the result of a "count ... bits in zero" operation.
> (At the momemnt these modes have to be the same, but it still seems
> conceptually wrong to use the number of bits in the output mode.)
> 
> The handling of float->integer ops also checked "width > 0",
> but this was redundant with the earlier check for MODE_INT.
> 
> 2017-07-13  Richard Sandiford  <richard.sandiford@linaro.org>
> 	    Alan Hayward  <alan.hayward@arm.com>
> 	    David Sherwood  <david.sherwood@arm.com>
> 
> gcc/
> 	* simplify-rtx.c (simplify_const_unary_operation): Use
> 	is_a <scalar_int_mode> instead of checking for a nonzero
> 	precision.  Forcibly convert op_mode to a scalar_int_mode
> 	in that case.  More clearly differentiate the operand and
> 	result modes and use the former when deciding what the value
> 	of a count-bits operation should be.  Use is_int_mode instead
> 	of checking for a MODE_INT.  Remove redundant check for whether
> 	this mode has a zero precision.
OK.
jeff


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