[LLVMbugs] [Bug 2108] New: Horrible x86 codegen for _mm_loadl_epi64

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Wed Feb 27 11:23:34 PST 2008


           Summary: Horrible x86 codegen for _mm_loadl_epi64
           Product: new-bugs
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: new bugs
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: sharparrow1 at yahoo.com
                CC: llvmbugs at cs.uiuc.edu

#include <xmmintrin.h>
__m128i doload64(unsigned long long x) { return _mm_loadl_epi64(&x);}

Generated il:
define <2 x i64> @doload64(i64 %x) nounwind  {
        %tmp717 = bitcast i64 %x to double
        %tmp8 = insertelement <2 x double> undef, double %tmp717, i32 0
        %tmp9 = insertelement <2 x double> %tmp8, double 0.000000e+00, i32 1
        %tmp11 = bitcast <2 x double> %tmp9 to <2 x i64>
        ret <2 x i64> %tmp11

On x86, the this codegens to the following:

        subl    $12, %esp
        movl    20(%esp), %eax
        movl    %eax, 4(%esp)
        movl    16(%esp), %eax
        movl    %eax, (%esp)
        movsd   (%esp), %xmm0
        addl    $12, %esp

which is 6 instructions longer than it needs to be.  The code generator should
really be smart enough to load from the original stack slot.

Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

More information about the llvm-bugs mailing list