aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/vect/pr114108.c
blob: b3075d41398edf2a01b4094bdb70a10b8d39b298 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/* { dg-do compile } */

#include "tree-vect.h"

typedef signed char schar;

__attribute__((noipa, noinline, optimize("O3")))
void foo(const schar *a, const schar *b, schar *c, int n)
{
  for (int i = 0; i < n; i++)
    {   
      unsigned u = __builtin_abs (a[i] - b[i]);
      c[i] = u <= 7U ? u : 7U; 
    }   
}


/* { dg-final { scan-tree-dump "LOOP VECTORIZED" "vect" { target aarch64*-*-* } } } */
/* { dg-final { scan-tree-dump "vect_recog_abd_pattern: detected" "vect" { target aarch64*-*-* } } } */