RE: Vectorizer question

2012-05-17 Thread Bingfeng Mei
2 00:01 To: 'gcc@gcc.gnu.org' Subject: Vectorizer question Hello Everyone, I have a question regarding the vectorizer. In the following code below... Int func (int x, int y) { If (x==y) Return (x+y); Else Return (x-y); } If we for

Re: Vectorizer question

2012-05-16 Thread Tim Prince
On 5/16/2012 4:01 PM, Iyer, Balaji V wrote: Hello Everyone, I have a question regarding the vectorizer. In the following code below... Int func (int x, int y) { If (x==y) Return (x+y); Else Return (x-y); } If we force the x and y to be ve

Vectorizer question

2012-05-16 Thread Iyer, Balaji V
Hello Everyone, I have a question regarding the vectorizer. In the following code below... Int func (int x, int y) { If (x==y) Return (x+y); Else Return (x-y); } If we force the x and y to be vectors of vectorlength 4, then will the if-sta

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

Re: vectorizer question

2008-08-18 Thread VandeVondele Joost
It would be nice to have a stand-alone testcase for this, so please file a bugreport. I've opened PR37150 for this. Thanks, Joost

Re: vectorizer question

2008-08-18 Thread Richard Guenther
2008/8/18 VandeVondele Joost <[EMAIL PROTECTED]>: > > The attached testcase yields (on a core2 duo, gcc trunk): > >> gfortran -O3 -ftree-vectorize -ffast-math -march=native test.f90 >> time ./a.out > > real0m3.414s > >> ifort -xT -O3 test.f90 >> time ./a.out > > real0m1.556s > > The assemb

vectorizer question

2008-08-18 Thread VandeVondele Joost
The attached testcase yields (on a core2 duo, gcc trunk): gfortran -O3 -ftree-vectorize -ffast-math -march=native test.f90 time ./a.out real0m3.414s ifort -xT -O3 test.f90 time ./a.out real0m1.556s The assembly contains: ifort gfortran mulpd 140 0 mulsd