Re: [PATCH] Improve __builtin_mul_overflow (uns, 1U << y, &res) (PR target/83210)

2017-11-30 Thread Richard Biener
On Thu, 30 Nov 2017, Jakub Jelinek wrote: > On Thu, Nov 30, 2017 at 10:26:33AM +0100, Richard Biener wrote: > > On Wed, 29 Nov 2017, Jakub Jelinek wrote: > > > > > Hi! > > > > > > Even if target has an umulv4_optab pattern like i?86 mul[lq]; jo, > > > if one argument is constant power of two, us

Re: [PATCH] Improve __builtin_mul_overflow (uns, 1U << y, &res) (PR target/83210)

2017-11-30 Thread Jakub Jelinek
On Thu, Nov 30, 2017 at 10:26:33AM +0100, Richard Biener wrote: > On Wed, 29 Nov 2017, Jakub Jelinek wrote: > > > Hi! > > > > Even if target has an umulv4_optab pattern like i?86 mul[lq]; jo, > > if one argument is constant power of two, using two shifts, or > > for multiplication by 2 just shl w

Re: [PATCH] Improve __builtin_mul_overflow (uns, 1U << y, &res) (PR target/83210)

2017-11-30 Thread Richard Biener
On Wed, 29 Nov 2017, Jakub Jelinek wrote: > Hi! > > Even if target has an umulv4_optab pattern like i?86 mul[lq]; jo, > if one argument is constant power of two, using two shifts, or > for multiplication by 2 just shl with js on previous value is faster > (though, for -Os mul[lq]; jo wins). > >

[PATCH] Improve __builtin_mul_overflow (uns, 1U << y, &res) (PR target/83210)

2017-11-29 Thread Jakub Jelinek
Hi! Even if target has an umulv4_optab pattern like i?86 mul[lq]; jo, if one argument is constant power of two, using two shifts, or for multiplication by 2 just shl with js on previous value is faster (though, for -Os mul[lq]; jo wins). Bootstrapped/regtested on x86_64-linux and i686-linux, ok f