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

--- Comment #3 from Hongtao.liu <crazylht at gmail dot com> ---
(In reply to Hongtao.liu from comment #2)
> It seems x86 doesn't supports optab reduc_plus_scal_v8hi yet.
vectorizer does the work for backend. 

typedef short v8hi __attribute__((vector_size(16)));
short
foo1 (v8hi p, int n)
{
  short sum = 0;
  for (int i = 0; i != 8; i++)
    sum += p[i];
  return sum;
}

  # sum_21 = PHI <sum_9(3)>
  # vect_sum_9.26_5 = PHI <vect_sum_9.26_6(3)>
  _22 = (vector(8) unsigned short) vect_sum_9.26_5;
  _23 = VEC_PERM_EXPR <_22, { 0, 0, 0, 0, 0, 0, 0, 0 }, { 4, 5, 6, 7, 8, 9, 10,
11 }>;
  _24 = _23 + _22;
  _25 = VEC_PERM_EXPR <_24, { 0, 0, 0, 0, 0, 0, 0, 0 }, { 2, 3, 4, 5, 6, 7, 8,
9 }>;
  _26 = _25 + _24;
  _27 = VEC_PERM_EXPR <_26, { 0, 0, 0, 0, 0, 0, 0, 0 }, { 1, 2, 3, 4, 5, 6, 7,
8 }>;
  _28 = _27 + _26;
  stmp_sum_9.27_29 = BIT_FIELD_REF <_28, 16, 0>;


But for the case in PR, it's v8qi -> 2 v4hi, and no vector reduction for v4hi.

Reply via email to