[PATCH] Fix high handling in wi::mul_internal (PR tree-optimization/61682)

2014-07-03 Thread Jakub Jelinek
Hi! Several places in wi::mul_internal didn't handle high parameter and would return the low bits instead of high bits. Fixed thusly, bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk? 2014-07-03 Jakub Jelinek ja...@redhat.com PR tree-optimization/61682 *

Re: [PATCH] Fix high handling in wi::mul_internal (PR tree-optimization/61682)

2014-07-03 Thread Richard Sandiford
Jakub Jelinek ja...@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]

Re: [PATCH] Fix high handling in wi::mul_internal (PR tree-optimization/61682)

2014-07-03 Thread Mike Stump
On Jul 3, 2014, at 2:53 PM, Richard Sandiford rdsandif...@googlemail.com wrote: Jakub Jelinek ja...@redhat.com writes: + if (sgn == SIGNED wi::neg_p (op1)) I think the preferred way of writing this is wi::neg_p (op1, svn) Yes.