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 short *w
, int i
, unsigned short *x
, int j
)
15 for (int a
= 0; a
< 16; a
++)
17 for (int b
= 0; b
< 8; b
++)
18 tot
+= abs (w
[b
] - x
[b
]);
26 bar (unsigned short *w
, unsigned short *x
, int i
, int *result
)
28 *result
= foo (w
, 8, x
, i
);
34 unsigned short m
[128];
35 unsigned short n
[128];
38 for (i
= 0; i
< 128; ++i
)
41 m
[i
] = (i
% 8) * 2 + 1;
46 m
[i
] = (i
% 8) * 4 - 3;