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

            Bug ID: 127909
           Summary: Arm should detect sdot_prod and use smlad/smlald for
                    32/64 bit accumulation.
           Product: gcc
           Version: 17.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: rearnsha at gcc dot gnu.org
  Target Milestone: ---

The function
typedef short v2hi __attribute__((vector_size(4)));
typedef int T;
T foo(v2hi a, v2hi b, T acc)
{
  return acc + a[0]*b[0] + a[1]*b[1];
}
(and similarly if T is 'long long')
is a vector length 2 sdot_prod idiom and should optimise to use smlad (smlald).

But the idiom is never recognised during SLP.

Note that despite this there are further missing components in the back-end,
but the start of the problem is failing to detect the idiom.

Reply via email to