https://bugs.llvm.org/show_bug.cgi?id=47608

            Bug ID: 47608
           Summary: Extract value from vector - dynamic index
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Backend: X86
          Assignee: unassignedb...@nondot.org
          Reporter: david.bolvan...@gmail.com
                CC: craig.top...@gmail.com, llvm-bugs@lists.llvm.org,
                    llvm-...@redking.me.uk, spatel+l...@rotateright.com

typedef double v2df __attribute__((vector_size(16)));

double bar (v2df x, int y)
{
  return x[y+1];
}


Clang -Ofast:
bar(double __vector(2), int):                           # @bar(double
__vector(2), int)
        add     edi, 1
        movaps  xmmword ptr [rsp - 24], xmm0
        and     edi, 1
        movsd   xmm0, qword ptr [rsp + 8*rdi - 24] # xmm0 = mem[0],zero
        ret

GCC:
bar(double __vector(2), int):
        movsxd    rdi, edi                                      #4.1
        movups    XMMWORD PTR [-24+rsp], xmm0                   #4.1
        movsd     xmm0, QWORD PTR [-16+rsp+rdi*8]               #5.14
        ret        


https://gcc.godbolt.org/z/Eab687

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to