http://llvm.org/bugs/show_bug.cgi?id=21791

            Bug ID: 21791
           Summary: shuffling instead of moving high element directly
                    (x86)
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Backend: X86
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]
    Classification: Unclassified

In this test case, we want to store the high element of the vector:

$ cat get_high.ll 
define void @get_high(<2 x double> %v, double* %ptr) {
  %vecext1 = extractelement <2 x double> %v, i32 1
  store double %vecext1, double* %ptr, align 8
  ret void
}

With plain SSE2:
$ ./llc get_high.ll -o -
...
    shufpd    $1, %xmm0, %xmm0        ## xmm0 = xmm0[1,0]
    movlpd    %xmm0, (%rdi)
    retq

With AVX:
$ ./llc -mcpu=btver2 get_high.ll -o -
...
    vpermilpd    $1, %xmm0, %xmm0 ## xmm0 = xmm0[1,0]
    vmovlpd    %xmm0, (%rdi)
    retq

---------------------------------------------------------------------

I think we should be generating '(v)movhpd' instead; no shuffles needed.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to