[LLVMbugs] [Bug 1286] NEW: SSE Code is Horrid!

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Wed Mar 28 12:07:06 PDT 2007


           Summary: SSE Code is Horrid!
           Product: libraries
           Version: trunk
          Platform: Macintosh
        OS/Version: MacOS X
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Backend: X86
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: isanbard at gmail.com


#include <xmmintrin.h>

void foo(__m128i *A, __m128i *B) {
  *A = _mm_sll_epi16 (*A, *B);

generates this code:

        movl 8(%esp), %eax
        movdqa (%eax), %xmm0
        #IMPLICIT_DEF %eax
	pinsrw $2, %eax, %xmm0
        xorl %ecx, %ecx
	pinsrw $3, %ecx, %xmm0
        pinsrw $4, %eax, %xmm0
        pinsrw $5, %ecx, %xmm0
	pinsrw $6, %eax, %xmm0
        pinsrw $7, %ecx, %xmm0
	movl 4(%esp), %eax
        movdqa (%eax), %xmm1
        psllw %xmm0, %xmm1
	movdqa %xmm1, (%eax)

This is obviously bad! We should be as good GCC at least.

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.

More information about the llvm-bugs mailing list