1 /* { dg-require-effective-target vect_usad_char } */
9 unsigned char X
[N
] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__
)));
10 unsigned char Y
[N
] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__
)));
13 /* Sum of absolute differences between arrays of unsigned char types.
14 Detected as a sad pattern.
15 Vectorized on targets that support sad for unsigned chars. */
17 __attribute__ ((noinline
)) int
23 for (i
= 0; i
< len
; i
++)
24 result
+= abs (X
[i
] - Y
[i
]);
38 for (i
= 0; i
< N
; i
++)
42 __asm__
volatile ("");
52 /* { dg-final { scan-tree-dump-times "vect_recog_sad_pattern: detected" 1 "vect" } } */
53 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */