http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50849
Bug #: 50849 Summary: long long right shift not vectorized Classification: Unclassified Product: gcc Version: 4.7.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization AssignedTo: unassig...@gcc.gnu.org ReportedBy: vincenzo.innoce...@cern.ch Any reason why left shift is vectorized and right shift not? long long l1[1024], l2[1024]; void sl() { for (int i=0;i!=1024;++i) l1[i] = l2[i]<<52; } void rl() { for (int i=0;i!=1024;++i) l1[i] = l2[i]>>52; } sl(): leaq _l1(%rip),%rcx xorl %eax,%eax leaq _l2(%rip),%rdx movdqa (%rdx,%rax),%xmm0 psllq $0x34,%xmm0 movdqa %xmm0,(%rcx,%rax) addq $0x10,%rax cmpq $0x00002000,%eax jne 0x00000010 repz/ret nopl (%rax) rl(): leaq _l1(%rip),%rsi xorl %eax,%eax leaq _l2(%rip),%rcx movq (%rcx,%rax),%rdx sarq $0x34,%rdx movq %rdx,(%rsi,%rax) addq $0x08,%rax cmpq $0x00002000,%eax jne 0x00000040 repz/ret