This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix high handling in wi::mul_internal (PR tree-optimization/61682)
- From: Richard Sandiford <rdsandiford at googlemail dot com>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Thu, 03 Jul 2014 22:53:42 +0100
- Subject: Re: [PATCH] Fix high handling in wi::mul_internal (PR tree-optimization/61682)
- Authentication-results: sourceware.org; auth=none
- References: <20140703184222 dot GK31640 at tucnak dot redhat dot com>
Jakub Jelinek <jakub@redhat.com> writes:
> @@ -1302,12 +1310,28 @@ wi::mul_internal (HOST_WIDE_INT *val, co
> /* Handle multiplications by 1. */
> if (op1 == 1)
> {
> + if (high)
> + {
> + if (sgn == SIGNED && wi::neg_p (op2))
> + val[0] = -1;
> + else
> + val[0] = 0;
> + return 1;
> + }
> for (i = 0; i < op2len; i++)
> val[i] = op2val[i];
> return op2len;
> }
> if (op2 == 1)
> {
> + if (high)
> + {
> + if (sgn == SIGNED && wi::neg_p (op1))
> + val[0] = -1;
> + else
> + val[0] = 0;
> + return 1;
> + }
> for (i = 0; i < op1len; i++)
> val[i] = op1val[i];
> return op1len;
I think the preferred way of writing this is "wi::neg_p (op1, sgn)"
OK otherwise, thanks, and sorry for the multiple breakage.
Richard