https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94864

            Bug ID: 94864
           Summary: Failure to combine vunpckhpd+movsd into single
                    vunpckhpd
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gabravier at gmail dot com
  Target Milestone: ---

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

v2df move_sd(v2df a, v2df b)
{
    v2df result = a;
    result[0] = b[1];
    return result;
}

LLVM outputs this :

move_sd(double __vector(2), double __vector(2)): # @move_sd(double __vector(2),
double __vector(2))
  vunpckhpd xmm0, xmm1, xmm0 # xmm0 = xmm1[1],xmm0[1]
  ret

GCC outputs this : 

move_sd(double __vector(2), double __vector(2)):
  vunpckhpd xmm1, xmm1, xmm1
  vmovsd xmm0, xmm0, xmm1
  ret

Reply via email to