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: [PATCH] Fix high handling in wi::mul_internal (PR tree-optimization/61682)


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


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