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

            Bug ID: 94865
           Summary: Failure to combine unpckhpd+unpcklpd into blendps
           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[1] = b[1];
    return result;
}

With `-O3 -msse4.1`, LLVM gives : 

move_sd(double __vector(2), double __vector(2)): # @move_sd(double __vector(2),
double __vector(2))
  blendps xmm0, xmm1, 12 # xmm0 = xmm0[0,1],xmm1[2,3]
  ret

GCC gives : 

move_sd(double __vector(2), double __vector(2)):
  unpckhpd xmm1, xmm1
  unpcklpd xmm0, xmm1
  ret

Reply via email to