This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [55/77] Use scalar_int_mode in simplify_const_unary_operation
- 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: Thu, 24 Aug 2017 15:26:39 -0600
- Subject: Re: [55/77] Use scalar_int_mode in simplify_const_unary_operation
- 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 14A377E432
- References: <8760ewohsv.fsf@linaro.org> <87k23cemsj.fsf@linaro.org>
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