2 /* { dg-require-effective-target p9vector_hw } */
3 /* { dg-options "-O3 -mdejagnu-cpu=power9" } */
5 /* Verify that we get correct code when we vectorize this SAD loop using
9 extern int abs (int __x
) __attribute__ ((__nothrow__
, __leaf__
)) __attribute__ ((__const__
));
12 foo (unsigned char *w
, int i
, unsigned char *x
, int j
)
15 for (int a
= 0; a
< 16; a
++)
17 for (int b
= 0; b
< 16; b
++)
18 tot
+= abs (w
[b
] - x
[b
]);
26 bar (unsigned char *w
, unsigned char *x
, int i
, int *result
)
28 *result
= foo (w
, 16, x
, i
);
38 for (i
= 0; i
< 256; ++i
)
41 m
[i
] = (i
% 8) * 2 + 1;
46 m
[i
] = -((i
% 8) * 2 + 2);
47 n
[i
] = -((i
% 8) >> 1);