Re: Vectorizer question: DIV to RSHIFT conversion

2011-12-13 Thread Kirill Yukhin
Great! Thanks, K > > Let me hack up a quick pattern recognizer for this... > >        Jakub

Re: Vectorizer question: DIV to RSHIFT conversion

2011-12-13 Thread Jakub Jelinek
On Tue, Dec 13, 2011 at 05:42:16PM +0400, Kirill Yukhin wrote: > The full case attached. > > Jakub, you are right, we have to convert signed ints into something a > bit more tricky. > BTW, here is output for that cases from Intel compiler: Ah, so that matches to do j / 2 in the pattern recognizer

Re: Vectorizer question: DIV to RSHIFT conversion

2011-12-13 Thread Kirill Yukhin
The full case attached. Jakub, you are right, we have to convert signed ints into something a bit more tricky. BTW, here is output for that cases from Intel compiler: vpxor %ymm1, %ymm1, %ymm1 #184.23 vmovdqu .L_2il0floatpacket.12(%rip), %ymm0

Re: Vectorizer question: DIV to RSHIFT conversion

2011-12-13 Thread Jakub Jelinek
On Tue, Dec 13, 2011 at 02:07:11PM +0100, Richard Guenther wrote: > > Hi guys, > > While looking at Spec2006/401.bzip2 I found such a loop: > > for (i = 1; i <= alphaSize; i++) { > > j = weight[i] >> 8; > > j = 1 + (j / 2); > > weight[i] = j << 8; > > } It would be helpfu

Re: Vectorizer question: DIV to RSHIFT conversion

2011-12-13 Thread Richard Guenther
On Tue, 13 Dec 2011, Kirill Yukhin wrote: > Hi guys, > While looking at Spec2006/401.bzip2 I found such a loop: > for (i = 1; i <= alphaSize; i++) { > j = weight[i] >> 8; > j = 1 + (j / 2); > weight[i] = j << 8; > } > > Which is not vectorizeble (using Intel's AVX2) beca

Vectorizer question: DIV to RSHIFT conversion

2011-12-13 Thread Kirill Yukhin
Hi guys, While looking at Spec2006/401.bzip2 I found such a loop: for (i = 1; i <= alphaSize; i++) { j = weight[i] >> 8; j = 1 + (j / 2); weight[i] = j << 8; } Which is not vectorizeble (using Intel's AVX2) because division by two is not recognized as rshift: 5: ==> exa